@superblocksteam/vite-plugin-file-sync 2.0.116-next.1 → 2.0.116-next.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ai-service/agent/prompts/build-base-system-prompt.d.ts.map +1 -1
- package/dist/ai-service/agent/prompts/build-base-system-prompt.js +4 -1
- package/dist/ai-service/agent/prompts/build-base-system-prompt.js.map +1 -1
- package/dist/ai-service/integrations/store.d.ts +5 -0
- package/dist/ai-service/integrations/store.d.ts.map +1 -1
- package/dist/ai-service/integrations/store.js +7 -0
- package/dist/ai-service/integrations/store.js.map +1 -1
- package/dist/ai-service/skills/system/superblocks-frontend/skill.generated.d.ts +1 -1
- package/dist/ai-service/skills/system/superblocks-frontend/skill.generated.d.ts.map +1 -1
- package/dist/ai-service/skills/system/superblocks-frontend/skill.generated.js +1 -0
- package/dist/ai-service/skills/system/superblocks-frontend/skill.generated.js.map +1 -1
- package/dist/ai-service/skills/system/third-party-migration/lovable.generated.d.ts +1 -1
- package/dist/ai-service/skills/system/third-party-migration/lovable.generated.d.ts.map +1 -1
- package/dist/ai-service/skills/system/third-party-migration/lovable.generated.js +1 -1
- package/dist/ai-service/skills/system/third-party-migration/skill.generated.d.ts +1 -1
- package/dist/ai-service/skills/system/third-party-migration/skill.generated.d.ts.map +1 -1
- package/dist/ai-service/skills/system/third-party-migration/skill.generated.js +23 -1
- package/dist/ai-service/skills/system/third-party-migration/skill.generated.js.map +1 -1
- package/dist/ai-service/state-machine/handlers/llm-generating.d.ts.map +1 -1
- package/dist/ai-service/state-machine/handlers/llm-generating.js +15 -22
- package/dist/ai-service/state-machine/handlers/llm-generating.js.map +1 -1
- package/dist/file-sync-vite-plugin.d.ts.map +1 -1
- package/dist/file-sync-vite-plugin.js +1 -0
- package/dist/file-sync-vite-plugin.js.map +1 -1
- package/dist/plugin-options.d.ts +1 -0
- package/dist/plugin-options.d.ts.map +1 -1
- package/dist/plugin-options.js.map +1 -1
- package/dist/router-parser.d.ts.map +1 -1
- package/dist/router-parser.js +137 -70
- package/dist/router-parser.js.map +1 -1
- package/dist/socket-manager.d.ts +2 -1
- package/dist/socket-manager.d.ts.map +1 -1
- package/dist/socket-manager.js +4 -2
- package/dist/socket-manager.js.map +1 -1
- package/package.json +7 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-base-system-prompt.d.ts","sourceRoot":"","sources":["../../../../src/ai-service/agent/prompts/build-base-system-prompt.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uCAAuC,CAAC;AAKpE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAStD,eAAO,MAAM,qBAAqB,GAChC,QAAQ,eAAe,EACvB,OAAO,MAAM,EACb,eAAe,MAAM,EACrB,sBAAsB,MAAM,EAC5B,yBAAyB,MAAM,
|
|
1
|
+
{"version":3,"file":"build-base-system-prompt.d.ts","sourceRoot":"","sources":["../../../../src/ai-service/agent/prompts/build-base-system-prompt.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uCAAuC,CAAC;AAKpE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAStD,eAAO,MAAM,qBAAqB,GAChC,QAAQ,eAAe,EACvB,OAAO,MAAM,EACb,eAAe,MAAM,EACrB,sBAAsB,MAAM,EAC5B,yBAAyB,MAAM,WAmShC,CAAC"}
|
|
@@ -151,7 +151,10 @@ An \`<attachment_reference>\` block means the bytes are NOT in context — you m
|
|
|
151
151
|
Rules:
|
|
152
152
|
- Never fetch the attachment \`url\` directly (no ad-hoc code, shell, urllib/curl, or HTTP requests) — \`downloadAttachments\` is the only path.
|
|
153
153
|
- Do not claim contents were reviewed unless you actually downloaded and inspected them in this turn.
|
|
154
|
-
- If the block's \`note\` says the file is unsupported, do not download — tell the user and ask how to proceed
|
|
154
|
+
- If the block's \`note\` says the file is unsupported, do not download — tell the user and ask how to proceed.${thirdPartyImportEnabled
|
|
155
|
+
? `
|
|
156
|
+
- If the attachment is a third-party app export (e.g. Replit, Lovable, v0, Next.js), \`build_readFile\` \`skills/system/third-party-migration/SKILL.md\` before drafting a plan, and the plan you submit to \`exitPlanMode\` must include theme/styling fidelity (color tokens, fonts, layout shells) — not just the functional spec.`
|
|
157
|
+
: ""}
|
|
155
158
|
- In Plan mode after inspection, don't freeform implement; use \`askMultiChoice\` or \`exitPlanMode\`. In Build mode, continue.`
|
|
156
159
|
: `**Attachment workflow:**
|
|
157
160
|
- Call \`listAttachments\` to discover attachment IDs when the user references uploaded files, then inspect them inline.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-base-system-prompt.js","sourceRoot":"","sources":["../../../../src/ai-service/agent/prompts/build-base-system-prompt.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,2BAA2B,EAAE,MAAM,yBAAyB,CAAC;AAEtE,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC1E,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE1D,OAAO,EACL,mBAAmB,EACnB,kBAAkB,EAClB,oBAAoB,GACrB,MAAM,kBAAkB,CAAC;AAE1B,MAAM,MAAM,GAAG,iBAAiB,CAAC,4BAA4B,CAAC,CAAC;AAE/D,MAAM,CAAC,MAAM,qBAAqB,GAAG,CACnC,MAAuB,EACvB,IAAa,EACb,YAAqB,EACrB,mBAA4B,EAC5B,sBAA+B,EAC/B,EAAE;IACF,MAAM,uBAAuB,GAAG,MAAM,CAAC,QAAQ,CAAC,yBAAyB;QACvE,CAAC,CAAC,snBAAsnB;QACxnB,CAAC,CAAC,8PAA8P,CAAC;IAEnQ,IAAI,QAAQ,GAAG,EAAE,CAAC;IAElB,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;QACvB,QAAQ,GAAG;;;;;;;;;;wKAUyJ,MAAM,CAAC,QAAQ,CAAC,8BAA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AG,MAAM,CAAC,QAAQ,CAAC,eAAe,CAAC;IAElD,8EAA8E;IAC9E,MAAM,cAAc,GAAG,SAAS;QAC9B,CAAC,CAAC,yBAAyB,CAAC,aAAa,EAAE,uBAAuB,CAAC;QACnE,CAAC,CAAC,IAAI,CAAC;IACT,MAAM,YAAY,GAAG,cAAc,KAAK,IAAI,CAAC;IAE7C,oFAAoF;IACpF,MAAM,gBAAgB,GAAG,YAAY;QACnC,CAAC,CAAC,EAAE;QACJ,CAAC,CAAC,6BAA6B,CAAC,aAAa,CAAC,CAAC;IAEjD,uCAAuC;IACvC,MAAM,CAAC,IAAI,CAAC,gDAAgD,EAAE;QAC5D,oBAAoB,EAAE,CAAC,CAAC,YAAY;QACpC,uBAAuB,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;QAClD,oBAAoB,EAAE,CAAC,CAAC,sBAAsB;QAC9C,uBAAuB,EAAE,sBAAsB,EAAE,MAAM,IAAI,CAAC;KAC7D,CAAC,CAAC;IAEH,IAAI,YAAY,EAAE,CAAC;QACjB,MAAM,CAAC,IAAI,CAAC,gCAAgC,GAAG,YAAY,CAAC,CAAC;IAC/D,CAAC;IAED,IAAI,sBAAsB,EAAE,CAAC;QAC3B,MAAM,CAAC,IAAI,CAAC,8BAA8B,GAAG,sBAAsB,CAAC,CAAC;IACvE,CAAC;IAED,OAAO,CACL,QAAQ;QACR,MAAM,CAAC;;WAEA,WAAW;;;;;;;;;;;;EAYpB,mBAAmB,CAAC,YAAY,EAAE,mBAAmB,CAAC;;;;;;EAOtD,MAAM,CAAC,QAAQ,CAAC,8BAA8B;YAC5C,CAAC,CAAC
|
|
1
|
+
{"version":3,"file":"build-base-system-prompt.js","sourceRoot":"","sources":["../../../../src/ai-service/agent/prompts/build-base-system-prompt.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,2BAA2B,EAAE,MAAM,yBAAyB,CAAC;AAEtE,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;A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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2P3C,CAAC;AACF,CAAC;AAED,MAAM,uBAAuB,GAAG,MAAM,CAAC;;;;;;;;CAQtC,CAAC"}
|
|
@@ -78,6 +78,11 @@ export declare class IntegrationStore {
|
|
|
78
78
|
initialize(): Promise<void>;
|
|
79
79
|
removeIntegrationCache(): Promise<void>;
|
|
80
80
|
availableIntegrations(): Promise<IntegrationHeader[]>;
|
|
81
|
+
/**
|
|
82
|
+
* Look up a single available integration by id. Same filters as `availableIntegrations()`
|
|
83
|
+
* (BUILD-permission via UI hydration + `UNSUPPORTED_INTEGRATIONS`).
|
|
84
|
+
*/
|
|
85
|
+
availableIntegration(id: IntegrationId): Promise<IntegrationHeader | undefined>;
|
|
81
86
|
getPlugin(pluginId: PluginId): Plugin | undefined;
|
|
82
87
|
/**
|
|
83
88
|
* Return all integration types available for setup.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../../src/ai-service/integrations/store.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,uCAAuC,CAAC;AACtF,OAAO,EAIL,KAAK,MAAM,EACX,KAAK,uBAAuB,EAC5B,KAAK,cAAc,EACnB,KAAK,UAAU,EAChB,MAAM,yBAAyB,CAAC;AAIjC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAG1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAMhD,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC;AACnC,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC;AAE9B,MAAM,MAAM,WAAW,GAAG,iBAAiB,GAAG;IAC5C,QAAQ,EAAE,yBAAyB,CAAC;CACrC,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,EAAE,EAAE,aAAa,CAAC;IAClB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AAY,EAC3B,OAAO,CAAC,EAAE,MAAM,GACf,OAAO,CAAC,WAAW,GAAG,SAAS,CAAC;YA+DrB,wBAAwB;IAgGtC;;;OAGG;IACH,YAAY,CAAC,EAAE,EAAE,aAAa,GAAG,MAAM,GAAG,SAAS;CAOpD;AAED,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,iBAAiB,WAE7D;AAED,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,iBAAiB,WAEhE;AAED,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,iBAAiB,WAE7D"}
|
|
@@ -130,6 +130,13 @@ let IntegrationStore = (() => {
|
|
|
130
130
|
getLogger().debug(`[integration-store] availableIntegrations() returning ${integrationHeaders.length} integrations: ${integrationHeaders.map((i) => `${i.name}(${i.id})`).join(", ")}`);
|
|
131
131
|
return integrationHeaders;
|
|
132
132
|
}
|
|
133
|
+
/**
|
|
134
|
+
* Look up a single available integration by id. Same filters as `availableIntegrations()`
|
|
135
|
+
* (BUILD-permission via UI hydration + `UNSUPPORTED_INTEGRATIONS`).
|
|
136
|
+
*/
|
|
137
|
+
async availableIntegration(id) {
|
|
138
|
+
return (await this.availableIntegrations()).find((i) => i.id === id);
|
|
139
|
+
}
|
|
133
140
|
getPlugin(pluginId) {
|
|
134
141
|
return this.pluginRegistry.get(pluginId);
|
|
135
142
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store.js","sourceRoot":"","sources":["../../../src/ai-service/integrations/store.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,aAAa,MAAM,6BAA6B,CAAC;AACxD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,IAAI,MAAM,MAAM,CAAC;AAGxB,OAAO,EACL,gBAAgB,EAChB,wBAAwB,EACxB,iBAAiB,GAKlB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,iCAAiC,EAAE,MAAM,uBAAuB,CAAC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ind CSS, and Superblocks components. Essential for connecting Superblocks UIs with APIs.\n Use when creating pages, components, handling user interactions, or working with the design system.\nreadOnly: true\nmetadata:\n author: superblocks\n version: \"1.0\"\n---\n\n# Superblocks Frontend Development\n\nThis skill covers building frontend UI for Superblocks applications using React, Tailwind CSS v4, and the Superblocks component library.\n\n## Platform Overview\n\nThis is a React-based web application platform. Use standard React patterns:\n\n- `useState`, `useEffect`, `useCallback`, `useMemo`\n- Event handlers and controlled components\n- JSX with Tailwind CSS classes\n\n## Using APIs from Frontend\n\nThree primitives are available from `@superblocksteam/library`:\n\n- **`useApiData`** \u2014 declarative reads with SWR caching (preferred for data loading)\n- **`useApi`** \u2014 imperative mutations (for event-driven actions)\n- **`executeApi`** \u2014 plain Promise outside React (utility functions, event handlers without hooks)\n\n**Data loading** \u2014 auto-fetches on mount and when inputs change (preferred for reads):\n\n```typescript\nimport { useApiData } from \"@superblocksteam/library\";\n\n// Auto-fetches when email or name changes. No useEffect or HMR guards needed.\n// IMPORTANT: Always use `fetching` to show a loading indicator during refetches.\nconst { data, loading, fetching, isError, error } = useApiData(\"GetUsers\", {\n email,\n name,\n});\n```\n\n**Mutations** \u2014 call `run()` manually (for event-driven actions like form submissions):\n\n```typescript\nimport { useApi } from \"@superblocksteam/library\";\nimport { toast } from \"sonner\";\n\nconst { run: createOrder, loading } = useApi(\"CreateOrder\");\n\nconst handleSubmit = useCallback(async () => {\n try {\n await createOrder({ item, qty });\n } catch (error) {\n const message =\n error && typeof error === \"object\" && \"message\" in error\n ? String((error as { message: unknown }).message)\n : String(error);\n toast.error(\"Error creating order: \" + message);\n }\n}, [item, qty, createOrder]);\n```\n\n**Outside React** \u2014 call APIs as a plain Promise (utility functions, event handlers):\n\n```typescript\nimport { executeApi } from \"@superblocksteam/library\";\n\nconst result = await executeApi(\"GetUsers\", { email });\n```\n\n`useApiData` returns `{ data, loading, fetching, isError, isSuccess, isStale, error, status, fetchStatus, refetch, cancel }`. `data` persists across background refetches (stale-while-revalidate). `loading` is true on first fetch with no cached data. `fetching` is true during any fetch including background refetch. `status` is `\"pending\"` | `\"success\"` | `\"error\"`. `fetchStatus` is `\"idle\"` | `\"fetching\"`. `cancel()` is synchronous (returns `void`).\n\n`useApi` returns `{ run, cancel, reset, loading, data, error, status, variables }`. `data` persists across re-runs (shows previous result while loading). `error` holds the most recent failure, or `undefined` on success. `status` is `\"idle\"` | `\"pending\"` | `\"success\"` | `\"error\"`. `variables` holds the inputs from the most recent `run()`. `reset()` clears all state back to idle. HMR double-fetch prevention is built in \u2014 no `useRef` guard needed.\n\n### useApiData Options\n\n```typescript\nconst { data } = useApiData(\"GetUsers\", { email }, {\n enabled: true, // Skip fetching when false (conditional fetching)\n staleTime: 0, // Ms before cached data is considered stale (0 = always refetch)\n retry: 3, // Retry attempts on failure (false to disable)\n retryDelay: (n) => ..., // Custom delay strategy (default: exponential backoff, max 30s)\n refetchOnWindowFocus: false, // Refetch when tab regains focus\n refetchOnReconnect: true, // Refetch when network reconnects\n refetchInterval: false, // Polling interval in ms (false = disabled)\n structuralSharing: false, // Deep-compare to preserve object identity\n placeholderData: undefined, // Shown while the first fetch is in progress\n});\n```\n\n### Cache invalidation and optimistic updates\n\n**Same scope as the read**: After a mutation, prefer `refetch()` from the `useApiData` that loads the data (same component or wherever you can pass `refetch`).\n\n```typescript\nimport { useApi, useApiData } from \"@superblocksteam/library\";\nimport { toast } from \"sonner\";\n\nconst { data: orders, refetch } = useApiData(\"GetOrders\", { status });\nconst { run: createOrder } = useApi(\"CreateOrder\");\n\nconst handleSubmit = useCallback(async () => {\n try {\n await createOrder({ item, qty });\n await refetch();\n } catch (error) {\n const message =\n error && typeof error === \"object\" && \"message\" in error\n ? String((error as { message: unknown }).message)\n : String(error);\n toast.error(\"Error creating order: \" + message);\n }\n}, [item, qty, createOrder, refetch]);\n```\n\n**Cross-scope or broad invalidation**: Use `queryClient.invalidateQueries` when you cannot call that `refetch` (mutation in a different place than the `useApiData`, or you need every cached variant of an API to refetch). For **`queryClient.invalidateQueries`, `buildCacheKey`, `setQueryData`, and any other `queryClient` usage, always import `queryClient` from `@superblocksteam/library`**.\n\n```typescript\nimport { queryClient, useApi } from \"@superblocksteam/library\";\nimport { toast } from \"sonner\";\n\nconst { run: createOrder } = useApi(\"CreateOrder\");\n\nconst handleSubmit = useCallback(async () => {\n try {\n await createOrder({ item, qty });\n await queryClient.invalidateQueries(\"GetOrders\");\n } catch (error) {\n const message =\n error && typeof error === \"object\" && \"message\" in error\n ? String((error as { message: unknown }).message)\n : String(error);\n toast.error(\"Error creating order: \" + message);\n }\n}, [item, qty, createOrder]);\n```\n\n```typescript\n// Optimistic update: set cached data without refetching\nimport { queryClient } from \"@superblocksteam/library\";\n\nconst cacheKey = queryClient.buildCacheKey(\"GetOrders\", { status: \"active\" });\nqueryClient.setQueryData(cacheKey, (old) => ({\n ...old,\n orders: [...old.orders, newOrder],\n}));\n```\n\n### Critical API Rules\n\n1. **MUST call API by exact name**: Format is `<ApiName>` matching folder `apis/<ApiName>/api.yaml`\n2. **Use `useApiData` for data loading, `useApi` for mutations**: For data fetching, use `useApiData(\"GetUsers\", { email })`. Only use `useApi` for event-driven actions (button clicks, form submissions). Use `executeApi` for API calls outside React components.\n3. **Use the hook's state fields**: Do NOT create separate `useState` for loading or response data \u2014 the hooks manage this for you\n4. **ALWAYS check API interfaces**: NEVER guess the response structure\n5. **Include all parameters**: Even optional ones should be passed as `null`\n6. **ALWAYS use try/catch**: In imperative mode, APIs throw errors when they fail - wrap ALL `run()` calls in try/catch blocks. In declarative mode, check the `error` field for failure details.\n\n### File Handling\n\n**CRITICAL: Files must be wrapped in `{ files: [...] }` format:**\n\n```tsx\n// \u2705 CORRECT - Frontend: wrap files in { files: [...] }\nconst response = await runUploadApi({ userFile: { files: selectedFiles } });\n\n// \u274C WRONG - backend cannot process unwrapped files\nconst response = await runUploadApi({ userFile: selectedFiles });\n```\n\n## Platform Hooks and Functions\n\nAvailable hooks and functions from `@superblocksteam/library`:\n\n### User and Group Context\n\n```typescript\nimport {\n useSuperblocksUser,\n useSuperblocksGroups,\n} from \"@superblocksteam/library\";\n\n// Get current user info\nconst user = useSuperblocksUser();\n// user.name, user.email, user.id, user.groups, user.username, user.metadata\n\n// Get organization groups\nconst groups = useSuperblocksGroups();\n```\n\n### Environments and Data Tags\n\nConcepts & terminology:\n\n- `Data tags` are labels for different data segments, such as `Staging`, `Production`, or `us-east`.\n- `Profiles` is the legacy term for the same concept. If a user asks about profiles, treat that as data tags.\n- `Environments` are `Edit`, `Preview`, and `Production`, and each data tag is allowed in one or more of those environments.\n- Clark operates in `Edit` mode, so the data tags visible in app context represent the tags available in `Edit`; do not assume this is the same set that will be available in `Preview` or `Production`.\n- When implementing app code, prefer `useSuperblocksDataTags()`, `dataTags`, and `setDataTag()`.\n\nThe `DataTag` type has these fields (it is an alias for `Profile` from `@superblocksteam/shared`):\n\n```typescript\ntype DataTag = {\n id: string;\n key: string;\n displayName: string; // human-readable label \u2014 use this for display, NOT \"name\"\n description: string;\n type: \"RESERVED\" | \"CUSTOM\";\n};\n```\n\nRelevant hooks and functions:\n\n```typescript\nimport { useSuperblocksDataTags, getAppMode } from \"@superblocksteam/library\";\nimport type { DataTag, DataTags } from \"@superblocksteam/library\";\n\n// Manage data tags\nconst { dataTags, setDataTag } = useSuperblocksDataTags();\n// dataTags.available: DataTag[] \u2014 all tags in the current environment\n// dataTags.selected: DataTag | undefined \u2014 currently active tag (may be undefined)\n// dataTags.default: DataTag \u2014 the default tag\n// setDataTag(dataTag.key) \u2014 switch the active tag by key\n\n// Read the current app mode when reasoning about environment-specific behavior\nconst appMode = getAppMode();\n```\n\nExample \u2014 data tag switcher using a Select:\n\n```tsx\nconst { dataTags, setDataTag } = useSuperblocksDataTags();\n\n<Select value={dataTags?.selected?.key} onValueChange={setDataTag}>\n {dataTags?.available.map((tag) => (\n <SelectItem key={tag.key} value={tag.key}>\n {tag.displayName}\n </SelectItem>\n ))}\n</Select>;\n```\n\n### Embedded Applications\n\n**For embedded applications**, see the `references/embedding.md` file for `useEmbedProperties`, `useEmbedEvent`, and `useEmitEmbedEvent` hooks.\n\n## Logging Out of Integrations\n\nWhen building a \"Log out\" or \"Sign out\" button for apps that use OAuth-like integrations, use `logoutIntegrations` from the library to clear OAuth tokens:\n\n```typescript\nimport { logoutIntegrations } from \"@superblocksteam/library\";\n\nconst handleLogout = async () => {\n await logoutIntegrations();\n // Optionally redirect or show confirmation\n};\n```\n\n## Application Architecture\n\n### App.tsx Layout Structure\n\n**For single-page applications:**\n\n- Put all content in `pages/<pageName>/index.tsx`\n- Use components to compose and build the page\n- Keep `App.tsx` minimal with just `<AppProvider>` and `<Outlet />`\n\n**For multi-page applications:**\n\n- Put shared navigation/layout in `App.tsx` (sidebars, headers, footers)\n- Always include `<Outlet />` for page content\n- Always include `<AppProvider />` wrapper\n- Individual pages focus on content, not layout\n\n```tsx\n// \u2705 CORRECT - Multi-page App.tsx layout\n<AppProvider>\n <div className=\"flex flex-row size-screen\">\n {/* Sidebar - persistent across all pages */}\n <div className=\"flex bg-sidebar border-r w-[250px]\">\n <Navigation />\n </div>\n\n {/* Main content area */}\n <div className=\"flex flex-1 h-full flex-col\">\n {/* Header - persistent across all pages */}\n <div className=\"flex bg-header border-b h-[60px]\">\n <Header />\n </div>\n\n {/* Page content area */}\n <div className=\"flex p-4 flex-1 overflow-auto\">\n <Outlet />\n </div>\n </div>\n </div>\n</AppProvider>\n```\n\n**PROTECTED: NEVER remove `<AppProvider>` or `<Outlet />` from App.tsx!**\n\n### Page Structure\n\n```tsx\n// \u2705 CORRECT - Page focuses on content only\n<div className=\"flex flex-col gap-4 size-screen overflow-auto\">\n <h1 className=\"text-3xl font-bold\">Dashboard Content</h1>\n <Card>{/* Page-specific content */}</Card>\n</div>\n```\n\n**IMPORTANT**: The first div on the page must have `overflow-auto` so the user's page can scroll.\n\n## Routing\n\nUse `react-router@7` in data mode. Standard patterns apply:\n\n- `useNavigate()` for programmatic navigation\n- `useParams()` for route parameters\n- `useSearchParams()` for query strings\n\n**If you add new pages or rename files, you MUST update the router.**\n\n## Design System (Tailwind CSS v4)\n\n**All design tokens are defined in `index.css`**. Apps come with a professional black-and-white theme by default.\n\n### Semantic Tokens Rule\n\n**ALWAYS use semantic tokens** \u2014 NEVER raw Tailwind utilities:\n\n```tsx\n// \u2705 CORRECT\n<Card className=\"bg-background text-foreground border border-border\" />\n\n// \u274C WRONG\n<Card className=\"bg-white text-black border-gray-200\" />\n```\n\n### When to Modify index.css\n\nOnly modify when:\n\n- User explicitly requests branding/theme changes\n- Replicating a specific brand look (e.g., Yelp, Instacart)\n- Feature requests (lists, filters, CRUD) do NOT require changes\n\n**Modification Rules:**\n\n- All colors must be in OKLCH format\n- Use semantic names (`--color-warning`, `--shadow-elevated`)\n- Do not remove or rename existing tokens\n- Limit color palette to 5 colors max\n- Avoid gradients unless explicitly requested\n- Minimal font sizes (3 max: body, section heading, main heading)\n\n### Component Variants\n\nUse or create variants instead of one-off styles:\n\n```tsx\n// \u274C WRONG - Hacky inline overrides\n<Button className=\"text-white border-white hover:bg-white\" />\n\n// \u2705 CORRECT - Use a variant\n<Button variant=\"secondary\" />\n```\n\n## Icons\n\nUse icons from Lucide React library:\n\n```tsx\nimport { Icon } from \"@/components/ui/icon\";\n<Icon icon=\"heart\" />;\n\nimport { Button } from \"@/components/ui/button\";\n<Button>\n <Icon icon=\"plus\" /> Add Item\n</Button>;\n```\n\n**Always use icons rather than emojis unless explicitly requested.**\n\n## Custom Components\n\n**CRITICAL: Component composition is MANDATORY. DO NOT create monolithic pages.**\n\n### The Composition Rule\n\nWhen building ANY feature:\n\n1. **First**, identify reusable parts (list items, cards, forms, filters, headers)\n2. **Then**, create separate component files\n3. **Finally**, compose them together in the page\n\n### When to Create Components\n\n- **Rendering any list** - Extract to a component\n- **Building cards/complex UI** - Each card type is a component\n- **Creating forms** - Form sections are components\n- **Adding filters/headers** - These are components\n- **Page has >50 lines JSX** - Break it down\n\n### Component Boundary Rules\n\n**Inside a custom component:**\n\n- \u2705 Use React hooks (useState, useReducer, useEffect, etc.)\n- \u2705 Use local React state\n- \u2705 Use internal helper components\n- \u2705 Use other registered components\n- \u274C CANNOT call APIs - must pass data into the component\n\n### Example: Proper Component Structure\n\n```tsx\n// components/ProductCard/index.tsx - Extract to component\nimport { Card } from \"@/components/ui/card\";\nimport { Button } from \"@/components/ui/button\";\n\ntype ProductCardProps = {\n product: {\n id: string;\n name: string;\n image: string;\n };\n};\n\nexport default function ProductCard(props: ProductCardProps) {\n return (\n <Card>\n <img src={props.product.image} />\n <h3 className=\"text-lg font-semibold\">{props.product.name}</h3>\n <Button>Add</Button>\n </Card>\n );\n}\n\n// pages/Products/index.tsx - Clean composition\nimport ProductCard from \"@/components/ProductCard\";\n\nconst ProductsPage = () => {\n const [products, setProducts] = useState([]);\n\n return (\n <div className=\"grid grid-cols-3 gap-4\">\n {products.map((p) => (\n <ProductCard key={p.id} product={p} />\n ))}\n </div>\n );\n};\n```\n\n## Visual Excellence\n\n**Prioritize visual excellence from the start:**\n\n1. **Design System Enhancement**: Start by enhancing `index.css` with app-specific colors that match the target aesthetic\n2. **Professional Layout Architecture**: Use sophisticated layouts with proper spacing, responsive design\n3. **Rich Interactive Components**: Leverage advanced components with proper variants and states\n4. **Visual Polish**: Add shadows, smooth transitions, skeleton loaders, hover effects, typography hierarchy\n5. **Real-World UI Patterns**: Create layouts that feel like professional applications\n\n**Make applications that look and feel like real, polished products - not basic wireframes.**\n\n### Loading States\n\nLoading behavior must differ based on whether data has already been fetched:\n\n**Initial load (no data yet):** Show skeleton shimmers that mirror the shape of the final content. Never show a blank screen or a generic spinner.\n\n**Refetch / background refresh (data already exists):** Keep showing the existing data. Use `fetching` from `useApiData` to apply a subtle visual indicator: light opacity (e.g. `opacity-70`) to signal a refresh is in progress, plus a non-blocking label such as a small inline spinner, a thin progress bar, or an \"Updating\u2026\" label. **Do not** use `pointer-events-none` or otherwise disable the content \u2014 it must remain fully interactive during refetch.\n\nUse `loading` and `fetching` from `useApiData` to distinguish these states:\n\n```tsx\nconst { data, loading, fetching, isError, error } = useApiData(\"GetOrders\", {\n status: statusFilter,\n search,\n});\n\n// Initial load \u2014 no data yet \u2192 show skeleton placeholder\nif (loading) {\n return <OrderTableSkeleton />;\n}\n\nif (isError) return <ErrorBanner error={error} />;\n\n// Refetch \u2014 data exists \u2192 subtle opacity + indicator, table stays interactive\nreturn (\n <div>\n {fetching && <div className=\"text-xs text-muted-foreground\">Updating\u2026</div>}\n <div className={fetching ? \"opacity-70\" : \"\"}>\n <OrderTable orders={data.orders} />\n </div>\n </div>\n);\n```\n\n```tsx\n// \u274C WRONG \u2014 pointer-events-none disables the table, making it feel broken\nreturn (\n <div className={fetching ? \"pointer-events-none\" : \"\"}>\n <OrderTable orders={data.orders} />\n </div>\n);\n\n// \u274C WRONG \u2014 no loading feedback when filters change\nif (loading) return <Skeleton />;\nreturn <OrderTable orders={data.orders} />;\n```\n\n#### Table Loading Rules\n\n- **Do not** use `pointer-events-none` on a table during loading \u2014 this disables interaction and makes the UI feel broken. During refetch, apply a subtle opacity (e.g. `opacity-70`) plus a non-blocking indicator (e.g., an \"Updating\u2026\" label or a thin progress bar). The table must remain clickable, sortable, and scrollable.\n- **Do not** replace a populated table with a full skeleton on refetch \u2014 this causes disorienting content flashes.\n- **Skeleton tables are only for initial load** (`loading` is true) when there is no data to display yet. Build them to match the real table's column structure (header + a few placeholder rows).\n\n### Efficient Loading Patterns\n\n1. **Always show loading indicators on refetch**: When inputs change (e.g. filters, search), show a non-blocking visual indicator while new data loads. Use `fetching` from `useApiData`.\n2. **Loading State Hierarchy**:\n - No data yet (`loading`) \u2192 Full skeleton placeholder\n - Has data, refetching (`fetching` && !`loading`) \u2192 Keep showing current data with a subtle visual indicator: light opacity (e.g. `opacity-70`) plus a non-blocking label (e.g. \"Updating\u2026\" text, thin progress bar, inline spinner). Do not use `pointer-events-none` \u2014 the content must remain fully interactive.\n - Error state (`isError`) \u2192 Show error with retry option, optionally keep stale data visible\n3. **Debounce Rapid Requests**: Prevent multiple API calls in short succession\n4. **Use useApiData for automatic refetching**: `useApiData` auto-refetches when inputs change and supports `staleTime`, `refetchOnWindowFocus`, `refetchOnReconnect`, `refetchInterval`, and `retry` options.\n\n## Performance Rules\n\n### 1. ALWAYS Paginate Tables and Lists\n\n**NEVER render more than 50 rows without pagination.** Always add client-side pagination:\n\n```tsx\nfunction PaginatedTable({ data }: { data: any[] }) {\n const PAGE_SIZE = 20;\n const [page, setPage] = useState(0);\n const totalPages = Math.ceil(data.length / PAGE_SIZE);\n const pageData = useMemo(\n () => data.slice(page * PAGE_SIZE, (page + 1) * PAGE_SIZE),\n [data, page],\n );\n\n useEffect(() => {\n setPage(0);\n }, [data.length]);\n\n return (\n <>\n <Table>{/* render pageData rows */}</Table>\n <span>\n Page {page + 1} of {totalPages} ({data.length} total rows)\n </span>\n <Button\n onClick={() => setPage((p) => Math.max(0, p - 1))}\n disabled={page === 0}\n >\n Previous\n </Button>\n <Button\n onClick={() => setPage((p) => Math.min(totalPages - 1, p + 1))}\n disabled={page >= totalPages - 1}\n >\n Next\n </Button>\n </>\n );\n}\n```\n\nFor 200+ rows, prefer **server-side pagination**; use cursor/keyset pagination for high offsets instead of `LIMIT`/`OFFSET`.\n\nFor 500+ item lists where pagination doesn't fit the UX (chat messages, infinite scroll feeds, large dropdowns), use **virtualization** (`react-virtuoso` or `@tanstack/react-virtual`) to render only the items visible in the viewport.\n\n### 2. ALWAYS Debounce Input-Driven API Calls\n\n**NEVER call an API directly from onChange.** Debounce search/filter inputs with a 300ms timer:\n\n```tsx\nfunction DebouncedSearch({ onSearch }: { onSearch: (query: string) => void }) {\n const [localValue, setLocalValue] = useState(\"\");\n const timerRef = useRef<ReturnType<typeof setTimeout>>();\n const handleChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n setLocalValue(e.target.value);\n clearTimeout(timerRef.current);\n timerRef.current = setTimeout(() => onSearch(e.target.value), 300);\n },\n [onSearch],\n );\n useEffect(() => () => clearTimeout(timerRef.current), []);\n\n return (\n <Input value={localValue} onChange={handleChange} placeholder=\"Search...\" />\n );\n}\n```\n\n### 3. Memoize Expensive Renders\n\nUse memoization (`memo()`, `useMemo`, `useCallback`) when it prevents measurable re-renders or expensive recomputation:\n\n```tsx\nconst OrderRow = memo(function OrderRow({\n order,\n onSelect,\n}: {\n order: Order;\n onSelect: (id: string) => void;\n}) {\n return (\n <TableRow onClick={() => onSelect(order.id)}>\n <TableCell>{order.id}</TableCell>...\n </TableRow>\n );\n});\n\nconst handleSelect = useCallback((id: string) => {\n setSelectedId(id);\n}, []);\n\nconst filtered = useMemo(\n () =>\n orders.filter((o) => o.status === status).sort((a, b) => b.total - a.total),\n [orders, status],\n);\n```\n\n### 4. ALWAYS Clean Up Side Effects\n\nClean up timers, event listeners, and subscriptions in `useEffect` return functions:\n\n```tsx\nuseEffect(() => {\n const handler = (e: KeyboardEvent) => {\n /* ... */\n };\n window.addEventListener(\"keydown\", handler);\n return () => window.removeEventListener(\"keydown\", handler);\n}, []);\n```\n\n### 5. Cancel In-Flight API Requests on Unmount\n\nFor search/filter patterns, prefer `useApiData` \u2014 it handles cancellation and cleanup automatically:\n\n```tsx\n// useApiData: auto-fetches and cancels on unmount/input change\nconst { data, fetching } = useApiData(\"SearchProducts\", { query });\n```\n\nFor imperative usage with manual cleanup, use the `cancel()` function:\n\n```tsx\nconst { run, cancel } = useApi(\"SearchProducts\");\n\nuseEffect(() => {\n if (!query) return;\n run({ query }).catch(console.error);\n return () => {\n cancel().catch(() => {});\n };\n}, [query, run, cancel]);\n```\n";
|
|
1
|
+
export declare const content = "---\nname: superblocks-frontend\ndescription: |\n Build frontend UI using React, Tailwind CSS, and Superblocks components. Essential for connecting Superblocks UIs with APIs.\n Use when creating pages, components, handling user interactions, or working with the design system.\nreadOnly: true\nmetadata:\n author: superblocks\n version: \"1.0\"\n---\n\n# Superblocks Frontend Development\n\nThis skill covers building frontend UI for Superblocks applications using React, Tailwind CSS v4, and the Superblocks component library.\n\n## Platform Overview\n\nThis is a React-based web application platform. Use standard React patterns:\n\n- `useState`, `useEffect`, `useCallback`, `useMemo`\n- Event handlers and controlled components\n- JSX with Tailwind CSS classes\n\n## Using APIs from Frontend\n\nThree primitives are available from `@superblocksteam/library`:\n\n- **`useApiData`** \u2014 declarative reads with SWR caching (preferred for data loading)\n- **`useApi`** \u2014 imperative mutations (for event-driven actions)\n- **`executeApi`** \u2014 plain Promise outside React (utility functions, event handlers without hooks)\n\n**Data loading** \u2014 auto-fetches on mount and when inputs change (preferred for reads):\n\n```typescript\nimport { useApiData } from \"@superblocksteam/library\";\n\n// Auto-fetches when email or name changes. No useEffect or HMR guards needed.\n// IMPORTANT: Always use `fetching` to show a loading indicator during refetches.\nconst { data, loading, fetching, isError, error } = useApiData(\"GetUsers\", {\n email,\n name,\n});\n```\n\n**Mutations** \u2014 call `run()` manually (for event-driven actions like form submissions):\n\n```typescript\nimport { useApi } from \"@superblocksteam/library\";\nimport { toast } from \"sonner\";\n\nconst { run: createOrder, loading } = useApi(\"CreateOrder\");\n\nconst handleSubmit = useCallback(async () => {\n try {\n await createOrder({ item, qty });\n } catch (error) {\n const message =\n error && typeof error === \"object\" && \"message\" in error\n ? String((error as { message: unknown }).message)\n : String(error);\n toast.error(\"Error creating order: \" + message);\n }\n}, [item, qty, createOrder]);\n```\n\n**Outside React** \u2014 call APIs as a plain Promise (utility functions, event handlers):\n\n```typescript\nimport { executeApi } from \"@superblocksteam/library\";\n\nconst result = await executeApi(\"GetUsers\", { email });\n```\n\n`useApiData` returns `{ data, loading, fetching, isError, isSuccess, isStale, error, status, fetchStatus, refetch, cancel }`. `data` persists across background refetches (stale-while-revalidate). `loading` is true on first fetch with no cached data. `fetching` is true during any fetch including background refetch. `status` is `\"pending\"` | `\"success\"` | `\"error\"`. `fetchStatus` is `\"idle\"` | `\"fetching\"`. `cancel()` is synchronous (returns `void`).\n\n`useApi` returns `{ run, cancel, reset, loading, data, error, status, variables }`. `data` persists across re-runs (shows previous result while loading). `error` holds the most recent failure, or `undefined` on success. `status` is `\"idle\"` | `\"pending\"` | `\"success\"` | `\"error\"`. `variables` holds the inputs from the most recent `run()`. `reset()` clears all state back to idle. HMR double-fetch prevention is built in \u2014 no `useRef` guard needed.\n\n### useApiData Options\n\n```typescript\nconst { data } = useApiData(\"GetUsers\", { email }, {\n enabled: true, // Skip fetching when false (conditional fetching)\n staleTime: 0, // Ms before cached data is considered stale (0 = always refetch)\n retry: 3, // Retry attempts on failure (false to disable)\n retryDelay: (n) => ..., // Custom delay strategy (default: exponential backoff, max 30s)\n refetchOnWindowFocus: false, // Refetch when tab regains focus\n refetchOnReconnect: true, // Refetch when network reconnects\n refetchInterval: false, // Polling interval in ms (false = disabled)\n structuralSharing: false, // Deep-compare to preserve object identity\n placeholderData: undefined, // Shown while the first fetch is in progress\n});\n```\n\n### Cache invalidation and optimistic updates\n\n**Same scope as the read**: After a mutation, prefer `refetch()` from the `useApiData` that loads the data (same component or wherever you can pass `refetch`).\n\n```typescript\nimport { useApi, useApiData } from \"@superblocksteam/library\";\nimport { toast } from \"sonner\";\n\nconst { data: orders, refetch } = useApiData(\"GetOrders\", { status });\nconst { run: createOrder } = useApi(\"CreateOrder\");\n\nconst handleSubmit = useCallback(async () => {\n try {\n await createOrder({ item, qty });\n await refetch();\n } catch (error) {\n const message =\n error && typeof error === \"object\" && \"message\" in error\n ? String((error as { message: unknown }).message)\n : String(error);\n toast.error(\"Error creating order: \" + message);\n }\n}, [item, qty, createOrder, refetch]);\n```\n\n**Cross-scope or broad invalidation**: Use `queryClient.invalidateQueries` when you cannot call that `refetch` (mutation in a different place than the `useApiData`, or you need every cached variant of an API to refetch). For **`queryClient.invalidateQueries`, `buildCacheKey`, `setQueryData`, and any other `queryClient` usage, always import `queryClient` from `@superblocksteam/library`**.\n\n```typescript\nimport { queryClient, useApi } from \"@superblocksteam/library\";\nimport { toast } from \"sonner\";\n\nconst { run: createOrder } = useApi(\"CreateOrder\");\n\nconst handleSubmit = useCallback(async () => {\n try {\n await createOrder({ item, qty });\n await queryClient.invalidateQueries(\"GetOrders\");\n } catch (error) {\n const message =\n error && typeof error === \"object\" && \"message\" in error\n ? String((error as { message: unknown }).message)\n : String(error);\n toast.error(\"Error creating order: \" + message);\n }\n}, [item, qty, createOrder]);\n```\n\n```typescript\n// Optimistic update: set cached data without refetching\nimport { queryClient } from \"@superblocksteam/library\";\n\nconst cacheKey = queryClient.buildCacheKey(\"GetOrders\", { status: \"active\" });\nqueryClient.setQueryData(cacheKey, (old) => ({\n ...old,\n orders: [...old.orders, newOrder],\n}));\n```\n\n### Critical API Rules\n\n1. **MUST call API by exact name**: Format is `<ApiName>` matching folder `apis/<ApiName>/api.yaml`\n2. **Use `useApiData` for data loading, `useApi` for mutations**: For data fetching, use `useApiData(\"GetUsers\", { email })`. Only use `useApi` for event-driven actions (button clicks, form submissions). Use `executeApi` for API calls outside React components.\n3. **Use the hook's state fields**: Do NOT create separate `useState` for loading or response data \u2014 the hooks manage this for you\n4. **ALWAYS check API interfaces**: NEVER guess the response structure\n5. **Include all parameters**: Even optional ones should be passed as `null`\n6. **ALWAYS use try/catch**: In imperative mode, APIs throw errors when they fail - wrap ALL `run()` calls in try/catch blocks. In declarative mode, check the `error` field for failure details.\n\n### File Handling\n\n**CRITICAL: Files must be wrapped in `{ files: [...] }` format:**\n\n```tsx\n// \u2705 CORRECT - Frontend: wrap files in { files: [...] }\nconst response = await runUploadApi({ userFile: { files: selectedFiles } });\n\n// \u274C WRONG - backend cannot process unwrapped files\nconst response = await runUploadApi({ userFile: selectedFiles });\n```\n\n## Platform Hooks and Functions\n\nAvailable hooks and functions from `@superblocksteam/library`:\n\n### User and Group Context\n\n```typescript\nimport {\n useSuperblocksUser,\n useSuperblocksGroups,\n} from \"@superblocksteam/library\";\n\n// Get current user info\nconst user = useSuperblocksUser();\n// user.name, user.email, user.id, user.groups, user.username, user.metadata\n\n// Get organization groups\nconst groups = useSuperblocksGroups();\n```\n\n### Environments and Data Tags\n\nConcepts & terminology:\n\n- `Data tags` are labels for different data segments, such as `Staging`, `Production`, or `us-east`.\n- `Profiles` is the legacy term for the same concept. If a user asks about profiles, treat that as data tags.\n- `Environments` are `Edit`, `Preview`, and `Production`, and each data tag is allowed in one or more of those environments.\n- Clark operates in `Edit` mode, so the data tags visible in app context represent the tags available in `Edit`; do not assume this is the same set that will be available in `Preview` or `Production`.\n- When implementing app code, prefer `useSuperblocksDataTags()`, `dataTags`, and `setDataTag()`.\n\nThe `DataTag` type has these fields (it is an alias for `Profile` from `@superblocksteam/shared`):\n\n```typescript\ntype DataTag = {\n id: string;\n key: string;\n displayName: string; // human-readable label \u2014 use this for display, NOT \"name\"\n description: string;\n type: \"RESERVED\" | \"CUSTOM\";\n};\n```\n\nRelevant hooks and functions:\n\n```typescript\nimport { useSuperblocksDataTags, getAppMode } from \"@superblocksteam/library\";\nimport type { DataTag, DataTags } from \"@superblocksteam/library\";\n\n// Manage data tags\nconst { dataTags, setDataTag } = useSuperblocksDataTags();\n// dataTags.available: DataTag[] \u2014 all tags in the current environment\n// dataTags.selected: DataTag | undefined \u2014 currently active tag (may be undefined)\n// dataTags.default: DataTag \u2014 the default tag\n// setDataTag(dataTag.key) \u2014 switch the active tag by key\n\n// Read the current app mode when reasoning about environment-specific behavior\nconst appMode = getAppMode();\n```\n\nExample \u2014 data tag switcher using a Select:\n\n```tsx\nconst { dataTags, setDataTag } = useSuperblocksDataTags();\n\n<Select value={dataTags?.selected?.key} onValueChange={setDataTag}>\n {dataTags?.available.map((tag) => (\n <SelectItem key={tag.key} value={tag.key}>\n {tag.displayName}\n </SelectItem>\n ))}\n</Select>;\n```\n\n### Embedded Applications\n\n**For embedded applications**, see the `references/embedding.md` file for `useEmbedProperties`, `useEmbedEvent`, and `useEmitEmbedEvent` hooks.\n\n## Logging Out of Integrations\n\nWhen building a \"Log out\" or \"Sign out\" button for apps that use OAuth-like integrations, use `logoutIntegrations` from the library to clear OAuth tokens:\n\n```typescript\nimport { logoutIntegrations } from \"@superblocksteam/library\";\n\nconst handleLogout = async () => {\n await logoutIntegrations();\n // Optionally redirect or show confirmation\n};\n```\n\n## Application Architecture\n\n### App.tsx Layout Structure\n\n**For single-page applications:**\n\n- Put all content in `pages/<pageName>/index.tsx`\n- Use components to compose and build the page\n- Keep `App.tsx` minimal with just `<AppProvider>` and `<Outlet />`\n\n**For multi-page applications:**\n\n- Put shared navigation/layout in `App.tsx` (sidebars, headers, footers)\n- Always include `<Outlet />` for page content\n- Always include `<AppProvider />` wrapper\n- Individual pages focus on content, not layout\n\n```tsx\n// \u2705 CORRECT - Multi-page App.tsx layout\n<AppProvider>\n <div className=\"flex flex-row size-screen\">\n {/* Sidebar - persistent across all pages */}\n <div className=\"flex bg-sidebar border-r w-[250px]\">\n <Navigation />\n </div>\n\n {/* Main content area */}\n <div className=\"flex flex-1 h-full flex-col\">\n {/* Header - persistent across all pages */}\n <div className=\"flex bg-header border-b h-[60px]\">\n <Header />\n </div>\n\n {/* Page content area */}\n <div className=\"flex p-4 flex-1 overflow-auto\">\n <Outlet />\n </div>\n </div>\n </div>\n</AppProvider>\n```\n\n**PROTECTED: NEVER remove `<AppProvider>` or `<Outlet />` from App.tsx!**\n\n### Page Structure\n\n```tsx\n// \u2705 CORRECT - Page focuses on content only\n<div className=\"flex flex-col gap-4 size-screen overflow-auto\">\n <h1 className=\"text-3xl font-bold\">Dashboard Content</h1>\n <Card>{/* Page-specific content */}</Card>\n</div>\n```\n\n**IMPORTANT**: The first div on the page must have `overflow-auto` so the user's page can scroll.\n\n## Routing\n\nUse `react-router@7` in data mode. Standard patterns apply:\n\n- `useNavigate()` for programmatic navigation\n- `useParams()` for route parameters\n- `useSearchParams()` for query strings\n\n**If you add new pages or rename files, you MUST update the router.**\n\n## Design System (Tailwind CSS v4)\n\n**All design tokens are defined in `index.css`**. Apps come with a professional black-and-white theme by default.\n\n### Semantic Tokens Rule\n\n**ALWAYS use semantic tokens** \u2014 NEVER raw Tailwind utilities:\n\n```tsx\n// \u2705 CORRECT\n<Card className=\"bg-background text-foreground border border-border\" />\n\n// \u274C WRONG\n<Card className=\"bg-white text-black border-gray-200\" />\n```\n\n### When to Modify index.css\n\nOnly modify when:\n\n- User explicitly requests branding/theme changes\n- Replicating a specific brand look (e.g., Yelp, Instacart)\n- Migrating an attached third-party app \u2014 see `skills/system/third-party-migration/SKILL.md` (its theme-port rules override the Modification Rules below \u2014 copy source tokens as-is, do not convert to OKLCH or trim the palette)\n- Feature requests (lists, filters, CRUD) do NOT require changes\n\n**Modification Rules:**\n\n- All colors must be in OKLCH format\n- Use semantic names (`--color-warning`, `--shadow-elevated`)\n- Do not remove or rename existing tokens\n- Limit color palette to 5 colors max\n- Avoid gradients unless explicitly requested\n- Minimal font sizes (3 max: body, section heading, main heading)\n\n### Component Variants\n\nUse or create variants instead of one-off styles:\n\n```tsx\n// \u274C WRONG - Hacky inline overrides\n<Button className=\"text-white border-white hover:bg-white\" />\n\n// \u2705 CORRECT - Use a variant\n<Button variant=\"secondary\" />\n```\n\n## Icons\n\nUse icons from Lucide React library:\n\n```tsx\nimport { Icon } from \"@/components/ui/icon\";\n<Icon icon=\"heart\" />;\n\nimport { Button } from \"@/components/ui/button\";\n<Button>\n <Icon icon=\"plus\" /> Add Item\n</Button>;\n```\n\n**Always use icons rather than emojis unless explicitly requested.**\n\n## Custom Components\n\n**CRITICAL: Component composition is MANDATORY. DO NOT create monolithic pages.**\n\n### The Composition Rule\n\nWhen building ANY feature:\n\n1. **First**, identify reusable parts (list items, cards, forms, filters, headers)\n2. **Then**, create separate component files\n3. **Finally**, compose them together in the page\n\n### When to Create Components\n\n- **Rendering any list** - Extract to a component\n- **Building cards/complex UI** - Each card type is a component\n- **Creating forms** - Form sections are components\n- **Adding filters/headers** - These are components\n- **Page has >50 lines JSX** - Break it down\n\n### Component Boundary Rules\n\n**Inside a custom component:**\n\n- \u2705 Use React hooks (useState, useReducer, useEffect, etc.)\n- \u2705 Use local React state\n- \u2705 Use internal helper components\n- \u2705 Use other registered components\n- \u274C CANNOT call APIs - must pass data into the component\n\n### Example: Proper Component Structure\n\n```tsx\n// components/ProductCard/index.tsx - Extract to component\nimport { Card } from \"@/components/ui/card\";\nimport { Button } from \"@/components/ui/button\";\n\ntype ProductCardProps = {\n product: {\n id: string;\n name: string;\n image: string;\n };\n};\n\nexport default function ProductCard(props: ProductCardProps) {\n return (\n <Card>\n <img src={props.product.image} />\n <h3 className=\"text-lg font-semibold\">{props.product.name}</h3>\n <Button>Add</Button>\n </Card>\n );\n}\n\n// pages/Products/index.tsx - Clean composition\nimport ProductCard from \"@/components/ProductCard\";\n\nconst ProductsPage = () => {\n const [products, setProducts] = useState([]);\n\n return (\n <div className=\"grid grid-cols-3 gap-4\">\n {products.map((p) => (\n <ProductCard key={p.id} product={p} />\n ))}\n </div>\n );\n};\n```\n\n## Visual Excellence\n\n**Prioritize visual excellence from the start:**\n\n1. **Design System Enhancement**: Start by enhancing `index.css` with app-specific colors that match the target aesthetic\n2. **Professional Layout Architecture**: Use sophisticated layouts with proper spacing, responsive design\n3. **Rich Interactive Components**: Leverage advanced components with proper variants and states\n4. **Visual Polish**: Add shadows, smooth transitions, skeleton loaders, hover effects, typography hierarchy\n5. **Real-World UI Patterns**: Create layouts that feel like professional applications\n\n**Make applications that look and feel like real, polished products - not basic wireframes.**\n\n### Loading States\n\nLoading behavior must differ based on whether data has already been fetched:\n\n**Initial load (no data yet):** Show skeleton shimmers that mirror the shape of the final content. Never show a blank screen or a generic spinner.\n\n**Refetch / background refresh (data already exists):** Keep showing the existing data. Use `fetching` from `useApiData` to apply a subtle visual indicator: light opacity (e.g. `opacity-70`) to signal a refresh is in progress, plus a non-blocking label such as a small inline spinner, a thin progress bar, or an \"Updating\u2026\" label. **Do not** use `pointer-events-none` or otherwise disable the content \u2014 it must remain fully interactive during refetch.\n\nUse `loading` and `fetching` from `useApiData` to distinguish these states:\n\n```tsx\nconst { data, loading, fetching, isError, error } = useApiData(\"GetOrders\", {\n status: statusFilter,\n search,\n});\n\n// Initial load \u2014 no data yet \u2192 show skeleton placeholder\nif (loading) {\n return <OrderTableSkeleton />;\n}\n\nif (isError) return <ErrorBanner error={error} />;\n\n// Refetch \u2014 data exists \u2192 subtle opacity + indicator, table stays interactive\nreturn (\n <div>\n {fetching && <div className=\"text-xs text-muted-foreground\">Updating\u2026</div>}\n <div className={fetching ? \"opacity-70\" : \"\"}>\n <OrderTable orders={data.orders} />\n </div>\n </div>\n);\n```\n\n```tsx\n// \u274C WRONG \u2014 pointer-events-none disables the table, making it feel broken\nreturn (\n <div className={fetching ? \"pointer-events-none\" : \"\"}>\n <OrderTable orders={data.orders} />\n </div>\n);\n\n// \u274C WRONG \u2014 no loading feedback when filters change\nif (loading) return <Skeleton />;\nreturn <OrderTable orders={data.orders} />;\n```\n\n#### Table Loading Rules\n\n- **Do not** use `pointer-events-none` on a table during loading \u2014 this disables interaction and makes the UI feel broken. During refetch, apply a subtle opacity (e.g. `opacity-70`) plus a non-blocking indicator (e.g., an \"Updating\u2026\" label or a thin progress bar). The table must remain clickable, sortable, and scrollable.\n- **Do not** replace a populated table with a full skeleton on refetch \u2014 this causes disorienting content flashes.\n- **Skeleton tables are only for initial load** (`loading` is true) when there is no data to display yet. Build them to match the real table's column structure (header + a few placeholder rows).\n\n### Efficient Loading Patterns\n\n1. **Always show loading indicators on refetch**: When inputs change (e.g. filters, search), show a non-blocking visual indicator while new data loads. Use `fetching` from `useApiData`.\n2. **Loading State Hierarchy**:\n - No data yet (`loading`) \u2192 Full skeleton placeholder\n - Has data, refetching (`fetching` && !`loading`) \u2192 Keep showing current data with a subtle visual indicator: light opacity (e.g. `opacity-70`) plus a non-blocking label (e.g. \"Updating\u2026\" text, thin progress bar, inline spinner). Do not use `pointer-events-none` \u2014 the content must remain fully interactive.\n - Error state (`isError`) \u2192 Show error with retry option, optionally keep stale data visible\n3. **Debounce Rapid Requests**: Prevent multiple API calls in short succession\n4. **Use useApiData for automatic refetching**: `useApiData` auto-refetches when inputs change and supports `staleTime`, `refetchOnWindowFocus`, `refetchOnReconnect`, `refetchInterval`, and `retry` options.\n\n## Performance Rules\n\n### 1. ALWAYS Paginate Tables and Lists\n\n**NEVER render more than 50 rows without pagination.** Always add client-side pagination:\n\n```tsx\nfunction PaginatedTable({ data }: { data: any[] }) {\n const PAGE_SIZE = 20;\n const [page, setPage] = useState(0);\n const totalPages = Math.ceil(data.length / PAGE_SIZE);\n const pageData = useMemo(\n () => data.slice(page * PAGE_SIZE, (page + 1) * PAGE_SIZE),\n [data, page],\n );\n\n useEffect(() => {\n setPage(0);\n }, [data.length]);\n\n return (\n <>\n <Table>{/* render pageData rows */}</Table>\n <span>\n Page {page + 1} of {totalPages} ({data.length} total rows)\n </span>\n <Button\n onClick={() => setPage((p) => Math.max(0, p - 1))}\n disabled={page === 0}\n >\n Previous\n </Button>\n <Button\n onClick={() => setPage((p) => Math.min(totalPages - 1, p + 1))}\n disabled={page >= totalPages - 1}\n >\n Next\n </Button>\n </>\n );\n}\n```\n\nFor 200+ rows, prefer **server-side pagination**; use cursor/keyset pagination for high offsets instead of `LIMIT`/`OFFSET`.\n\nFor 500+ item lists where pagination doesn't fit the UX (chat messages, infinite scroll feeds, large dropdowns), use **virtualization** (`react-virtuoso` or `@tanstack/react-virtual`) to render only the items visible in the viewport.\n\n### 2. ALWAYS Debounce Input-Driven API Calls\n\n**NEVER call an API directly from onChange.** Debounce search/filter inputs with a 300ms timer:\n\n```tsx\nfunction DebouncedSearch({ onSearch }: { onSearch: (query: string) => void }) {\n const [localValue, setLocalValue] = useState(\"\");\n const timerRef = useRef<ReturnType<typeof setTimeout>>();\n const handleChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n setLocalValue(e.target.value);\n clearTimeout(timerRef.current);\n timerRef.current = setTimeout(() => onSearch(e.target.value), 300);\n },\n [onSearch],\n );\n useEffect(() => () => clearTimeout(timerRef.current), []);\n\n return (\n <Input value={localValue} onChange={handleChange} placeholder=\"Search...\" />\n );\n}\n```\n\n### 3. Memoize Expensive Renders\n\nUse memoization (`memo()`, `useMemo`, `useCallback`) when it prevents measurable re-renders or expensive recomputation:\n\n```tsx\nconst OrderRow = memo(function OrderRow({\n order,\n onSelect,\n}: {\n order: Order;\n onSelect: (id: string) => void;\n}) {\n return (\n <TableRow onClick={() => onSelect(order.id)}>\n <TableCell>{order.id}</TableCell>...\n </TableRow>\n );\n});\n\nconst handleSelect = useCallback((id: string) => {\n setSelectedId(id);\n}, []);\n\nconst filtered = useMemo(\n () =>\n orders.filter((o) => o.status === status).sort((a, b) => b.total - a.total),\n [orders, status],\n);\n```\n\n### 4. ALWAYS Clean Up Side Effects\n\nClean up timers, event listeners, and subscriptions in `useEffect` return functions:\n\n```tsx\nuseEffect(() => {\n const handler = (e: KeyboardEvent) => {\n /* ... */\n };\n window.addEventListener(\"keydown\", handler);\n return () => window.removeEventListener(\"keydown\", handler);\n}, []);\n```\n\n### 5. Cancel In-Flight API Requests on Unmount\n\nFor search/filter patterns, prefer `useApiData` \u2014 it handles cancellation and cleanup automatically:\n\n```tsx\n// useApiData: auto-fetches and cancels on unmount/input change\nconst { data, fetching } = useApiData(\"SearchProducts\", { query });\n```\n\nFor imperative usage with manual cleanup, use the `cancel()` function:\n\n```tsx\nconst { run, cancel } = useApi(\"SearchProducts\");\n\nuseEffect(() => {\n if (!query) return;\n run({ query }).catch(console.error);\n return () => {\n cancel().catch(() => {});\n };\n}, [query, run, cancel]);\n```\n";
|
|
2
2
|
//# sourceMappingURL=skill.generated.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skill.generated.d.ts","sourceRoot":"","sources":["../../../../../src/ai-service/skills/system/superblocks-frontend/skill.generated.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,OAAO,
|
|
1
|
+
{"version":3,"file":"skill.generated.d.ts","sourceRoot":"","sources":["../../../../../src/ai-service/skills/system/superblocks-frontend/skill.generated.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,OAAO,g/vBAiqBnB,CAAC"}
|
|
@@ -350,6 +350,7 @@ Only modify when:
|
|
|
350
350
|
|
|
351
351
|
- User explicitly requests branding/theme changes
|
|
352
352
|
- Replicating a specific brand look (e.g., Yelp, Instacart)
|
|
353
|
+
- Migrating an attached third-party app — see \`skills/system/third-party-migration/SKILL.md\` (its theme-port rules override the Modification Rules below — copy source tokens as-is, do not convert to OKLCH or trim the palette)
|
|
353
354
|
- Feature requests (lists, filters, CRUD) do NOT require changes
|
|
354
355
|
|
|
355
356
|
**Modification Rules:**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skill.generated.js","sourceRoot":"","sources":["../../../../../src/ai-service/skills/system/superblocks-frontend/skill.generated.ts"],"names":[],"mappings":"AAAA,iFAAiF;AACjF,mDAAmD;AAEnD,MAAM,CAAC,MAAM,OAAO,GAAG
|
|
1
|
+
{"version":3,"file":"skill.generated.js","sourceRoot":"","sources":["../../../../../src/ai-service/skills/system/superblocks-frontend/skill.generated.ts"],"names":[],"mappings":"AAAA,iFAAiF;AACjF,mDAAmD;AAEnD,MAAM,CAAC,MAAM,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiqBtB,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const content = "# Lovable-specific mapping\n\nThis is a per-platform reference loaded from `SKILL.md`. The framework \u2014 target layout, universal mapping, non-negotiables, workflow, code-emission rules \u2014 lives there. This file documents only what's specific to a Lovable source.\n\n> Lovable is not a fixed stack. Unlike Replit, there is no canonical template to assume. A Lovable app may talk to Lovable Cloud / Supabase directly from the client, may have edge functions, may call arbitrary third-party APIs, may have no backend at all, or may mix all of the above. **Discover before you map.** Do not assume Supabase, do not assume an Express server, and do not invent integrations the source does not use.\n\n## Where the source lives\n\nHallmarks: `src/integrations/supabase/client.ts`, `src/integrations/supabase/types.ts`, `supabase/config.toml`, `supabase/functions/<name>/index.ts`, `supabase/migrations/`, a `lovable-tagger` entry in `vite.config.ts`, or a Lovable-flavored README.\n\nIf the user gave a path, use it. Otherwise look for the hallmarks above in the working tree. If ambiguous, ask.\n\n## Typical shape (hints, not rules)\n\nUse these as starting points; re-verify against the actual source tree on every migration.\n\n- **Frontend**: React 18 + Vite + TypeScript + Tailwind + shadcn/ui. Routing via `react-router-dom` (v6 or v7) or sometimes `wouter`. Data fetching via `@tanstack/react-query`. Forms via `react-hook-form` + `zod`.\n- **Backend (when present)** \u2014 pick whichever the source actually uses:\n - **Lovable Cloud / Supabase** is the default. Surfaces in the source as `src/integrations/supabase/client.ts`, `src/integrations/supabase/types.ts`, a top-level `supabase/` dir with `migrations/` and/or `functions/<name>/index.ts` (Deno edge functions), and direct `supabase.from(\"table\").select(...)` calls from React components.\n - **Edge functions** (Deno-style): `supabase/functions/<name>/index.ts`. Each is its own HTTP endpoint, may use `Deno.serve`, often reads `Deno.env.get(...)`.\n - **Third-party APIs** called from the client (Stripe, OpenAI, Resend, etc.) \u2014 frequently with secrets that should never have been on the client.\n - **No backend at all** \u2014 pure static app, possibly with localStorage state. The framework's \"Don't fabricate a backend\" rule applies; the migrated app stays frontend-only.\n- **Auth**: `supabase.auth` from the client (`signInWithPassword`, `onAuthStateChange`, `getSession`). Sometimes wrapped in an `AuthContext`.\n- **Storage**: `supabase.storage.from(bucket).upload(...)` or third-party upload services.\n- **Realtime**: `supabase.channel(...).on(\"postgres_changes\", ...)` subscriptions. **Superblocks has no realtime equivalent in this template \u2014 flag and degrade to polling or one-shot fetches; do not silently drop.**\n\n## Discovery checklist\n\nThis is the most important step for a Lovable migration \u2014 get it wrong and the rest is rework. In addition to the framework's discovery requirements, build a list of:\n\n- Every distinct backend interaction: Supabase table queries (grouped by table + operation), Supabase RPC calls, edge functions, third-party API calls (each endpoint), storage operations, realtime subscriptions, auth calls.\n- Every env var and where it's used (client vs. server, whether it's a secret).\n- Every Supabase migration file and the schema it implies.\n- Every RLS policy you can find \u2014 these become explicit `WHERE` clauses post-migration.\n- Every leaked secret found on the client side (`VITE_*`, hardcoded keys) \u2014 these go into the security note at the end.\n\nIf the discovery summary doesn't tell you what every API will look like, you haven't discovered enough.\n\n## Core mapping\n\n- **Each client-side Supabase call \u2192 one Superblocks API**, then call it via `useApi`/`useApiData`. Direct database access from the client is not how Superblocks apps work \u2014 every read and write flows through `server/apis/<ApiName>/api.ts`.\n - `supabase.from(\"table\").select(...)` \u2192 `api()` with a Postgres integration and `ctx.integrations.db.query(...)`. Translate the PostgREST filter chain (`.eq`, `.in`, `.order`, `.range`, `.limit`) into parameterized SQL \u2014 never string-interpolate user input.\n - `supabase.from(\"table\").insert/update/upsert/delete(...)` \u2192 `.execute(...)` with parameterized SQL.\n - `supabase.rpc(\"<fn>\", { ... })` \u2192 `SELECT * FROM <fn>(...)` via `.query` if it returns rows, else `.execute`.\n - **RLS / row-level-security policies** in Lovable do not transfer automatically. The Superblocks API runs as the integration's service user, not the end user. You must enforce per-user filtering in SQL using `ctx.user.userId` (or another claim) explicitly. Audit every ported query \u2014 if the original relied on `auth.uid()` in an RLS policy, the ported SQL needs an equivalent `WHERE user_id = $N` clause. Missing filters are a security bug. Write a one-line comment above the clause noting which RLS policy it replaces, since the _why_ is non-obvious to a future reader.\n - **Schema**: Postgres tables exist on the integration the user binds. Do not run Lovable's `supabase/migrations/*.sql` against the target DB. Read them to understand schema and surface a summary; if the integration's DB is empty or schema-mismatched, stop and ask the user how they want to proceed (apply migrations manually, point to an existing DB, or defer).\n- **Each `supabase/functions/<name>/index.ts` edge function \u2192 one Superblocks API** at `server/apis/<NameInPascalCase>/api.ts`. Translate `Deno.serve`'s request handler the same way as any other handler: body/query/params \u2192 unified `input` schema, response \u2192 `return { ... }` from `run`. `Deno.env.get(...)` \u2192 `ctx.env`. Edge-function-specific helpers (CORS headers, JWT verification middleware) \u2192 drop; the platform handles them.\n- **Each third-party API call \u2192 integration**. `fetch(\"https://api.stripe.com/...\")` becomes a declared integration plus `apiRequest(...)`. Secrets from `import.meta.env.VITE_*`, hardcoded keys, or `Deno.env.get` move into the integration definition. A `VITE_OPENAI_API_KEY` on the client side is also a security finding worth surfacing in the migration summary.\n- **`supabase.auth` \u2192 `ctx.user`**. Drop `AuthContext` providers, sign-in pages, password-reset flows, and magic-link handlers \u2014 they have no role in a Superblocks app.\n- **`supabase.storage` \u2192 integrations**. If the source uses Supabase storage, ask the user which target storage integration to use (S3, GCS, etc.) \u2014 there is no Lovable-flavored \"storage\" integration. Surface the buckets used in the discovery summary.\n- **`supabase.channel(...)` realtime subscriptions** \u2192 not supported in this template. Flag as a `failed` checklist item with `failureReason: \"realtime subscription on <table> has no Superblocks equivalent\"`, and ask the user before silently rewriting to polling.\n\n## Ask-before-guessing \u2014 Lovable specifics\n\n- \"The source uses Supabase for both database and auth \u2014 bind to an existing Postgres integration, or do you want to point at a different DB? Auth is platform-managed in Superblocks regardless.\"\n- \"I see direct calls to `<third-party API>` from the client with secrets in `VITE_*` env vars. I'll move these server-side via an integration \u2014 confirm which integration to bind, or whether to create a new one.\"\n- \"The source has Postgres migrations under `supabase/migrations/`. I will not run them against your integration's database. How do you want the schema to land?\"\n- \"I see realtime subscriptions on `<table>`. Superblocks has no realtime in this template \u2014 degrade to polling, drop the feature, or stop and let you decide?\"\n- \"RLS policy `<policy>` filtered by `auth.uid()`. I'll replace it with `WHERE user_id = $N` keyed off `ctx.user.userId`. Is that the right user-claim mapping?\"\n\n## Page port \u2014 what changes vs. what doesn't\n\nFor each Lovable page, only these change:\n\n- **Data hooks**: direct Supabase calls + `@tanstack/react-query` \u2192 `useApi` / `useApiData`.\n- **Auth touchpoints**: `supabase.auth` / custom `AuthContext` \u2192 platform-managed (drop the provider; consume `ctx.user` server-side).\n- **Router primitives**: if the source uses `wouter` or v6 patterns, adapt to `react-router` v7.\n\nEverything else \u2014 JSX structure, Tailwind classes, shadcn variants, custom CSS, theme tokens, fonts, layout containers \u2014 transfers unchanged. If the diff goes beyond data + auth + routing, you are over-editing.\n\n## Done \u2014 Lovable specifics\n\nIn the final report, additionally surface:\n\n- Any unsupported features that became `failed` items (realtime subscriptions, Supabase storage without a target integration, etc.).\n";
|
|
1
|
+
export declare const content = "# Lovable-specific mapping\n\nThis is a per-platform reference loaded from `SKILL.md`. The framework \u2014 target layout, universal mapping, non-negotiables, workflow, code-emission rules \u2014 lives there. This file documents only what's specific to a Lovable source.\n\n> Lovable is not a fixed stack. Unlike Replit, there is no canonical template to assume. A Lovable app may talk to Lovable Cloud / Supabase directly from the client, may have edge functions, may call arbitrary third-party APIs, may have no backend at all, or may mix all of the above. **Discover before you map.** Do not assume Supabase, do not assume an Express server, and do not invent integrations the source does not use.\n\n## Where the source lives\n\nHallmarks: `src/integrations/supabase/client.ts`, `src/integrations/supabase/types.ts`, `supabase/config.toml`, `supabase/functions/<name>/index.ts`, `supabase/migrations/`, a `lovable-tagger` entry in `vite.config.ts`, or a Lovable-flavored README.\n\nIf the user gave a path, use it. Otherwise look for the hallmarks above in the working tree. If ambiguous, ask.\n\n## Typical shape (hints, not rules)\n\nUse these as starting points; re-verify against the actual source tree on every migration.\n\n- **Frontend**: React 18 + Vite + TypeScript + Tailwind + shadcn/ui. Routing via `react-router-dom` (v6 or v7) or sometimes `wouter`. Data fetching via `@tanstack/react-query`. Forms via `react-hook-form` + `zod`.\n- **Backend (when present)** \u2014 pick whichever the source actually uses:\n - **Lovable Cloud / Supabase** is the default. Surfaces in the source as `src/integrations/supabase/client.ts`, `src/integrations/supabase/types.ts`, a top-level `supabase/` dir with `migrations/` and/or `functions/<name>/index.ts` (Deno edge functions), and direct `supabase.from(\"table\").select(...)` calls from React components.\n - **Edge functions** (Deno-style): `supabase/functions/<name>/index.ts`. Each is its own HTTP endpoint, may use `Deno.serve`, often reads `Deno.env.get(...)`.\n - **Third-party APIs** called from the client (Stripe, OpenAI, Resend, etc.) \u2014 frequently with secrets that should never have been on the client.\n - **No backend at all** \u2014 pure static app, possibly with localStorage state. The framework's \"Don't fabricate a backend\" rule applies; the migrated app stays frontend-only.\n- **Auth**: `supabase.auth` from the client (`signInWithPassword`, `onAuthStateChange`, `getSession`). Sometimes wrapped in an `AuthContext`.\n- **Storage**: `supabase.storage.from(bucket).upload(...)` or third-party upload services.\n- **Realtime**: `supabase.channel(...).on(\"postgres_changes\", ...)` subscriptions. **Superblocks has no realtime equivalent in this template \u2014 flag and degrade to polling or one-shot fetches; do not silently drop.**\n\n## Discovery checklist\n\nThis is the most important step for a Lovable migration \u2014 get it wrong and the rest is rework. In addition to the framework's discovery requirements, build a list of:\n\n- Every distinct backend interaction: Supabase table queries (grouped by table + operation), Supabase RPC calls, edge functions, third-party API calls (each endpoint), storage operations, realtime subscriptions, auth calls.\n- Every env var and where it's used (client vs. server, whether it's a secret).\n- Every Supabase migration file and the schema it implies.\n- Every RLS policy you can find \u2014 these become explicit `WHERE` clauses post-migration.\n- Every leaked secret found on the client side (`VITE_*`, hardcoded keys) \u2014 these go into the security note at the end.\n\nIf the discovery summary doesn't tell you what every API will look like, you haven't discovered enough.\n\n## Core mapping\n\n- **Each client-side Supabase call \u2192 one Superblocks API**, then call it via `useApi`/`useApiData`. Direct database access from the client is not how Superblocks apps work \u2014 every read and write flows through `server/apis/<ApiName>/api.ts`.\n - `supabase.from(\"table\").select(...)` \u2192 `api()` with a Postgres integration and `ctx.integrations.db.query(...)`. Translate the PostgREST filter chain (`.eq`, `.in`, `.order`, `.range`, `.limit`) into parameterized SQL \u2014 never string-interpolate user input.\n - `supabase.from(\"table\").insert/update/upsert/delete(...)` \u2192 `.execute(...)` with parameterized SQL.\n - `supabase.rpc(\"<fn>\", { ... })` \u2192 `SELECT * FROM <fn>(...)` via `.query` if it returns rows, else `.execute`.\n - **RLS / row-level-security policies** in Lovable do not transfer automatically. The Superblocks API runs as the integration's service user, not the end user. You must enforce per-user filtering in SQL using `ctx.user.userId` (or another claim) explicitly. Audit every ported query \u2014 if the original relied on `auth.uid()` in an RLS policy, the ported SQL needs an equivalent `WHERE user_id = $N` clause. Missing filters are a security bug. Write a one-line comment above the clause noting which RLS policy it replaces, since the _why_ is non-obvious to a future reader.\n - **Schema**: Postgres tables exist on the integration the user binds. Do not run Lovable's `supabase/migrations/*.sql` against the target DB. Read them to understand schema and surface a summary; if the integration's DB is empty or schema-mismatched, stop and ask the user how they want to proceed (apply migrations manually, point to an existing DB, or defer).\n- **Each `supabase/functions/<name>/index.ts` edge function \u2192 one Superblocks API** at `server/apis/<NameInPascalCase>/api.ts`. Translate `Deno.serve`'s request handler the same way as any other handler: body/query/params \u2192 unified `input` schema, response \u2192 `return { ... }` from `run`. `Deno.env.get(...)` \u2192 `ctx.env`. Edge-function-specific helpers (CORS headers, JWT verification middleware) \u2192 drop; the platform handles them.\n- **Each third-party API call \u2192 integration**. `fetch(\"https://api.stripe.com/...\")` becomes a declared integration plus `apiRequest(...)`. Secrets from `import.meta.env.VITE_*`, hardcoded keys, or `Deno.env.get` move into the integration definition. A `VITE_OPENAI_API_KEY` on the client side is also a security finding worth surfacing in the migration summary.\n- **`supabase.auth` \u2192 `ctx.user`**. Drop `AuthContext` providers, sign-in pages, password-reset flows, and magic-link handlers \u2014 they have no role in a Superblocks app.\n- **`supabase.storage` \u2192 integrations**. If the source uses Supabase storage, ask the user which target storage integration to use (S3, GCS, etc.) \u2014 there is no Lovable-flavored \"storage\" integration. Surface the buckets used in the discovery summary.\n- **`supabase.channel(...)` realtime subscriptions** \u2192 not supported in this template. Flag as a `failed` checklist item with `failureReason: \"realtime subscription on <table> has no Superblocks equivalent\"`, and ask the user before silently rewriting to polling.\n\n## Ask-before-guessing \u2014 Lovable specifics\n\n- \"The source uses Supabase for both database and auth \u2014 bind to an existing Postgres integration, or do you want to point at a different DB? Auth is platform-managed in Superblocks regardless.\"\n- \"I see direct calls to `<third-party API>` from the client with secrets in `VITE_*` env vars. I'll move these server-side via an integration \u2014 confirm which integration to bind, or whether to create a new one.\"\n- \"The source has Postgres migrations under `supabase/migrations/`. I will not run them against your integration's database. How do you want the schema to land?\"\n- \"I see realtime subscriptions on `<table>`. Superblocks has no realtime in this template \u2014 degrade to polling, drop the feature, or stop and let you decide?\"\n- \"RLS policy `<policy>` filtered by `auth.uid()`. I'll replace it with `WHERE user_id = $N` keyed off `ctx.user.userId`. Is that the right user-claim mapping?\"\n\n## Page port \u2014 what changes vs. what doesn't\n\nFor each Lovable page, only these change:\n\n- **Data hooks**: direct Supabase calls + `@tanstack/react-query` \u2192 `useApi` / `useApiData`.\n- **Auth touchpoints**: `supabase.auth` / custom `AuthContext` \u2192 platform-managed (drop the provider; consume `ctx.user` server-side).\n- **Router primitives**: if the source uses `wouter` or v6 patterns, adapt to `react-router` v7. The router is statically parsed by the editor \u2014 bind page components only via static imports or `lazy(() => import(\"...\"))` (see \"Router shape\" in the framework SKILL). Lovable sources commonly emit a long `<Routes>` block with `<Route element={<Page />} />` JSX; rewrite this as a `createBrowserRouter([...])` array using `Component:` (or inline `lazy:`), keeping the `const Page = lazy(() => import(\"./pages/Page/index.tsx\"))` declarations intact.\n\nEverything else \u2014 JSX structure, Tailwind classes, shadcn variants, custom CSS, theme tokens, fonts, layout containers \u2014 transfers unchanged. If the diff goes beyond data + auth + routing, you are over-editing.\n\n## Done \u2014 Lovable specifics\n\nIn the final report, additionally surface:\n\n- Any unsupported features that became `failed` items (realtime subscriptions, Supabase storage without a target integration, etc.).\n";
|
|
2
2
|
//# sourceMappingURL=lovable.generated.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lovable.generated.d.ts","sourceRoot":"","sources":["../../../../../src/ai-service/skills/system/third-party-migration/lovable.generated.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,OAAO,
|
|
1
|
+
{"version":3,"file":"lovable.generated.d.ts","sourceRoot":"","sources":["../../../../../src/ai-service/skills/system/third-party-migration/lovable.generated.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,OAAO,8lSA2EnB,CAAC"}
|
|
@@ -66,7 +66,7 @@ For each Lovable page, only these change:
|
|
|
66
66
|
|
|
67
67
|
- **Data hooks**: direct Supabase calls + \`@tanstack/react-query\` → \`useApi\` / \`useApiData\`.
|
|
68
68
|
- **Auth touchpoints**: \`supabase.auth\` / custom \`AuthContext\` → platform-managed (drop the provider; consume \`ctx.user\` server-side).
|
|
69
|
-
- **Router primitives**: if the source uses \`wouter\` or v6 patterns, adapt to \`react-router\` v7.
|
|
69
|
+
- **Router primitives**: if the source uses \`wouter\` or v6 patterns, adapt to \`react-router\` v7. The router is statically parsed by the editor — bind page components only via static imports or \`lazy(() => import("..."))\` (see "Router shape" in the framework SKILL). Lovable sources commonly emit a long \`<Routes>\` block with \`<Route element={<Page />} />\` JSX; rewrite this as a \`createBrowserRouter([...])\` array using \`Component:\` (or inline \`lazy:\`), keeping the \`const Page = lazy(() => import("./pages/Page/index.tsx"))\` declarations intact.
|
|
70
70
|
|
|
71
71
|
Everything else — JSX structure, Tailwind classes, shadcn variants, custom CSS, theme tokens, fonts, layout containers — transfers unchanged. If the diff goes beyond data + auth + routing, you are over-editing.
|
|
72
72
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const content = "---\nname: third-party-migration\ndescription: |\n Migrate a third-party app (Replit, Lovable, v0, or similar) into a Superblocks 3.0 full-stack app.\n Load when the user asks to migrate, import, or port an external app \u2014 or when the source tree contains hallmarks of a supported platform (`replit.md` / `.replit`, `src/integrations/supabase/`, `supabase/functions/`, `lovable-tagger`, an `app/` directory with `next.config.*` and `\"use client\"` / `\"use server\"` directives, etc.) and the user wants it turned into a Superblocks app.\nreadOnly: true\nmetadata:\n author: superblocks\n version: \"1.0\"\n---\n\n# Third-Party App \u2192 Superblocks 3.0 Migration\n\nPort a user-provided external app into the Superblocks fullstack app you are running inside (template: `app-fullstack`). The source tree is **read-only material**. All edits land in the target app under `server/` and `client/`.\n\nThis file is the migration framework. **Per-platform mapping rules live in sibling files** \u2014 load the right one before you start mapping.\n\n## Identify the source platform\n\nMatch the source tree against these signals, then read the matching reference file in this folder. Read it once, up-front \u2014 it tells you what shapes to look for and how each maps to Superblocks.\n\n- **Replit** \u2014 `replit.md`, `.replit`, `artifacts/`, an Express server with an Orval-generated client. \u2192 load `replit.md`.\n- **Lovable** \u2014 `src/integrations/supabase/client.ts`, `supabase/config.toml`, `supabase/functions/`, `supabase/migrations/`, `lovable-tagger` in `vite.config.ts`. \u2192 load `lovable.md`.\n- **v0** \u2014 `app/<segment>/page.tsx` (Next.js App Router) plus `next.config.{js,mjs,ts}` and `next` in `package.json`, files with `\"use client\"` / `\"use server\"` directives, `next/link` / `next/navigation` imports, `components/ui/` with shadcn primitives. \u2192 load `v0.md`.\n- **Ambiguous or neither** \u2014 stop and ask the user which platform the source came from. Do not guess. It is possible that it is No Platform. In this case, follow the general guidelines in this document and ask user questions for any ambiguity.\n\nThe framework below applies to every platform; the platform file fills in the source-specific mapping.\n\n## Target layout\n\nThe app you are running inside looks like this. Do not invent new top-level directories.\n\n```\nclient/\n App.tsx \u2014 root with <AppProvider> + <Outlet />\n router.tsx \u2014 react-router v7, lazy imports\n index.css \u2014 Tailwind v4 + theme tokens\n hooks/\n useApi.ts \u2014 typed wrapper around useTypedApi<ApiRegistry>\n useApiData.ts \u2014 typed wrapper around useTypedApiData<ApiRegistry>\n lib/executeApi.ts \u2014 non-React typed executeApi\n pages/<Name>/index.tsx\n components/ui/ \u2014 shadcn primitives (do not modify)\nserver/\n apis/\n index.ts \u2014 registry: `const apis = { ApiName: ... } as const;`\n <ApiName>/api.ts\n```\n\n## Universal mapping (applies to every source)\n\nThese hold regardless of source platform. Per-platform specifics layer on top.\n\n- APIs are addressed by `name` via the registry \u2014 there is no URL path. Within `api()`:\n - All inputs (whatever shape the source had \u2014 body, query, params, function args) \u2192 one unified `input` Zod schema; destructure inside `run(ctx, { ... })`.\n - The handler's response \u2192 `return { ... }` from `run`. The `output` schema validates it automatically; do not `safeParse` by hand.\n - Auth \u2192 `ctx.user` (`userId`, `email`, `name`, `groups`, `customClaims`). Auth is platform-managed; drop the source's auth flows entirely.\n - Errors \u2192 throw the `SdkError` subtypes the sdk-api README documents (`InputValidationError`, `OutputValidationError`, `IntegrationError`, `ExecutionError`). Never invent error classes or return HTTP status codes.\n - DB clients (`pg`, `knex`, `prisma`, Drizzle, `supabase.from(...)`) \u2192 declare in `integrations: { db: postgres(DB_INTEGRATION_ID) }` and call `ctx.integrations.db.query(sql, ZodSchema, params, { label: \"...\" })` / `.execute(...)`. Parameterized SQL only. Hold integration UUIDs in module-level `const`s, not literals scattered through `run`.\n - External HTTP (`axios`, `fetch`, third-party SDKs) \u2192 declared integration + `ctx.integrations.<name>.apiRequest({ method, path, body }, { response: ZodSchema })`.\n - `process.env.*` / `import.meta.env.*` / `Deno.env.get(...)` \u2192 `ctx.env`. Logging \u2192 `ctx.log.info/warn/error/debug(msg, data?)`.\n - Server bootstrapping (`app.listen`, CORS, route grouping, middleware setup, `Deno.serve`) \u2192 drop entirely. The platform handles it.\n- **Each frontend page \u2192 one Superblocks page** at `client/pages/<Name>/index.tsx`, wired into `client/router.tsx`.\n- **Each backend data source (DB, REST client, S3, ...) \u2192 one Superblocks integration** referenced by UUID. Credentials live on the integration, never in code.\n\n## Authoritative references (read just-in-time, not up front)\n\n- `node_modules/@superblocksteam/sdk-api/README.md` and `src/index.ts` \u2014 the server `api()` contract and the full list of factory names. **Never invent factory names.** If a required file is missing, mark the affected checklist item `failed` with the missing path as the reason.\n- Per-integration READMEs under `node_modules/@superblocksteam/sdk-api/src/integrations/<kind>/` \u2014 read once, when you first emit an API that uses that integration.\n- `skills/system/superblocks-frontend/SKILL.md` \u2014 the client contract (`useApi` / `useApiData` / `executeApi` from `@superblocksteam/library`).\n\n> \u26A0\uFE0F **Never** load `skills/system/superblocks-api/SKILL.md`. It describes a different, block-based API pattern that is incompatible with the fullstack template's `sdk-api`. Mixing them produces code that does not compile.\n\n## Non-negotiables\n\n1. **Track everything in the checklist.** The **first tool call after exiting plan mode** or **during build mode, before building** is `build_manageChecklist` to seed. Before every per-item edit, `update <itemId> in_progress`; after, `update <itemId> completed` (or `failed` with a concrete `failureReason`). If you are about to write code and the checklist is empty, stale, or missing the item you are working on, **stop and fix the checklist first** \u2014 the orchestration depends on it. Free-text status reports are not a substitute.\n2. **Discover before you edit.** Inventory routes, pages, data sources, env vars, _and visual surface_ (theme tokens, `index.css`, custom CSS, font setup, layout shells) across the entire source tree before writing any code. The platform file tells you what shapes to look for.\n3. **Ask before guessing.** Multiple integrations of the same kind, missing integrations, unsupported data sources, or any platform-specific ambiguity \u2192 stop and `askMultiChoice`. Never pick for the user. The platform file lists ambiguities specific to that source.\n4. **Preserve visual identity.** The migrated app must look and feel like the source. Carry over Tailwind config, shadcn theme tokens, `index.css` / `globals.css`, custom CSS modules, fonts, spacing, color palette, and layout shells (header/sidebar/grid). shadcn/ui components stay as-is. Do **not** redesign, restyle, or \"clean up\" while porting \u2014 visual regressions are bugs, not improvements. If the user wants a redesign, that is a separate task after migration.\n5. **Never copy secrets.** DSN strings, API keys, anon/service-role keys, JWT secrets, env-var lookups for credentials \u2014 none move into the target tree. Integration UUIDs replace them. Surface every leaked secret you find (especially client-side `VITE_*` / `NEXT_PUBLIC_*` keys) in the discovery summary so the user can rotate them.\n6. **No `// TODO`s.** Anything you can't finish deterministically becomes a `failed` checklist item with a concrete `failureReason`.\n7. **Don't scaffold.** If `server/apis/index.ts` or `client/router.tsx` doesn't already exist, you're in the wrong app \u2014 stop and surface this.\n8. **Don't fabricate a backend.** If the source is genuinely frontend-only, the migrated app should also be frontend-only. Don't invent APIs to \"complete\" the architecture.\n\n## Workflow\n\n1. **Locate the source.** If the user gave a path, use it. Otherwise look in the working tree for the platform signals listed above. If ambiguous, ask.\n2. **Load the platform guide.** Read `replit.md`, `lovable.md`, or `v0.md` based on what you found. Do not start mapping before you've read it \u2014 it documents the source's shape and how each piece translates.\n3. **Inventory.** Following the platform guide's discovery checklist, enumerate every route/handler, page, data source, env var, secret, and visual asset in the source tree. Surface a one-paragraph summary plus an itemized list of integrations and unsupported features before writing anything. If the source has bespoke styling, seed a `setup_theme` checklist item to port it.\n4. **Resolve integrations.** For each data source kind: call `searchIntegrations` (filter by `type`). One match \u2192 bind it. Multiple \u2192 ask the user which. Zero \u2192 ask whether to create one; if yes, use `listAvailableIntegrationTypes` (if needed) and `openIntegrationSetup`, then ask the user explicitly whether they saved or cancelled before re-searching. Resolution is **blocking** \u2014 the checklist cannot be seeded until every kind maps to a UUID, is explicitly deferred, or has been confirmed unsupported.\n5. **Seed the checklist** via `build_manageChecklist`. One `api_<ApiName>` per backend interaction, one `frontend_<PageName>` per page, plus `setup_router`, `setup_registry`, `setup_cleanup`, and any `setup_theme` / `setup_storage` / `unsupported_<feature>` items the platform guide tells you to add. Print the count as a sanity check; if it looks wrong, re-check discovery.\n6. **Execute.** Every item follows the same ritual \u2014 no exceptions:\n - **Before touching files:** `build_manageChecklist update <itemId> in_progress`.\n - **Emit / edit the files** for that item.\n - **After the edit lands:** `build_manageChecklist update <itemId> completed` (or `failed` with a concrete `failureReason`).\n - You are not done with an item until its checklist entry has moved to a terminal state. Do not batch updates at the end; update as you go.\n - **For parallelizable work:** call `spawnCodingSubagents` with batches of tasks. Each batch's `instructions` names exact `itemId`s, includes the integration-UUID map and source path, any platform-specific context the sub-agent needs (e.g. RLS-replacement clauses for Lovable), and tells the sub-agent to follow the same `in_progress` \u2192 `completed`/`failed` ritual for every item it owns.\n - `spawnCodingSubagents` **must be the only tool call in that turn.** It blocks until every sub-agent finishes; there is no \"while waiting\" from your perspective. Other tool calls in the same turn race on the shared checklist and corrupt state. After it returns, read the checklist and handle `failed` items sequentially. If the tool itself errors, surface it and fall back to sequential \u2014 or fail the affected items with `sub-agent orchestration failed: <error>`.\n\n## When emitting code\n\n- **Server.** Default-export one `api({ name, integrations, input, output, run })` from `@superblocksteam/sdk-api`. The `name` and the registry key in `server/apis/index.ts` must equal `<ApiName>` verbatim \u2014 the client calls `useApi(\"<ApiName>\")` by that exact string. Preserve the external response shape exactly so the migrated frontend keeps working. Use parameterized SQL only (`$N`); zero string interpolations. Throw the error classes the sdk-api README documents instead of returning HTTP status codes.\n- **Client.** Replace the source's data hooks with `useApiData` (reads) or `useApi` (mutations) keyed by `<ApiName>`. **Import the typed wrappers from the template, not the library directly:** `import { useApi } from \"@/hooks/useApi.js\"`, `import { useApiData } from \"@/hooks/useApiData.js\"`, `import { executeApi } from \"@/lib/executeApi.js\"`. They give compile-time inference from `ApiRegistry`. Drop the source's generated client packages, `QueryClientProvider`, base-URL or auth-token getters, and any auth-context plumbing \u2014 Superblocks handles all of that. shadcn/form + react-hook-form + zod stays. Follow the loading-state guidance in `superblocks-frontend/SKILL.md`.\n- **ESM imports.** Every relative import in emitted code uses an explicit `.js` extension (`./api.js`, `../hooks/useApi.js`) \u2014 even though the source is `.ts`. The template is ESM; bare specifiers fail at runtime.\n- **Theme port.** When carrying over the source's theme, copy the existing color values **as-is** into `client/index.css`'s `:root` block. HSL values written `hsl(222 47% 11%)` (CSS Color Level 4 space-separated form) work directly with the `@theme inline` mapping in Tailwind v4. **Do not convert to OKLCH** unless the source already uses OKLCH \u2014 converting introduces drift and is a common visual-regression source.\n- **Visual fidelity.** JSX structure, Tailwind classes, shadcn variants, custom CSS, theme tokens, fonts, and layout containers must transfer over **unchanged** from the source page. The only things that change in a page port are the data hooks, the auth touchpoints, and the router primitives. Do not \"improve\" markup, swap class names, or substitute components. If the diff between source and target page goes beyond data + auth + routing, you are over-editing \u2014 back out the cosmetic changes.\n- **Sub-agents must not** call `searchIntegrations`, `openIntegrationSetup`, or any integration-resolution tool. If they hit a kind missing from the map, fail the item with `unresolved integration kind: <kind>` and let the main agent handle it on return.\n\n## Done\n\nStop only when every checklist item is `completed` or `failed`. Report the counts plus any platform-specific findings the per-platform guide asks you to surface (e.g. leaked secrets, replaced RLS policies, unsupported realtime features). Do not claim success \u2014 defer verification to the user running the app.\n";
|
|
1
|
+
export declare const content = "---\nname: third-party-migration\ndescription: |\n Migrate a third-party app (Replit, Lovable, v0, or similar) into a Superblocks 3.0 full-stack app.\n Load when the user asks to migrate, import, or port an external app \u2014 or when the source tree contains hallmarks of a supported platform (`replit.md` / `.replit`, `src/integrations/supabase/`, `supabase/functions/`, `lovable-tagger`, an `app/` directory with `next.config.*` and `\"use client\"` / `\"use server\"` directives, etc.) and the user wants it turned into a Superblocks app.\nreadOnly: true\nmetadata:\n author: superblocks\n version: \"1.0\"\n---\n\n# Third-Party App \u2192 Superblocks 3.0 Migration\n\nPort a user-provided external app into the Superblocks fullstack app you are running inside (template: `app-fullstack`). The source tree is **read-only material**. All edits land in the target app under `server/` and `client/`.\n\nThis file is the migration framework. **Per-platform mapping rules live in sibling files** \u2014 load the right one before you start mapping.\n\n## Identify the source platform\n\nMatch the source tree against these signals, then read the matching reference file in this folder. Read it once, up-front \u2014 it tells you what shapes to look for and how each maps to Superblocks.\n\n- **Replit** \u2014 `replit.md`, `.replit`, `artifacts/`, an Express server with an Orval-generated client. \u2192 load `replit.md`.\n- **Lovable** \u2014 `src/integrations/supabase/client.ts`, `supabase/config.toml`, `supabase/functions/`, `supabase/migrations/`, `lovable-tagger` in `vite.config.ts`. \u2192 load `lovable.md`.\n- **v0** \u2014 `app/<segment>/page.tsx` (Next.js App Router) plus `next.config.{js,mjs,ts}` and `next` in `package.json`, files with `\"use client\"` / `\"use server\"` directives, `next/link` / `next/navigation` imports, `components/ui/` with shadcn primitives. \u2192 load `v0.md`.\n- **Ambiguous or neither** \u2014 stop and ask the user which platform the source came from. Do not guess. It is possible that it is No Platform. In this case, follow the general guidelines in this document and ask user questions for any ambiguity.\n\nThe framework below applies to every platform; the platform file fills in the source-specific mapping.\n\n## Target layout\n\nThe app you are running inside looks like this. Do not invent new top-level directories.\n\n```\nclient/\n App.tsx \u2014 root with <AppProvider> + <Outlet />\n router.tsx \u2014 react-router v7 data mode (`createBrowserRouter`); see Router shape below\n index.css \u2014 Tailwind v4 + theme tokens\n hooks/\n useApi.ts \u2014 typed wrapper around useTypedApi<ApiRegistry>\n useApiData.ts \u2014 typed wrapper around useTypedApiData<ApiRegistry>\n lib/executeApi.ts \u2014 non-React typed executeApi\n pages/<Name>/index.tsx\n components/ui/ \u2014 shadcn primitives (do not modify)\nserver/\n apis/\n index.ts \u2014 registry: `const apis = { ApiName: ... } as const;`\n <ApiName>/api.ts\n```\n\n## Universal mapping (applies to every source)\n\nThese hold regardless of source platform. Per-platform specifics layer on top.\n\n- APIs are addressed by `name` via the registry \u2014 there is no URL path. Within `api()`:\n - All inputs (whatever shape the source had \u2014 body, query, params, function args) \u2192 one unified `input` Zod schema; destructure inside `run(ctx, { ... })`.\n - The handler's response \u2192 `return { ... }` from `run`. The `output` schema validates it automatically; do not `safeParse` by hand.\n - Auth \u2192 `ctx.user` (`userId`, `email`, `name`, `groups`, `customClaims`). Auth is platform-managed; drop the source's auth flows entirely.\n - Errors \u2192 throw the `SdkError` subtypes the sdk-api README documents (`InputValidationError`, `OutputValidationError`, `IntegrationError`, `ExecutionError`). Never invent error classes or return HTTP status codes.\n - DB clients (`pg`, `knex`, `prisma`, Drizzle, `supabase.from(...)`) \u2192 declare in `integrations: { db: postgres(DB_INTEGRATION_ID) }` and call `ctx.integrations.db.query(sql, ZodSchema, params, { label: \"...\" })` / `.execute(...)`. Parameterized SQL only. Hold integration UUIDs in module-level `const`s, not literals scattered through `run`.\n - External HTTP (`axios`, `fetch`, third-party SDKs) \u2192 declared integration + `ctx.integrations.<name>.apiRequest({ method, path, body }, { response: ZodSchema })`.\n - `process.env.*` / `import.meta.env.*` / `Deno.env.get(...)` \u2192 `ctx.env`. Logging \u2192 `ctx.log.info/warn/error/debug(msg, data?)`.\n - Server bootstrapping (`app.listen`, CORS, route grouping, middleware setup, `Deno.serve`) \u2192 drop entirely. The platform handles it.\n- **Each frontend page \u2192 one Superblocks page** at `client/pages/<Name>/index.tsx`, wired into `client/router.tsx`.\n- **Each backend data source (DB, REST client, S3, ...) \u2192 one Superblocks integration** referenced by UUID. Credentials live on the integration, never in code.\n\n### Router shape (`client/router.tsx`)\n\nThe editor parses this file statically to build the page list and route table. **Use one of the supported page-component bindings \u2014 anything else silently drops every route and the editor shows a \"404 / route has been deleted\" overlay.**\n\nSupported page bindings (mix freely):\n\n```tsx\n// 1. Inline lazy on the route object (preferred \u2014 matches the template):\n{ path: \"about\", lazy: () => import(\"./pages/About/index.tsx\").then(m => ({ Component: m.default })) }\n\n// 2. Static default import + Component / element:\nimport About from \"./pages/About/index.tsx\";\n{ path: \"about\", Component: About }\n{ path: \"about\", element: <About /> }\n\n// 3. Top-level `const` bound to React.lazy + Component / element:\nconst About = lazy(() => import(\"./pages/About/index.tsx\"));\n{ path: \"about\", Component: About }\n```\n\nDo **not**: assign `Component` / `element` to identifiers bound by anything other than a static import or `lazy(() => import(\"...\"))` (no IIFEs, no helper wrappers, no conditional `lazy(...)`, no objects whose keys are computed from a loop). The parser only resolves the shapes above.\n\n## Authoritative references (read just-in-time, not up front)\n\n- `node_modules/@superblocksteam/sdk-api/README.md` and `src/index.ts` \u2014 the server `api()` contract and the full list of factory names. **Never invent factory names.** If a required file is missing, mark the affected checklist item `failed` with the missing path as the reason.\n- Per-integration READMEs under `node_modules/@superblocksteam/sdk-api/src/integrations/<kind>/` \u2014 read once, when you first emit an API that uses that integration.\n- `skills/system/superblocks-frontend/SKILL.md` \u2014 the client contract (`useApi` / `useApiData` / `executeApi` from `@superblocksteam/library`).\n\n> \u26A0\uFE0F **Never** load `skills/system/superblocks-api/SKILL.md`. It describes a different, block-based API pattern that is incompatible with the fullstack template's `sdk-api`. Mixing them produces code that does not compile.\n\n## Non-negotiables\n\n1. **Track everything in the checklist.** The **first tool call after exiting plan mode** or **during build mode, before building** is `build_manageChecklist` to seed. Before every per-item edit, `update <itemId> in_progress`; after, `update <itemId> completed` (or `failed` with a concrete `failureReason`). If you are about to write code and the checklist is empty, stale, or missing the item you are working on, **stop and fix the checklist first** \u2014 the orchestration depends on it. Free-text status reports are not a substitute.\n2. **Discover before you edit.** Inventory routes, pages, data sources, env vars, _and visual surface_ (theme tokens, `index.css`, custom CSS, font setup, layout shells) across the entire source tree before writing any code. The platform file tells you what shapes to look for.\n3. **Ask before guessing.** Multiple integrations of the same kind, missing integrations, unsupported data sources, or any platform-specific ambiguity \u2192 stop and `askMultiChoice`. Never pick for the user. The platform file lists ambiguities specific to that source.\n4. **Preserve visual identity.** The migrated app must look and feel like the source. Carry over Tailwind config, shadcn theme tokens, `index.css` / `globals.css`, custom CSS modules, fonts, spacing, color palette, and layout shells (header/sidebar/grid). shadcn/ui components stay as-is. Do **not** redesign, restyle, or \"clean up\" while porting \u2014 visual regressions are bugs, not improvements. If the user wants a redesign, that is a separate task after migration.\n5. **Never copy secrets.** DSN strings, API keys, anon/service-role keys, JWT secrets, env-var lookups for credentials \u2014 none move into the target tree. Integration UUIDs replace them. Surface every leaked secret you find (especially client-side `VITE_*` / `NEXT_PUBLIC_*` keys) in the discovery summary so the user can rotate them.\n6. **No `// TODO`s.** Anything you can't finish deterministically becomes a `failed` checklist item with a concrete `failureReason`.\n7. **Don't scaffold.** If `server/apis/index.ts` or `client/router.tsx` doesn't already exist, you're in the wrong app \u2014 stop and surface this.\n8. **Don't fabricate a backend.** If the source is genuinely frontend-only, the migrated app should also be frontend-only. Don't invent APIs to \"complete\" the architecture.\n\n## Workflow\n\n1. **Locate the source.** If the user gave a path, use it. Otherwise look in the working tree for the platform signals listed above. If ambiguous, ask.\n2. **Load the platform guide.** Read `replit.md`, `lovable.md`, or `v0.md` based on what you found. Do not start mapping before you've read it \u2014 it documents the source's shape and how each piece translates.\n3. **Inventory.** Following the platform guide's discovery checklist, enumerate every route/handler, page, data source, env var, secret, and visual asset in the source tree. Surface a one-paragraph summary plus an itemized list of integrations and unsupported features before writing anything. If the source has bespoke styling, seed a `setup_theme` checklist item to port it.\n4. **Resolve integrations.** For each data source kind: call `searchIntegrations` (filter by `type`). One match \u2192 bind it. Multiple \u2192 ask the user which. Zero \u2192 ask whether to create one; if yes, use `listAvailableIntegrationTypes` (if needed) and `openIntegrationSetup`, then ask the user explicitly whether they saved or cancelled before re-searching. Resolution is **blocking** \u2014 the checklist cannot be seeded until every kind maps to a UUID, is explicitly deferred, or has been confirmed unsupported.\n5. **Seed the checklist** via `build_manageChecklist`. One `api_<ApiName>` per backend interaction, one `frontend_<PageName>` per page, plus `setup_router`, `setup_registry`, `setup_cleanup`, and any `setup_theme` / `setup_storage` / `unsupported_<feature>` items the platform guide tells you to add. Print the count as a sanity check; if it looks wrong, re-check discovery.\n6. **Execute.** Every item follows the same ritual \u2014 no exceptions:\n - **Before touching files:** `build_manageChecklist update <itemId> in_progress`.\n - **Emit / edit the files** for that item.\n - **After the edit lands:** `build_manageChecklist update <itemId> completed` (or `failed` with a concrete `failureReason`).\n - You are not done with an item until its checklist entry has moved to a terminal state. Do not batch updates at the end; update as you go.\n - **For parallelizable work:** call `spawnCodingSubagents` with batches of tasks. Each batch's `instructions` names exact `itemId`s, includes the integration-UUID map and source path, any platform-specific context the sub-agent needs (e.g. RLS-replacement clauses for Lovable), and tells the sub-agent to follow the same `in_progress` \u2192 `completed`/`failed` ritual for every item it owns.\n - `spawnCodingSubagents` **must be the only tool call in that turn.** It blocks until every sub-agent finishes; there is no \"while waiting\" from your perspective. Other tool calls in the same turn race on the shared checklist and corrupt state. After it returns, read the checklist and handle `failed` items sequentially. If the tool itself errors, surface it and fall back to sequential \u2014 or fail the affected items with `sub-agent orchestration failed: <error>`.\n\n## When emitting code\n\n- **Server.** Default-export one `api({ name, integrations, input, output, run })` from `@superblocksteam/sdk-api`. The `name` and the registry key in `server/apis/index.ts` must equal `<ApiName>` verbatim \u2014 the client calls `useApi(\"<ApiName>\")` by that exact string. Preserve the external response shape exactly so the migrated frontend keeps working. Use parameterized SQL only (`$N`); zero string interpolations. Throw the error classes the sdk-api README documents instead of returning HTTP status codes.\n- **Client.** Replace the source's data hooks with `useApiData` (reads) or `useApi` (mutations) keyed by `<ApiName>`. **Import the typed wrappers from the template, not the library directly:** `import { useApi } from \"@/hooks/useApi.js\"`, `import { useApiData } from \"@/hooks/useApiData.js\"`, `import { executeApi } from \"@/lib/executeApi.js\"`. They give compile-time inference from `ApiRegistry`. Drop the source's generated client packages, `QueryClientProvider`, base-URL or auth-token getters, and any auth-context plumbing \u2014 Superblocks handles all of that. shadcn/form + react-hook-form + zod stays. Follow the loading-state guidance in `superblocks-frontend/SKILL.md`.\n- **ESM imports.** Every relative import in emitted code uses an explicit `.js` extension (`./api.js`, `../hooks/useApi.js`) \u2014 even though the source is `.ts`. The template is ESM; bare specifiers fail at runtime.\n- **Theme port.** When carrying over the source's theme, copy the existing color values **as-is** into `client/index.css`'s `:root` block. HSL values written `hsl(222 47% 11%)` (CSS Color Level 4 space-separated form) work directly with the `@theme inline` mapping in Tailwind v4. **Do not convert to OKLCH** unless the source already uses OKLCH \u2014 converting introduces drift and is a common visual-regression source.\n- **Visual fidelity.** JSX structure, Tailwind classes, shadcn variants, custom CSS, theme tokens, fonts, and layout containers must transfer over **unchanged** from the source page. The only things that change in a page port are the data hooks, the auth touchpoints, and the router primitives. Do not \"improve\" markup, swap class names, or substitute components. If the diff between source and target page goes beyond data + auth + routing, you are over-editing \u2014 back out the cosmetic changes.\n- **Sub-agents must not** call `searchIntegrations`, `openIntegrationSetup`, or any integration-resolution tool. If they hit a kind missing from the map, fail the item with `unresolved integration kind: <kind>` and let the main agent handle it on return.\n\n## Done\n\nStop only when every checklist item is `completed` or `failed`. Report the counts plus any platform-specific findings the per-platform guide asks you to surface (e.g. leaked secrets, replaced RLS policies, unsupported realtime features). Do not claim success \u2014 defer verification to the user running the app.\n";
|
|
2
2
|
//# sourceMappingURL=skill.generated.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skill.generated.d.ts","sourceRoot":"","sources":["../../../../../src/ai-service/skills/system/third-party-migration/skill.generated.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,OAAO,
|
|
1
|
+
{"version":3,"file":"skill.generated.d.ts","sourceRoot":"","sources":["../../../../../src/ai-service/skills/system/third-party-migration/skill.generated.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,OAAO,6peAqInB,CAAC"}
|
|
@@ -35,7 +35,7 @@ The app you are running inside looks like this. Do not invent new top-level dire
|
|
|
35
35
|
\`\`\`
|
|
36
36
|
client/
|
|
37
37
|
App.tsx — root with <AppProvider> + <Outlet />
|
|
38
|
-
router.tsx — react-router v7
|
|
38
|
+
router.tsx — react-router v7 data mode (\`createBrowserRouter\`); see Router shape below
|
|
39
39
|
index.css — Tailwind v4 + theme tokens
|
|
40
40
|
hooks/
|
|
41
41
|
useApi.ts — typed wrapper around useTypedApi<ApiRegistry>
|
|
@@ -65,6 +65,28 @@ These hold regardless of source platform. Per-platform specifics layer on top.
|
|
|
65
65
|
- **Each frontend page → one Superblocks page** at \`client/pages/<Name>/index.tsx\`, wired into \`client/router.tsx\`.
|
|
66
66
|
- **Each backend data source (DB, REST client, S3, ...) → one Superblocks integration** referenced by UUID. Credentials live on the integration, never in code.
|
|
67
67
|
|
|
68
|
+
### Router shape (\`client/router.tsx\`)
|
|
69
|
+
|
|
70
|
+
The editor parses this file statically to build the page list and route table. **Use one of the supported page-component bindings — anything else silently drops every route and the editor shows a "404 / route has been deleted" overlay.**
|
|
71
|
+
|
|
72
|
+
Supported page bindings (mix freely):
|
|
73
|
+
|
|
74
|
+
\`\`\`tsx
|
|
75
|
+
// 1. Inline lazy on the route object (preferred — matches the template):
|
|
76
|
+
{ path: "about", lazy: () => import("./pages/About/index.tsx").then(m => ({ Component: m.default })) }
|
|
77
|
+
|
|
78
|
+
// 2. Static default import + Component / element:
|
|
79
|
+
import About from "./pages/About/index.tsx";
|
|
80
|
+
{ path: "about", Component: About }
|
|
81
|
+
{ path: "about", element: <About /> }
|
|
82
|
+
|
|
83
|
+
// 3. Top-level \`const\` bound to React.lazy + Component / element:
|
|
84
|
+
const About = lazy(() => import("./pages/About/index.tsx"));
|
|
85
|
+
{ path: "about", Component: About }
|
|
86
|
+
\`\`\`
|
|
87
|
+
|
|
88
|
+
Do **not**: assign \`Component\` / \`element\` to identifiers bound by anything other than a static import or \`lazy(() => import("..."))\` (no IIFEs, no helper wrappers, no conditional \`lazy(...)\`, no objects whose keys are computed from a loop). The parser only resolves the shapes above.
|
|
89
|
+
|
|
68
90
|
## Authoritative references (read just-in-time, not up front)
|
|
69
91
|
|
|
70
92
|
- \`node_modules/@superblocksteam/sdk-api/README.md\` and \`src/index.ts\` — the server \`api()\` contract and the full list of factory names. **Never invent factory names.** If a required file is missing, mark the affected checklist item \`failed\` with the missing path as the reason.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skill.generated.js","sourceRoot":"","sources":["../../../../../src/ai-service/skills/system/third-party-migration/skill.generated.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAClF,mDAAmD;AAEnD,MAAM,CAAC,MAAM,OAAO,GAAG
|
|
1
|
+
{"version":3,"file":"skill.generated.js","sourceRoot":"","sources":["../../../../../src/ai-service/skills/system/third-party-migration/skill.generated.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAClF,mDAAmD;AAEnD,MAAM,CAAC,MAAM,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqItB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"llm-generating.d.ts","sourceRoot":"","sources":["../../../../src/ai-service/state-machine/handlers/llm-generating.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"llm-generating.d.ts","sourceRoot":"","sources":["../../../../src/ai-service/state-machine/handlers/llm-generating.ts"],"names":[],"mappings":"AA4DA,OAAO,EAWL,KAAK,KAAK,EACV,KAAK,uBAAuB,EAC5B,KAAK,eAAe,EACrB,MAAM,iBAAiB,CAAC;AA6jBzB,eAAO,MAAM,eAAe,GAC1B,OAAO,KAAK,EACZ,UAAU,uBAAuB,MAInB,WAAW,eAAe,KAAG,OAAO,CAAC,IAAI,CAqdxD,CAAC"}
|
|
@@ -143,7 +143,7 @@ note: This archive was not uploaded to persistent storage, so downloadAttachment
|
|
|
143
143
|
throw new Error("Unsupported attachment type");
|
|
144
144
|
});
|
|
145
145
|
};
|
|
146
|
-
const buildUserMessage = ({ userPrompt, promptContext, planContext, mode, services, userChanges, userFactsSection, pendingKnowledgeFreeTextTurn, pendingKnowledgeEntries, skillsNeedReload, useSystemSkills, }) => {
|
|
146
|
+
const buildUserMessage = ({ preferredAppInferenceIntegration, userPrompt, promptContext, planContext, mode, services, userChanges, userFactsSection, pendingKnowledgeFreeTextTurn, pendingKnowledgeEntries, skillsNeedReload, useSystemSkills, }) => {
|
|
147
147
|
const content = [];
|
|
148
148
|
// If context was recently summarized, remind Clark to re-read skills
|
|
149
149
|
if (skillsNeedReload && useSystemSkills) {
|
|
@@ -364,29 +364,17 @@ Do not rely on prior knowledge from skills that may have been summarized away.
|
|
|
364
364
|
});
|
|
365
365
|
}
|
|
366
366
|
}
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
// different one.
|
|
376
|
-
const defaultAiIntegrationId = promptContext?.aiConfiguration?.preferredAppInferenceIntegrationId;
|
|
377
|
-
if (defaultAiIntegrationId) {
|
|
378
|
-
const defaultFromContext = promptContext?.integrations?.find((i) => i.id === defaultAiIntegrationId);
|
|
379
|
-
const defaultPayload = defaultFromContext
|
|
380
|
-
? {
|
|
381
|
-
id: defaultFromContext.id,
|
|
382
|
-
name: defaultFromContext.displayName || defaultFromContext.name,
|
|
383
|
-
tagName: defaultFromContext.name,
|
|
384
|
-
type: defaultFromContext.type,
|
|
385
|
-
}
|
|
386
|
-
: { id: defaultAiIntegrationId };
|
|
367
|
+
if (preferredAppInferenceIntegration) {
|
|
368
|
+
const defaultPayload = {
|
|
369
|
+
id: preferredAppInferenceIntegration.id,
|
|
370
|
+
name: preferredAppInferenceIntegration.displayName ||
|
|
371
|
+
preferredAppInferenceIntegration.name,
|
|
372
|
+
tagName: preferredAppInferenceIntegration.name,
|
|
373
|
+
type: preferredAppInferenceIntegration.type,
|
|
374
|
+
};
|
|
387
375
|
content.push({
|
|
388
376
|
type: "text",
|
|
389
|
-
text: `<default_ai_integration>\nThe organization has configured the following integration as the default for AI inference in customer-built apps:\n${escapeTagDelimiters(safeJsonStringify(defaultPayload))}\nWhen the user asks for AI-powered functionality (chatbots, summarization, classification, content generation, semantic search, etc.), use this integration for AI inference
|
|
377
|
+
text: `<default_ai_integration>\nThe organization has configured the following integration as the default for AI inference in customer-built apps:\n${escapeTagDelimiters(safeJsonStringify(defaultPayload))}\nWhen the user asks for AI-powered functionality (chatbots, summarization, classification, content generation, semantic search, etc.), DIRECTLY use this integration for AI inference. Do NOT use askMultiChoice or searchIntegrations to ask which AI provider to use — this integration is already the organization's chosen default. Include its ID in integrationIds when calling exitPlanMode for plans that involve AI-powered features. Only pick a different AI integration if the user explicitly names another provider.\n</default_ai_integration>\n\n`,
|
|
390
378
|
});
|
|
391
379
|
}
|
|
392
380
|
// Add integration-specific knowledge facts
|
|
@@ -543,7 +531,12 @@ export const doLLMGenerating = (clark, services) => {
|
|
|
543
531
|
void services.logger.info("[llm-generating] System prompt:", {
|
|
544
532
|
system,
|
|
545
533
|
});
|
|
534
|
+
const preferredAppInferenceIntegrationId = promptContext?.aiConfiguration?.preferredAppInferenceIntegrationId;
|
|
535
|
+
const preferredAppInferenceIntegration = preferredAppInferenceIntegrationId
|
|
536
|
+
? await services.integrationStore.availableIntegration(preferredAppInferenceIntegrationId)
|
|
537
|
+
: undefined;
|
|
546
538
|
const user = buildUserMessage({
|
|
539
|
+
preferredAppInferenceIntegration,
|
|
547
540
|
userPrompt,
|
|
548
541
|
promptContext,
|
|
549
542
|
planContext,
|