@superblocksteam/vite-plugin-file-sync 2.0.118 → 2.0.119-next.0

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.
Files changed (316) hide show
  1. package/dist/ai-service/agent/middleware.d.ts.map +1 -1
  2. package/dist/ai-service/agent/middleware.js +2 -5
  3. package/dist/ai-service/agent/middleware.js.map +1 -1
  4. package/dist/ai-service/agent/prompts/build-base-system-prompt.d.ts.map +1 -1
  5. package/dist/ai-service/agent/prompts/build-base-system-prompt.js +17 -11
  6. package/dist/ai-service/agent/prompts/build-base-system-prompt.js.map +1 -1
  7. package/dist/ai-service/agent/prompts/build-security-scan-prompt.d.ts +17 -0
  8. package/dist/ai-service/agent/prompts/build-security-scan-prompt.d.ts.map +1 -0
  9. package/dist/ai-service/agent/prompts/build-security-scan-prompt.js +219 -0
  10. package/dist/ai-service/agent/prompts/build-security-scan-prompt.js.map +1 -0
  11. package/dist/ai-service/agent/tool-message-utils.d.ts.map +1 -1
  12. package/dist/ai-service/agent/tool-message-utils.js +27 -3
  13. package/dist/ai-service/agent/tool-message-utils.js.map +1 -1
  14. package/dist/ai-service/agent/tools/apis/api-comparator.d.ts +36 -0
  15. package/dist/ai-service/agent/tools/apis/api-comparator.d.ts.map +1 -0
  16. package/dist/ai-service/agent/tools/apis/api-comparator.js +369 -0
  17. package/dist/ai-service/agent/tools/apis/api-comparator.js.map +1 -0
  18. package/dist/ai-service/agent/tools/apis/api-validation-orchestrator.d.ts +4 -0
  19. package/dist/ai-service/agent/tools/apis/api-validation-orchestrator.d.ts.map +1 -1
  20. package/dist/ai-service/agent/tools/apis/api-validation-orchestrator.js +16 -5
  21. package/dist/ai-service/agent/tools/apis/api-validation-orchestrator.js.map +1 -1
  22. package/dist/ai-service/agent/tools/apis/get-api-docs.d.ts +1 -1
  23. package/dist/ai-service/agent/tools/apis/get-sdk-api-docs.d.ts.map +1 -1
  24. package/dist/ai-service/agent/tools/apis/get-sdk-api-docs.js +18 -13
  25. package/dist/ai-service/agent/tools/apis/get-sdk-api-docs.js.map +1 -1
  26. package/dist/ai-service/agent/tools/apis/test-api.d.ts.map +1 -1
  27. package/dist/ai-service/agent/tools/apis/test-api.js +138 -2
  28. package/dist/ai-service/agent/tools/apis/test-api.js.map +1 -1
  29. package/dist/ai-service/agent/tools/build-copy-directory.d.ts +12 -0
  30. package/dist/ai-service/agent/tools/build-copy-directory.d.ts.map +1 -0
  31. package/dist/ai-service/agent/tools/build-copy-directory.js +51 -0
  32. package/dist/ai-service/agent/tools/build-copy-directory.js.map +1 -0
  33. package/dist/ai-service/agent/tools/build-copy-file.d.ts +12 -0
  34. package/dist/ai-service/agent/tools/build-copy-file.d.ts.map +1 -0
  35. package/dist/ai-service/agent/tools/build-copy-file.js +52 -0
  36. package/dist/ai-service/agent/tools/build-copy-file.js.map +1 -0
  37. package/dist/ai-service/agent/tools/build-copy-utils.d.ts +57 -0
  38. package/dist/ai-service/agent/tools/build-copy-utils.d.ts.map +1 -0
  39. package/dist/ai-service/agent/tools/build-copy-utils.js +37 -0
  40. package/dist/ai-service/agent/tools/build-copy-utils.js.map +1 -0
  41. package/dist/ai-service/agent/tools/build-debug.d.ts.map +1 -1
  42. package/dist/ai-service/agent/tools/build-debug.js +17 -5
  43. package/dist/ai-service/agent/tools/build-debug.js.map +1 -1
  44. package/dist/ai-service/agent/tools/build-finalize.d.ts.map +1 -1
  45. package/dist/ai-service/agent/tools/build-finalize.js +42 -50
  46. package/dist/ai-service/agent/tools/build-finalize.js.map +1 -1
  47. package/dist/ai-service/agent/tools/build-manage-checklist.d.ts +7 -5
  48. package/dist/ai-service/agent/tools/build-manage-checklist.d.ts.map +1 -1
  49. package/dist/ai-service/agent/tools/build-manage-checklist.js +54 -108
  50. package/dist/ai-service/agent/tools/build-manage-checklist.js.map +1 -1
  51. package/dist/ai-service/agent/tools/databases/dev-database.d.ts +103 -0
  52. package/dist/ai-service/agent/tools/databases/dev-database.d.ts.map +1 -0
  53. package/dist/ai-service/agent/tools/databases/dev-database.js +117 -0
  54. package/dist/ai-service/agent/tools/databases/dev-database.js.map +1 -0
  55. package/dist/ai-service/agent/tools/get-logs.d.ts +1 -1
  56. package/dist/ai-service/agent/tools/index.d.ts +4 -0
  57. package/dist/ai-service/agent/tools/index.d.ts.map +1 -1
  58. package/dist/ai-service/agent/tools/index.js +4 -0
  59. package/dist/ai-service/agent/tools/index.js.map +1 -1
  60. package/dist/ai-service/agent/tools/integrations/delete-integration.d.ts +18 -0
  61. package/dist/ai-service/agent/tools/integrations/delete-integration.d.ts.map +1 -0
  62. package/dist/ai-service/agent/tools/integrations/delete-integration.js +99 -0
  63. package/dist/ai-service/agent/tools/integrations/delete-integration.js.map +1 -0
  64. package/dist/ai-service/agent/tools/integrations/execute-request.d.ts +1 -1
  65. package/dist/ai-service/agent/tools/integrations/index.d.ts +1 -0
  66. package/dist/ai-service/agent/tools/integrations/index.d.ts.map +1 -1
  67. package/dist/ai-service/agent/tools/integrations/index.js +1 -0
  68. package/dist/ai-service/agent/tools/integrations/index.js.map +1 -1
  69. package/dist/ai-service/agent/tools/integrations/metadata.d.ts.map +1 -1
  70. package/dist/ai-service/agent/tools/integrations/metadata.js +30 -4
  71. package/dist/ai-service/agent/tools/integrations/metadata.js.map +1 -1
  72. package/dist/ai-service/agent/tools/report-security-findings.d.ts +163 -0
  73. package/dist/ai-service/agent/tools/report-security-findings.d.ts.map +1 -0
  74. package/dist/ai-service/agent/tools/report-security-findings.js +52 -0
  75. package/dist/ai-service/agent/tools/report-security-findings.js.map +1 -0
  76. package/dist/ai-service/agent/tools.d.ts +2 -0
  77. package/dist/ai-service/agent/tools.d.ts.map +1 -1
  78. package/dist/ai-service/agent/tools.js +74 -6
  79. package/dist/ai-service/agent/tools.js.map +1 -1
  80. package/dist/ai-service/agent/tools2/example.js +1 -1
  81. package/dist/ai-service/agent/tools2/example.js.map +1 -1
  82. package/dist/ai-service/agent/tools2/tools/ask-multi-choice.d.ts +7 -0
  83. package/dist/ai-service/agent/tools2/tools/ask-multi-choice.d.ts.map +1 -1
  84. package/dist/ai-service/agent/tools2/tools/ask-multi-choice.js +11 -1
  85. package/dist/ai-service/agent/tools2/tools/ask-multi-choice.js.map +1 -1
  86. package/dist/ai-service/agent/tools2/tools/ask-searchable-dropdown.d.ts +7 -0
  87. package/dist/ai-service/agent/tools2/tools/ask-searchable-dropdown.d.ts.map +1 -1
  88. package/dist/ai-service/agent/tools2/tools/ask-searchable-dropdown.js +3 -1
  89. package/dist/ai-service/agent/tools2/tools/ask-searchable-dropdown.js.map +1 -1
  90. package/dist/ai-service/agent/tools2/tools/download-attachments.d.ts.map +1 -1
  91. package/dist/ai-service/agent/tools2/tools/download-attachments.js +4 -3
  92. package/dist/ai-service/agent/tools2/tools/download-attachments.js.map +1 -1
  93. package/dist/ai-service/agent/tools2/tools/exit-plan-mode.d.ts +9 -0
  94. package/dist/ai-service/agent/tools2/tools/exit-plan-mode.d.ts.map +1 -1
  95. package/dist/ai-service/agent/tools2/tools/exit-plan-mode.js +15 -1
  96. package/dist/ai-service/agent/tools2/tools/exit-plan-mode.js.map +1 -1
  97. package/dist/ai-service/agent/tools2/tools/list-attachments.d.ts.map +1 -1
  98. package/dist/ai-service/agent/tools2/tools/list-attachments.js +8 -4
  99. package/dist/ai-service/agent/tools2/tools/list-attachments.js.map +1 -1
  100. package/dist/ai-service/agent/tools2/tools/spawn-coding-subagents.d.ts +21 -4
  101. package/dist/ai-service/agent/tools2/tools/spawn-coding-subagents.d.ts.map +1 -1
  102. package/dist/ai-service/agent/tools2/tools/spawn-coding-subagents.js +87 -11
  103. package/dist/ai-service/agent/tools2/tools/spawn-coding-subagents.js.map +1 -1
  104. package/dist/ai-service/agent/tools2/types.d.ts +10 -2
  105. package/dist/ai-service/agent/tools2/types.d.ts.map +1 -1
  106. package/dist/ai-service/agent/tools2/types.js.map +1 -1
  107. package/dist/ai-service/agent/utils.d.ts.map +1 -1
  108. package/dist/ai-service/agent/utils.js +2 -0
  109. package/dist/ai-service/agent/utils.js.map +1 -1
  110. package/dist/ai-service/app-interface/filesystem/draft-manager.d.ts +1 -1
  111. package/dist/ai-service/app-interface/filesystem/draft-manager.d.ts.map +1 -1
  112. package/dist/ai-service/app-interface/filesystem/draft-manager.js.map +1 -1
  113. package/dist/ai-service/app-interface/npm-registry.d.ts +137 -0
  114. package/dist/ai-service/app-interface/npm-registry.d.ts.map +1 -0
  115. package/dist/ai-service/app-interface/npm-registry.js +415 -0
  116. package/dist/ai-service/app-interface/npm-registry.js.map +1 -0
  117. package/dist/ai-service/app-interface/shell.d.ts +38 -0
  118. package/dist/ai-service/app-interface/shell.d.ts.map +1 -1
  119. package/dist/ai-service/app-interface/shell.js +222 -1
  120. package/dist/ai-service/app-interface/shell.js.map +1 -1
  121. package/dist/ai-service/attachments/uploaded-content-part.d.ts +5 -0
  122. package/dist/ai-service/attachments/uploaded-content-part.d.ts.map +1 -1
  123. package/dist/ai-service/attachments/uploaded-content-part.js +31 -21
  124. package/dist/ai-service/attachments/uploaded-content-part.js.map +1 -1
  125. package/dist/ai-service/checklist/persisted-checklist-store.d.ts +105 -0
  126. package/dist/ai-service/checklist/persisted-checklist-store.d.ts.map +1 -0
  127. package/dist/ai-service/checklist/persisted-checklist-store.js +498 -0
  128. package/dist/ai-service/checklist/persisted-checklist-store.js.map +1 -0
  129. package/dist/ai-service/context-download.d.ts +14 -1
  130. package/dist/ai-service/context-download.d.ts.map +1 -1
  131. package/dist/ai-service/context-download.js +80 -0
  132. package/dist/ai-service/context-download.js.map +1 -1
  133. package/dist/ai-service/dev-database-client.d.ts +90 -0
  134. package/dist/ai-service/dev-database-client.d.ts.map +1 -0
  135. package/dist/ai-service/dev-database-client.js +166 -0
  136. package/dist/ai-service/dev-database-client.js.map +1 -0
  137. package/dist/ai-service/features.d.ts +16 -0
  138. package/dist/ai-service/features.d.ts.map +1 -1
  139. package/dist/ai-service/features.js +10 -0
  140. package/dist/ai-service/features.js.map +1 -1
  141. package/dist/ai-service/index.d.ts +11 -1
  142. package/dist/ai-service/index.d.ts.map +1 -1
  143. package/dist/ai-service/index.js +81 -13
  144. package/dist/ai-service/index.js.map +1 -1
  145. package/dist/ai-service/integrations/store.d.ts +5 -0
  146. package/dist/ai-service/integrations/store.d.ts.map +1 -1
  147. package/dist/ai-service/integrations/store.js +19 -2
  148. package/dist/ai-service/integrations/store.js.map +1 -1
  149. package/dist/ai-service/judge/tools/submit-feedback.d.ts +1 -1
  150. package/dist/ai-service/llm/context-v2/manager.d.ts +8 -1
  151. package/dist/ai-service/llm/context-v2/manager.d.ts.map +1 -1
  152. package/dist/ai-service/llm/context-v2/manager.js +17 -1
  153. package/dist/ai-service/llm/context-v2/manager.js.map +1 -1
  154. package/dist/ai-service/llm/context-v2/prompts/compaction.d.ts +1 -1
  155. package/dist/ai-service/llm/context-v2/prompts/compaction.d.ts.map +1 -1
  156. package/dist/ai-service/llm/context-v2/prompts/compaction.js +3 -3
  157. package/dist/ai-service/llm/impl/clark.d.ts.map +1 -1
  158. package/dist/ai-service/llm/impl/clark.js +3 -3
  159. package/dist/ai-service/llm/impl/clark.js.map +1 -1
  160. package/dist/ai-service/llm/provider.d.ts.map +1 -1
  161. package/dist/ai-service/llm/provider.js +22 -7
  162. package/dist/ai-service/llm/provider.js.map +1 -1
  163. package/dist/ai-service/llm/types.d.ts +14 -1
  164. package/dist/ai-service/llm/types.d.ts.map +1 -1
  165. package/dist/ai-service/llmobs/context-registry.d.ts +62 -0
  166. package/dist/ai-service/llmobs/context-registry.d.ts.map +1 -0
  167. package/dist/ai-service/llmobs/context-registry.js +115 -0
  168. package/dist/ai-service/llmobs/context-registry.js.map +1 -0
  169. package/dist/ai-service/llmobs/otel-exporter.d.ts +23 -0
  170. package/dist/ai-service/llmobs/otel-exporter.d.ts.map +1 -1
  171. package/dist/ai-service/llmobs/otel-exporter.js +112 -10
  172. package/dist/ai-service/llmobs/otel-exporter.js.map +1 -1
  173. package/dist/ai-service/llmobs/tracer.d.ts +7 -0
  174. package/dist/ai-service/llmobs/tracer.d.ts.map +1 -1
  175. package/dist/ai-service/llmobs/tracer.js +38 -0
  176. package/dist/ai-service/llmobs/tracer.js.map +1 -1
  177. package/dist/ai-service/skills/system/_registry.generated.d.ts.map +1 -1
  178. package/dist/ai-service/skills/system/_registry.generated.js +2 -0
  179. package/dist/ai-service/skills/system/_registry.generated.js.map +1 -1
  180. package/dist/ai-service/skills/system/superblocks-frontend/skill.generated.d.ts +1 -1
  181. package/dist/ai-service/skills/system/superblocks-frontend/skill.generated.d.ts.map +1 -1
  182. package/dist/ai-service/skills/system/superblocks-frontend/skill.generated.js +2 -0
  183. package/dist/ai-service/skills/system/superblocks-frontend/skill.generated.js.map +1 -1
  184. package/dist/ai-service/skills/system/superblocks-migration/references/focused-debug.generated.d.ts +1 -1
  185. package/dist/ai-service/skills/system/superblocks-migration/references/focused-debug.generated.d.ts.map +1 -1
  186. package/dist/ai-service/skills/system/superblocks-migration/references/focused-debug.generated.js +3 -1
  187. package/dist/ai-service/skills/system/superblocks-migration/references/focused-debug.generated.js.map +1 -1
  188. package/dist/ai-service/skills/system/superblocks-migration/references/yaml-block-mapping.generated.d.ts +1 -1
  189. package/dist/ai-service/skills/system/superblocks-migration/references/yaml-block-mapping.generated.d.ts.map +1 -1
  190. package/dist/ai-service/skills/system/superblocks-migration/references/yaml-block-mapping.generated.js +29 -0
  191. package/dist/ai-service/skills/system/superblocks-migration/references/yaml-block-mapping.generated.js.map +1 -1
  192. package/dist/ai-service/skills/system/superblocks-migration/skill.generated.d.ts +1 -1
  193. package/dist/ai-service/skills/system/superblocks-migration/skill.generated.d.ts.map +1 -1
  194. package/dist/ai-service/skills/system/superblocks-migration/skill.generated.js +112 -6
  195. package/dist/ai-service/skills/system/superblocks-migration/skill.generated.js.map +1 -1
  196. package/dist/ai-service/skills/system/third-party-migration/claude-design.generated.d.ts +2 -0
  197. package/dist/ai-service/skills/system/third-party-migration/claude-design.generated.d.ts.map +1 -0
  198. package/dist/ai-service/skills/system/third-party-migration/claude-design.generated.js +107 -0
  199. package/dist/ai-service/skills/system/third-party-migration/claude-design.generated.js.map +1 -0
  200. package/dist/ai-service/skills/system/third-party-migration/skill.generated.d.ts +1 -1
  201. package/dist/ai-service/skills/system/third-party-migration/skill.generated.d.ts.map +1 -1
  202. package/dist/ai-service/skills/system/third-party-migration/skill.generated.js +33 -3
  203. package/dist/ai-service/skills/system/third-party-migration/skill.generated.js.map +1 -1
  204. package/dist/ai-service/state-machine/clark-fsm.d.ts +21 -0
  205. package/dist/ai-service/state-machine/clark-fsm.d.ts.map +1 -1
  206. package/dist/ai-service/state-machine/clark-fsm.js.map +1 -1
  207. package/dist/ai-service/state-machine/handlers/agent-planning.d.ts.map +1 -1
  208. package/dist/ai-service/state-machine/handlers/agent-planning.js +79 -6
  209. package/dist/ai-service/state-machine/handlers/agent-planning.js.map +1 -1
  210. package/dist/ai-service/state-machine/handlers/llm-generating.d.ts +10 -0
  211. package/dist/ai-service/state-machine/handlers/llm-generating.d.ts.map +1 -1
  212. package/dist/ai-service/state-machine/handlers/llm-generating.js +69 -41
  213. package/dist/ai-service/state-machine/handlers/llm-generating.js.map +1 -1
  214. package/dist/ai-service/state-machine/helpers/peer.d.ts +35 -7
  215. package/dist/ai-service/state-machine/helpers/peer.d.ts.map +1 -1
  216. package/dist/ai-service/state-machine/helpers/peer.js +81 -15
  217. package/dist/ai-service/state-machine/helpers/peer.js.map +1 -1
  218. package/dist/ai-service/template-renderer.d.ts +14 -1
  219. package/dist/ai-service/template-renderer.d.ts.map +1 -1
  220. package/dist/ai-service/template-renderer.js +144 -41
  221. package/dist/ai-service/template-renderer.js.map +1 -1
  222. package/dist/ai-service/transform/api-builder/to-sdk-transformer.js +2 -2
  223. package/dist/ai-service/transform/api-builder/to-sdk-transformer.js.map +1 -1
  224. package/dist/ai-service/transform/api-builder/to-yaml-transformer.js +2 -2
  225. package/dist/ai-service/transform/api-builder/to-yaml-transformer.js.map +1 -1
  226. package/dist/draft-interface.d.ts +1 -1
  227. package/dist/draft-interface.d.ts.map +1 -1
  228. package/dist/file-sync-vite-plugin.d.ts.map +1 -1
  229. package/dist/file-sync-vite-plugin.js +34 -27
  230. package/dist/file-sync-vite-plugin.js.map +1 -1
  231. package/dist/file-system-helpers.d.ts +4 -0
  232. package/dist/file-system-helpers.d.ts.map +1 -1
  233. package/dist/file-system-helpers.js +13 -0
  234. package/dist/file-system-helpers.js.map +1 -1
  235. package/dist/inject-index-vite-plugin.d.ts.map +1 -1
  236. package/dist/inject-index-vite-plugin.js +15 -1
  237. package/dist/inject-index-vite-plugin.js.map +1 -1
  238. package/dist/injected-index.d.ts.map +1 -1
  239. package/dist/injected-index.js +15 -1
  240. package/dist/injected-index.js.map +1 -1
  241. package/dist/lock-service/index.d.ts.map +1 -1
  242. package/dist/lock-service/index.js +8 -10
  243. package/dist/lock-service/index.js.map +1 -1
  244. package/dist/migration/migration-checklist.d.ts +51 -2
  245. package/dist/migration/migration-checklist.d.ts.map +1 -1
  246. package/dist/migration/migration-checklist.js +79 -151
  247. package/dist/migration/migration-checklist.js.map +1 -1
  248. package/dist/migration/migration-routes.d.ts.map +1 -1
  249. package/dist/migration/migration-routes.js +290 -30
  250. package/dist/migration/migration-routes.js.map +1 -1
  251. package/dist/migration/migration-verification.d.ts +206 -0
  252. package/dist/migration/migration-verification.d.ts.map +1 -0
  253. package/dist/migration/migration-verification.js +1006 -0
  254. package/dist/migration/migration-verification.js.map +1 -0
  255. package/dist/migration/restructure.d.ts +9 -2
  256. package/dist/migration/restructure.d.ts.map +1 -1
  257. package/dist/migration/restructure.js +116 -5
  258. package/dist/migration/restructure.js.map +1 -1
  259. package/dist/migration/unsupported-integrations.d.ts.map +1 -1
  260. package/dist/migration/unsupported-integrations.js +9 -0
  261. package/dist/migration/unsupported-integrations.js.map +1 -1
  262. package/dist/migration/yaml-walk.d.ts +18 -0
  263. package/dist/migration/yaml-walk.d.ts.map +1 -0
  264. package/dist/migration/yaml-walk.js +45 -0
  265. package/dist/migration/yaml-walk.js.map +1 -0
  266. package/dist/migration-templates/app-fullstack/client/components/hooks/use-mobile.ts +1 -1
  267. package/dist/migration-templates/app-fullstack/client/components/ui/accordion.tsx +1 -1
  268. package/dist/migration-templates/app-fullstack/client/components/ui/avatar.tsx +1 -1
  269. package/dist/migration-templates/app-fullstack/client/components/ui/breadcrumb.tsx +1 -1
  270. package/dist/migration-templates/app-fullstack/client/components/ui/button.tsx +1 -1
  271. package/dist/migration-templates/app-fullstack/client/components/ui/calendar.tsx +1 -1
  272. package/dist/migration-templates/app-fullstack/client/components/ui/chart.tsx +1 -1
  273. package/dist/migration-templates/app-fullstack/client/components/ui/file-dropzone.tsx +1 -1
  274. package/dist/migration-templates/app-fullstack/client/components/ui/file-input.tsx +1 -1
  275. package/dist/migration-templates/app-fullstack/client/components/ui/hover-card.tsx +1 -1
  276. package/dist/migration-templates/app-fullstack/client/components/ui/image.tsx +1 -1
  277. package/dist/migration-templates/app-fullstack/client/components/ui/input.tsx +1 -1
  278. package/dist/migration-templates/app-fullstack/client/components/ui/label.tsx +1 -1
  279. package/dist/migration-templates/app-fullstack/client/components/ui/navigation-menu.tsx +1 -1
  280. package/dist/migration-templates/app-fullstack/client/components/ui/pagination.tsx +1 -1
  281. package/dist/migration-templates/app-fullstack/client/components/ui/popover.tsx +1 -1
  282. package/dist/migration-templates/app-fullstack/client/components/ui/progress.tsx +1 -1
  283. package/dist/migration-templates/app-fullstack/client/components/ui/select.tsx +1 -1
  284. package/dist/migration-templates/app-fullstack/client/components/ui/sheet.tsx +1 -1
  285. package/dist/migration-templates/app-fullstack/client/components/ui/sidebar.tsx +1 -1
  286. package/dist/migration-templates/app-fullstack/client/components/ui/slider.tsx +1 -1
  287. package/dist/migration-templates/app-fullstack/client/components/ui/switch.tsx +1 -1
  288. package/dist/migration-templates/app-fullstack/client/components/ui/table.tsx +1 -1
  289. package/dist/migration-templates/app-fullstack/client/components/ui/tabs.tsx +1 -1
  290. package/dist/migration-templates/app-fullstack/client/components/ui/toggle-group.tsx +1 -1
  291. package/dist/migration-templates/app-fullstack/client/components/ui/toggle.tsx +1 -1
  292. package/dist/migration-templates/app-fullstack/client/components/ui/tooltip.tsx +1 -1
  293. package/dist/socket-manager.d.ts.map +1 -1
  294. package/dist/socket-manager.js +8 -0
  295. package/dist/socket-manager.js.map +1 -1
  296. package/dist/sync-service/hash-dir-tree.d.ts +1 -1
  297. package/dist/sync-service/hash-dir-tree.d.ts.map +1 -1
  298. package/dist/sync-service/hash-dir-tree.js +3 -3
  299. package/dist/sync-service/hash-dir-tree.js.map +1 -1
  300. package/dist/sync-service/index.d.ts +0 -14
  301. package/dist/sync-service/index.d.ts.map +1 -1
  302. package/dist/sync-service/index.js +1 -44
  303. package/dist/sync-service/index.js.map +1 -1
  304. package/dist/sync-service/list-dir.d.ts +1 -1
  305. package/dist/sync-service/list-dir.d.ts.map +1 -1
  306. package/dist/sync-service/list-dir.js +36 -3
  307. package/dist/sync-service/list-dir.js.map +1 -1
  308. package/dist/sync-service/snapshot/take-snapshot.d.ts +1 -1
  309. package/dist/sync-service/snapshot/take-snapshot.d.ts.map +1 -1
  310. package/dist/sync-service/snapshot/take-snapshot.js +4 -8
  311. package/dist/sync-service/snapshot/take-snapshot.js.map +1 -1
  312. package/dist/util/log-sanitizer.d.ts +6 -5
  313. package/dist/util/log-sanitizer.d.ts.map +1 -1
  314. package/dist/util/log-sanitizer.js +21 -6
  315. package/dist/util/log-sanitizer.js.map +1 -1
  316. package/package.json +9 -8
