diff --git a/apps/backend/src/lib/ai/prompts.ts b/apps/backend/src/lib/ai/prompts.ts index b052ecc00..fcf1add74 100644 --- a/apps/backend/src/lib/ai/prompts.ts +++ b/apps/backend/src/lib/ai/prompts.ts @@ -451,7 +451,7 @@ Authentication is handled automatically - the SDK fetches access tokens from the You MUST NOT create a new HexclaveServerApp or HexclaveAdminApp instance. You MUST NOT use fetch() directly. -IMPORTANT: All Stack API calls are async and may fail. ALWAYS: +IMPORTANT: All Hexclave API calls are async and may fail. ALWAYS: 1. Wrap API calls in try-catch blocks 2. Set error state when calls fail 3. Show user-friendly error messages (not technical details) @@ -497,7 +497,7 @@ RUNTIME CONTRACT (HARD RULES) - Use hooks via the React global object: React.useState, React.useEffect, React.useCallback - DashboardUI components are available via the global DashboardUI object (e.g. DashboardUI.DesignMetricCard) - Recharts is available via the global Recharts object (e.g. Recharts.BarChart) -- Use hexclaveServerApp for all Stack API calls +- Use hexclaveServerApp for all Hexclave API calls - Both light and dark mode are supported automatically — do NOT hardcode colors No import/export/require statements. No external networking calls. @@ -750,7 +750,7 @@ Use DashboardUI.getDesignChartColor(index) for consistent chart colors. Use "hsl(var(--border))" for CartesianGrid stroke and "hsl(var(--muted-foreground))" for axis tick fill. TYPE DEFINITIONS -The type definitions for the Stack SDK and dashboard UI components will be provided in the user messages. +The type definitions for the Hexclave SDK and dashboard UI components will be provided in the user messages. Use them to determine available fields, methods, prop types, and variants. CLICKHOUSE ANALYTICS diff --git a/apps/dashboard/src/lib/ai-dashboard/shared-prompt.ts b/apps/dashboard/src/lib/ai-dashboard/shared-prompt.ts index 25d6c09fb..4f433c936 100644 --- a/apps/dashboard/src/lib/ai-dashboard/shared-prompt.ts +++ b/apps/dashboard/src/lib/ai-dashboard/shared-prompt.ts @@ -44,7 +44,7 @@ export async function selectRelevantFiles( const systemPromptText = `You are a code assistant helping to generate dashboard code for Hexclave. -Your task is to select which Stack SDK type definition files you'll need to generate the requested dashboard. +Your task is to select which Hexclave SDK type definition files you'll need to generate the requested dashboard. IMPORTANT GUIDELINES: - DO NOT be conservative in file selection - when in doubt, INCLUDE the file @@ -129,7 +129,7 @@ ${stripComments(file.content)} return ` Complete Hexclave SDK Type Definitions (Selected Files): -These files show the available methods, types, and interfaces for the Stack SDK. +These files show the available methods, types, and interfaces for the Hexclave SDK. ${fileContents.join('\n')} `.trim(); } @@ -184,7 +184,7 @@ export async function buildDashboardMessages( } else { contextMessages.push({ role: "user", - content: `Here are the type definitions for the Stack SDK:\n${typeDefinitions}\n\n${dashboardUiDocsHeader}\n${BUNDLED_DASHBOARD_UI_TYPES}${availableRoutes}`, + content: `Here are the type definitions for the Hexclave SDK:\n${typeDefinitions}\n\n${dashboardUiDocsHeader}\n${BUNDLED_DASHBOARD_UI_TYPES}${availableRoutes}`, }); contextMessages.push({ role: "assistant", diff --git a/packages/shared/src/ai/unified-prompts/reminders.ts b/packages/shared/src/ai/unified-prompts/reminders.ts index 4150d1d98..a8675331f 100644 --- a/packages/shared/src/ai/unified-prompts/reminders.ts +++ b/packages/shared/src/ai/unified-prompts/reminders.ts @@ -21,7 +21,7 @@ export const remindersPrompt = deindent` - The \`Result\` type is \`{ status: "ok", data: T } | { status: "error", error: E }\`. - \`KnownErrors[KNOWN_ERROR_CODE]\` refers to a specific known error type. Each KnownError may have its own properties, but they all inherit from \`Error & { statusCode: number, humanReadableMessage: string, details?: Json }\`. - React & Next.js: - - Almost all \`getXyz\` and \`listXyz\` functions on the Stack App have corresponding \`useXyz\` hooks that suspend the current component until the data is available. Make sure there is a Suspense boundary in place if you're using this pattern. The parameter and return types are identical except that the hooks don't return promises. - - There is a \`useStackApp()\` hook as a named export from the package itself that serves as a shortcut to get the current Stack App object from the React context. Similarly, the \`useUser(...args)\` named export is short for \`useStackApp().useUser(...args)\`. + - Almost all \`getXyz\` and \`listXyz\` functions on the Hexclave App have corresponding \`useXyz\` hooks that suspend the current component until the data is available. Make sure there is a Suspense boundary in place if you're using this pattern. The parameter and return types are identical except that the hooks don't return promises. + - There is a \`useHexclaveApp()\` hook as a named export from the package itself that serves as a shortcut to get the current Hexclave App object from the React context. Similarly, the \`useUser(...args)\` named export is short for \`useHexclaveApp().useUser(...args)\`. - Hexclave was formerly known as Stack Auth. You may still see reference to it as Stack Auth in some places. `; diff --git a/packages/shared/src/interface/page-component-versions.ts b/packages/shared/src/interface/page-component-versions.ts index 08589c4d8..6d39e5f02 100644 --- a/packages/shared/src/interface/page-component-versions.ts +++ b/packages/shared/src/interface/page-component-versions.ts @@ -67,10 +67,10 @@ function createCustomPagePrompt(options: { ${options.reactExample} \`\`\` - When you're done, please update the file where the Stack app is configured with its URLs, to make sure it points to this page. For example, you may have an object declared like this: + When you're done, please update the file where the Hexclave app is configured with its URLs, to make sure it points to this page. For example, you may have an object declared like this: \`\`\`tsx - export const hexclaveServerApp = new StackServerApp({ + export const hexclaveServerApp = new HexclaveServerApp({ tokenStore: "nextjs-cookie", urls: { default: { @@ -159,7 +159,7 @@ function createAuthPagePrompt(type: AuthPagePromptType): CustomPagePrompt { `, reactExample: deindent` export default function Custom${isSignIn ? "SignIn" : "SignUp"}Page() { - const hexclaveApp = useStackApp(); + const hexclaveApp = useHexclaveApp(); const user = useUser({ includeRestricted: true }); const project = hexclaveApp.useProject(); const [otpState, setOtpState] = useState(null); @@ -347,7 +347,7 @@ export function getCustomPagePrompts(): Record }) { - const hexclaveApp = useStackApp(); + const hexclaveApp = useHexclaveApp(); const [result, setResult] = useState> | null>(null); const code = props.searchParams?.code; @@ -461,7 +461,7 @@ export function getCustomPagePrompts(): Record }) { - const hexclaveApp = useStackApp(); + const hexclaveApp = useHexclaveApp(); const code = props.searchParams.code; const [password, setPassword] = useState(""); const [passwordRepeat, setPasswordRepeat] = useState(""); @@ -469,7 +469,7 @@ export function getCustomPagePrompts(): Record(null); - const cachedVerifyPasswordResetCode = cacheFunction(async (app: StackClientApp, codeToVerify: string) => { + const cachedVerifyPasswordResetCode = cacheFunction(async (app: HexclaveClientApp, codeToVerify: string) => { return await app.verifyPasswordResetCode(codeToVerify); }); @@ -533,7 +533,7 @@ export function getCustomPagePrompts(): Record(null); const [showRedirectLink, setShowRedirectLink] = useState(false); @@ -651,7 +651,7 @@ export function getCustomPagePrompts(): Record }) { - const hexclaveApp = useStackApp(); + const hexclaveApp = useHexclaveApp(); const user = useUser({ or: "return-null" }); const [result, setResult] = useState> | null>(null); const code = props.searchParams?.code; @@ -830,7 +830,7 @@ export function getCustomPagePrompts(): Record x.type === "email" && x.isVerified && x.usedForAuth); @@ -888,7 +888,7 @@ export function getCustomPagePrompts(): Record x.type === "email" && x.isVerified && x.usedForAuth); @@ -1039,7 +1039,7 @@ export function getCustomPagePrompts(): Record{product.displayName} {product.subscription?.isCancelable ? ( @@ -1189,7 +1189,7 @@ export function getCustomPagePrompts(): Record }) { - const hexclaveApp = useStackApp(); + const hexclaveApp = useHexclaveApp(); const user = useUser({ or: "return-null", includeRestricted: true }); const code = props.searchParams.code; const [accepted, setAccepted] = useState(false); @@ -1486,7 +1486,7 @@ export function getCustomPagePrompts(): Record(null); @@ -1558,7 +1558,7 @@ export function getCustomPagePrompts(): Record }) { - const hexclaveApp = useStackApp(); + const hexclaveApp = useHexclaveApp(); const errorCode = props.searchParams.errorCode; const message = props.searchParams.message; const details = props.searchParams.details; @@ -1624,7 +1624,7 @@ export function getCustomPagePrompts(): Record { const blob = new Blob([formatLogsForExport()], { type: 'text/plain;charset=utf-8' }); const url = URL.createObjectURL(blob); - const link = h('a', { href: url, download: `stack-auth-dev-tool-logs-${new Date().toISOString()}.txt` }); + const link = h('a', { href: url, download: `hexclave-dev-tool-logs-${new Date().toISOString()}.txt` }); document.body.appendChild(link); link.click(); link.remove();