@@ -0,0 +1,107 @@
1
+ // Auto-generated from src/ai-service/skills/system/third-party-migration/claude-design.md
2
+ // Do not edit directly - edit the .md file instead
3
+ export const content = `# Claude Design-specific mapping
4
+
5
+ This is a per-platform reference loaded from \`SKILL.md\`. The framework — target layout, universal mapping, non-negotiables, workflow, code-emission rules — lives there. This file documents only what is specific to a Claude Design source.
6
+
7
+ > Claude Design is a prototype-design tool from Anthropic. Its "Download project as .zip" output is a tiny, self-contained, **frontend-only** prototype: a single \`<Name>.html\` shell that loads React, ReactDOM, and Babel from a CDN and \`<script type="text/babel" src="...">\` files that compile in the browser at run time. There is **no backend, no \`package.json\`, no build step, and no module system** — every helper is hung off \`window.*\` or pulled from globals. Treat the export as design-quality intent (layout, typography, color, interactions, copy) that needs to be re-expressed inside the Superblocks fullstack template (Vite + React + react-router v7 + Tailwind v4 + shadcn/ui). The framework's "Don't fabricate a backend" rule applies — if the source is purely UI driven by inline mock data, the migrated app stays frontend-only unless the user explicitly asks for one.
8
+
9
+ ## Where the source lives
10
+
11
+ Definitive marker: a flat archive (no nested project folder) containing exactly one top-level \`<Name>.html\` file plus sibling JSX/JS files, with the HTML loading React, ReactDOM, and \`@babel/standalone\` from \`unpkg.com\` and using \`<script type="text/babel" src="...">\` for the JSX files. No \`package.json\`, no \`node_modules\`, no \`vite.config.*\`, no \`tsconfig.json\`.
12
+
13
+ Strong supporting signals:
14
+
15
+ - The HTML root tag is \`<html lang="..." data-theme="light">\` (or \`"dark"\`); theme switching happens by mutating \`data-theme\` on \`<html>\` and CSS variables defined under \`:root[data-theme="light"]\` / \`:root[data-theme="dark"]\`.
16
+ - A \`tweaks-panel.jsx\` sibling that defines a draggable in-canvas controls panel and exposes \`useTweaks\`, \`TweaksPanel\`, \`TweakSection\`, \`TweakSlider\`, \`TweakRadio\`, \`TweakColor\`, \`TweakToggle\` as window globals. The host protocol is \`__activate_edit_mode\` / \`__deactivate_edit_mode\` postMessage handshakes plus \`__edit_mode_available\` / \`__edit_mode_set_keys\` / \`__edit_mode_dismissed\` responses.
17
+ - An \`app.jsx\` whose top has \`const TWEAK_DEFAULTS = /*EDITMODE-BEGIN*/{ ... }/*EDITMODE-END*/;\` — the \`EDITMODE-BEGIN\` / \`EDITMODE-END\` markers are how the Claude Design canvas locates and rewrites the defaults block.
18
+ - A \`data.js\` (or similarly named sibling) that hangs sample data off \`window.*\`: e.g. \`window.ORDERS = [...]; window.KPIS = [...];\`. Components consume the globals directly (\`/* global React, ReactDOM, ORDERS, KPIS, useTweaks, ... */\` at the top of \`app.jsx\`).
19
+ - Mounting happens at the bottom of \`app.jsx\` via \`ReactDOM.createRoot(document.getElementById("root")).render(<App />);\` against a single \`<div id="root"></div>\` in the HTML body.
20
+ - Inline \`<style>\` block in \`<head>\` defines the entire visual system: a light + dark token palette under \`:root[data-theme="..."]\`, body typography (commonly DM Sans + JetBrains Mono via Google Fonts), all component styles by hand-rolled BEM-ish class names (\`.topbar\`, \`.brand\`, \`.kpi\`, \`.orders-table\`, etc.). No Tailwind, no shadcn primitives in the source.
21
+
22
+ If the user gave a path, use it. Otherwise look for the markers above in the working tree. If you see a flat archive with \`EDITMODE-BEGIN\` markers and a CDN-loaded React shell, it is a Claude Design export. If anything is ambiguous (e.g. someone hand-built a similar HTML+JSX shell), ask before assuming Claude Design conventions.
23
+
24
+ ## Typical shape (hints, not rules)
25
+
26
+ Use these as starting points; re-verify against the actual source tree on every migration.
27
+
28
+ - **Frontend**: One HTML shell + one or more \`.jsx\` files compiled in-browser by \`@babel/standalone\`. Components are plain functions (\`function App()\`, \`function KpiCard({ k, theme })\`) that consume \`React.useState\` / \`useMemo\` / \`useEffect\` from a \`const { useState, useMemo, useEffect } = React;\` destructure. No imports, no JSX modules, no TypeScript.
29
+ - **Styling**: Inline \`<style>\` in \`<head>\` with hand-written CSS, custom properties, and media queries. CSS variables drive the theme: \`--bg\`, \`--surface\`, \`--ink\`, \`--accent\`, \`--line\`, \`--muted\`, \`--shadow-{sm,md,lg}\`, etc. Dark mode flips the variable values under \`:root[data-theme="dark"]\`.
30
+ - **Fonts**: Google Fonts loaded via \`<link>\` in \`<head>\`; commonly DM Sans (UI) + JetBrains Mono (mono).
31
+ - **Tweaks**: \`tweaks-panel.jsx\` is a self-contained controls overlay used during prototyping. The \`useTweaks(TWEAK_DEFAULTS)\` hook returns \`[t, setTweak]\`; \`<TweaksPanel>\` renders the floating controls inside the canvas. Every tweak control posts \`__edit_mode_set_keys\` to the parent frame so the Claude Design host can persist values.
32
+ - **Data**: \`data.js\` defines synthetic sample data on \`window.*\`. Treat as fixtures, not production data.
33
+ - **Backend**: None. There are no API calls, no \`fetch\`, no auth, no DB access in a typical export.
34
+ - **Routing**: None. Single-page prototype; no \`react-router\` or hashes.
35
+ - **Assets**: Inlined SVGs in JSX or referenced from inline \`<style>\` background-images. No \`public/\`, no separate image files in the typical export.
36
+
37
+ ## Discovery checklist
38
+
39
+ In addition to the framework's discovery requirements, for a Claude Design source enumerate:
40
+
41
+ - The HTML shell file (\`<Name>.html\`) and the \`<title>\` it sets — that is the prototype's name and should anchor your \`<PageName>\`.
42
+ - Every sibling \`.jsx\` / \`.js\` file and its purpose: which one is the entry (\`app.jsx\`), which is the tweaks shell (\`tweaks-panel.jsx\`), which holds data fixtures (\`data.js\` or similar).
43
+ - The full \`TWEAK_DEFAULTS\` object between \`/*EDITMODE-BEGIN*/\` and \`/*EDITMODE-END*/\` — every key here corresponds to a runtime control; preserve every one in the migrated app or call out which you are dropping and why.
44
+ - The full set of CSS variables defined under \`:root[data-theme="light"]\` and \`:root[data-theme="dark"]\` — these are the theme tokens to port.
45
+ - Every Google Fonts family loaded in \`<head>\` and which CSS rules consume them.
46
+ - Every \`window.*\` global the JSX files read (look for the \`/* global ... */\` comment at the top of \`app.jsx\`) — these are the data fixtures to recreate.
47
+ - Every top-level component function in \`app.jsx\` and its responsibility (KPI tile, table, modal, toast, etc.). The migrated app keeps the same component breakdown.
48
+ - Every inline SVG and its role (icons, sparklines, chart paths) — these go straight into the migrated JSX unchanged.
49
+ - Whether the tweaks panel is purely visual (color, density, font size) or carries semantic state (filters, modes). Visual tweaks usually drop after migration; semantic tweaks become real React state on the page.
50
+
51
+ If the discovery summary doesn't tell you which CSS variables drive the theme, what every tweak controls, and what each component renders, you haven't discovered enough.
52
+
53
+ ## Core mapping
54
+
55
+ - **The HTML shell + \`app.jsx\` → one Superblocks page** at \`client/pages/<Name>/index.tsx\`, wired into \`client/router.tsx\` (commonly as the \`index: true\` route). The page name comes from the HTML \`<title>\` or the \`<Name>.html\` filename — pick one shape and stay consistent.
56
+ - **Drop the CDN script tags entirely.** React, ReactDOM, and \`@babel/standalone\` from \`unpkg\` have no role in the migrated app — the Vite template ships React via \`node_modules\` and compiles JSX at build time. Likewise drop the \`<script type="text/babel" src="...">\` references.
57
+ - **Drop the \`<html>\` / \`<body>\` shell.** The Superblocks template owns the document. Mounting via \`ReactDOM.createRoot(...)\` also drops; the platform handles render.
58
+ - **Translate the inline \`<style>\` block into Tailwind v4 + \`client/index.css\`:**
59
+ - The CSS variables under \`:root[data-theme="light"]\` / \`:root[data-theme="dark"]\` move into \`client/index.css\`'s \`:root\` and \`.dark\` blocks **as-is** (CSS Color Level 4 values stay as-is — do not convert to OKLCH; see the framework's "Theme port" rule). Wire them into Tailwind v4 via \`@theme inline\` so \`bg-bg\`, \`text-ink\`, \`border-line\` etc. resolve to the source tokens.
60
+ - The Google Fonts \`<link>\` tags become \`@import url('https://fonts.googleapis.com/...')\` at the top of \`client/index.css\`, with \`@theme { --font-sans: 'DM Sans', ...; --font-mono: 'JetBrains Mono', ...; }\` so \`font-sans\` / \`font-mono\` keep working. (See v0.md's font-port checklist for the three-step pattern.)
61
+ - Hand-rolled component CSS (\`.topbar\`, \`.kpi\`, \`.orders-table\`, etc.) translates into Tailwind utility classes on the corresponding JSX. Preserve spacing, sizing, color, shadow, and breakpoint behavior **exactly**. If a rule is too gnarly to express in utilities (complex animations, pseudo-element trickery), keep it in \`client/index.css\` under a scoped class — do not invent a new design.
62
+ - **Theme switching.** The source toggles theme by mutating \`<html data-theme="...">\`. Translate to a small custom provider that toggles \`class="dark"\` on \`document.documentElement\` and persists to \`localStorage\` (mirroring the v0 \`next-themes\` translation). Preserve the source's CSS variable scheme (\`:root\` / \`.dark\` blocks) — only the JS toggle changes.
63
+ - **Tweaks panel.** The Claude Design \`tweaks-panel.jsx\` is **canvas-only tooling** for the Claude Design host. It does not belong in the migrated app. Drop \`tweaks-panel.jsx\`, the \`useTweaks\` import, the \`<TweaksPanel>\` element, the \`__activate_edit_mode\` / \`__deactivate_edit_mode\` postMessage protocol, and the \`EDITMODE-BEGIN\` / \`EDITMODE-END\` markers entirely.
64
+ - **But preserve what the tweaks controlled.** For each tweak in \`TWEAK_DEFAULTS\`:
65
+ - **Visual-only tweaks** (theme, accent color, density, font size) → either drop and pin to the default value, or surface as a real settings UI if the user wants it. Ask before keeping; visual tweaks are usually prototype affordances, not product features.
66
+ - **Semantic tweaks** (active tab, selected filter, sort order, "show kpis" toggles) → become real React state on the page (\`useState\` defaulted to the value from \`TWEAK_DEFAULTS\`). The user's interactions drive them; there is no edit-mode panel.
67
+ - Surface the full list of tweaks and your decision per tweak in the discovery summary so the user can override.
68
+ - **\`data.js\` / \`window.*\` globals.** These are mock fixtures, not real data. Two paths:
69
+ - **Default: keep as inline mock data inside the migrated page** (e.g., a \`const ORDERS = [...]\` at module scope, or a small \`client/data/<name>.ts\` module). The migrated app stays frontend-only and behaves like the prototype.
70
+ - **If the user wants a real backend**: surface the data shape in the discovery summary and ask before fabricating APIs. Per the framework's "Don't fabricate a backend" rule, do not invent server-side endpoints unless the user opts in. If they do, each \`window.*\` collection becomes one Superblocks API returning the same shape, and the page calls \`useApiData("<ApiName>")\` instead of reading the global.
71
+ - **Components.** Each top-level function in \`app.jsx\` (\`KpiCard\`, \`OrdersTable\`, \`Checkbox\`, \`TrackingModal\`, \`BulkBar\`, \`Toast\`, ...) becomes a sibling component file under \`client/pages/<Name>/components/<Name>.tsx\` (or stays inline if small). Function bodies, JSX structure, prop shapes, and event handlers transfer **unchanged** — only imports change (pull \`useState\` / \`useMemo\` / \`useEffect\` from \`react\` instead of destructuring from a \`React\` global, and add explicit \`import React from "react"\` only if JSX runtime requires it).
72
+ - **Inline SVGs** (sparklines, icons, chart paths) move into the migrated JSX **verbatim**. Do not swap for \`lucide-react\` icons or other libraries unless the user asks; the source's SVGs are part of the design.
73
+ - **Modals, toasts, and overlays.** Source uses raw \`<div>\` + CSS for these. Keep as-is in the migrated page — do not silently swap for shadcn \`Dialog\` / \`Sonner\` unless the user explicitly opts in. shadcn primitives change visual behavior (focus rings, animation, scrim color) and that is a design regression.
74
+ - **Responsive breakpoints.** The source defines \`@media (max-width: 900px)\` rules in the inline \`<style>\`. Translate to Tailwind responsive prefixes (\`sm:\` / \`md:\` / \`lg:\`) on the corresponding utilities, matching the source's breakpoint values exactly.
75
+
76
+ ## Ask-before-guessing — Claude Design specifics
77
+
78
+ - "The export has no backend. I'll keep the data as inline mocks under \`client/pages/<Name>/data.ts\`. Want me to fabricate APIs for it instead, or leave it frontend-only?"
79
+ - "The tweaks panel exposes \`<list of tweaks>\`. Visual tweaks (theme, accent, density) typically drop on migration; semantic tweaks become real page state. Confirm which to keep, drop, or surface as a settings UI."
80
+ - "The source uses Google Fonts \`<list>\` via CDN \`<link>\`. I'll re-load them via \`@import\` in \`client/index.css\` and bind via \`@theme\`. OK, or do you want self-hosted fonts?"
81
+ - "The source switches themes by toggling \`<html data-theme>\`. I'll translate to a provider that toggles \`class='dark'\` on \`document.documentElement\`. Acceptable, or do you want a different theme-toggle shape?"
82
+ - "The export ships hand-rolled UI components (modal, toast, table). I'll keep them as-is rather than swapping in shadcn primitives, since shadcn would change the visual behavior. Confirm, or override per-component?"
83
+
84
+ ## Page port — what changes vs. what doesn't
85
+
86
+ For each Claude Design page, only these change:
87
+
88
+ - **Module system**: \`<script type="text/babel">\` + \`window.*\` globals → ESM imports between \`client/pages/...\` files; \`data.js\` becomes a \`.ts\` module (or inline \`const\`).
89
+ - **React acquisition**: \`const { useState, ... } = React;\` → \`import { useState, ... } from "react";\`
90
+ - **Mounting**: \`ReactDOM.createRoot(...).render(<App />)\` → page is mounted by \`client/router.tsx\` via the standard route binding.
91
+ - **Styling pipeline**: inline \`<style>\` + hand-rolled CSS classes → CSS variables in \`client/index.css\` under \`@theme inline\` + Tailwind utilities on JSX.
92
+ - **Theme toggle**: \`<html data-theme>\` mutation → \`document.documentElement\` class toggle.
93
+ - **Tweaks**: \`useTweaks\` / \`<TweaksPanel>\` → real React state for semantic tweaks; visual tweaks drop or move to a settings UI.
94
+ - **Edit-mode protocol**: \`__activate_edit_mode\` / \`__deactivate_edit_mode\` postMessage handshakes → drop entirely.
95
+
96
+ Everything else — JSX structure, component breakdown, prop shapes, event handlers, copy, layout, spacing, color, shadow, animation, breakpoints — transfers **unchanged** from the source. If the diff between source and target page goes beyond the bullets above, you are over-editing — back out the cosmetic changes.
97
+
98
+ ## Done — Claude Design specifics
99
+
100
+ In the final report, additionally surface:
101
+
102
+ - The full list of tweaks from \`TWEAK_DEFAULTS\` and what happened to each (kept as state, dropped, surfaced as settings).
103
+ - Whether the data stayed as inline mocks or was promoted to APIs (and which integration backs each, if so).
104
+ - Any hand-rolled UI primitives (modal, toast, popover) you preserved verbatim, so the user can choose whether to standardize on shadcn later.
105
+ - The list of Google Fonts re-loaded and the \`@theme\` font tokens bound.
106
+ `;
107
+ //# sourceMappingURL=claude-design.generated.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"claude-design.generated.js","sourceRoot":"","sources":["../../../../../src/ai-service/skills/system/third-party-migration/claude-design.generated.ts"],"names":[],"mappings":"AAAA,0FAA0F;AAC1F,mDAAmD;AAEnD,MAAM,CAAC,MAAM,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuGtB,CAAC"}
@@ -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 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";
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## Checklist is mandatory\n\nChecklist discipline is required for every migration run:\n\n- Before any file edits, ensure migration checklist items are seeded via `build_manageChecklist`.\n- Before editing an item, mark it `in_progress`.\n- After the edit lands, mark it `completed`, or `failed` with a concrete `failureReason` if deterministic completion is impossible.\n- When you need an item to survive `build_finalize`, set `clearOnFinalize: false` on add/update. Use this only for migration-tracking items that must persist until explicit migration completion.\n- Do not continue implementation if checklist state is missing, stale, or inconsistent with the work you are doing. Fix checklist state first.\n- Free-text progress updates are never a substitute for checklist updates.\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- **Claude Design** \u2014 a small flat archive (no `package.json`, no `node_modules`, no build config) with one top-level `<Name>.html` plus sibling `app.jsx`, `data.js`, and `tweaks-panel.jsx`. The HTML loads React + ReactDOM + Babel from a CDN, uses `<html data-theme=\"...\">`, and references `var(--accent)` / `var(--ink)` CSS variables. The `.jsx` files contain `/*EDITMODE-BEGIN*/ ... /*EDITMODE-END*/` markers around defaults and use `useTweaks` / `TweaksPanel` / `TweakSection` / `TweakToggle` globals. \u2192 load `claude-design.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 be pixel-faithful to the source. Transfer these source details verbatim: copy strings (every label, heading, placeholder, helper text, button, empty state, error, alt text, tooltip, and aria-label), Tailwind class lists, CSS custom properties with original units and color space (no HSL\u2194OKLCH conversion), border-radius, spacing / padding / margin / gap, width / height literals including arbitrary values such as `w-[280px]` and `rounded-[14px]`, shadow tokens and values, typography (family, weight, size, line-height, and letter-spacing), icon identity (same lucide name or same inline SVG), inline SVG and image assets, breakpoints and responsive prefixes, animations and transitions, component breakdown, and JSX nesting. shadcn/ui components stay as-is. Do **not** redesign, restyle, or \"clean up\" while porting. A diff that goes beyond data hooks + auth + routing + framework directives is a regression \u2014 back it out.\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 - **Classify the work** per _Before emitting code_ below \u2014 pick the right tool (copy / copy+edit / write) before you start typing.\n - **Emit / edit the files** for that item using the tool the classification selected.\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` must direct the sub-agent to `build_readFile` `skills/system/third-party-migration/SKILL.md` and the matching platform file (for example, `v0.md`) before touching any files. Do not inline the fidelity contract; keep a single source of truth. The instructions also name exact `itemId`s, include the integration-UUID map and source path, include any platform-specific context the sub-agent needs (e.g. RLS-replacement clauses for Lovable), and tell 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## Before emitting code\n\nPick the right tool **before** you start typing. The source tree is the source of truth; preserve it byte-for-byte wherever you can. `build_writeFile` is an escalation, not the primary tool \u2014 a rewritten file is only as faithful as the model's attention, while a copied file is faithful by construction.\n\nFor each checklist item, classify the target file(s) into the **lowest bucket that fits** and use the tool for that bucket:\n\n| Source vs. target needs | Tool | Examples |\n| -------------------------------------------------------------------------------------------------------------- | ----------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |\n| **Directory** of non-source files | `build_copyDirectory` \u2014 never per-file | `public/`, `static/`, `assets/`, `src/assets/`, fonts, image bundles |\n| **Identical** \u2014 byte-for-byte | `build_copyFile` | data modules, type files, JSON, fixtures, vendored utils, content/copy modules, shadcn primitives the source has already customized |\n| **Trivial edits only** \u2014 \u2264 3 distinct edit sites | `build_copyFile` then `build_editFile` per site | import-path swaps (`react-router-dom` \u2192 `react-router`), single hook rename, one-line constant fix, removing a single `\"use client\"` directive |\n| **Structural changes** \u2014 different component APIs, framework wrappers, routing overhaul, data-hook replacement | `build_writeFile` | page components whose data layer is being rewritten, server handlers being reshaped to `api(...)`, router file being regenerated |\n\n**Heuristic:** if you cannot name the specific lines that need to change before reading the file, you have not earned `build_writeFile` yet \u2014 `build_readFile` first, then re-classify.\n\n**Asset directories never get a per-file ruling.** If `public/` (or the platform's equivalent \u2014 see the per-platform guide) exists in the source, it ships as a single `build_copyDirectory` regardless of contents. Do not enumerate, do not skip, do not selectively copy \"the ones you think you'll need.\"\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,6peAqInB,CAAC"}
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,otoBAmKnB,CAAC"}
@@ -17,6 +17,17 @@ Port a user-provided external app into the Superblocks fullstack app you are run
17
17
 
18
18
  This file is the migration framework. **Per-platform mapping rules live in sibling files** — load the right one before you start mapping.
19
19
 
20
+ ## Checklist is mandatory
21
+
22
+ Checklist discipline is required for every migration run:
23
+
24
+ - Before any file edits, ensure migration checklist items are seeded via \`build_manageChecklist\`.
25
+ - Before editing an item, mark it \`in_progress\`.
26
+ - After the edit lands, mark it \`completed\`, or \`failed\` with a concrete \`failureReason\` if deterministic completion is impossible.
27
+ - When you need an item to survive \`build_finalize\`, set \`clearOnFinalize: false\` on add/update. Use this only for migration-tracking items that must persist until explicit migration completion.
28
+ - Do not continue implementation if checklist state is missing, stale, or inconsistent with the work you are doing. Fix checklist state first.
29
+ - Free-text progress updates are never a substitute for checklist updates.
30
+
20
31
  ## Identify the source platform
21
32
 
22
33
  Match the source tree against these signals, then read the matching reference file in this folder. Read it once, up-front — it tells you what shapes to look for and how each maps to Superblocks.
@@ -24,6 +35,7 @@ Match the source tree against these signals, then read the matching reference fi
24
35
  - **Replit** — \`replit.md\`, \`.replit\`, \`artifacts/\`, an Express server with an Orval-generated client. → load \`replit.md\`.
25
36
  - **Lovable** — \`src/integrations/supabase/client.ts\`, \`supabase/config.toml\`, \`supabase/functions/\`, \`supabase/migrations/\`, \`lovable-tagger\` in \`vite.config.ts\`. → load \`lovable.md\`.
26
37
  - **v0** — \`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. → load \`v0.md\`.
38
+ - **Claude Design** — a small flat archive (no \`package.json\`, no \`node_modules\`, no build config) with one top-level \`<Name>.html\` plus sibling \`app.jsx\`, \`data.js\`, and \`tweaks-panel.jsx\`. The HTML loads React + ReactDOM + Babel from a CDN, uses \`<html data-theme="...">\`, and references \`var(--accent)\` / \`var(--ink)\` CSS variables. The \`.jsx\` files contain \`/*EDITMODE-BEGIN*/ ... /*EDITMODE-END*/\` markers around defaults and use \`useTweaks\` / \`TweaksPanel\` / \`TweakSection\` / \`TweakToggle\` globals. → load \`claude-design.md\`.
27
39
  - **Ambiguous or neither** — 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.
28
40
 
29
41
  The framework below applies to every platform; the platform file fills in the source-specific mapping.
@@ -100,7 +112,7 @@ Do **not**: assign \`Component\` / \`element\` to identifiers bound by anything
100
112
  1. **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** — the orchestration depends on it. Free-text status reports are not a substitute.
101
113
  2. **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.
102
114
  3. **Ask before guessing.** Multiple integrations of the same kind, missing integrations, unsupported data sources, or any platform-specific ambiguity → stop and \`askMultiChoice\`. Never pick for the user. The platform file lists ambiguities specific to that source.
103
- 4. **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 visual regressions are bugs, not improvements. If the user wants a redesign, that is a separate task after migration.
115
+ 4. **Preserve visual identity.** The migrated app must be pixel-faithful to the source. Transfer these source details verbatim: copy strings (every label, heading, placeholder, helper text, button, empty state, error, alt text, tooltip, and aria-label), Tailwind class lists, CSS custom properties with original units and color space (no HSL↔OKLCH conversion), border-radius, spacing / padding / margin / gap, width / height literals including arbitrary values such as \`w-[280px]\` and \`rounded-[14px]\`, shadow tokens and values, typography (family, weight, size, line-height, and letter-spacing), icon identity (same lucide name or same inline SVG), inline SVG and image assets, breakpoints and responsive prefixes, animations and transitions, component breakdown, and JSX nesting. shadcn/ui components stay as-is. Do **not** redesign, restyle, or "clean up" while porting. A diff that goes beyond data hooks + auth + routing + framework directives is a regression back it out.
104
116
  5. **Never copy secrets.** DSN strings, API keys, anon/service-role keys, JWT secrets, env-var lookups for credentials — 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.
105
117
  6. **No \`// TODO\`s.** Anything you can't finish deterministically becomes a \`failed\` checklist item with a concrete \`failureReason\`.
106
118
  7. **Don't scaffold.** If \`server/apis/index.ts\` or \`client/router.tsx\` doesn't already exist, you're in the wrong app — stop and surface this.
@@ -115,12 +127,30 @@ Do **not**: assign \`Component\` / \`element\` to identifiers bound by anything
115
127
  5. **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.
116
128
  6. **Execute.** Every item follows the same ritual — no exceptions:
117
129
  - **Before touching files:** \`build_manageChecklist update <itemId> in_progress\`.
118
- - **Emit / edit the files** for that item.
130
+ - **Classify the work** per _Before emitting code_ below — pick the right tool (copy / copy+edit / write) before you start typing.
131
+ - **Emit / edit the files** for that item using the tool the classification selected.
119
132
  - **After the edit lands:** \`build_manageChecklist update <itemId> completed\` (or \`failed\` with a concrete \`failureReason\`).
120
133
  - 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.
121
- - **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\` → \`completed\`/\`failed\` ritual for every item it owns.
134
+ - **For parallelizable work:** call \`spawnCodingSubagents\` with batches of tasks. Each batch's \`instructions\` must direct the sub-agent to \`build_readFile\` \`skills/system/third-party-migration/SKILL.md\` and the matching platform file (for example, \`v0.md\`) before touching any files. Do not inline the fidelity contract; keep a single source of truth. The instructions also name exact \`itemId\`s, include the integration-UUID map and source path, include any platform-specific context the sub-agent needs (e.g. RLS-replacement clauses for Lovable), and tell the sub-agent to follow the same \`in_progress\` → \`completed\`/\`failed\` ritual for every item it owns.
122
135
  - \`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 — or fail the affected items with \`sub-agent orchestration failed: <error>\`.
123
136
 
137
+ ## Before emitting code
138
+
139
+ Pick the right tool **before** you start typing. The source tree is the source of truth; preserve it byte-for-byte wherever you can. \`build_writeFile\` is an escalation, not the primary tool — a rewritten file is only as faithful as the model's attention, while a copied file is faithful by construction.
140
+
141
+ For each checklist item, classify the target file(s) into the **lowest bucket that fits** and use the tool for that bucket:
142
+
143
+ | Source vs. target needs | Tool | Examples |
144
+ | -------------------------------------------------------------------------------------------------------------- | ----------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
145
+ | **Directory** of non-source files | \`build_copyDirectory\` — never per-file | \`public/\`, \`static/\`, \`assets/\`, \`src/assets/\`, fonts, image bundles |
146
+ | **Identical** — byte-for-byte | \`build_copyFile\` | data modules, type files, JSON, fixtures, vendored utils, content/copy modules, shadcn primitives the source has already customized |
147
+ | **Trivial edits only** — ≤ 3 distinct edit sites | \`build_copyFile\` then \`build_editFile\` per site | import-path swaps (\`react-router-dom\` → \`react-router\`), single hook rename, one-line constant fix, removing a single \`"use client"\` directive |
148
+ | **Structural changes** — different component APIs, framework wrappers, routing overhaul, data-hook replacement | \`build_writeFile\` | page components whose data layer is being rewritten, server handlers being reshaped to \`api(...)\`, router file being regenerated |
149
+
150
+ **Heuristic:** if you cannot name the specific lines that need to change before reading the file, you have not earned \`build_writeFile\` yet — \`build_readFile\` first, then re-classify.
151
+
152
+ **Asset directories never get a per-file ruling.** If \`public/\` (or the platform's equivalent — see the per-platform guide) exists in the source, it ships as a single \`build_copyDirectory\` regardless of contents. Do not enumerate, do not skip, do not selectively copy "the ones you think you'll need."
153
+
124
154
  ## When emitting code
125
155
 
126
156
  - **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 — 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.
@@ -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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqItB,CAAC"}
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmKtB,CAAC"}
@@ -80,6 +80,12 @@ export type ClarkEvent = {
80
80
  * ai-service itself.
81
81
  */
82
82
  internal?: boolean;
83
+ /**
84
+ * When true, persist and surface the prompt in chat history even when
85
+ * the turn is internal. This is used by system-initiated prompts that we
86
+ * still want users to see (for example, migration bootstrap prompts).
87
+ */
88
+ visibleInChatHistory?: boolean;
83
89
  } | {
84
90
  type: typeof USER_ACCEPTED_DRAFT;
85
91
  silently?: boolean;
@@ -362,6 +368,8 @@ export type ClarkContext = {
362
368
  status: "pending" | "in_progress" | "completed" | "cancelled" | "failed";
363
369
  createdAt: string;
364
370
  updatedAt?: string;
371
+ /** Populated only when status === "failed". */
372
+ failureReason?: string;
365
373
  }[];
366
374
  lastUpdated: string;
367
375
  };
@@ -391,7 +399,20 @@ export type ClarkContext = {
391
399
  activeInteractiveMessage?: {
392
400
  id: string;
393
401
  payload: AiChatMessage;
402
+ /**
403
+ * Set by `sendInteractiveMessageChannel` after a successful peer
404
+ * push. Distinguishes prompts that are genuinely in flight (waiting
405
+ * on the user) from stale guards left behind by a lifecycle path
406
+ * that did not clear `activeInteractiveMessage`. The channel uses
407
+ * this to auto-recover from stale state instead of silently
408
+ * dropping the next interactive tool call.
409
+ */
410
+ deliveredViaChannel?: boolean;
411
+ };
412
+ deferredInteractiveMessage?: {
413
+ payload: AiChatMessage;
394
414
  };
415
+ lastMigrationUnresolvedSnapshotKey?: string;
395
416
  /** Tracks integration action prompt sent after opening setup so responses can be handled deterministically */
396
417
  pendingIntegrationActionPrompt?: {
397
418
  messageId: string;
@@ -1 +1 @@
1
- {"version":3,"file":"clark-fsm.d.ts","sourceRoot":"","sources":["../../../src/ai-service/state-machine/clark-fsm.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAExD,OAAO,KAAK,EAAE,YAAY,EAAsB,MAAM,IAAI,CAAC;AAC3D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,MAAM,CAAC;AAE1C,OAAO,KAAK,EACV,iBAAiB,EACjB,UAAU,EACV,iBAAiB,EACjB,wBAAwB,EACxB,aAAa,EACb,mBAAmB,EACnB,8BAA8B,EAC9B,0BAA0B,EAC1B,gBAAgB,EAChB,MAAM,EACN,WAAW,EAGX,aAAa,EACb,iBAAiB,EACjB,gBAAgB,EAChB,cAAc,EACd,eAAe,EACf,YAAY,EACZ,oBAAoB,EACrB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,KAAK,EACV,sBAAsB,EACtB,kBAAkB,EACnB,MAAM,yBAAyB,CAAC;AAIjC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uCAAuC,CAAC;AACnF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,KAAK,EAAE,oBAAoB,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAC3E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2CAA2C,CAAC;AACrF,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,K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;QAEtE,KAAK,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI;aACzB,iBAAiB,CAAC,EAAE,WAAW,EAAE,CAAC;aAClC,KAAK,CAAC,CAAC,GAAY,EAAE,EAAE;YACtB,IAAI,CAAC,MAAM,CAAC,IAAI,CACd,6BAA6B,EAC7B,iBAAiB,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,CACrC,CAAC;QACJ,CAAC,CAAC,CAAC;IACP,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"agent-planning.d.ts","sourceRoot":"","sources":["../../../../src/ai-service/state-machine/handlers/agent-planning.ts"],"names":[],"mappings":"AAqCA,OAAO,KAAK,EAKV,KAAK,EACL,uBAAuB,EACvB,eAAe,EAChB,MAAM,iBAAiB,CAAC;AAkEzB,eAAO,MAAM,eAAe,GAC1B,OAAO,KAAK,EACZ,QAAQ,uBAAuB,MAqFjB,WAAW,eAAe,KAAG,OAAO,CAAC,IAAI,CAowBxD,CAAC"}
1
+ {"version":3,"file":"agent-planning.d.ts","sourceRoot":"","sources":["../../../../src/ai-service/state-machine/handlers/agent-planning.ts"],"names":[],"mappings":"AAsCA,OAAO,KAAK,EAKV,KAAK,EACL,uBAAuB,EACvB,eAAe,EAChB,MAAM,iBAAiB,CAAC;AAmEzB,eAAO,MAAM,eAAe,GAC1B,OAAO,KAAK,EACZ,QAAQ,uBAAuB,MAqFjB,WAAW,eAAe,KAAG,OAAO,CAAC,IAAI,CA42BxD,CAAC"}
@@ -11,7 +11,7 @@ import { parseJwt } from "../../util/parse-jwt.js";
11
11
  import { AGENT_PLANNED, AGENT_NEEDS_USER_INPUT, LLM_ERRORED, LLM_FINISHED_UNEXPECTEDLY, POST_PROCESSING_ERRORED, RUNTIME_REVIEW_ERRORED, USER_SENT_PROMPT, BUILD_SYSTEM_ERRORED, AGENT_CANCELED, } from "../clark-fsm.js";
12
12
  import { sendChangeInfoHelper } from "../helpers/change-info.js";
13
13
  import { handlerMetadata } from "../helpers/metadata.js";
14
- import { sendUserMessageChannel, sendUserGenerationStateChannel, clearPendingToolPermissionRequest, } from "../helpers/peer.js";
14
+ import { flushDeferredInteractiveMessage, sendUserMessageChannel, sendUserGenerationStateChannel, clearPendingToolPermissionRequest, } from "../helpers/peer.js";
15
15
  import { transitionFrom } from "../helpers/transition.js";
16
16
  // TODO: make dynamically configurable
17
17
  const MAX_DEBUG_ATTEMPTS = 5;
@@ -123,7 +123,7 @@ Address the errors and return the fixed code.`;
123
123
  case USER_SENT_PROMPT: {
124
124
  // Clear error history for new generation
125
125
  debugCache.getErrorHistoryTracker().clear();
126
- const { request, internal: isInternalTurn } = event;
126
+ const { request, internal: isInternalTurn, visibleInChatHistory, } = event;
127
127
  const promptContextWithUploadedAttachments = request.promptContext;
128
128
  const pendingIntegrationActionMessageId = clark.context.pendingIntegrationActionPrompt?.messageId;
129
129
  const previousMode = clark.context.currentMode;
@@ -175,7 +175,18 @@ Address the errors and return the fixed code.`;
175
175
  void params.entityPermissionStore.approve(permission.entityType, permission.entityId, permission.permissionType);
176
176
  });
177
177
  }
178
- clearPendingToolPermissionRequest(clark);
178
+ clearPendingToolPermissionRequest(clark, "tool-permission-response-handled");
179
+ }
180
+ // Responding to a tool-permission widget is also a fresh
181
+ // user turn — any interactive prompt that was active when
182
+ // we entered this branch is no longer the user's focus.
183
+ // Without this clear, the channel guard would silently
184
+ // drop the next interactive tool call from the model
185
+ // (exitPlanMode, askMultiChoice, askSearchableDropdown).
186
+ // See peer.ts for the channel-level recovery the channel
187
+ // does on top of this lifecycle clear.
188
+ if (clark.context.activeInteractiveMessage) {
189
+ clark.updateContext({ activeInteractiveMessage: undefined });
179
190
  }
180
191
  }
181
192
  else {
@@ -183,6 +194,7 @@ Address the errors and return the fixed code.`;
183
194
  clark.updateContext({
184
195
  activeInteractiveMessage: undefined,
185
196
  });
197
+ await flushDeferredInteractiveMessage(clark, params.chatSessionStore);
186
198
  const handledKnowledge = await handleAppKnowledgeApprovalResponse(clark, params, request);
187
199
  if (handledKnowledge) {
188
200
  return;
@@ -377,9 +389,30 @@ Address the errors and return the fixed code.`;
377
389
  }
378
390
  const promptForRecording = clark.context.interruptOriginalPrompt ?? request.prompt;
379
391
  clark.updateContext({ interruptOriginalPrompt: undefined });
380
- if (isInternalTurn) {
392
+ const shouldRecordUserPrompt = !isInternalTurn || visibleInChatHistory === true;
393
+ let shouldSkipDuplicateInternalPrompt = false;
394
+ if (shouldRecordUserPrompt &&
395
+ isInternalTurn &&
396
+ visibleInChatHistory === true) {
397
+ try {
398
+ const messages = await params.chatSessionStore.getMessages();
399
+ const lastUserTextMessage = [...messages]
400
+ .reverse()
401
+ .find((message) => message.role === "user" && message.type === "text");
402
+ shouldSkipDuplicateInternalPrompt =
403
+ lastUserTextMessage?.content.trim() ===
404
+ promptForRecording.trim();
405
+ }
406
+ catch (error) {
407
+ getLogger().warn("[agent-planning] Failed to inspect chat history for duplicate internal prompt", error);
408
+ }
409
+ }
410
+ if (!shouldRecordUserPrompt) {
381
411
  getLogger().info(`[agent-planning] Internal turn: skipping chat session recording`);
382
412
  }
413
+ else if (shouldSkipDuplicateInternalPrompt) {
414
+ getLogger().info(`[agent-planning] Internal turn: skipping duplicate visible prompt`);
415
+ }
383
416
  else {
384
417
  getLogger().info(`[agent-planning] Recording user message to chat session...`);
385
418
  const chatmessageId = await params.chatSessionStore.recordUser(promptForRecording, {
@@ -448,8 +481,13 @@ Address the errors and return the fixed code.`;
448
481
  getLogger().error(`[agent-planning] Failed to persist attachments`, getErrorMeta(err));
449
482
  }
450
483
  }
451
- // clear pending tool permission request if it exists
452
- clearPendingToolPermissionRequest(clark);
484
+ // Clear stale pending tool permission when the user sends an explicit
485
+ // new prompt. Internal/system turns (e.g. post-flip migration
486
+ // translation) and structured interactive responses must not dismiss
487
+ // an in-flight permission prompt.
488
+ if (!isInternalTurn && !request.responseMetadata) {
489
+ clearPendingToolPermissionRequest(clark, "new-prompt-agent-planning");
490
+ }
453
491
  if (!request?.jwt) {
454
492
  getLogger().error(`[agent-planning] Missing or invalid JWT token in AI request (applicationId: ${params.applicationId})`);
455
493
  void transitionTo({
@@ -508,6 +546,41 @@ Address the errors and return the fixed code.`;
508
546
  state: AiGenerationState.GENERATING,
509
547
  });
510
548
  params.signals.emit("generationStarted");
549
+ // Demo-only: emit the "Preparing development environment" mock card
550
+ // on the user's first prompt of an empty app, gated by the
551
+ // `superblocks.byo-db.demo` LaunchDarkly flag. State transitions
552
+ // (pending → done per task) are driven from the server: we emit
553
+ // the same message id three times with updated `statuses` and the
554
+ // UI's awsInfraDemoHandler folds them into a single card. The
555
+ // awaits below intentionally block agent planning so the demo
556
+ // finishes before the LLM starts generating.
557
+ //
558
+ // Gated by chat history length (rather than a context flag) so it
559
+ // remains correctly suppressed across reloads — once persisted, the
560
+ // message stays in the session log and the length check skips
561
+ // re-emission.
562
+ if (params.features.byoDbDemo?.enabled &&
563
+ !isInternalTurn &&
564
+ !request.responseMetadata) {
565
+ const priorMessages = await params.chatSessionStore.getMessages();
566
+ const isFirstPrompt = !priorMessages.some((m) => m.type === "aws_infra_demo");
567
+ if (isFirstPrompt) {
568
+ const demoId = generateShortId();
569
+ const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
570
+ const sendDemo = (statuses) => sendUserMessage({
571
+ id: demoId,
572
+ type: "aws_infra_demo",
573
+ role: "assistant",
574
+ content: "",
575
+ statuses,
576
+ });
577
+ await sendDemo({ db: "pending", s3: "pending" });
578
+ await sleep(2000);
579
+ await sendDemo({ db: "done", s3: "pending" });
580
+ await sleep(2000);
581
+ await sendDemo({ db: "done", s3: "done" });
582
+ }
583
+ }
511
584
  const components = params.appContextStore.componentSemanticsById;
512
585
  const entities = [
513
586
  ...(request.promptContext?.entities ?? []),