@superblocksteam/vite-plugin-file-sync 2.0.170 → 2.0.171-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 (491) hide show
  1. package/dist/ai-service/agent/prompts/api-prompts.d.ts.map +1 -1
  2. package/dist/ai-service/agent/prompts/api-prompts.js +4 -6
  3. package/dist/ai-service/agent/prompts/api-prompts.js.map +1 -1
  4. package/dist/ai-service/agent/prompts/build-base-system-prompt.d.ts +3 -12
  5. package/dist/ai-service/agent/prompts/build-base-system-prompt.d.ts.map +1 -1
  6. package/dist/ai-service/agent/prompts/build-base-system-prompt.js +144 -71
  7. package/dist/ai-service/agent/prompts/build-base-system-prompt.js.map +1 -1
  8. package/dist/ai-service/agent/subagents/testing/types.d.ts +2 -1
  9. package/dist/ai-service/agent/subagents/testing/types.d.ts.map +1 -1
  10. package/dist/ai-service/agent/tool-message-utils.d.ts.map +1 -1
  11. package/dist/ai-service/agent/tool-message-utils.js +47 -36
  12. package/dist/ai-service/agent/tool-message-utils.js.map +1 -1
  13. package/dist/ai-service/agent/tool-result-metrics.d.ts +15 -0
  14. package/dist/ai-service/agent/tool-result-metrics.d.ts.map +1 -1
  15. package/dist/ai-service/agent/tool-result-metrics.js +28 -0
  16. package/dist/ai-service/agent/tool-result-metrics.js.map +1 -1
  17. package/dist/ai-service/agent/tools/apis/analysis.d.ts +24 -2
  18. package/dist/ai-service/agent/tools/apis/analysis.d.ts.map +1 -1
  19. package/dist/ai-service/agent/tools/apis/analysis.js +164 -11
  20. package/dist/ai-service/agent/tools/apis/analysis.js.map +1 -1
  21. package/dist/ai-service/agent/tools/apis/api-comparator.d.ts +2 -1
  22. package/dist/ai-service/agent/tools/apis/api-comparator.d.ts.map +1 -1
  23. package/dist/ai-service/agent/tools/apis/contained-source-reader.d.ts +11 -0
  24. package/dist/ai-service/agent/tools/apis/contained-source-reader.d.ts.map +1 -0
  25. package/dist/ai-service/agent/tools/apis/contained-source-reader.js +48 -0
  26. package/dist/ai-service/agent/tools/apis/contained-source-reader.js.map +1 -0
  27. package/dist/ai-service/agent/tools/apis/get-sdk-api-docs.d.ts +37 -10
  28. package/dist/ai-service/agent/tools/apis/get-sdk-api-docs.d.ts.map +1 -1
  29. package/dist/ai-service/agent/tools/apis/get-sdk-api-docs.js +140 -70
  30. package/dist/ai-service/agent/tools/apis/get-sdk-api-docs.js.map +1 -1
  31. package/dist/ai-service/agent/tools/apis/spreadsheet-csv.d.ts +6 -20
  32. package/dist/ai-service/agent/tools/apis/spreadsheet-csv.d.ts.map +1 -1
  33. package/dist/ai-service/agent/tools/apis/spreadsheet-csv.js +3 -3
  34. package/dist/ai-service/agent/tools/apis/spreadsheet-csv.js.map +1 -1
  35. package/dist/ai-service/agent/tools/apis/test-api-metrics.d.ts +8 -0
  36. package/dist/ai-service/agent/tools/apis/test-api-metrics.d.ts.map +1 -0
  37. package/dist/ai-service/agent/tools/apis/test-api-metrics.js +41 -0
  38. package/dist/ai-service/agent/tools/apis/test-api-metrics.js.map +1 -0
  39. package/dist/ai-service/agent/tools/apis/test-api-timing.d.ts +27 -0
  40. package/dist/ai-service/agent/tools/apis/test-api-timing.d.ts.map +1 -0
  41. package/dist/ai-service/agent/tools/apis/test-api-timing.js +25 -0
  42. package/dist/ai-service/agent/tools/apis/test-api-timing.js.map +1 -0
  43. package/dist/ai-service/agent/tools/apis/test-api.d.ts +4 -0
  44. package/dist/ai-service/agent/tools/apis/test-api.d.ts.map +1 -1
  45. package/dist/ai-service/agent/tools/apis/test-api.js +119 -20
  46. package/dist/ai-service/agent/tools/apis/test-api.js.map +1 -1
  47. package/dist/ai-service/agent/tools/build-capture-screenshot.d.ts +0 -18
  48. package/dist/ai-service/agent/tools/build-capture-screenshot.d.ts.map +1 -1
  49. package/dist/ai-service/agent/tools/build-capture-screenshot.js +2 -2
  50. package/dist/ai-service/agent/tools/build-capture-screenshot.js.map +1 -1
  51. package/dist/ai-service/agent/tools/build-install-packages.d.ts +32 -5
  52. package/dist/ai-service/agent/tools/build-install-packages.d.ts.map +1 -1
  53. package/dist/ai-service/agent/tools/build-install-packages.js +20 -19
  54. package/dist/ai-service/agent/tools/build-install-packages.js.map +1 -1
  55. package/dist/ai-service/agent/tools/build-manage-checklist.d.ts +1 -1
  56. package/dist/ai-service/agent/tools/build-manage-packages.d.ts +19 -0
  57. package/dist/ai-service/agent/tools/build-manage-packages.d.ts.map +1 -0
  58. package/dist/ai-service/agent/tools/build-manage-packages.js +220 -0
  59. package/dist/ai-service/agent/tools/build-manage-packages.js.map +1 -0
  60. package/dist/ai-service/agent/tools/build-read-file.d.ts +5 -14
  61. package/dist/ai-service/agent/tools/build-read-file.d.ts.map +1 -1
  62. package/dist/ai-service/agent/tools/build-read-file.js +5 -8
  63. package/dist/ai-service/agent/tools/build-read-file.js.map +1 -1
  64. package/dist/ai-service/agent/tools/databases/dev-database-tasks.d.ts +2 -90
  65. package/dist/ai-service/agent/tools/databases/dev-database-tasks.d.ts.map +1 -1
  66. package/dist/ai-service/agent/tools/databases/dev-database-tasks.js +1 -2
  67. package/dist/ai-service/agent/tools/databases/dev-database-tasks.js.map +1 -1
  68. package/dist/ai-service/agent/tools/debug-cache.d.ts +0 -12
  69. package/dist/ai-service/agent/tools/debug-cache.d.ts.map +1 -1
  70. package/dist/ai-service/agent/tools/debug-cache.js +1 -1
  71. package/dist/ai-service/agent/tools/debug-cache.js.map +1 -1
  72. package/dist/ai-service/agent/tools/index.d.ts +3 -3
  73. package/dist/ai-service/agent/tools/index.d.ts.map +1 -1
  74. package/dist/ai-service/agent/tools/index.js +2 -2
  75. package/dist/ai-service/agent/tools/index.js.map +1 -1
  76. package/dist/ai-service/agent/tools/integrations/errors.d.ts.map +1 -1
  77. package/dist/ai-service/agent/tools/integrations/errors.js +3 -0
  78. package/dist/ai-service/agent/tools/integrations/errors.js.map +1 -1
  79. package/dist/ai-service/agent/tools/integrations/execute-request.d.ts +27 -0
  80. package/dist/ai-service/agent/tools/integrations/execute-request.d.ts.map +1 -1
  81. package/dist/ai-service/agent/tools/integrations/execute-request.js +85 -11
  82. package/dist/ai-service/agent/tools/integrations/execute-request.js.map +1 -1
  83. package/dist/ai-service/agent/tools/integrations/managed-app-database.d.ts +0 -2
  84. package/dist/ai-service/agent/tools/integrations/managed-app-database.d.ts.map +1 -1
  85. package/dist/ai-service/agent/tools/integrations/managed-app-database.js +1 -1
  86. package/dist/ai-service/agent/tools/integrations/managed-app-database.js.map +1 -1
  87. package/dist/ai-service/agent/tools/integrations/metadata.d.ts.map +1 -1
  88. package/dist/ai-service/agent/tools/integrations/metadata.js +1 -0
  89. package/dist/ai-service/agent/tools/integrations/metadata.js.map +1 -1
  90. package/dist/ai-service/agent/tools/read-state-trackers.d.ts +16 -2
  91. package/dist/ai-service/agent/tools/read-state-trackers.d.ts.map +1 -1
  92. package/dist/ai-service/agent/tools/read-state-trackers.js +11 -2
  93. package/dist/ai-service/agent/tools/read-state-trackers.js.map +1 -1
  94. package/dist/ai-service/agent/tools.d.ts.map +1 -1
  95. package/dist/ai-service/agent/tools.js +13 -6
  96. package/dist/ai-service/agent/tools.js.map +1 -1
  97. package/dist/ai-service/agent/tools2/registry.d.ts +20 -1
  98. package/dist/ai-service/agent/tools2/registry.d.ts.map +1 -1
  99. package/dist/ai-service/agent/tools2/registry.js +55 -9
  100. package/dist/ai-service/agent/tools2/registry.js.map +1 -1
  101. package/dist/ai-service/agent/tools2/tools/grep-metadata-ripgrep.d.ts.map +1 -1
  102. package/dist/ai-service/agent/tools2/tools/grep-metadata-ripgrep.js +25 -0
  103. package/dist/ai-service/agent/tools2/tools/grep-metadata-ripgrep.js.map +1 -1
  104. package/dist/ai-service/agent/tools2/tools/grep-metadata.d.ts +8 -2
  105. package/dist/ai-service/agent/tools2/tools/grep-metadata.d.ts.map +1 -1
  106. package/dist/ai-service/agent/tools2/tools/grep-metadata.js +17 -0
  107. package/dist/ai-service/agent/tools2/tools/grep-metadata.js.map +1 -1
  108. package/dist/ai-service/agent/tools2/tools/grep.d.ts.map +1 -1
  109. package/dist/ai-service/agent/tools2/tools/grep.js +50 -25
  110. package/dist/ai-service/agent/tools2/tools/grep.js.map +1 -1
  111. package/dist/ai-service/agent/utils.d.ts.map +1 -1
  112. package/dist/ai-service/agent/utils.js +3 -3
  113. package/dist/ai-service/agent/utils.js.map +1 -1
  114. package/dist/ai-service/app-interface/file-system-interface.d.ts +0 -6
  115. package/dist/ai-service/app-interface/file-system-interface.d.ts.map +1 -1
  116. package/dist/ai-service/app-interface/file-system-interface.js +39 -97
  117. package/dist/ai-service/app-interface/file-system-interface.js.map +1 -1
  118. package/dist/ai-service/app-interface/filesystem/handlers/skill-handler.d.ts.map +1 -1
  119. package/dist/ai-service/app-interface/filesystem/handlers/skill-handler.js +2 -2
  120. package/dist/ai-service/app-interface/filesystem/handlers/skill-handler.js.map +1 -1
  121. package/dist/ai-service/app-interface/filesystem/validation.js +1 -1
  122. package/dist/ai-service/app-interface/filesystem/validation.js.map +1 -1
  123. package/dist/ai-service/app-interface/npm-package-lookup.d.ts +1 -3
  124. package/dist/ai-service/app-interface/npm-package-lookup.d.ts.map +1 -1
  125. package/dist/ai-service/app-interface/npm-package-lookup.js +1 -1
  126. package/dist/ai-service/app-interface/npm-package-lookup.js.map +1 -1
  127. package/dist/ai-service/app-interface/pnpm-lockfile.d.ts.map +1 -1
  128. package/dist/ai-service/app-interface/pnpm-lockfile.js +2 -4
  129. package/dist/ai-service/app-interface/pnpm-lockfile.js.map +1 -1
  130. package/dist/ai-service/app-interface/shell.d.ts +38 -15
  131. package/dist/ai-service/app-interface/shell.d.ts.map +1 -1
  132. package/dist/ai-service/app-interface/shell.js +646 -48
  133. package/dist/ai-service/app-interface/shell.js.map +1 -1
  134. package/dist/ai-service/app-interface/vulnerability-gate.d.ts +7 -0
  135. package/dist/ai-service/app-interface/vulnerability-gate.d.ts.map +1 -1
  136. package/dist/ai-service/app-interface/vulnerability-gate.js +16 -6
  137. package/dist/ai-service/app-interface/vulnerability-gate.js.map +1 -1
  138. package/dist/ai-service/app-layout.d.ts +3 -0
  139. package/dist/ai-service/app-layout.d.ts.map +1 -1
  140. package/dist/ai-service/app-layout.js +14 -0
  141. package/dist/ai-service/app-layout.js.map +1 -1
  142. package/dist/ai-service/app-skills/parser.d.ts +2 -1
  143. package/dist/ai-service/app-skills/parser.d.ts.map +1 -1
  144. package/dist/ai-service/attachments/store.d.ts +4 -4
  145. package/dist/ai-service/attachments/store.d.ts.map +1 -1
  146. package/dist/ai-service/chat/chat-session-store-metrics.d.ts +1 -2
  147. package/dist/ai-service/chat/chat-session-store-metrics.d.ts.map +1 -1
  148. package/dist/ai-service/chat/chat-session-store-metrics.js +0 -6
  149. package/dist/ai-service/chat/chat-session-store-metrics.js.map +1 -1
  150. package/dist/ai-service/chat/chat-session-store.d.ts +2 -11
  151. package/dist/ai-service/chat/chat-session-store.d.ts.map +1 -1
  152. package/dist/ai-service/chat/chat-session-store.js +21 -4
  153. package/dist/ai-service/chat/chat-session-store.js.map +1 -1
  154. package/dist/ai-service/chat/utils.d.ts +1 -2
  155. package/dist/ai-service/chat/utils.d.ts.map +1 -1
  156. package/dist/ai-service/chat/utils.js +0 -1
  157. package/dist/ai-service/chat/utils.js.map +1 -1
  158. package/dist/ai-service/checklist/persisted-checklist-store.d.ts +3 -3
  159. package/dist/ai-service/checklist/persisted-checklist-store.d.ts.map +1 -1
  160. package/dist/ai-service/checklist/persisted-checklist-store.js +4 -2
  161. package/dist/ai-service/checklist/persisted-checklist-store.js.map +1 -1
  162. package/dist/ai-service/context/app-context.d.ts +7 -39
  163. package/dist/ai-service/context/app-context.d.ts.map +1 -1
  164. package/dist/ai-service/context/app-context.js +29 -110
  165. package/dist/ai-service/context/app-context.js.map +1 -1
  166. package/dist/ai-service/context-clear-metrics.d.ts +11 -0
  167. package/dist/ai-service/context-clear-metrics.d.ts.map +1 -0
  168. package/dist/ai-service/context-clear-metrics.js +64 -0
  169. package/dist/ai-service/context-clear-metrics.js.map +1 -0
  170. package/dist/ai-service/context-download.js +2 -2
  171. package/dist/ai-service/context-download.js.map +1 -1
  172. package/dist/ai-service/edit-after-clark.d.ts +0 -5
  173. package/dist/ai-service/edit-after-clark.d.ts.map +1 -1
  174. package/dist/ai-service/edit-after-clark.js +1 -1
  175. package/dist/ai-service/edit-after-clark.js.map +1 -1
  176. package/dist/ai-service/features.d.ts +20 -4
  177. package/dist/ai-service/features.d.ts.map +1 -1
  178. package/dist/ai-service/features.js +20 -4
  179. package/dist/ai-service/features.js.map +1 -1
  180. package/dist/ai-service/filter-disabled-tools-for-migration.js +1 -1
  181. package/dist/ai-service/filter-disabled-tools-for-migration.js.map +1 -1
  182. package/dist/ai-service/index.d.ts +58 -0
  183. package/dist/ai-service/index.d.ts.map +1 -1
  184. package/dist/ai-service/index.js +186 -21
  185. package/dist/ai-service/index.js.map +1 -1
  186. package/dist/ai-service/integrations/store.d.ts +6 -0
  187. package/dist/ai-service/integrations/store.d.ts.map +1 -1
  188. package/dist/ai-service/integrations/store.js +101 -3
  189. package/dist/ai-service/integrations/store.js.map +1 -1
  190. package/dist/ai-service/live-edit-events/forwarder.d.ts +1 -12
  191. package/dist/ai-service/live-edit-events/forwarder.d.ts.map +1 -1
  192. package/dist/ai-service/live-edit-events/forwarder.js +1 -7
  193. package/dist/ai-service/live-edit-events/forwarder.js.map +1 -1
  194. package/dist/ai-service/llm/context-v2/compaction/client-side.d.ts.map +1 -1
  195. package/dist/ai-service/llm/context-v2/compaction/client-side.js +15 -5
  196. package/dist/ai-service/llm/context-v2/compaction/client-side.js.map +1 -1
  197. package/dist/ai-service/llm/context-v2/compaction/compaction-strategy.d.ts +6 -0
  198. package/dist/ai-service/llm/context-v2/compaction/compaction-strategy.d.ts.map +1 -1
  199. package/dist/ai-service/llm/context-v2/compaction/server-side.d.ts.map +1 -1
  200. package/dist/ai-service/llm/context-v2/compaction/server-side.js +5 -1
  201. package/dist/ai-service/llm/context-v2/compaction/server-side.js.map +1 -1
  202. package/dist/ai-service/llm/context-v2/compactor.d.ts.map +1 -1
  203. package/dist/ai-service/llm/context-v2/compactor.js +34 -12
  204. package/dist/ai-service/llm/context-v2/compactor.js.map +1 -1
  205. package/dist/ai-service/llm/context-v2/context-management.d.ts.map +1 -1
  206. package/dist/ai-service/llm/context-v2/context-management.js +9 -0
  207. package/dist/ai-service/llm/context-v2/context-management.js.map +1 -1
  208. package/dist/ai-service/llm/context-v2/context-metrics.d.ts +4 -0
  209. package/dist/ai-service/llm/context-v2/context-metrics.d.ts.map +1 -1
  210. package/dist/ai-service/llm/context-v2/context-metrics.js +15 -3
  211. package/dist/ai-service/llm/context-v2/context-metrics.js.map +1 -1
  212. package/dist/ai-service/llm/context-v2/context.d.ts +36 -6
  213. package/dist/ai-service/llm/context-v2/context.d.ts.map +1 -1
  214. package/dist/ai-service/llm/context-v2/context.js +72 -28
  215. package/dist/ai-service/llm/context-v2/context.js.map +1 -1
  216. package/dist/ai-service/llm/context-v2/manager.d.ts +3 -3
  217. package/dist/ai-service/llm/context-v2/manager.d.ts.map +1 -1
  218. package/dist/ai-service/llm/context-v2/manager.js +13 -7
  219. package/dist/ai-service/llm/context-v2/manager.js.map +1 -1
  220. package/dist/ai-service/llm/context-v2/migrations/types.d.ts +2 -1
  221. package/dist/ai-service/llm/context-v2/migrations/types.d.ts.map +1 -1
  222. package/dist/ai-service/llm/context-v2/storage/event-types.d.ts +5 -5
  223. package/dist/ai-service/llm/context-v2/storage/event-types.d.ts.map +1 -1
  224. package/dist/ai-service/llm/context-v2/storage/event-types.js +3 -23
  225. package/dist/ai-service/llm/context-v2/storage/event-types.js.map +1 -1
  226. package/dist/ai-service/llm/context-v2/types.d.ts +9 -1
  227. package/dist/ai-service/llm/context-v2/types.d.ts.map +1 -1
  228. package/dist/ai-service/llm/context-v2/types.js.map +1 -1
  229. package/dist/ai-service/llm/context-v2/uniquify-filenames.d.ts +20 -4
  230. package/dist/ai-service/llm/context-v2/uniquify-filenames.d.ts.map +1 -1
  231. package/dist/ai-service/llm/context-v2/uniquify-filenames.js +128 -29
  232. package/dist/ai-service/llm/context-v2/uniquify-filenames.js.map +1 -1
  233. package/dist/ai-service/llm/error.d.ts +1 -1
  234. package/dist/ai-service/llm/error.d.ts.map +1 -1
  235. package/dist/ai-service/llm/error.js +57 -7
  236. package/dist/ai-service/llm/error.js.map +1 -1
  237. package/dist/ai-service/llm/stream/config.d.ts +3 -3
  238. package/dist/ai-service/llm/stream/config.d.ts.map +1 -1
  239. package/dist/ai-service/llm/stream/errors.d.ts +3 -0
  240. package/dist/ai-service/llm/stream/errors.d.ts.map +1 -1
  241. package/dist/ai-service/llm/stream/errors.js +72 -4
  242. package/dist/ai-service/llm/stream/errors.js.map +1 -1
  243. package/dist/ai-service/llm/stream/observers/workflow-usage.d.ts +0 -6
  244. package/dist/ai-service/llm/stream/observers/workflow-usage.d.ts.map +1 -1
  245. package/dist/ai-service/llm/stream/observers/workflow-usage.js +2 -2
  246. package/dist/ai-service/llm/stream/observers/workflow-usage.js.map +1 -1
  247. package/dist/ai-service/llm/stream/orchestrator.d.ts.map +1 -1
  248. package/dist/ai-service/llm/stream/orchestrator.js +6 -1
  249. package/dist/ai-service/llm/stream/orchestrator.js.map +1 -1
  250. package/dist/ai-service/managed-native-db-availability.d.ts +5 -2
  251. package/dist/ai-service/managed-native-db-availability.d.ts.map +1 -1
  252. package/dist/ai-service/managed-native-db-availability.js +5 -1
  253. package/dist/ai-service/managed-native-db-availability.js.map +1 -1
  254. package/dist/ai-service/mcp/embedded-playwright-mcp-server.js +2 -0
  255. package/dist/ai-service/mcp/embedded-playwright-mcp-server.js.map +1 -1
  256. package/dist/ai-service/migration-prompt-gating.d.ts +1 -0
  257. package/dist/ai-service/migration-prompt-gating.d.ts.map +1 -1
  258. package/dist/ai-service/migration-prompt-gating.js +3 -0
  259. package/dist/ai-service/migration-prompt-gating.js.map +1 -1
  260. package/dist/ai-service/migration-turns-log.d.ts +3 -2
  261. package/dist/ai-service/migration-turns-log.d.ts.map +1 -1
  262. package/dist/ai-service/migration-turns-log.js.map +1 -1
  263. package/dist/ai-service/policy-agent-metrics.d.ts +2 -4
  264. package/dist/ai-service/policy-agent-metrics.d.ts.map +1 -1
  265. package/dist/ai-service/policy-agent-metrics.js +3 -3
  266. package/dist/ai-service/policy-agent-metrics.js.map +1 -1
  267. package/dist/ai-service/policy-gate-remediation-usage.d.ts.map +1 -1
  268. package/dist/ai-service/policy-gate-remediation-usage.js +29 -19
  269. package/dist/ai-service/policy-gate-remediation-usage.js.map +1 -1
  270. package/dist/ai-service/prompt-builder-service/classifiers/prompt-interpret-task.js +1 -1
  271. package/dist/ai-service/prompt-builder-service/classifiers/prompt-interpret-task.js.map +1 -1
  272. package/dist/ai-service/recording/types.d.ts +6 -5
  273. package/dist/ai-service/recording/types.d.ts.map +1 -1
  274. package/dist/ai-service/skills/system/_registry.generated.d.ts.map +1 -1
  275. package/dist/ai-service/skills/system/_registry.generated.js +10 -0
  276. package/dist/ai-service/skills/system/_registry.generated.js.map +1 -1
  277. package/dist/ai-service/skills/system/app-database/skill.generated.d.ts +2 -0
  278. package/dist/ai-service/skills/system/app-database/skill.generated.d.ts.map +1 -0
  279. package/dist/ai-service/skills/system/app-database/skill.generated.js +79 -0
  280. package/dist/ai-service/skills/system/app-database/skill.generated.js.map +1 -0
  281. package/dist/ai-service/skills/system/resolve.d.ts +1 -1
  282. package/dist/ai-service/skills/system/resolve.d.ts.map +1 -1
  283. package/dist/ai-service/skills/system/resolve.js +25 -2
  284. package/dist/ai-service/skills/system/resolve.js.map +1 -1
  285. package/dist/ai-service/skills/system/spreadsheet-import/skill.generated.d.ts +1 -1
  286. package/dist/ai-service/skills/system/spreadsheet-import/skill.generated.d.ts.map +1 -1
  287. package/dist/ai-service/skills/system/spreadsheet-import/skill.generated.js +1 -1
  288. package/dist/ai-service/skills/system/superblocks-frontend/_variants/base-ui-plain.generated.d.ts +2 -0
  289. package/dist/ai-service/skills/system/superblocks-frontend/_variants/base-ui-plain.generated.d.ts.map +1 -0
  290. package/dist/ai-service/skills/system/superblocks-frontend/_variants/base-ui-plain.generated.js +5 -0
  291. package/dist/ai-service/skills/system/superblocks-frontend/_variants/base-ui-plain.generated.js.map +1 -0
  292. package/dist/ai-service/skills/system/superblocks-frontend/_variants/base-ui-registered.generated.d.ts +2 -0
  293. package/dist/ai-service/skills/system/superblocks-frontend/_variants/base-ui-registered.generated.d.ts.map +1 -0
  294. package/dist/ai-service/skills/system/superblocks-frontend/_variants/base-ui-registered.generated.js +5 -0
  295. package/dist/ai-service/skills/system/superblocks-frontend/_variants/base-ui-registered.generated.js.map +1 -0
  296. package/dist/ai-service/skills/system/superblocks-frontend/_variants/icons-lucide.generated.d.ts +2 -0
  297. package/dist/ai-service/skills/system/superblocks-frontend/_variants/icons-lucide.generated.d.ts.map +1 -0
  298. package/dist/ai-service/skills/system/superblocks-frontend/_variants/icons-lucide.generated.js +32 -0
  299. package/dist/ai-service/skills/system/superblocks-frontend/_variants/icons-lucide.generated.js.map +1 -0
  300. package/dist/ai-service/skills/system/superblocks-frontend/_variants/icons-wrapper.generated.d.ts +2 -0
  301. package/dist/ai-service/skills/system/superblocks-frontend/_variants/icons-wrapper.generated.d.ts.map +1 -0
  302. package/dist/ai-service/skills/system/superblocks-frontend/_variants/icons-wrapper.generated.js +34 -0
  303. package/dist/ai-service/skills/system/superblocks-frontend/_variants/icons-wrapper.generated.js.map +1 -0
  304. package/dist/ai-service/skills/system/superblocks-frontend/skill.generated.d.ts +1 -1
  305. package/dist/ai-service/skills/system/superblocks-frontend/skill.generated.d.ts.map +1 -1
  306. package/dist/ai-service/skills/system/superblocks-frontend/skill.generated.js +99 -68
  307. package/dist/ai-service/skills/system/superblocks-frontend/skill.generated.js.map +1 -1
  308. package/dist/ai-service/skills/system/superblocks-migration/skill.generated.d.ts +1 -1
  309. package/dist/ai-service/skills/system/superblocks-migration/skill.generated.d.ts.map +1 -1
  310. package/dist/ai-service/skills/system/superblocks-migration/skill.generated.js +4 -4
  311. package/dist/ai-service/skills/system/superblocks-sdk-api/skill.generated.d.ts +1 -1
  312. package/dist/ai-service/skills/system/superblocks-sdk-api/skill.generated.d.ts.map +1 -1
  313. package/dist/ai-service/skills/system/superblocks-sdk-api/skill.generated.js +7 -7
  314. package/dist/ai-service/skills/system/third-party-migration/skill.generated.d.ts +1 -1
  315. package/dist/ai-service/skills/system/third-party-migration/skill.generated.d.ts.map +1 -1
  316. package/dist/ai-service/skills/system/third-party-migration/skill.generated.js +1 -1
  317. package/dist/ai-service/state-machine/clark-fsm.d.ts +2 -3
  318. package/dist/ai-service/state-machine/clark-fsm.d.ts.map +1 -1
  319. package/dist/ai-service/state-machine/clark-fsm.js +1 -1
  320. package/dist/ai-service/state-machine/clark-fsm.js.map +1 -1
  321. package/dist/ai-service/state-machine/handlers/agent-planning.d.ts.map +1 -1
  322. package/dist/ai-service/state-machine/handlers/agent-planning.js +1 -4
  323. package/dist/ai-service/state-machine/handlers/agent-planning.js.map +1 -1
  324. package/dist/ai-service/state-machine/handlers/llm-generating.d.ts.map +1 -1
  325. package/dist/ai-service/state-machine/handlers/llm-generating.js +21 -12
  326. package/dist/ai-service/state-machine/handlers/llm-generating.js.map +1 -1
  327. package/dist/ai-service/state-machine/helpers/prompt-degradation-cause.d.ts +63 -0
  328. package/dist/ai-service/state-machine/helpers/prompt-degradation-cause.d.ts.map +1 -0
  329. package/dist/ai-service/state-machine/helpers/prompt-degradation-cause.js +96 -0
  330. package/dist/ai-service/state-machine/helpers/prompt-degradation-cause.js.map +1 -0
  331. package/dist/ai-service/state-machine/helpers/prompt-degradation-metrics.d.ts +12 -3
  332. package/dist/ai-service/state-machine/helpers/prompt-degradation-metrics.d.ts.map +1 -1
  333. package/dist/ai-service/state-machine/helpers/prompt-degradation-metrics.js +89 -17
  334. package/dist/ai-service/state-machine/helpers/prompt-degradation-metrics.js.map +1 -1
  335. package/dist/ai-service/state-machine/helpers/prompt-org-claims.d.ts +17 -0
  336. package/dist/ai-service/state-machine/helpers/prompt-org-claims.d.ts.map +1 -0
  337. package/dist/ai-service/state-machine/helpers/prompt-org-claims.js +50 -0
  338. package/dist/ai-service/state-machine/helpers/prompt-org-claims.js.map +1 -0
  339. package/dist/ai-service/state-machine/helpers/prompt-request-metrics.d.ts +6 -0
  340. package/dist/ai-service/state-machine/helpers/prompt-request-metrics.d.ts.map +1 -1
  341. package/dist/ai-service/state-machine/helpers/prompt-request-metrics.js +35 -5
  342. package/dist/ai-service/state-machine/helpers/prompt-request-metrics.js.map +1 -1
  343. package/dist/ai-service/state-machine/mocks.d.ts.map +1 -1
  344. package/dist/ai-service/state-machine/mocks.js +1 -4
  345. package/dist/ai-service/state-machine/mocks.js.map +1 -1
  346. package/dist/ai-service/tasks/peer-push.d.ts +2 -1
  347. package/dist/ai-service/tasks/peer-push.d.ts.map +1 -1
  348. package/dist/ai-service/test-utils/metrics-harness.d.ts +2 -1
  349. package/dist/ai-service/test-utils/metrics-harness.d.ts.map +1 -1
  350. package/dist/ai-service/util/llm-config-utils.d.ts +16 -5
  351. package/dist/ai-service/util/llm-config-utils.d.ts.map +1 -1
  352. package/dist/ai-service/util/llm-config-utils.js +25 -3
  353. package/dist/ai-service/util/llm-config-utils.js.map +1 -1
  354. package/dist/ai-service/util/parse-jwt.d.ts +5 -1
  355. package/dist/ai-service/util/parse-jwt.d.ts.map +1 -1
  356. package/dist/ai-service/util/parse-jwt.js +9 -1
  357. package/dist/ai-service/util/parse-jwt.js.map +1 -1
  358. package/dist/app-scope-source.d.ts +13 -0
  359. package/dist/app-scope-source.d.ts.map +1 -0
  360. package/dist/app-scope-source.js +68 -0
  361. package/dist/app-scope-source.js.map +1 -0
  362. package/dist/extract-api-integrations.d.ts +28 -6
  363. package/dist/extract-api-integrations.d.ts.map +1 -1
  364. package/dist/extract-api-integrations.js +166 -98
  365. package/dist/extract-api-integrations.js.map +1 -1
  366. package/dist/file-sync-vite-plugin.d.ts +1 -5
  367. package/dist/file-sync-vite-plugin.d.ts.map +1 -1
  368. package/dist/file-sync-vite-plugin.js +44 -70
  369. package/dist/file-sync-vite-plugin.js.map +1 -1
  370. package/dist/file-system-helpers.d.ts +0 -5
  371. package/dist/file-system-helpers.d.ts.map +1 -1
  372. package/dist/file-system-helpers.js +1 -1
  373. package/dist/file-system-helpers.js.map +1 -1
  374. package/dist/file-system-manager.d.ts +2 -9
  375. package/dist/file-system-manager.d.ts.map +1 -1
  376. package/dist/file-system-manager.js +50 -118
  377. package/dist/file-system-manager.js.map +1 -1
  378. package/dist/git-service/index.d.ts.map +1 -1
  379. package/dist/git-service/index.js +8 -0
  380. package/dist/git-service/index.js.map +1 -1
  381. package/dist/lock-service/index.d.ts +24 -0
  382. package/dist/lock-service/index.d.ts.map +1 -1
  383. package/dist/lock-service/index.js +74 -2
  384. package/dist/lock-service/index.js.map +1 -1
  385. package/dist/migration/integration-write-policy.d.ts +2 -1
  386. package/dist/migration/integration-write-policy.d.ts.map +1 -1
  387. package/dist/migration/integration-write-policy.js.map +1 -1
  388. package/dist/migration/restructure.d.ts +1 -1
  389. package/dist/migration/restructure.d.ts.map +1 -1
  390. package/dist/migration/restructure.js +1 -1
  391. package/dist/migration/restructure.js.map +1 -1
  392. package/dist/migration/translation-prompt.js +1 -1
  393. package/dist/migration-templates/app-fullstack/client/components/ui/accordion.tsx +0 -69
  394. package/dist/migration-templates/app-fullstack/client/components/ui/aspect-ratio.tsx +0 -31
  395. package/dist/migration-templates/app-fullstack/client/components/ui/avatar.tsx +0 -52
  396. package/dist/migration-templates/app-fullstack/client/components/ui/badge.tsx +5 -79
  397. package/dist/migration-templates/app-fullstack/client/components/ui/breadcrumb.tsx +14 -161
  398. package/dist/migration-templates/app-fullstack/client/components/ui/button.tsx +1 -53
  399. package/dist/migration-templates/app-fullstack/client/components/ui/calendar.tsx +4 -56
  400. package/dist/migration-templates/app-fullstack/client/components/ui/card.tsx +0 -34
  401. package/dist/migration-templates/app-fullstack/client/components/ui/chart.tsx +3 -51
  402. package/dist/migration-templates/app-fullstack/client/components/ui/checkbox.tsx +0 -42
  403. package/dist/migration-templates/app-fullstack/client/components/ui/dialog.tsx +0 -55
  404. package/dist/migration-templates/app-fullstack/client/components/ui/dropdown-menu.tsx +0 -29
  405. package/dist/migration-templates/app-fullstack/client/components/ui/hover-card.tsx +0 -64
  406. package/dist/migration-templates/app-fullstack/client/components/ui/input.tsx +0 -57
  407. package/dist/migration-templates/app-fullstack/client/components/ui/label.tsx +0 -30
  408. package/dist/migration-templates/app-fullstack/client/components/ui/navigation-menu.tsx +16 -172
  409. package/dist/migration-templates/app-fullstack/client/components/ui/pagination.tsx +0 -44
  410. package/dist/migration-templates/app-fullstack/client/components/ui/popover.tsx +0 -64
  411. package/dist/migration-templates/app-fullstack/client/components/ui/progress.tsx +0 -31
  412. package/dist/migration-templates/app-fullstack/client/components/ui/scroll-area.tsx +0 -30
  413. package/dist/migration-templates/app-fullstack/client/components/ui/select.tsx +0 -41
  414. package/dist/migration-templates/app-fullstack/client/components/ui/separator.tsx +0 -29
  415. package/dist/migration-templates/app-fullstack/client/components/ui/sheet.tsx +0 -64
  416. package/dist/migration-templates/app-fullstack/client/components/ui/sidebar.tsx +30 -265
  417. package/dist/migration-templates/app-fullstack/client/components/ui/slider.tsx +0 -45
  418. package/dist/migration-templates/app-fullstack/client/components/ui/switch.tsx +0 -41
  419. package/dist/migration-templates/app-fullstack/client/components/ui/table.tsx +0 -32
  420. package/dist/migration-templates/app-fullstack/client/components/ui/tabs.tsx +0 -23
  421. package/dist/migration-templates/app-fullstack/client/components/ui/textarea.tsx +0 -48
  422. package/dist/migration-templates/app-fullstack/client/components/ui/toggle-group.tsx +0 -81
  423. package/dist/migration-templates/app-fullstack/client/components/ui/toggle.tsx +0 -46
  424. package/dist/migration-templates/app-fullstack/client/components/ui/tooltip.tsx +0 -63
  425. package/dist/migration-templates/app-fullstack/eslint.config.js +7 -0
  426. package/dist/migration-templates/app-fullstack/package.json +0 -3
  427. package/dist/parsing/types.d.ts +3 -2
  428. package/dist/parsing/types.d.ts.map +1 -1
  429. package/dist/policy-gate-runner.d.ts +1 -1
  430. package/dist/policy-gate-runner.d.ts.map +1 -1
  431. package/dist/policy-gate-runner.js.map +1 -1
  432. package/dist/reconnect-guard-plugin.d.ts +0 -1
  433. package/dist/reconnect-guard-plugin.d.ts.map +1 -1
  434. package/dist/reconnect-guard-plugin.js +1 -1
  435. package/dist/reconnect-guard-plugin.js.map +1 -1
  436. package/dist/resolver.d.ts +1 -1
  437. package/dist/resolver.d.ts.map +1 -1
  438. package/dist/resolver.js +2 -2
  439. package/dist/resolver.js.map +1 -1
  440. package/dist/socket-manager.d.ts.map +1 -1
  441. package/dist/socket-manager.js +12 -2
  442. package/dist/socket-manager.js.map +1 -1
  443. package/dist/source-tracker.d.ts +5 -15
  444. package/dist/source-tracker.d.ts.map +1 -1
  445. package/dist/source-tracker.js +28 -66
  446. package/dist/source-tracker.js.map +1 -1
  447. package/dist/sync-service/checkpoint-result.d.ts +6 -5
  448. package/dist/sync-service/checkpoint-result.d.ts.map +1 -1
  449. package/dist/sync-service/checkpoint-result.js +9 -8
  450. package/dist/sync-service/checkpoint-result.js.map +1 -1
  451. package/dist/sync-service/index.d.ts +1 -0
  452. package/dist/sync-service/index.d.ts.map +1 -1
  453. package/dist/sync-service/index.js +8 -1
  454. package/dist/sync-service/index.js.map +1 -1
  455. package/dist/sync-service/snapshot/types.d.ts +3 -2
  456. package/dist/sync-service/snapshot/types.d.ts.map +1 -1
  457. package/dist/util/generation-wait-timeout-error.d.ts +12 -0
  458. package/dist/util/generation-wait-timeout-error.d.ts.map +1 -0
  459. package/dist/util/generation-wait-timeout-error.js +16 -0
  460. package/dist/util/generation-wait-timeout-error.js.map +1 -0
  461. package/package.json +9 -13
  462. package/dist/ai-service/agent/tools/apis/sdk-root-documentation.d.ts +0 -20
  463. package/dist/ai-service/agent/tools/apis/sdk-root-documentation.d.ts.map +0 -1
  464. package/dist/ai-service/agent/tools/apis/sdk-root-documentation.js +0 -284
  465. package/dist/ai-service/agent/tools/apis/sdk-root-documentation.js.map +0 -1
  466. package/dist/migration-templates/app-fullstack/client/components/hooks/use-active-page.ts +0 -73
  467. package/dist/migration-templates/app-fullstack/client/components/ui/area-chart.tsx +0 -312
  468. package/dist/migration-templates/app-fullstack/client/components/ui/bar-chart.tsx +0 -264
  469. package/dist/migration-templates/app-fullstack/client/components/ui/code-block-content.tsx +0 -66
  470. package/dist/migration-templates/app-fullstack/client/components/ui/date-range-picker.tsx +0 -255
  471. package/dist/migration-templates/app-fullstack/client/components/ui/file-dropzone.tsx +0 -312
  472. package/dist/migration-templates/app-fullstack/client/components/ui/file-input.tsx +0 -105
  473. package/dist/migration-templates/app-fullstack/client/components/ui/icon.tsx +0 -120
  474. package/dist/migration-templates/app-fullstack/client/components/ui/image.tsx +0 -56
  475. package/dist/migration-templates/app-fullstack/client/components/ui/line-chart.tsx +0 -264
  476. package/dist/migration-templates/app-fullstack/client/components/ui/link.tsx +0 -119
  477. package/dist/migration-templates/app-fullstack/client/components/ui/pie-chart.tsx +0 -181
  478. package/dist/migration-templates/app-fullstack/client/components/ui/radar-chart.tsx +0 -252
  479. package/dist/migration-templates/app-fullstack/client/components/ui/radial-chart.tsx +0 -250
  480. package/dist/refactor/entities.d.ts +0 -6
  481. package/dist/refactor/entities.d.ts.map +0 -1
  482. package/dist/refactor/entities.js +0 -65
  483. package/dist/refactor/entities.js.map +0 -1
  484. package/dist/refactor/javascript.d.ts +0 -15
  485. package/dist/refactor/javascript.d.ts.map +0 -1
  486. package/dist/refactor/javascript.js +0 -283
  487. package/dist/refactor/javascript.js.map +0 -1
  488. package/dist/rename-manager.d.ts +0 -28
  489. package/dist/rename-manager.d.ts.map +0 -1
  490. package/dist/rename-manager.js +0 -161
  491. package/dist/rename-manager.js.map +0 -1
@@ -1,2 +1,2 @@
1
- export declare const content = "---\nname: superblocks-migration\ndescription: |\n Convert legacy Superblocks 2.0 YAML APIs (\"block-chain\" format) to the new 3.0 sdk-api TypeScript format.\n Load when executing a v2\u2192v3 migration turn \u2014 the runtime prompt will tell you to.\nreadOnly: true\nmetadata:\n author: superblocks\n version: \"1.0\"\n---\n\n# v2 \u2192 v3 API Translation\n\nYou are converting **legacy Superblocks \"block-chain\" YAML APIs** into the **new code-mode `@superblocksteam/sdk-api` TypeScript format**. Each YAML file under `scratch/v2-backup/apis/<ApiName>/api.yaml` must be emitted as a single TypeScript file at `server/apis/<ApiName>/api.ts` that compiles, typechecks, and preserves behavior exactly.\n\n## Meta-rule: ZERO judgment calls\n\nIf any situation below is not resolved deterministically by this document, **STOP** for that API. Do **not** pick a default. Do **not** guess a factory, a shape, or an import. Skip it, continue with other APIs, and mark the checklist item as `failed` via `build_manageChecklist` with a short `failureReason` describing the exact ambiguity (failing rule, block name if any, what would be needed to proceed). This rule overrides everything else.\n\nCorollary: do not add `// TODO` comments that silently ship. Unresolved items live only as `failed` checklist entries.\n\nCorollary for `migration_page_route_verification_*`: see the _Page route verification_ section below \u2014 screenshot timeout/error \u2192 `failed`, never `completed`, never \"verified via router/source inspection.\" The full rule (including the hard-rule restatements) lives there to avoid drift.\n\n## Inputs and outputs\n\n- **Source tree:** `scratch/v2-backup/apis/<ApiName>/api.yaml`. Discover the actual set by listing the directory \u2014 do not hardcode a count or list.\n- **Target tree:** `server/apis/<ApiName>/api.ts`. Do not create scaffolding trees that do not already exist (see \"Registry registration\" below).\n- **Checklist:** the migration checklist has already been seeded with one item per API (id `api_<ApiName>`, origin `2.0-upgrade`, status `pending`, `clearOnFinalize: false`). Legacy in-flight runs may still have `origin: \"seed_api\"` for these API items. Pull the live set by calling `build_manageChecklist` with `action: \"get\"` and filtering to `status: \"pending\"` plus API-migration origins (`origin: \"2.0-upgrade\"` or legacy `origin: \"seed_api\"`) \u2014 that is your authoritative API list and count for this turn.\n\n## Required reading (read these BEFORE writing any output)\n\nAuthoritative. If a rule here conflicts with your priors, these win.\n\n1. The installed SDK root documentation through `getSdkApiDocs` \u2014 call it with no arguments for the current section index, then retrieve every top-level section (following every `root.continuation`) so the full api() contract, execution model, `ctx.*`, exports, error classes, performance best practices, `useApi` frontend hook, and integration method table are covered without loading the whole README at once.\n2. `node_modules/@superblocksteam/sdk-api/src/index.ts` (the **barrel**) \u2014 the authoritative list of exported factory names. Integration factory names are whatever this file exports, not whatever the directory name is. Never invent or case-fold a factory name without confirming it here.\n3. Version-aware documentation for **every integration** referenced by the YAMLs you convert:\n - Call `getSdkApiDocs` with that integration's ID (or plugin ID when no integration ID is available).\n - If a vendor-specific factory exists for the target service (e.g., a dedicated one for a given LLM provider), prefer it over a generic HTTP one.\n4. `skills/system/superblocks-migration/references/yaml-block-mapping.md` \u2014 full YAML \u2192 TS mapping for each legacy block type.\n\nThere is **no `javascript` integration** in sdk-api \u2014 inline JS/TS lives directly inside `run(ctx, input)`. Any block whose YAML key is `javascript:` becomes plain TypeScript in `run()`. The same applies to **`python:` blocks**: there is no `python` integration in sdk-api, so port the body to inline TypeScript inside `run(ctx, input)` (see \"Substituting unsupported integrations\" below and the Python section in `yaml-block-mapping.md`).\n\n## Substituting unsupported integrations\n\nThe pre-migration UI warns the user when an app references integrations whose v2 plugin is not present in sdk-api. The migration is **not** aborted on those APIs \u2014 they are still in your `seed_api` checklist and you are expected to make a best-effort port rather than immediately marking them `failed`.\n\nSubstitution rules (apply in order; first match wins):\n\n1. **`python:` step \u2192 inline TypeScript.** Re-write the Python body as equivalent TypeScript inside `run(ctx, input)`, exactly the way `javascript:` blocks are inlined. Translate Python idioms to JS/TS (e.g. `requests.get(...)` \u2192 `fetch(...)`, list comprehensions \u2192 `array.map`/`filter`, `len(x)` \u2192 `x.length`, dict access \u2192 object property access, `os.environ[...]` \u2192 `process.env[...]`, raise/except \u2192 `throw`/`try\u2026catch`). If the Python relied on a third-party PyPI package with no obvious JS equivalent, mark that one API `failed` with a `failureReason` naming the package \u2014 do not ship a guess.\n2. **HTTP-shaped vendor plugin \u2192 REST.** If an unsupported integration was effectively making REST calls (e.g. a thin wrapper around an HTTP API) and you can read the request shape from the YAML, port it to the `restApi` factory from sdk-api (or the dedicated vendor factory if one exists in the barrel \u2014 check `node_modules/@superblocksteam/sdk-api/src/index.ts`).\n3. **Otherwise, mark `failed`.** Per the meta-rule, do not invent a factory or fabricate behavior. Use `build_manageChecklist` with `status: \"failed\"` and a concrete `failureReason` (e.g. `\"unsupported integration <pluginId> with no JS-equivalent path\"`).\n\nDo **not** silently skip a step or replace it with a `// TODO` \u2014 every API still needs a deterministic outcome (`completed` or `failed`) on the checklist.\n\n## Preflight gate (MUST pass before any file edits)\n\nComplete this orientation sequence before writing or modifying any API file:\n\n0. **Install recommended user dependencies (before API work).** The platform restructure already computed exactly which v2 user-added packages the migrated client/server code imports, and persisted them at `scratch/migration-state.json` \u2192 `recommendedUserDeps` (each entry has `name`, `version`, and `dev`). Your job is to install that list \u2014 not to recompute it.\n - Mark `migration_dependency_verification` as `in_progress` via `build_manageChecklist`.\n - Read `scratch/migration-state.json` and extract `recommendedUserDeps`.\n - If `recommendedUserDeps` is missing or empty, mark `migration_dependency_verification` as `completed` and continue to step 1.\n - Otherwise, call `build_installPackages` **once** with every entry from `recommendedUserDeps` (passing `name`, `version`, and `dev` through unchanged). Do **not** skip because `node_modules` exists on disk; the platform never wrote these packages into `package.json`.\n - **Failure semantics (covers every non-success outcome \u2014 no judgment calls):**\n - On full success \u2192 mark `migration_dependency_verification` as `completed`.\n - On **any** failure \u2014 full, partial (some packages installed, others did not), structured registry error (`not_in_registry`, `registry_auth_failed`, `registry_unreachable`), or unstructured error \u2014 mark `migration_dependency_verification` as `failed` with a `failureReason` that lists the affected package names and the tool's verbatim error code or message. Treat partial success the same as full failure for checklist purposes; do not split into multiple checklist items. Then continue to step 1 so API translation can still proceed. The user/operator will repair the registry/packages and re-trigger the migration turn.\n - If `scratch/migration-state.json` also contains `recommendedUserDepsPinnedToLatest` (a string array of package names), include those names in the `failureReason` of `migration_dependency_verification` even on full success \u2014 phrased as \"pinned to latest, may need user confirmation: <names>\" \u2014 so the user can downgrade them before runtime if the latest major is incompatible. Use status `completed` in this case (the install succeeded), but the surfaced reason gives the user a checkpoint to act on.\n - Do **not** scan imports yourself, edit `package.json`, or add packages outside `recommendedUserDeps`. If you believe a package is missing from the list, that is a platform bug: mark `migration_dependency_verification` as `failed` with `failureReason: \"platform bug: <pkg> imported by <file> but absent from recommendedUserDeps\"` and continue with API work using the packages that did install. (`build_manageChecklist` has no `note` action \u2014 `failed` with a structured `failureReason` is the only way to record this.)\n1. Call `build_manageChecklist` with `action: \"get\"` and filter to `status: \"pending\"` and API-migration origins (`origin: \"2.0-upgrade\"` or legacy `origin: \"seed_api\"`) \u2014 this is your authoritative API list and count for this turn.\n2. Read `node_modules/@superblocksteam/sdk-api/src/index.ts` and treat it as the **only** source of truth for sdk-api export/factory names.\n3. Call `getSdkApiDocs()` for the installed root README index, then retrieve every top-level section and follow every continuation before editing. This is the progressive equivalent of reading the whole root README.\n4. For each API, call `getSdkApiDocs` only for the integration(s) needed by that API right before migrating it (just-in-time). Do **not** preload every integration's documentation for the entire app.\n\nHard constraints:\n\n- Do **not** rely on prior conversation memory, \"knowledge\" summaries, or inferred export names.\n- Do **not** start editing API files until preflight steps 0\u20133 are complete.\n- If required documentation cannot be retrieved, mark that API's checklist item `failed` with a concrete `failureReason` that names the failed `getSdkApiDocs` selector or integration ID.\n\n## File layout & exports\n\n- One API per file, default export: `export default api({ ... });`.\n- Use ESM-style relative `.js` specifiers in imports.\n- File path: `server/apis/<ApiName>/api.ts` where `<ApiName>` is the YAML `metadata.name` (for example, `GetFloors` \u2192 `server/apis/GetFloors/api.ts`).\n- The `api({ name })` string and the registry key must both equal the YAML `metadata.name` verbatim \u2014 frontends call `useApi(\"<metadata.name>\")`.\n\n### Registry registration (conditional)\n\n- If `server/apis/index.ts` exists in the target tree: add an import + entry for each new module. Do not reorder existing entries.\n- If it does **not** exist: do **not** create it, do not create scaffolding. Mark the checklist item `failed` with a `failureReason` noting the missing registry.\n\n## Critical rules\n\n1. **Integration IDs are opaque per-YAML.** Extract each distinct `step.integration` UUID to a named `const` at the top of the file. Never carry UUIDs across files.\n2. **SQL: parameterize always.** Zero `${\u2026}` interpolations may remain inside any SQL string. Dynamic lists use `= ANY($N::<type>[])` \u2014 never string-building `IN (\u2026)`.\n3. **`query` vs `execute`.** Rows returned \u2192 `query` with Zod schema. Nothing actionable \u2192 `execute`.\n4. **Output shape preservation.** Mirror the legacy API's externally-visible response exactly \u2014 shape, nullability, cardinality. Do not wrap in envelopes.\n5. **Default is sequential.** `TYPE_FOREACH` \u2192 `for ... of` with sequential `await`. `Promise.all` only when YAML explicitly used a `parallel:` block.\n6. **Determinism, no slop.** No retries, no caching, no extra logging beyond a single `ctx.log.info(\"<ApiName> start\", {...})` at the top of `run`. No narrative code comments.\n7. **Never invent client methods.** If the integration README only documents `apiRequest`, use `apiRequest`.\n\n## Security / user identity\n\n- `authorization.type: AUTHORIZATION_TYPE_APP_USERS` is enforced by the server; rely on `ctx.user` in TS.\n- If the YAML accepts `userId` / `email` / etc. as API input, remove that input and read from `ctx.user` instead.\n\n## Observability\n\n- One `ctx.log.info(\"<ApiName> start\", { <safe-ids> })` at the top of `run` is allowed. Never log secrets, tokens, or PII.\n\n## Verification before you hand off\n\nRuntime verification (required):\n\n1. `build_debug` passing is required but not sufficient. Do not treat compile/typecheck success as proof that runtime behavior is correct.\n2. Use risk-based runtime checks: run `testApi` for APIs with integrations (REST/vendor/SQL), multi-step control flow, transformed outputs, or any uncertainty. For obviously simple APIs, you may skip `testApi`.\n3. If `testApi` output appears stale or mismatched, run `build_reloadFile` once and re-test. If runtime still fails after documented-method verification + one reload/retest cycle, record a concrete `failureReason` and continue.\n\nPage route verification (required once per migration run):\n\n**Hard rule:** A route is verified only with **runtime visual evidence on that exact path**. Reading `client/router.tsx`, page source, or backup artifacts is orientation only \u2014 it **never** satisfies verification.\n\n**Hard rule:** `build_debug` passing and `get_runtime_errors` returning `count: 0` are **not sufficient** for route verification. Do not mark routes `completed` because \"only APIs changed\" or \"the frontend files are unchanged.\"\n\n**Hard rule:** If `build_captureScreenshot` errors or times out for a route, mark that `migration_page_route_verification_*` item `failed` with `failureReason` naming the path and outcome (prefix `page_route_screenshot_timeout:` or `page_route_screenshot_error:`). Do **not** mark `completed`. Do **not** substitute router/source inspection.\n\n### Evidence required per route\n\nMark `completed` only when **all** are true:\n\n1. The app preview is on **that route's path** (not merely the default route).\n2. `build_captureScreenshot` **succeeds** and returns an image you inspect.\n3. You **describe** what you see and confirm it is not a loading-only view (follow the screenshot tool's skeleton/spinner retry procedure first).\n4. Any route-specific runtime errors are resolved (re-check after fixes).\n\n### Procedure (one route at a time)\n\n1. Enumerate checklist items whose IDs start with `migration_page_route_verification_`.\n2. Enumerate paths from `scratch/v2-backup/router.tsx` (fallback: `scratch/v2-backup/pages/**/index.tsx` confirmed against `client/router.tsx`).\n3. For each route: set the matching item `in_progress` \u2192 `build_navigatePreview` with that path \u2192 `build_captureScreenshot` \u2192 on success, `completed`.\n4. If the preview looks stale, `build_reloadFile` **once**, then retry screenshot. If capture still fails, `failed` with `failureReason` as above.\n5. Fix import/lazy-load/runtime failures, then repeat from step 3 for that route.\n\n### Forbidden shortcuts\n\n- Marking `completed` because `client/router.tsx` lists the path\n- Marking `completed` because the page module exists under `client/pages/`\n- Marking `completed` after screenshot timeout/error\n- Batch-marking all route items without per-route screenshot evidence\n\nFor each converted API, self-check:\n\n1. File default-exports exactly one `api({...})`; `name` matches `metadata.name`.\n2. Zero `${\u2026}` interpolations remain in any SQL string.\n3. No SQL `IN (\u2026)` built by concatenation; dynamic lists use `= ANY($N::<type>[])`.\n4. Every prior block's `.output` read is replaced by an actual result `const`.\n5. Input is the minimal union of identifiers the YAML references that are not produced by earlier blocks or `Variables`.\n6. Output shape exactly mirrors the legacy API's external response.\n7. If `server/apis/index.ts` exists, it registers the new module under `metadata.name`.\n8. **sdk-api integration wiring:** declare each integration in an `integrations: { \u2026 }` block and call it via `ctx.integrations.<key>` \u2014 never call `postgres(ID)` / `github(ID)` / etc. inside `run()` as if they were clients.\n9. **`input` / `output` schemas:** both are Zod schemas (`input: z.object({\u2026})`, `output: z.\u2026`). Do not use plain `{ field: { type: \"string\" } }` objects.\n10. **`run` signature:** `async run(ctx, input)` (or destructured input fields as the second argument). Never import `ctx` from the module scope.\n\n## Parallelization policy\n\nCount pending APIs from the checklist (`build_manageChecklist` `action: \"get\"`, filter `status: \"pending\"` and API-migration origins: `origin: \"2.0-upgrade\"` or legacy `origin: \"seed_api\"`).\n\n- **If the pending count is `< 8`:** migrate the APIs yourself, sequentially. Do NOT call `spawnCodingSubagents`. Work through each API using the per-API procedure below.\n- **If the pending count is `>= 8`:** you **MUST spawn sub-agents** to migrate these APIs in parallel. There are too many APIs to migrate sequentially yourself. Do NOT attempt to migrate APIs yourself in this run \u2014 use `spawnCodingSubagents`.\n - Split pending APIs into batches of ~5 (aim for 4\u20135 per batch; 4 workers \u00D7 5 APIs = 20, the hard cap), with a hard cap of **4 sub-agents** and **20 APIs** in this spawn. If more APIs remain pending, leave them for a **later spawn round** after this one returns \u2014 never enlarge a worker's share.\n - The spawn tool will reject oversized batches and will refuse to fan out under heap pressure. If it errors because the batch is too large, shrink the batch and retry. If it refuses because of heap pressure, do not retry spawn in this turn \u2014 wait for a later turn after memory has dropped. Do not fall back to migrating remaining APIs yourself while the pending count is still \u2265 8.\n - For each batch, craft an `instructions` string that:\n - Names the exact `<ApiName>` values that sub-agent owns, verbatim, as a bulleted list.\n - **Directs the sub-agent to `build_readFile` `skills/system/superblocks-migration/SKILL.md` (and the integration README(s) for the APIs it owns) before writing any files.** Do not inline a shortened sdk-api contract \u2014 keep a single source of truth.\n - Restates the per-API procedure below so the sub-agent is self-contained.\n - Reminds the sub-agent to update the shared checklist (id `api_<ApiName>`) for every item it owns.\n - **Restates the vacuous-pass rule and the sentinel explicitly**: the sub-agent must apply the `passed` outcome's vacuous-pass check itself (source real inputs before accepting a sad-path-only pass), and when it marks an API `completed` on an exhausted sourcing attempt it MUST set `failureReason` to `vacuous_pass_accepted: <reason>`. This is the only signal that reaches you \u2014 you run the final sweep without the sub-agents' chat context, so an unflagged vacuous pass is invisible to you.\n - **Also pass `apiNames: [\"<ApiName1>\", \"<ApiName2>\", \u2026]` for every sub-agent**, listing the same names that appear in its `instructions`. The spawn tool stamps each `api_<ApiName>` checklist item with that sub-agent's `id` as `workerId` BEFORE fan-out, which lets the migration UI render one batch row per sub-agent in the chat sidebar. Forgetting `apiNames` is non-fatal (the sub-agents still run) but the sidebar checklist will fall back to one row per API instead of one per batch.\n - **Call `spawnCodingSubagents` as the ONLY tool call in that turn.** Do not emit any other tool calls alongside it \u2014 no reads, no writes, no checklist updates. The tool blocks until every sub-agent finishes; you cannot do migration work \"while waiting\" because there is no waiting from your perspective \u2014 your next turn only begins after the tool returns. If you emit other tool calls in the same turn, you and the sub-agents will race on the shared checklist and corrupt state.\n - **After `spawnCodingSubagents` returns** \u2014 only in a subsequent turn \u2014 read the checklist via `build_manageChecklist` with `action: \"get\"`. For any `failed` items, review the `failureReason`. Retry small numbers of recoverable failures yourself (sequentially, using the per-API procedure below). Leave deterministic failures as `failed`. Then re-count pending APIs; if any remain, repeat this batching step with another `spawnCodingSubagents` call. Do not proceed to the final sweep until every API item is `completed` or `failed`.\n\n## Per-API procedure\n\nFor APIs you migrate yourself, or that you embed in a sub-agent's `instructions`:\n\n1. Call `build_manageChecklist` with `action: \"update\"`, `itemId: \"api_<ApiName>\"`, `status: \"in_progress\"`.\n2. Read `scratch/v2-backup/apis/<ApiName>/api.yaml` and any sibling files the blocks reference.\n3. Produce the TypeScript module at `server/apis/<ApiName>/api.ts`, overwriting the stub. Use the YAML block \u2192 TS mapping in `skills/system/superblocks-migration/references/yaml-block-mapping.md`.\n4. If `server/apis/index.ts` exists, update it to register the new module.\n5. Call `build_debug`. If it fails, fix and repeat until it passes. Do not proceed to step 6 until `build_debug` succeeds.\n6. **Call `runMigrationVerification({ apiName: \"<ApiName>\", inputs: <inputs> })` and resolve every divergence in this same chat.** The tool's response includes `attempt` and `maxAttempts` so you don't need to track an attempt counter yourself \u2014 the server reads it from on-disk history per API.\n\n Your job is to make v3 produce the same response as v2 \u2014 not to \"try a few times and punt to the user\". The user already lived with this API working on v2 with their real data; if v3 doesn't match, that's a regression you introduced, and you fix it here. NEVER leave a `diverged` API for the user to \"Accept divergence\" or \"Try one more attempt\" via the API calls panel \u2014 those buttons exist as escape hatches for situations the policy gate requires (mutations, denied integrations), not as a way for you to skip work.\n\n Synthesize `inputs` the same way you would for `testApi`. Inspect the v2 YAML from step 2 (`apiInputs` / externally-declared parameters) and the v3 TS from step 3 (`input` schema on `run(ctx, input)`). Every name the caller must supply must appear as a top-level key in `inputs` with a realistic value \u2014 a mock, or a real value harvested per the \"Sourcing input values\" rules below \u2014 matching its expected type. This includes two categories \u2014 do not conflate them:\n - **API parameters** \u2014 names declared in `apiInputs` (v2) or the v3 `input` shape (e.g. `sourceContext`, `currentDocument`, `messages`). Pass each parameter name directly as a key in `inputs`. These are what the frontend passes when it invokes the API; they are not unavailable \"runtime bindings.\"\n - **UI bindings and caller context** \u2014 values the API reads from the app that are not API parameters (component values like `Input1.value`/`Select1.selectedItem.id`, table selections like `Table1.selectedRow`, state variables, workflow `body`/`params` not declared as `apiInputs`). Mock each binding the API references that isn't produced by an earlier block.\n\n Both v2 and v3 receive the same `inputs`, so this is what makes the diff meaningful \u2014 `{}` for an API that expects parameters or bindings produces a vacuous `both_failed` that tells you nothing. Errors like `'sourceContext' is not defined` (v2) or v3 input-validation failures for missing required fields mean you omitted keys from `inputs`; synthesize mocks and retry. That is not an environmental failure.\n\n **Sourcing input values \u2014 real app data over invented data.** A value is only \"realistic\" if the system the API talks to actually accepts it. Invented values are fine for self-contained inputs (a search string, a page size, a boolean flag). But when an input must reference something that already exists \u2014 any key the target system looks up, such as a row/record ID, a resource name, or an uploaded-file reference \u2014 do NOT invent it: an invented identifier either fails on both sides or exercises only the not-found/guard-clause path, and neither proves the API works. Source a real value instead, in this order:\n 1. **Harvest from the app's own APIs.** Find a read-only API in this app (prefer zero-input \"list\"/\"get all\" APIs) whose output contains the identifier you need, run it via `testApi`, and take a value from its real response. Chain as needed: a list API yields a real ID \u2192 pass it to the detail API \u2192 its response yields the next identifier. Prefer migrating and verifying zero-input read-only APIs first so their outputs become your pool of real test data.\n 2. **Follow the client code.** The `useApi`/`useApiData`/`executeApi` call sites under `client/` (and the v2 pages under `scratch/v2-backup/`) show where the app gets each input \u2014 a table's selected row, a route param, a select populated by another API. Trace that source to a concrete real value.\n 3. Only if neither path yields a value, fall back to an invented mock \u2014 and treat any resulting not-found/empty output as unverified (see the vacuous-pass rule under `passed` below).\n\n Outcomes and how to resolve them:\n - **`passed`**: `passed` only proves v2 and v3 agree on the inputs you supplied. Before accepting it, check what actually ran: if the shared output is a sad-path/guard-clause result \u2014 a not-found or error object from a caught exception, a validity flag that came back false, an empty result from a lookup that should have matched \u2014 the API's core logic never executed and the pass is vacuous. In that case source real inputs (per the sourcing rules above) and re-run `runMigrationVerification`; only accept a sad-path-only pass after the sourcing steps genuinely produced no usable value. Once a non-vacuous `passed` is in hand, call `build_manageChecklist` with `status: \"completed\"`. Done. If instead you are marking `completed` on an exhausted sourcing attempt (the pass stayed vacuous), you MUST also set `failureReason` to a string beginning `vacuous_pass_accepted:` followed by a one-line reason \u2014 this sentinel is the only durable signal that survives into the final sweep (and across sub-agents, whose chat context the orchestrator cannot see).\n\n **Platform gate:** the checklist store rejects `status: \"completed\"` on `api_<ApiName>` items until verification has run at least once (`lastVerificationAt` is set \u2014 normally via this tool). You cannot bulk-mark APIs complete without calling `runMigrationVerification` per API.\n - **`skipped_mutation`**: the runtime marks the checklist item `completed` with `verificationSkippedReason: \"mutation\"` automatically. Do **NOT** keep it `in_progress` or ask the user a grouped decision. Continue translating each API as well as you can from the code; the user will verify mutation-skipped APIs manually at finalize time.\n\n - **`v2_unrunnable`**: the v2 backup itself couldn't execute, so there is no baseline to match. Call `build_manageChecklist` with `status: \"completed\"` and continue.\n\n - **`timeout`**: a pipeline stalled past the reporting timeout (`side` says which one). This is transient environment noise \u2014 a dropped editor connection or a backgrounded browser tab \u2014 NOT evidence about the API. Do **NOT** mark the item `completed`. Retry `runMigrationVerification` after finishing your current API. If it times out repeatedly, tell the user verification is stalling (likely tab backgrounded / connection dropped), ask them to keep the app tab focused, and retry \u2014 never convert repeated timeouts into `completed`.\n\n - **`disconnected`**: the editor connection was down when the pipeline tried to run (`side` says which one) \u2014 the app tab is closed, backgrounded, or reconnecting. Unlike `timeout` this diagnosis is certain, and it says nothing about the API. Do **NOT** mark the item `completed`. Tell the user the app tab must stay open and focused during verification, then retry `runMigrationVerification` \u2014 never convert `disconnected` into `completed`.\n\n - **`both_failed`**:\n - If you passed `inputs: {}` or omitted declared API parameters / bindings: synthesize real `inputs` (per the bullet above) and retry. Do NOT mark completed here \u2014 missing inputs caused this, not a real failure.\n - If the error names a symbol that appears in `apiInputs` or the v3 `input` schema: add that key to `inputs` with a realistic mock and retry. Do NOT classify this as environmental \u2014 the parameter is available; you did not supply it.\n - If you passed real inputs and v2 still failed: read v2's error. If it is environmental (auth/credentials/integration-unavailable: \"no integration configured\", \"401\", \"ECONNREFUSED\", \"missing API key\"), v2 cannot run in this verification context regardless of what you do \u2014 call `build_manageChecklist` with `status: \"completed\"` and continue; the user will verify manually. If it's a v2 runtime error that v3 also reproduces, treat as `diverged` (your inputs are wrong, or the API expects state that isn't reproducible here \u2014 revise inputs and retry).\n\n - **`error`**: a system error in the verification flow itself (cannot read v3 source, etc.). Fix what you can; if it persists across one retry, mark the item `failed` with `failureReason: \"<error detail>\"` and continue.\n\n- **`diverged`**: the API ran on both sides and the outputs differ. **Iterate until v3 matches v2 byte-for-byte (modulo the normalizations api-comparator already applies: identical ISO timestamps, near-now ISO timestamps within \u00B160s of each other and \u00B15min of \"now\", UUIDs, monotonic integer IDs differing by \u22641 on fields whose leaf ends with \"id\", floats within 1e-9 relative tolerance, and per-request opaque identifiers at leaves named `requestId`/`traceId`/`spanId`/`correlationId`/`sessionId`/`nonce`/`csrfToken`/`_id` \u2014 note: a bare leaf named `token` is intentionally NOT normalized, since auth/access-token divergence is a security-relevant signal we want to surface).**\n\n There is one bounded judgment exception: if both v2 and v3 executions succeeded, the output shape/types are equivalent, and the remaining diffs are value-level fields you reasonably infer are inherently non-deterministic outputs for this API, treat the migration as semantically complete for this run. In that case, mark the checklist item `completed` and continue.\n\n Use this exception only when all of the following are true:\n - The divergence is not structural (no missing/extra fields, no type mismatch, no changed nesting/cardinality, no changed error/status behavior).\n - The differing fields are expected to vary per invocation and do not change control flow decisions.\n - The API's functional contract remains intact for downstream consumers.\n\n If any of those conditions are not met, the divergence is semantic and must be fixed \u2014 do NOT add code purely to mask values the comparator already tolerates.\n\n For each `summaryForAgent` entry \u2014 every entry names the JSON path that diverged and the v2/v3 values \u2014 find the block in `server/apis/<ApiName>/api.ts` that produces that path and fix the discrepancy. Common causes, in rough order of frequency:\n - wrong column projection or missing field in a SELECT\n - missing transform / output shape mismatch (array vs object wrapper, single vs list)\n - off-by-one or wrong placeholder in a SQL parameter\n - mistyped binding key (case, plural, dotted path)\n - type coercion (string vs number, null vs undefined, boolean vs \"true\")\n - missing default value when the binding is undefined\n - wrong join order or implicit ordering of rows\n - filter/where condition different from v2\n - missing `LIMIT`, `OFFSET`, or pagination handling\n\n If a divergence stems from the `inputs` you passed (e.g. v2 echoes the input one way and v3 a different way because they normalize it differently), revise the inputs alongside the source.\n\n Then call `build_debug` (fix any failures), then `runMigrationVerification` again with the revised source/inputs.\n\n **There is no fixed retry budget \u2014 iterate until `passed` or until you have firm structural evidence that no v3 source change can reconcile v2 and v3.** Acceptable evidence for stopping: v2 references a YAML construct with no v3 SDK equivalent and the divergence is in that construct; v2 derives a value from runtime state v3 cannot observe (e.g. an env var that differs by environment). When you stop on structural grounds, mark the item `failed` with `failureReason: \"verification_diverged_irreconcilable: <one-paragraph reason naming the specific summaryForAgent entry and the structural reason> | summary: <JSON.stringify(summaryForAgent)>\"`.\n\n Guardrail against infinite loops (NOT a retry budget): if you have iterated 8 times on the same API and the set of divergences has not materially changed across the last 3 attempts (i.e. you are flailing, not converging), stop and mark `failed` with the same `failureReason` shape. If you ARE converging \u2014 fewer divergences each attempt, or the remaining ones look smaller \u2014 keep going past 8.\n\n## Run-level rules\n\n- Do NOT emit a free-text UNRESOLVED report \u2014 every unresolved item must be a `failed` checklist entry with a `failureReason`.\n- Do NOT stop the run because one API failed. Only stop once every API is either `completed` or `failed`.\n\n## Updating integration write policy (Clark-only, with user consent)\n\nDuring migration, integration write policy (`allow` / `deny` per integration UUID) lives in `scratch/migration-state.json` \u2192 `integrationWritePolicy`. The pre-migration modal sets it once; **there is no mid-migration UI for the user to change it.**\n\n- **Only Clark can update write policy mid-migration**, and only when the user **explicitly asks** (e.g. \"test this API even though I set Don't test\", \"go ahead and run writes against Postgres\").\n- **Never** tell the user to update write policy in the UI \u2014 they cannot.\n- **Never** hand-edit `scratch/migration-state.json` with `build_writeFile` / `build_editFile` to change write policy. Use `updateMigrationWritePolicy` instead; it validates input and shows a permission card when granting `allow`.\n- To find integration ids: read the `const` UUID at the top of `server/apis/<ApiName>/api.ts`, or read existing keys from `scratch/migration-state.json` \u2192 `integrationWritePolicy`.\n- After updating policy to `allow` (with user approval), call `testApi` or `runMigrationVerification` again for the affected APIs.\n\nIf `testApi` is blocked by access control because an integration is still `deny`, explain that the user previously chose \"Don't test\" for that integration and ask whether they want you to update the policy and retry \u2014 do not suggest they change settings in the UI.\n\n## User-reported manual verification\n\nSome APIs are marked `completed` without automatic testing \u2014 write-policy \"Don't test\" (`verificationSkippedReason: \"mutation\"`) or a `testApi` permission denial (`verificationSkippedReason: \"testing_denied\"`). The user is expected to verify these by using the app themselves.\n\n### When the user asks how to test a skipped API\n\nIf the user requests manual test instructions for a specific API (including when the UI sends a prompt referencing `skills/system/migration-api-verification/SKILL.md`):\n\n1. Read `skills/system/migration-api-verification/SKILL.md` and follow it.\n2. Produce UI click-through steps for that API \u2014 do **NOT** call `testApi` or `runMigrationVerification`.\n\n### When the user confirms they verified an API\n\nIf the user tells you they have checked such an API and it works (e.g. \"I clicked through the app and GetOrders works, mark it complete\"), call `markApiManuallyVerified({ apiName })`. Do **NOT** call `testApi` or `runMigrationVerification` for it \u2014 the user opted out of automatic testing. This records the API as user-verified so it no longer appears in the list of APIs needing manual verification.\n\nIf the user instead asks you to **test** a denied or skipped API (not merely confirm they tested it manually), call `updateMigrationWritePolicy` first to grant `allow` for the relevant integration ids, then run `testApi` or `runMigrationVerification`.\n\n## Post-batch re-verification\n\nAfter `spawnCodingSubagents` returns (or after all sequential APIs are settled), before updating the checklist overall status:\n\n1. Call `build_manageChecklist` with `action: \"get\"` and read all items.\n2. For any item where `verificationOutcome === \"auto_passed\"` and `lastVerificationAt` is older than any sibling item's `updatedAt` minus 60 seconds: this item may have drifted due to registry edits made by later sub-agents. Re-run `runMigrationVerification({ apiName, inputs: <inputs> })` for each such item \u2014 synthesize `inputs` the same way as in step 6 of the per-API procedure, including the \"Sourcing input values\" rule (harvest real IDs from the app's read-only APIs; do not invent identifiers).\n3. If any re-verification produces `diverged`, apply the normal per-API diverge\u2192retry loop (no fixed retry budget; iterate until `passed` or firm structural-irreconcilability evidence, with the anti-flail guardrail at 8 iterations without convergence).\n4. Proceed to mark overall checklist completed/failed only after all re-verifications settle and the final sweep below is done.\n\n## Final sweep: retry unverified happy paths with real app data (required once per run)\n\nIf your closing summary would say \"I could not verify the happy path for X\" \u2014 that sentence is a trigger to do more work, not a conclusion to hand the user. Before marking the overall checklist completed/failed, do one last pass:\n\n1. From the checklist, collect every API that (a) is `failed` or unresolved because its test never succeeded, or (b) was marked `completed` but carries the `vacuous_pass_accepted:` sentinel in `failureReason` (set by you or by a sub-agent when a sad-path-only pass was accepted after exhausting sourcing).\n\n Note on the parallel path: for APIs a sub-agent migrated, you cannot see its chat context or reconstruct its verification outputs \u2014 `verificationOutcome` records only the outcome type (`auto_passed`), not whether the pass was vacuous. The `vacuous_pass_accepted:` sentinel is therefore the ONLY way a sub-agent's vacuous pass surfaces here; APIs a sub-agent completed without it are treated as genuinely verified. This is why the sub-agent `instructions` MUST restate the vacuous-pass rule and the sentinel (see Parallelization policy). If you have specific reason to distrust a sub-agent's `completed` items (e.g. its batch reported many `both_failed` retries), re-verify them here with harvested real inputs rather than trusting the bare `completed`.\n\n2. For each, harvest real inputs from the app itself per the \"Sourcing input values\" rule in the per-API procedure: run the app's read-only APIs via `testApi` (zero-input list APIs first) and chain their real outputs into the inputs of the API under test.\n3. Re-run `runMigrationVerification` with those real inputs and resolve the outcome per the normal per-API rules.\n4. Only APIs whose sourcing steps genuinely produced no usable value (or whose failures are environmental per the `both_failed` rules) may finish the run without a happy-path verification \u2014 and each needs a `failureReason` or verification record saying so.\n";
1
+ export declare const content = "---\nname: superblocks-migration\ndescription: |\n Convert legacy Superblocks 2.0 YAML APIs (\"block-chain\" format) to the new 3.0 sdk-api TypeScript format.\n Load when executing a v2\u2192v3 migration turn \u2014 the runtime prompt will tell you to.\nreadOnly: true\nmetadata:\n author: superblocks\n version: \"1.0\"\n---\n\n# v2 \u2192 v3 API Translation\n\nYou are converting **legacy Superblocks \"block-chain\" YAML APIs** into the **new code-mode `@superblocksteam/sdk-api` TypeScript format**. Each YAML file under `scratch/v2-backup/apis/<ApiName>/api.yaml` must be emitted as a single TypeScript file at `server/apis/<ApiName>/api.ts` that compiles, typechecks, and preserves behavior exactly.\n\n## Meta-rule: ZERO judgment calls\n\nIf any situation below is not resolved deterministically by this document, **STOP** for that API. Do **not** pick a default. Do **not** guess a factory, a shape, or an import. Skip it, continue with other APIs, and mark the checklist item as `failed` via `build_manageChecklist` with a short `failureReason` describing the exact ambiguity (failing rule, block name if any, what would be needed to proceed). This rule overrides everything else.\n\nCorollary: do not add `// TODO` comments that silently ship. Unresolved items live only as `failed` checklist entries.\n\nCorollary for `migration_page_route_verification_*`: see the _Page route verification_ section below \u2014 screenshot timeout/error \u2192 `failed`, never `completed`, never \"verified via router/source inspection.\" The full rule (including the hard-rule restatements) lives there to avoid drift.\n\n## Inputs and outputs\n\n- **Source tree:** `scratch/v2-backup/apis/<ApiName>/api.yaml`. Discover the actual set by listing the directory \u2014 do not hardcode a count or list.\n- **Target tree:** `server/apis/<ApiName>/api.ts`. Do not create scaffolding trees that do not already exist (see \"Registry registration\" below).\n- **Checklist:** the migration checklist has already been seeded with one item per API (id `api_<ApiName>`, origin `2.0-upgrade`, status `pending`, `clearOnFinalize: false`). Legacy in-flight runs may still have `origin: \"seed_api\"` for these API items. Pull the live set by calling `build_manageChecklist` with `action: \"get\"` and filtering to `status: \"pending\"` plus API-migration origins (`origin: \"2.0-upgrade\"` or legacy `origin: \"seed_api\"`) \u2014 that is your authoritative API list and count for this turn.\n\n## Required reading (read these BEFORE writing any output)\n\nAuthoritative. If a rule here conflicts with your priors, these win.\n\n1. The installed SDK root documentation through `getSdkApiDocs`. The first call of the session (preflight step 3) returns the complete shared README. Read all of it so the full api() contract, execution model, `ctx.*`, exports, error classes, performance best practices, `useApi` frontend hook, and integration method table are covered.\n2. `node_modules/@superblocksteam/sdk-api/src/index.ts` (the **barrel**) \u2014 the authoritative list of exported factory names. Integration factory names are whatever this file exports, not whatever the directory name is. Never invent or case-fold a factory name without confirming it here.\n3. Version-aware documentation for **every integration** referenced by the YAMLs you convert:\n - Call `getSdkApiDocs` with that integration's ID (or plugin ID when no integration ID is available).\n - If a vendor-specific factory exists for the target service (e.g., a dedicated one for a given LLM provider), prefer it over a generic HTTP one.\n4. `skills/system/superblocks-migration/references/yaml-block-mapping.md` \u2014 full YAML \u2192 TS mapping for each legacy block type.\n\nThere is **no `javascript` integration** in sdk-api \u2014 inline JS/TS lives directly inside `run(ctx, input)`. Any block whose YAML key is `javascript:` becomes plain TypeScript in `run()`. The same applies to **`python:` blocks**: there is no `python` integration in sdk-api, so port the body to inline TypeScript inside `run(ctx, input)` (see \"Substituting unsupported integrations\" below and the Python section in `yaml-block-mapping.md`).\n\n## Substituting unsupported integrations\n\nThe pre-migration UI warns the user when an app references integrations whose v2 plugin is not present in sdk-api. The migration is **not** aborted on those APIs \u2014 they are still in your `seed_api` checklist and you are expected to make a best-effort port rather than immediately marking them `failed`.\n\nSubstitution rules (apply in order; first match wins):\n\n1. **`python:` step \u2192 inline TypeScript.** Re-write the Python body as equivalent TypeScript inside `run(ctx, input)`, exactly the way `javascript:` blocks are inlined. Translate Python idioms to JS/TS (e.g. `requests.get(...)` \u2192 `fetch(...)`, list comprehensions \u2192 `array.map`/`filter`, `len(x)` \u2192 `x.length`, dict access \u2192 object property access, `os.environ[...]` \u2192 `process.env[...]`, raise/except \u2192 `throw`/`try\u2026catch`). If the Python relied on a third-party PyPI package with no obvious JS equivalent, mark that one API `failed` with a `failureReason` naming the package \u2014 do not ship a guess.\n2. **HTTP-shaped vendor plugin \u2192 REST.** If an unsupported integration was effectively making REST calls (e.g. a thin wrapper around an HTTP API) and you can read the request shape from the YAML, port it to the `restApi` factory from sdk-api (or the dedicated vendor factory if one exists in the barrel \u2014 check `node_modules/@superblocksteam/sdk-api/src/index.ts`).\n3. **Otherwise, mark `failed`.** Per the meta-rule, do not invent a factory or fabricate behavior. Use `build_manageChecklist` with `status: \"failed\"` and a concrete `failureReason` (e.g. `\"unsupported integration <pluginId> with no JS-equivalent path\"`).\n\nDo **not** silently skip a step or replace it with a `// TODO` \u2014 every API still needs a deterministic outcome (`completed` or `failed`) on the checklist.\n\n## Preflight gate (MUST pass before any file edits)\n\nComplete this orientation sequence before writing or modifying any API file:\n\n0. **Install recommended user dependencies (before API work).** The platform restructure already computed exactly which v2 user-added packages the migrated client/server code imports, and persisted them at `scratch/migration-state.json` \u2192 `recommendedUserDeps` (each entry has `name`, `version`, and `dev`). Your job is to install that list \u2014 not to recompute it.\n - Mark `migration_dependency_verification` as `in_progress` via `build_manageChecklist`.\n - Read `scratch/migration-state.json` and extract `recommendedUserDeps`.\n - If `recommendedUserDeps` is missing or empty, mark `migration_dependency_verification` as `completed` and continue to step 1.\n - Otherwise, call `build_managePackages` **once** with `action` `install` and every entry from `recommendedUserDeps` in `packages` (passing `name`, `version`, and `dev` through unchanged). Do **not** skip because `node_modules` exists on disk; the platform never wrote these packages into `package.json`.\n - **Failure semantics (covers every non-success outcome \u2014 no judgment calls):**\n - On full success \u2192 mark `migration_dependency_verification` as `completed`.\n - On **any** failure \u2014 full, partial (some packages installed, others did not), structured registry error (`not_in_registry`, `registry_auth_failed`, `registry_unreachable`), or unstructured error \u2014 mark `migration_dependency_verification` as `failed` with a `failureReason` that lists the affected package names and the tool's verbatim error code or message. Treat partial success the same as full failure for checklist purposes; do not split into multiple checklist items. Then continue to step 1 so API translation can still proceed. The user/operator will repair the registry/packages and re-trigger the migration turn.\n - If `scratch/migration-state.json` also contains `recommendedUserDepsPinnedToLatest` (a string array of package names), include those names in the `failureReason` of `migration_dependency_verification` even on full success \u2014 phrased as \"pinned to latest, may need user confirmation: <names>\" \u2014 so the user can downgrade them before runtime if the latest major is incompatible. Use status `completed` in this case (the install succeeded), but the surfaced reason gives the user a checkpoint to act on.\n - Do **not** scan imports yourself, edit `package.json`, or add packages outside `recommendedUserDeps`. If you believe a package is missing from the list, that is a platform bug: mark `migration_dependency_verification` as `failed` with `failureReason: \"platform bug: <pkg> imported by <file> but absent from recommendedUserDeps\"` and continue with API work using the packages that did install. (`build_manageChecklist` has no `note` action \u2014 `failed` with a structured `failureReason` is the only way to record this.)\n1. Call `build_manageChecklist` with `action: \"get\"` and filter to `status: \"pending\"` and API-migration origins (`origin: \"2.0-upgrade\"` or legacy `origin: \"seed_api\"`) \u2014 this is your authoritative API list and count for this turn.\n2. Read `node_modules/@superblocksteam/sdk-api/src/index.ts` and treat it as the **only** source of truth for sdk-api export/factory names.\n3. Before editing the first API file, call `getSdkApiDocs` with that API's integration ID (or plugin ID when no integration ID is available). The first call of the session returns the complete shared root README together with that API's plugin docs. Read all of the README before editing any API file. Later calls, including the per-API calls in step 4, return plugin docs only.\n4. For each API, call `getSdkApiDocs` only for the integration(s) needed by that API right before migrating it (just-in-time). Do **not** preload every integration's documentation for the entire app.\n\nHard constraints:\n\n- Do **not** rely on prior conversation memory, \"knowledge\" summaries, or inferred export names.\n- Do **not** start editing API files until preflight steps 0\u20133 are complete.\n- If required documentation cannot be retrieved, mark that API's checklist item `failed` with a concrete `failureReason` that names the failed `getSdkApiDocs` integration ID or plugin ID.\n\n## File layout & exports\n\n- One API per file, default export: `export default api({ ... });`.\n- Use ESM-style relative `.js` specifiers in imports.\n- File path: `server/apis/<ApiName>/api.ts` where `<ApiName>` is the YAML `metadata.name` (for example, `GetFloors` \u2192 `server/apis/GetFloors/api.ts`).\n- The `api({ name })` string and the registry key must both equal the YAML `metadata.name` verbatim \u2014 frontends call `useApi(\"<metadata.name>\")`.\n\n### Registry registration (conditional)\n\n- If `server/apis/index.ts` exists in the target tree: add an import + entry for each new module. Do not reorder existing entries.\n- If it does **not** exist: do **not** create it, do not create scaffolding. Mark the checklist item `failed` with a `failureReason` noting the missing registry.\n\n## Critical rules\n\n1. **Integration IDs are opaque per-YAML.** Extract each distinct `step.integration` UUID to a named `const` at the top of the file. Never carry UUIDs across files.\n2. **SQL: parameterize always.** Zero `${\u2026}` interpolations may remain inside any SQL string. Dynamic lists use `= ANY($N::<type>[])` \u2014 never string-building `IN (\u2026)`.\n3. **`query` vs `execute`.** Rows returned \u2192 `query` with Zod schema. Nothing actionable \u2192 `execute`.\n4. **Output shape preservation.** Mirror the legacy API's externally-visible response exactly \u2014 shape, nullability, cardinality. Do not wrap in envelopes.\n5. **Default is sequential.** `TYPE_FOREACH` \u2192 `for ... of` with sequential `await`. `Promise.all` only when YAML explicitly used a `parallel:` block.\n6. **Determinism, no slop.** No retries, no caching, no extra logging beyond a single `ctx.log.info(\"<ApiName> start\", {...})` at the top of `run`. No narrative code comments.\n7. **Never invent client methods.** If the integration README only documents `apiRequest`, use `apiRequest`.\n\n## Security / user identity\n\n- `authorization.type: AUTHORIZATION_TYPE_APP_USERS` is enforced by the server; rely on `ctx.user` in TS.\n- If the YAML accepts `userId` / `email` / etc. as API input, remove that input and read from `ctx.user` instead.\n\n## Observability\n\n- One `ctx.log.info(\"<ApiName> start\", { <safe-ids> })` at the top of `run` is allowed. Never log secrets, tokens, or PII.\n\n## Verification before you hand off\n\nRuntime verification (required):\n\n1. `build_debug` passing is required but not sufficient. Do not treat compile/typecheck success as proof that runtime behavior is correct.\n2. Use risk-based runtime checks: run `testApi` for APIs with integrations (REST/vendor/SQL), multi-step control flow, transformed outputs, or any uncertainty. For obviously simple APIs, you may skip `testApi`.\n3. If `testApi` output appears stale or mismatched, run `build_reloadFile` once and re-test. If runtime still fails after documented-method verification + one reload/retest cycle, record a concrete `failureReason` and continue.\n\nPage route verification (required once per migration run):\n\n**Hard rule:** A route is verified only with **runtime visual evidence on that exact path**. Reading `client/router.tsx`, page source, or backup artifacts is orientation only \u2014 it **never** satisfies verification.\n\n**Hard rule:** `build_debug` passing and `get_runtime_errors` returning `count: 0` are **not sufficient** for route verification. Do not mark routes `completed` because \"only APIs changed\" or \"the frontend files are unchanged.\"\n\n**Hard rule:** If `build_captureScreenshot` errors or times out for a route, mark that `migration_page_route_verification_*` item `failed` with `failureReason` naming the path and outcome (prefix `page_route_screenshot_timeout:` or `page_route_screenshot_error:`). Do **not** mark `completed`. Do **not** substitute router/source inspection.\n\n### Evidence required per route\n\nMark `completed` only when **all** are true:\n\n1. The app preview is on **that route's path** (not merely the default route).\n2. `build_captureScreenshot` **succeeds** and returns an image you inspect.\n3. You **describe** what you see and confirm it is not a loading-only view (follow the screenshot tool's skeleton/spinner retry procedure first).\n4. Any route-specific runtime errors are resolved (re-check after fixes).\n\n### Procedure (one route at a time)\n\n1. Enumerate checklist items whose IDs start with `migration_page_route_verification_`.\n2. Enumerate paths from `scratch/v2-backup/router.tsx` (fallback: `scratch/v2-backup/pages/**/index.tsx` confirmed against `client/router.tsx`).\n3. For each route: set the matching item `in_progress` \u2192 `build_navigatePreview` with that path \u2192 `build_captureScreenshot` \u2192 on success, `completed`.\n4. If the preview looks stale, `build_reloadFile` **once**, then retry screenshot. If capture still fails, `failed` with `failureReason` as above.\n5. Fix import/lazy-load/runtime failures, then repeat from step 3 for that route.\n\n### Forbidden shortcuts\n\n- Marking `completed` because `client/router.tsx` lists the path\n- Marking `completed` because the page module exists under `client/pages/`\n- Marking `completed` after screenshot timeout/error\n- Batch-marking all route items without per-route screenshot evidence\n\nFor each converted API, self-check:\n\n1. File default-exports exactly one `api({...})`; `name` matches `metadata.name`.\n2. Zero `${\u2026}` interpolations remain in any SQL string.\n3. No SQL `IN (\u2026)` built by concatenation; dynamic lists use `= ANY($N::<type>[])`.\n4. Every prior block's `.output` read is replaced by an actual result `const`.\n5. Input is the minimal union of identifiers the YAML references that are not produced by earlier blocks or `Variables`.\n6. Output shape exactly mirrors the legacy API's external response.\n7. If `server/apis/index.ts` exists, it registers the new module under `metadata.name`.\n8. **sdk-api integration wiring:** declare each integration in an `integrations: { \u2026 }` block and call it via `ctx.integrations.<key>` \u2014 never call `postgres(ID)` / `github(ID)` / etc. inside `run()` as if they were clients.\n9. **`input` / `output` schemas:** both are Zod schemas (`input: z.object({\u2026})`, `output: z.\u2026`). Do not use plain `{ field: { type: \"string\" } }` objects.\n10. **`run` signature:** `async run(ctx, input)` (or destructured input fields as the second argument). Never import `ctx` from the module scope.\n\n## Parallelization policy\n\nCount pending APIs from the checklist (`build_manageChecklist` `action: \"get\"`, filter `status: \"pending\"` and API-migration origins: `origin: \"2.0-upgrade\"` or legacy `origin: \"seed_api\"`).\n\n- **If the pending count is `< 8`:** migrate the APIs yourself, sequentially. Do NOT call `spawnCodingSubagents`. Work through each API using the per-API procedure below.\n- **If the pending count is `>= 8`:** you **MUST spawn sub-agents** to migrate these APIs in parallel. There are too many APIs to migrate sequentially yourself. Do NOT attempt to migrate APIs yourself in this run \u2014 use `spawnCodingSubagents`.\n - Split pending APIs into batches of ~5 (aim for 4\u20135 per batch; 4 workers \u00D7 5 APIs = 20, the hard cap), with a hard cap of **4 sub-agents** and **20 APIs** in this spawn. If more APIs remain pending, leave them for a **later spawn round** after this one returns \u2014 never enlarge a worker's share.\n - The spawn tool will reject oversized batches and will refuse to fan out under heap pressure. If it errors because the batch is too large, shrink the batch and retry. If it refuses because of heap pressure, do not retry spawn in this turn \u2014 wait for a later turn after memory has dropped. Do not fall back to migrating remaining APIs yourself while the pending count is still \u2265 8.\n - For each batch, craft an `instructions` string that:\n - Names the exact `<ApiName>` values that sub-agent owns, verbatim, as a bulleted list.\n - **Directs the sub-agent to `build_readFile` `skills/system/superblocks-migration/SKILL.md` (and the integration README(s) for the APIs it owns) before writing any files.** Do not inline a shortened sdk-api contract \u2014 keep a single source of truth.\n - Restates the per-API procedure below so the sub-agent is self-contained.\n - Reminds the sub-agent to update the shared checklist (id `api_<ApiName>`) for every item it owns.\n - **Restates the vacuous-pass rule and the sentinel explicitly**: the sub-agent must apply the `passed` outcome's vacuous-pass check itself (source real inputs before accepting a sad-path-only pass), and when it marks an API `completed` on an exhausted sourcing attempt it MUST set `failureReason` to `vacuous_pass_accepted: <reason>`. This is the only signal that reaches you \u2014 you run the final sweep without the sub-agents' chat context, so an unflagged vacuous pass is invisible to you.\n - **Also pass `apiNames: [\"<ApiName1>\", \"<ApiName2>\", \u2026]` for every sub-agent**, listing the same names that appear in its `instructions`. The spawn tool stamps each `api_<ApiName>` checklist item with that sub-agent's `id` as `workerId` BEFORE fan-out, which lets the migration UI render one batch row per sub-agent in the chat sidebar. Forgetting `apiNames` is non-fatal (the sub-agents still run) but the sidebar checklist will fall back to one row per API instead of one per batch.\n - **Call `spawnCodingSubagents` as the ONLY tool call in that turn.** Do not emit any other tool calls alongside it \u2014 no reads, no writes, no checklist updates. The tool blocks until every sub-agent finishes; you cannot do migration work \"while waiting\" because there is no waiting from your perspective \u2014 your next turn only begins after the tool returns. If you emit other tool calls in the same turn, you and the sub-agents will race on the shared checklist and corrupt state.\n - **After `spawnCodingSubagents` returns** \u2014 only in a subsequent turn \u2014 read the checklist via `build_manageChecklist` with `action: \"get\"`. For any `failed` items, review the `failureReason`. Retry small numbers of recoverable failures yourself (sequentially, using the per-API procedure below). Leave deterministic failures as `failed`. Then re-count pending APIs; if any remain, repeat this batching step with another `spawnCodingSubagents` call. Do not proceed to the final sweep until every API item is `completed` or `failed`.\n\n## Per-API procedure\n\nFor APIs you migrate yourself, or that you embed in a sub-agent's `instructions`:\n\n1. Call `build_manageChecklist` with `action: \"update\"`, `itemId: \"api_<ApiName>\"`, `status: \"in_progress\"`.\n2. Read `scratch/v2-backup/apis/<ApiName>/api.yaml` and any sibling files the blocks reference.\n3. Produce the TypeScript module at `server/apis/<ApiName>/api.ts`, overwriting the stub. Use the YAML block \u2192 TS mapping in `skills/system/superblocks-migration/references/yaml-block-mapping.md`.\n4. If `server/apis/index.ts` exists, update it to register the new module.\n5. Call `build_debug`. If it fails, fix and repeat until it passes. Do not proceed to step 6 until `build_debug` succeeds.\n6. **Call `runMigrationVerification({ apiName: \"<ApiName>\", inputs: <inputs> })` and resolve every divergence in this same chat.** The tool's response includes `attempt` and `maxAttempts` so you don't need to track an attempt counter yourself \u2014 the server reads it from on-disk history per API.\n\n Your job is to make v3 produce the same response as v2 \u2014 not to \"try a few times and punt to the user\". The user already lived with this API working on v2 with their real data; if v3 doesn't match, that's a regression you introduced, and you fix it here. NEVER leave a `diverged` API for the user to \"Accept divergence\" or \"Try one more attempt\" via the API calls panel \u2014 those buttons exist as escape hatches for situations the policy gate requires (mutations, denied integrations), not as a way for you to skip work.\n\n Synthesize `inputs` the same way you would for `testApi`. Inspect the v2 YAML from step 2 (`apiInputs` / externally-declared parameters) and the v3 TS from step 3 (`input` schema on `run(ctx, input)`). Every name the caller must supply must appear as a top-level key in `inputs` with a realistic value \u2014 a mock, or a real value harvested per the \"Sourcing input values\" rules below \u2014 matching its expected type. This includes two categories \u2014 do not conflate them:\n - **API parameters** \u2014 names declared in `apiInputs` (v2) or the v3 `input` shape (e.g. `sourceContext`, `currentDocument`, `messages`). Pass each parameter name directly as a key in `inputs`. These are what the frontend passes when it invokes the API; they are not unavailable \"runtime bindings.\"\n - **UI bindings and caller context** \u2014 values the API reads from the app that are not API parameters (component values like `Input1.value`/`Select1.selectedItem.id`, table selections like `Table1.selectedRow`, state variables, workflow `body`/`params` not declared as `apiInputs`). Mock each binding the API references that isn't produced by an earlier block.\n\n Both v2 and v3 receive the same `inputs`, so this is what makes the diff meaningful \u2014 `{}` for an API that expects parameters or bindings produces a vacuous `both_failed` that tells you nothing. Errors like `'sourceContext' is not defined` (v2) or v3 input-validation failures for missing required fields mean you omitted keys from `inputs`; synthesize mocks and retry. That is not an environmental failure.\n\n **Sourcing input values \u2014 real app data over invented data.** A value is only \"realistic\" if the system the API talks to actually accepts it. Invented values are fine for self-contained inputs (a search string, a page size, a boolean flag). But when an input must reference something that already exists \u2014 any key the target system looks up, such as a row/record ID, a resource name, or an uploaded-file reference \u2014 do NOT invent it: an invented identifier either fails on both sides or exercises only the not-found/guard-clause path, and neither proves the API works. Source a real value instead, in this order:\n 1. **Harvest from the app's own APIs.** Find a read-only API in this app (prefer zero-input \"list\"/\"get all\" APIs) whose output contains the identifier you need, run it via `testApi`, and take a value from its real response. Chain as needed: a list API yields a real ID \u2192 pass it to the detail API \u2192 its response yields the next identifier. Prefer migrating and verifying zero-input read-only APIs first so their outputs become your pool of real test data.\n 2. **Follow the client code.** The `useApi`/`useApiData`/`executeApi` call sites under `client/` (and the v2 pages under `scratch/v2-backup/`) show where the app gets each input \u2014 a table's selected row, a route param, a select populated by another API. Trace that source to a concrete real value.\n 3. Only if neither path yields a value, fall back to an invented mock \u2014 and treat any resulting not-found/empty output as unverified (see the vacuous-pass rule under `passed` below).\n\n Outcomes and how to resolve them:\n - **`passed`**: `passed` only proves v2 and v3 agree on the inputs you supplied. Before accepting it, check what actually ran: if the shared output is a sad-path/guard-clause result \u2014 a not-found or error object from a caught exception, a validity flag that came back false, an empty result from a lookup that should have matched \u2014 the API's core logic never executed and the pass is vacuous. In that case source real inputs (per the sourcing rules above) and re-run `runMigrationVerification`; only accept a sad-path-only pass after the sourcing steps genuinely produced no usable value. Once a non-vacuous `passed` is in hand, call `build_manageChecklist` with `status: \"completed\"`. Done. If instead you are marking `completed` on an exhausted sourcing attempt (the pass stayed vacuous), you MUST also set `failureReason` to a string beginning `vacuous_pass_accepted:` followed by a one-line reason \u2014 this sentinel is the only durable signal that survives into the final sweep (and across sub-agents, whose chat context the orchestrator cannot see).\n\n **Platform gate:** the checklist store rejects `status: \"completed\"` on `api_<ApiName>` items until verification has run at least once (`lastVerificationAt` is set \u2014 normally via this tool). You cannot bulk-mark APIs complete without calling `runMigrationVerification` per API.\n - **`skipped_mutation`**: the runtime marks the checklist item `completed` with `verificationSkippedReason: \"mutation\"` automatically. Do **NOT** keep it `in_progress` or ask the user a grouped decision. Continue translating each API as well as you can from the code; the user will verify mutation-skipped APIs manually at finalize time.\n\n - **`v2_unrunnable`**: the v2 backup itself couldn't execute, so there is no baseline to match. Call `build_manageChecklist` with `status: \"completed\"` and continue.\n\n - **`timeout`**: a pipeline stalled past the reporting timeout (`side` says which one). This is transient environment noise \u2014 a dropped editor connection or a backgrounded browser tab \u2014 NOT evidence about the API. Do **NOT** mark the item `completed`. Retry `runMigrationVerification` after finishing your current API. If it times out repeatedly, tell the user verification is stalling (likely tab backgrounded / connection dropped), ask them to keep the app tab focused, and retry \u2014 never convert repeated timeouts into `completed`.\n\n - **`disconnected`**: the editor connection was down when the pipeline tried to run (`side` says which one) \u2014 the app tab is closed, backgrounded, or reconnecting. Unlike `timeout` this diagnosis is certain, and it says nothing about the API. Do **NOT** mark the item `completed`. Tell the user the app tab must stay open and focused during verification, then retry `runMigrationVerification` \u2014 never convert `disconnected` into `completed`.\n\n - **`both_failed`**:\n - If you passed `inputs: {}` or omitted declared API parameters / bindings: synthesize real `inputs` (per the bullet above) and retry. Do NOT mark completed here \u2014 missing inputs caused this, not a real failure.\n - If the error names a symbol that appears in `apiInputs` or the v3 `input` schema: add that key to `inputs` with a realistic mock and retry. Do NOT classify this as environmental \u2014 the parameter is available; you did not supply it.\n - If you passed real inputs and v2 still failed: read v2's error. If it is environmental (auth/credentials/integration-unavailable: \"no integration configured\", \"401\", \"ECONNREFUSED\", \"missing API key\"), v2 cannot run in this verification context regardless of what you do \u2014 call `build_manageChecklist` with `status: \"completed\"` and continue; the user will verify manually. If it's a v2 runtime error that v3 also reproduces, treat as `diverged` (your inputs are wrong, or the API expects state that isn't reproducible here \u2014 revise inputs and retry).\n\n - **`error`**: a system error in the verification flow itself (cannot read v3 source, etc.). Fix what you can; if it persists across one retry, mark the item `failed` with `failureReason: \"<error detail>\"` and continue.\n\n- **`diverged`**: the API ran on both sides and the outputs differ. **Iterate until v3 matches v2 byte-for-byte (modulo the normalizations api-comparator already applies: identical ISO timestamps, near-now ISO timestamps within \u00B160s of each other and \u00B15min of \"now\", UUIDs, monotonic integer IDs differing by \u22641 on fields whose leaf ends with \"id\", floats within 1e-9 relative tolerance, and per-request opaque identifiers at leaves named `requestId`/`traceId`/`spanId`/`correlationId`/`sessionId`/`nonce`/`csrfToken`/`_id` \u2014 note: a bare leaf named `token` is intentionally NOT normalized, since auth/access-token divergence is a security-relevant signal we want to surface).**\n\n There is one bounded judgment exception: if both v2 and v3 executions succeeded, the output shape/types are equivalent, and the remaining diffs are value-level fields you reasonably infer are inherently non-deterministic outputs for this API, treat the migration as semantically complete for this run. In that case, mark the checklist item `completed` and continue.\n\n Use this exception only when all of the following are true:\n - The divergence is not structural (no missing/extra fields, no type mismatch, no changed nesting/cardinality, no changed error/status behavior).\n - The differing fields are expected to vary per invocation and do not change control flow decisions.\n - The API's functional contract remains intact for downstream consumers.\n\n If any of those conditions are not met, the divergence is semantic and must be fixed \u2014 do NOT add code purely to mask values the comparator already tolerates.\n\n For each `summaryForAgent` entry \u2014 every entry names the JSON path that diverged and the v2/v3 values \u2014 find the block in `server/apis/<ApiName>/api.ts` that produces that path and fix the discrepancy. Common causes, in rough order of frequency:\n - wrong column projection or missing field in a SELECT\n - missing transform / output shape mismatch (array vs object wrapper, single vs list)\n - off-by-one or wrong placeholder in a SQL parameter\n - mistyped binding key (case, plural, dotted path)\n - type coercion (string vs number, null vs undefined, boolean vs \"true\")\n - missing default value when the binding is undefined\n - wrong join order or implicit ordering of rows\n - filter/where condition different from v2\n - missing `LIMIT`, `OFFSET`, or pagination handling\n\n If a divergence stems from the `inputs` you passed (e.g. v2 echoes the input one way and v3 a different way because they normalize it differently), revise the inputs alongside the source.\n\n Then call `build_debug` (fix any failures), then `runMigrationVerification` again with the revised source/inputs.\n\n **There is no fixed retry budget \u2014 iterate until `passed` or until you have firm structural evidence that no v3 source change can reconcile v2 and v3.** Acceptable evidence for stopping: v2 references a YAML construct with no v3 SDK equivalent and the divergence is in that construct; v2 derives a value from runtime state v3 cannot observe (e.g. an env var that differs by environment). When you stop on structural grounds, mark the item `failed` with `failureReason: \"verification_diverged_irreconcilable: <one-paragraph reason naming the specific summaryForAgent entry and the structural reason> | summary: <JSON.stringify(summaryForAgent)>\"`.\n\n Guardrail against infinite loops (NOT a retry budget): if you have iterated 8 times on the same API and the set of divergences has not materially changed across the last 3 attempts (i.e. you are flailing, not converging), stop and mark `failed` with the same `failureReason` shape. If you ARE converging \u2014 fewer divergences each attempt, or the remaining ones look smaller \u2014 keep going past 8.\n\n## Run-level rules\n\n- Do NOT emit a free-text UNRESOLVED report \u2014 every unresolved item must be a `failed` checklist entry with a `failureReason`.\n- Do NOT stop the run because one API failed. Only stop once every API is either `completed` or `failed`.\n\n## Updating integration write policy (Clark-only, with user consent)\n\nDuring migration, integration write policy (`allow` / `deny` per integration UUID) lives in `scratch/migration-state.json` \u2192 `integrationWritePolicy`. The pre-migration modal sets it once; **there is no mid-migration UI for the user to change it.**\n\n- **Only Clark can update write policy mid-migration**, and only when the user **explicitly asks** (e.g. \"test this API even though I set Don't test\", \"go ahead and run writes against Postgres\").\n- **Never** tell the user to update write policy in the UI \u2014 they cannot.\n- **Never** hand-edit `scratch/migration-state.json` with `build_writeFile` / `build_editFile` to change write policy. Use `updateMigrationWritePolicy` instead; it validates input and shows a permission card when granting `allow`.\n- To find integration ids: read the `const` UUID at the top of `server/apis/<ApiName>/api.ts`, or read existing keys from `scratch/migration-state.json` \u2192 `integrationWritePolicy`.\n- After updating policy to `allow` (with user approval), call `testApi` or `runMigrationVerification` again for the affected APIs.\n\nIf `testApi` is blocked by access control because an integration is still `deny`, explain that the user previously chose \"Don't test\" for that integration and ask whether they want you to update the policy and retry \u2014 do not suggest they change settings in the UI.\n\n## User-reported manual verification\n\nSome APIs are marked `completed` without automatic testing \u2014 write-policy \"Don't test\" (`verificationSkippedReason: \"mutation\"`) or a `testApi` permission denial (`verificationSkippedReason: \"testing_denied\"`). The user is expected to verify these by using the app themselves.\n\n### When the user asks how to test a skipped API\n\nIf the user requests manual test instructions for a specific API (including when the UI sends a prompt referencing `skills/system/migration-api-verification/SKILL.md`):\n\n1. Read `skills/system/migration-api-verification/SKILL.md` and follow it.\n2. Produce UI click-through steps for that API \u2014 do **NOT** call `testApi` or `runMigrationVerification`.\n\n### When the user confirms they verified an API\n\nIf the user tells you they have checked such an API and it works (e.g. \"I clicked through the app and GetOrders works, mark it complete\"), call `markApiManuallyVerified({ apiName })`. Do **NOT** call `testApi` or `runMigrationVerification` for it \u2014 the user opted out of automatic testing. This records the API as user-verified so it no longer appears in the list of APIs needing manual verification.\n\nIf the user instead asks you to **test** a denied or skipped API (not merely confirm they tested it manually), call `updateMigrationWritePolicy` first to grant `allow` for the relevant integration ids, then run `testApi` or `runMigrationVerification`.\n\n## Post-batch re-verification\n\nAfter `spawnCodingSubagents` returns (or after all sequential APIs are settled), before updating the checklist overall status:\n\n1. Call `build_manageChecklist` with `action: \"get\"` and read all items.\n2. For any item where `verificationOutcome === \"auto_passed\"` and `lastVerificationAt` is older than any sibling item's `updatedAt` minus 60 seconds: this item may have drifted due to registry edits made by later sub-agents. Re-run `runMigrationVerification({ apiName, inputs: <inputs> })` for each such item \u2014 synthesize `inputs` the same way as in step 6 of the per-API procedure, including the \"Sourcing input values\" rule (harvest real IDs from the app's read-only APIs; do not invent identifiers).\n3. If any re-verification produces `diverged`, apply the normal per-API diverge\u2192retry loop (no fixed retry budget; iterate until `passed` or firm structural-irreconcilability evidence, with the anti-flail guardrail at 8 iterations without convergence).\n4. Proceed to mark overall checklist completed/failed only after all re-verifications settle and the final sweep below is done.\n\n## Final sweep: retry unverified happy paths with real app data (required once per run)\n\nIf your closing summary would say \"I could not verify the happy path for X\" \u2014 that sentence is a trigger to do more work, not a conclusion to hand the user. Before marking the overall checklist completed/failed, do one last pass:\n\n1. From the checklist, collect every API that (a) is `failed` or unresolved because its test never succeeded, or (b) was marked `completed` but carries the `vacuous_pass_accepted:` sentinel in `failureReason` (set by you or by a sub-agent when a sad-path-only pass was accepted after exhausting sourcing).\n\n Note on the parallel path: for APIs a sub-agent migrated, you cannot see its chat context or reconstruct its verification outputs \u2014 `verificationOutcome` records only the outcome type (`auto_passed`), not whether the pass was vacuous. The `vacuous_pass_accepted:` sentinel is therefore the ONLY way a sub-agent's vacuous pass surfaces here; APIs a sub-agent completed without it are treated as genuinely verified. This is why the sub-agent `instructions` MUST restate the vacuous-pass rule and the sentinel (see Parallelization policy). If you have specific reason to distrust a sub-agent's `completed` items (e.g. its batch reported many `both_failed` retries), re-verify them here with harvested real inputs rather than trusting the bare `completed`.\n\n2. For each, harvest real inputs from the app itself per the \"Sourcing input values\" rule in the per-API procedure: run the app's read-only APIs via `testApi` (zero-input list APIs first) and chain their real outputs into the inputs of the API under test.\n3. Re-run `runMigrationVerification` with those real inputs and resolve the outcome per the normal per-API rules.\n4. Only APIs whose sourcing steps genuinely produced no usable value (or whose failures are environmental per the `both_failed` rules) may finish the run without a happy-path verification \u2014 and each needs a `failureReason` or verification record saying so.\n";
2
2
  //# sourceMappingURL=skill.generated.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"skill.generated.d.ts","sourceRoot":"","sources":["../../../../../src/ai-service/skills/system/superblocks-migration/skill.generated.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,OAAO,m+tCAoTnB,CAAC"}
1
+ {"version":3,"file":"skill.generated.d.ts","sourceRoot":"","sources":["../../../../../src/ai-service/skills/system/superblocks-migration/skill.generated.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,OAAO,2luCAoTnB,CAAC"}
@@ -33,7 +33,7 @@ Corollary for \`migration_page_route_verification_*\`: see the _Page route verif
33
33
 
34
34
  Authoritative. If a rule here conflicts with your priors, these win.
35
35
 
36
- 1. The installed SDK root documentation through \`getSdkApiDocs\` — call it with no arguments for the current section index, then retrieve every top-level section (following every \`root.continuation\`) so the full api() contract, execution model, \`ctx.*\`, exports, error classes, performance best practices, \`useApi\` frontend hook, and integration method table are covered without loading the whole README at once.
36
+ 1. The installed SDK root documentation through \`getSdkApiDocs\`. The first call of the session (preflight step 3) returns the complete shared README. Read all of it so the full api() contract, execution model, \`ctx.*\`, exports, error classes, performance best practices, \`useApi\` frontend hook, and integration method table are covered.
37
37
  2. \`node_modules/@superblocksteam/sdk-api/src/index.ts\` (the **barrel**) — the authoritative list of exported factory names. Integration factory names are whatever this file exports, not whatever the directory name is. Never invent or case-fold a factory name without confirming it here.
38
38
  3. Version-aware documentation for **every integration** referenced by the YAMLs you convert:
39
39
  - Call \`getSdkApiDocs\` with that integration's ID (or plugin ID when no integration ID is available).
@@ -62,7 +62,7 @@ Complete this orientation sequence before writing or modifying any API file:
62
62
  - Mark \`migration_dependency_verification\` as \`in_progress\` via \`build_manageChecklist\`.
63
63
  - Read \`scratch/migration-state.json\` and extract \`recommendedUserDeps\`.
64
64
  - If \`recommendedUserDeps\` is missing or empty, mark \`migration_dependency_verification\` as \`completed\` and continue to step 1.
65
- - Otherwise, call \`build_installPackages\` **once** with every entry from \`recommendedUserDeps\` (passing \`name\`, \`version\`, and \`dev\` through unchanged). Do **not** skip because \`node_modules\` exists on disk; the platform never wrote these packages into \`package.json\`.
65
+ - Otherwise, call \`build_managePackages\` **once** with \`action\` \`install\` and every entry from \`recommendedUserDeps\` in \`packages\` (passing \`name\`, \`version\`, and \`dev\` through unchanged). Do **not** skip because \`node_modules\` exists on disk; the platform never wrote these packages into \`package.json\`.
66
66
  - **Failure semantics (covers every non-success outcome — no judgment calls):**
67
67
  - On full success → mark \`migration_dependency_verification\` as \`completed\`.
68
68
  - On **any** failure — full, partial (some packages installed, others did not), structured registry error (\`not_in_registry\`, \`registry_auth_failed\`, \`registry_unreachable\`), or unstructured error — mark \`migration_dependency_verification\` as \`failed\` with a \`failureReason\` that lists the affected package names and the tool's verbatim error code or message. Treat partial success the same as full failure for checklist purposes; do not split into multiple checklist items. Then continue to step 1 so API translation can still proceed. The user/operator will repair the registry/packages and re-trigger the migration turn.
@@ -70,14 +70,14 @@ Complete this orientation sequence before writing or modifying any API file:
70
70
  - Do **not** scan imports yourself, edit \`package.json\`, or add packages outside \`recommendedUserDeps\`. If you believe a package is missing from the list, that is a platform bug: mark \`migration_dependency_verification\` as \`failed\` with \`failureReason: "platform bug: <pkg> imported by <file> but absent from recommendedUserDeps"\` and continue with API work using the packages that did install. (\`build_manageChecklist\` has no \`note\` action — \`failed\` with a structured \`failureReason\` is the only way to record this.)
71
71
  1. Call \`build_manageChecklist\` with \`action: "get"\` and filter to \`status: "pending"\` and API-migration origins (\`origin: "2.0-upgrade"\` or legacy \`origin: "seed_api"\`) — this is your authoritative API list and count for this turn.
72
72
  2. Read \`node_modules/@superblocksteam/sdk-api/src/index.ts\` and treat it as the **only** source of truth for sdk-api export/factory names.
73
- 3. Call \`getSdkApiDocs()\` for the installed root README index, then retrieve every top-level section and follow every continuation before editing. This is the progressive equivalent of reading the whole root README.
73
+ 3. Before editing the first API file, call \`getSdkApiDocs\` with that API's integration ID (or plugin ID when no integration ID is available). The first call of the session returns the complete shared root README together with that API's plugin docs. Read all of the README before editing any API file. Later calls, including the per-API calls in step 4, return plugin docs only.
74
74
  4. For each API, call \`getSdkApiDocs\` only for the integration(s) needed by that API right before migrating it (just-in-time). Do **not** preload every integration's documentation for the entire app.
75
75
 
76
76
  Hard constraints:
77
77
 
78
78
  - Do **not** rely on prior conversation memory, "knowledge" summaries, or inferred export names.
79
79
  - Do **not** start editing API files until preflight steps 0–3 are complete.
80
- - If required documentation cannot be retrieved, mark that API's checklist item \`failed\` with a concrete \`failureReason\` that names the failed \`getSdkApiDocs\` selector or integration ID.
80
+ - If required documentation cannot be retrieved, mark that API's checklist item \`failed\` with a concrete \`failureReason\` that names the failed \`getSdkApiDocs\` integration ID or plugin ID.
81
81
 
82
82
  ## File layout & exports
83
83
 
@@ -1,2 +1,2 @@
1
- export declare const content = "---\nname: superblocks-sdk-api\ndescription: |\n Retrieve authoritative SDK API and integration guidance progressively before creating or editing SDK APIs.\nreadOnly: true\nmetadata:\n author: superblocks\n version: \"1.0\"\n---\n\n# SDK API documentation workflow\n\nUse `getSdkApiDocs` as the authoritative SDK documentation interface. Do not read SDK README files directly and do not fetch newer documentation from the internet: the tool reads the installed `@superblocksteam/sdk-api` package and applies plugin/orchestrator version overlays.\n\nThe root README reflects that installed package and is not proof that every statement matches a customer's execution runtime. Plugin documentation remains compatibility-aware: the tool resolves overlays using both the integration execution version and the orchestrator's `javascriptsdkapi` version.\n\n## Before writing or modifying an SDK API\n\n1. Call `getSdkApiDocs` with the app's integration IDs whenever available. Use the returned version-aware plugin guidance for integration methods and signatures.\n2. For shared SDK rules, call `getSdkApiDocs()` with no arguments. This returns a compact index derived from the installed root README, not the full document.\n3. Request only the relevant root entry with `getSdkApiDocs({ section: \"<id>\" })`.\n4. If the result contains `root.continuation`, retrieve the rest with `getSdkApiDocs({ continuation: \"<exact token>\" })`. Continue until no token is returned. Never repeat the original section call to get the next chunk.\n5. If a section or continuation is stale or unknown, use the refreshed index in the response and restart from the current section ID.\n\nKeep exact `section`, `continuation`, integration ID, and plugin ID arguments when refetching after compaction. SDK signatures, examples, and detailed implementation rules remain in `getSdkApiDocs`; do not infer or duplicate them from this skill.\n";
1
+ export declare const content = "---\nname: superblocks-sdk-api\ndescription: |\n Retrieve authoritative SDK API and integration guidance before creating or editing SDK APIs.\nreadOnly: true\nmetadata:\n author: superblocks\n version: \"1.0\"\n---\n\n# SDK API documentation workflow\n\nUse `getSdkApiDocs` as the authoritative SDK documentation interface. Do not read SDK README files directly and do not fetch newer documentation from the internet: the tool reads the installed `@superblocksteam/sdk-api` package and applies plugin/orchestrator version overlays.\n\nThe root README reflects that installed package and is not proof that every statement matches a customer's execution runtime. Plugin documentation remains compatibility-aware: the tool resolves overlays using both the integration execution version and the orchestrator's `javascriptsdkapi` version.\n\n## Before writing or modifying an SDK API\n\n1. Call `getSdkApiDocs({ integrationIds })` with the app's integration IDs whenever available, or `getSdkApiDocs({ pluginIds })` when the integration does not exist yet. The first call in a session returns the complete shared SDK README plus the plugin docs. Read it before writing or modifying any `server/apis/**` file.\n2. Repeat calls with IDs return plugin docs only; the README is not repeated while it is still in context.\n3. If neither integration IDs nor plugin IDs are known, call `getSdkApiDocs()` with no arguments. It returns the same complete shared SDK README on the first call in a session and the shared guidance alone afterwards.\n\nSDK signatures, examples, and detailed implementation rules remain in `getSdkApiDocs`; do not infer or duplicate them from this skill.\n\n`testApi` returns `timing`. `roundTripMs` runs from sending the request until the editor answered or the call failed, including file sync and authentication. `executionMs` is how long the API ran, as measured by the orchestrator, when it reports one. `integrationCallCount` and `integrationTotalMs` are the number and summed duration of its integration calls.\n";
2
2
  //# sourceMappingURL=skill.generated.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"skill.generated.d.ts","sourceRoot":"","sources":["../../../../../src/ai-service/skills/system/superblocks-sdk-api/skill.generated.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,OAAO,k4DAyBnB,CAAC"}
1
+ {"version":3,"file":"skill.generated.d.ts","sourceRoot":"","sources":["../../../../../src/ai-service/skills/system/superblocks-sdk-api/skill.generated.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,OAAO,y/DAyBnB,CAAC"}
@@ -3,7 +3,7 @@
3
3
  export const content = `---
4
4
  name: superblocks-sdk-api
5
5
  description: |
6
- Retrieve authoritative SDK API and integration guidance progressively before creating or editing SDK APIs.
6
+ Retrieve authoritative SDK API and integration guidance before creating or editing SDK APIs.
7
7
  readOnly: true
8
8
  metadata:
9
9
  author: superblocks
@@ -18,12 +18,12 @@ The root README reflects that installed package and is not proof that every stat
18
18
 
19
19
  ## Before writing or modifying an SDK API
20
20
 
21
- 1. Call \`getSdkApiDocs\` with the app's integration IDs whenever available. Use the returned version-aware plugin guidance for integration methods and signatures.
22
- 2. For shared SDK rules, call \`getSdkApiDocs()\` with no arguments. This returns a compact index derived from the installed root README, not the full document.
23
- 3. Request only the relevant root entry with \`getSdkApiDocs({ section: "<id>" })\`.
24
- 4. If the result contains \`root.continuation\`, retrieve the rest with \`getSdkApiDocs({ continuation: "<exact token>" })\`. Continue until no token is returned. Never repeat the original section call to get the next chunk.
25
- 5. If a section or continuation is stale or unknown, use the refreshed index in the response and restart from the current section ID.
21
+ 1. Call \`getSdkApiDocs({ integrationIds })\` with the app's integration IDs whenever available, or \`getSdkApiDocs({ pluginIds })\` when the integration does not exist yet. The first call in a session returns the complete shared SDK README plus the plugin docs. Read it before writing or modifying any \`server/apis/**\` file.
22
+ 2. Repeat calls with IDs return plugin docs only; the README is not repeated while it is still in context.
23
+ 3. If neither integration IDs nor plugin IDs are known, call \`getSdkApiDocs()\` with no arguments. It returns the same complete shared SDK README on the first call in a session and the shared guidance alone afterwards.
26
24
 
27
- Keep exact \`section\`, \`continuation\`, integration ID, and plugin ID arguments when refetching after compaction. SDK signatures, examples, and detailed implementation rules remain in \`getSdkApiDocs\`; do not infer or duplicate them from this skill.
25
+ SDK signatures, examples, and detailed implementation rules remain in \`getSdkApiDocs\`; do not infer or duplicate them from this skill.
26
+
27
+ \`testApi\` returns \`timing\`. \`roundTripMs\` runs from sending the request until the editor answered or the call failed, including file sync and authentication. \`executionMs\` is how long the API ran, as measured by the orchestrator, when it reports one. \`integrationCallCount\` and \`integrationTotalMs\` are the number and summed duration of its integration calls.
28
28
  `;
29
29
  //# sourceMappingURL=skill.generated.js.map
@@ -1,2 +1,2 @@
1
- export declare const content = "---\nname: third-party-migration\ndescription: |\n Migrate a third-party app (Replit, Streamlit, 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`, `streamlit_app.py`, `.streamlit/config.toml`, `import streamlit as st`, `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- **Streamlit** \u2014 `streamlit_app.py`, `.streamlit/config.toml`, dependency files containing `streamlit`, Python files with `import streamlit as st`, or a Python `pages/` multipage app structure. Follow the general guidelines in this document.\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 frontend-only prototype (no `package.json`, no `node_modules`, no build config) whose durable hallmarks are: React + ReactDOM + `@babel/standalone` loaded from a CDN; `<script type=\"text/babel\" src=\"...\">` for JSX files; `/*EDITMODE-BEGIN*/ ... /*EDITMODE-END*/` markers in defaults blocks; `useTweaks` / `TweaksPanel` / `TweakSection` / `TweakToggle` window globals; `<html data-theme=\"...\">` with CSS variables such as `var(--accent)` / `var(--ink)`. A **common** layout is a flat archive with one top-level `<Name>.html` plus sibling `app.jsx`, `data.js` (or `data.jsx`), and `tweaks-panel.jsx` \u2014 but exports may nest modules under a project directory, include a large bundler-style standalone HTML at the archive root, ship an embedded design-system bundle (e.g. `_ds/`), or duplicate stale files at the root vs a nested folder. When layout deviates, rely on the durable hallmarks and the actual tree \u2014 do not force the flat-archive shape. \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\nWhen a source only **partially** matches a platform's hallmarks, do not abandon identification or reshape the tree to fit the canonical checklist. Explore the actual archive, confirm via durable signals, use best judgment to find the real entry point and module layout, and `askMultiChoice` on genuine ambiguity rather than forcing a textbook export shape.\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- `getSdkApiDocs` and `node_modules/@superblocksteam/sdk-api/src/index.ts` \u2014 use the tool's root section index for the server `api()` contract and the barrel for the full list of factory names. Follow `root.continuation` exactly. **Never invent factory names.** If required documentation or the barrel is unavailable, mark the affected checklist item `failed` with the failed selector or missing path as the reason.\n- Version-aware per-integration documentation from `getSdkApiDocs` \u2014 retrieve once, with an integration ID when possible, when you first emit an API that uses that integration.\n- `skills/system/superblocks-frontend/SKILL.md` - the target client's API-hook behavior and loading-state contract.\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.** Read the user's prompt and any in-archive instructional files (README, spec, guidance docs \u2014 the platform guide lists artifact patterns for that source) **before** mapping. Summarize inferred product purpose, primary personas, and explicit non-goals in the discovery summary. Then 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. Non-canonical export layout (nested dirs, duplicate entry files, bundler HTML decoys) does **not** automatically trigger `askMultiChoice`. First explore the archive and use the durable hallmarks in the platform guide to identify the true entry. If the layout is still genuinely ambiguous after exploration, `askMultiChoice`. Do not force the textbook layout, and do not ask before making a reasonable exploration attempt. 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`, `v0.md`, or `claude-design.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. **Read guidance and inventory.** First, read the user's prompt and any in-archive instructional files per the platform guide. State inferred product intent and non-goals before mapping. Then, following the platform guide's discovery checklist, enumerate every route/handler, page, data source, env var, secret, and visual asset in the source tree. When the export layout is non-canonical, identify the true runtime entry (not bundler decoys or stale duplicates) and reconcile nested module directories. 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 - File edits change the live app immediately. Create a page before adding its router reference. Remove router references before deleting a page. For a rename, create the new page, repoint the router, then delete the old page. Wait for each dependent tool call to return without an error. Batch only independent tool calls.\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";
1
+ export declare const content = "---\nname: third-party-migration\ndescription: |\n Migrate a third-party app (Replit, Streamlit, 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`, `streamlit_app.py`, `.streamlit/config.toml`, `import streamlit as st`, `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- **Streamlit** \u2014 `streamlit_app.py`, `.streamlit/config.toml`, dependency files containing `streamlit`, Python files with `import streamlit as st`, or a Python `pages/` multipage app structure. Follow the general guidelines in this document.\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 frontend-only prototype (no `package.json`, no `node_modules`, no build config) whose durable hallmarks are: React + ReactDOM + `@babel/standalone` loaded from a CDN; `<script type=\"text/babel\" src=\"...\">` for JSX files; `/*EDITMODE-BEGIN*/ ... /*EDITMODE-END*/` markers in defaults blocks; `useTweaks` / `TweaksPanel` / `TweakSection` / `TweakToggle` window globals; `<html data-theme=\"...\">` with CSS variables such as `var(--accent)` / `var(--ink)`. A **common** layout is a flat archive with one top-level `<Name>.html` plus sibling `app.jsx`, `data.js` (or `data.jsx`), and `tweaks-panel.jsx` \u2014 but exports may nest modules under a project directory, include a large bundler-style standalone HTML at the archive root, ship an embedded design-system bundle (e.g. `_ds/`), or duplicate stale files at the root vs a nested folder. When layout deviates, rely on the durable hallmarks and the actual tree \u2014 do not force the flat-archive shape. \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\nWhen a source only **partially** matches a platform's hallmarks, do not abandon identification or reshape the tree to fit the canonical checklist. Explore the actual archive, confirm via durable signals, use best judgment to find the real entry point and module layout, and `askMultiChoice` on genuine ambiguity rather than forcing a textbook export shape.\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- `getSdkApiDocs` and `node_modules/@superblocksteam/sdk-api/src/index.ts`: use the complete shared README returned by `getSdkApiDocs` with the target integration's ID or plugin ID for the server `api()` contract, and the barrel for the full list of factory names. **Never invent factory names.** If required documentation or the barrel is unavailable, mark the affected checklist item `failed` with the failed call or missing path as the reason.\n- Version-aware per-integration documentation from `getSdkApiDocs` \u2014 retrieve once, with an integration ID when possible, when you first emit an API that uses that integration.\n- `skills/system/superblocks-frontend/SKILL.md` - the target client's API-hook behavior and loading-state contract.\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.** Read the user's prompt and any in-archive instructional files (README, spec, guidance docs \u2014 the platform guide lists artifact patterns for that source) **before** mapping. Summarize inferred product purpose, primary personas, and explicit non-goals in the discovery summary. Then 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. Non-canonical export layout (nested dirs, duplicate entry files, bundler HTML decoys) does **not** automatically trigger `askMultiChoice`. First explore the archive and use the durable hallmarks in the platform guide to identify the true entry. If the layout is still genuinely ambiguous after exploration, `askMultiChoice`. Do not force the textbook layout, and do not ask before making a reasonable exploration attempt. 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`, `v0.md`, or `claude-design.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. **Read guidance and inventory.** First, read the user's prompt and any in-archive instructional files per the platform guide. State inferred product intent and non-goals before mapping. Then, following the platform guide's discovery checklist, enumerate every route/handler, page, data source, env var, secret, and visual asset in the source tree. When the export layout is non-canonical, identify the true runtime entry (not bundler decoys or stale duplicates) and reconcile nested module directories. 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 - File edits change the live app immediately. Create a page before adding its router reference. Remove router references before deleting a page. For a rename, create the new page, repoint the router, then delete the old page. Wait for each dependent tool call to return without an error. Batch only independent tool calls.\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,o0tBAuKnB,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,81tBAuKnB,CAAC"}
@@ -104,7 +104,7 @@ Do **not**: assign \`Component\` / \`element\` to identifiers bound by anything
104
104
 
105
105
  ## Authoritative references (read just-in-time, not up front)
106
106
 
107
- - \`getSdkApiDocs\` and \`node_modules/@superblocksteam/sdk-api/src/index.ts\` — use the tool's root section index for the server \`api()\` contract and the barrel for the full list of factory names. Follow \`root.continuation\` exactly. **Never invent factory names.** If required documentation or the barrel is unavailable, mark the affected checklist item \`failed\` with the failed selector or missing path as the reason.
107
+ - \`getSdkApiDocs\` and \`node_modules/@superblocksteam/sdk-api/src/index.ts\`: use the complete shared README returned by \`getSdkApiDocs\` with the target integration's ID or plugin ID for the server \`api()\` contract, and the barrel for the full list of factory names. **Never invent factory names.** If required documentation or the barrel is unavailable, mark the affected checklist item \`failed\` with the failed call or missing path as the reason.
108
108
  - Version-aware per-integration documentation from \`getSdkApiDocs\` — retrieve once, with an integration ID when possible, when you first emit an API that uses that integration.
109
109
  - \`skills/system/superblocks-frontend/SKILL.md\` - the target client's API-hook behavior and loading-state contract.
110
110
 
@@ -64,7 +64,7 @@ export declare const AGENT_REPORTED_ERROR_TO_USER = "agentReportedErrorToUser";
64
64
  export declare const AGENT_NEEDS_USER_INPUT = "agentNeedsUserInput";
65
65
  export declare const AGENT_GAVE_UP = "agentGaveUp";
66
66
  export declare const AGENT_CANCELED = "agentCanceled";
67
- export declare const LLM_REQUESTED_CONTEXT = "llmRequestedContext";
67
+ declare const LLM_REQUESTED_CONTEXT = "llmRequestedContext";
68
68
  export declare const LLM_FINISHED_UNEXPECTEDLY = "llmFinishedUnexpectedly";
69
69
  export declare const LLM_ERRORED = "llmErrored";
70
70
  export declare const LLM_FINISHED = "llmFinished";
@@ -314,7 +314,7 @@ export declare class Clark extends TracedFSM<ClarkState, ClarkEvent, ClarkContex
314
314
  private sendContextUsage;
315
315
  }
316
316
  export type ClarkTransition = FSMOnTransitionParams<ClarkState, ClarkEvent>;
317
- export type ClarkStateHandlerFactory = (clark: Clark, params: ClarkStateHandlerParams) => (transition: ClarkTransition) => Promise<void>;
317
+ type ClarkStateHandlerFactory = (clark: Clark, params: ClarkStateHandlerParams) => (transition: ClarkTransition) => Promise<void>;
318
318
  export type ClarkStateHandlerFactories = {
319
319
  [K in ClarkState]: ClarkStateHandlerFactory;
320
320
  };
@@ -444,7 +444,6 @@ export type ClarkContext = {
444
444
  content: string;
445
445
  }[];
446
446
  abortController?: AbortController;
447
- initialElementIds?: string[];
448
447
  initialFilePaths?: {
449
448
  apis: string[];
450
449
  components: 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,EAAoC,MAAM,IAAI,CAAC;AACzE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,MAAM,CAAC;AAE1C,OAAO,KAAK,EACV,iBAAiB,EACjB,iBAAiB,EACjB,wBAAwB,EACxB,aAAa,EACb,mBAAmB,EACnB,8BAA8B,EAC9B,0BAA0B,EAC1B,gBAAgB,EAChB,MAAM,EACN,WAAW,EAGX,aAAa,EACb,yBAAyB,EACzB,gBAAgB,EAChB,oBAAoB,EACpB,cAAc,EACd,eAAe,EACf,YAAY,EACZ,oBAAoB,EACpB,oBAAoB,EACrB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,KAAK,EACV,sBAAsB,EACtB,oBAAoB,EACpB,kBAAkB,EACnB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAG7D,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,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,KAAK,EAAE,oBAAoB,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAC3E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2CAA2C,CAAC;AACrF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAC;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,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,YAAY,EAAE,YAAY,CAAC;IAC3B,qBAAqB,EAAE,qBAAqB,CAAC;IAC7C,SAAS,EAAE,SAAS,CAAC;IACrB,gBAAgB,EAAE,0BAA0B,CAAC;IAC7C,sBAAsB,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IACpD,6BAA6B,EAAE,CAC7B,OAAO,EAAE,iBAAiB,KACvB,OAAO,CAAC,iBAAiB,GAAG,SAAS,CAAC,CAAC;IAC5C,UAAU,CAAC,EAAE,aAAa,CAAC;IAC3B,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IACpC;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB;;;;;;;;;;OAUG;IACH,iBAAiB,CAAC,EAAE,MAAM,MAAM,GAAG,SAAS,CAAC;CAC9C,CAAC;AAEF;;;;;;GAMG;AACH,UAAU,sBAAsB,CAC9B,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,CAClC,SAAQ,IAAI,CAAC,0BAA0B,CAAC,KAAK,CAAC,EAAE,OAAO,GAAG,gBAAgB,CAAC;IAC3E,iGAAiG;IACjG,KAAK,CAAC,EAAE,eAAe,CAAC;CACzB"}
@@ -31,7 +31,7 @@ export const AGENT_REPORTED_ERROR_TO_USER = "agentReportedErrorToUser";
31
31
  export const AGENT_NEEDS_USER_INPUT = "agentNeedsUserInput";
32
32
  export const AGENT_GAVE_UP = "agentGaveUp";
33
33
  export const AGENT_CANCELED = "agentCanceled";
34
- export const LLM_REQUESTED_CONTEXT = "llmRequestedContext";
34
+ const LLM_REQUESTED_CONTEXT = "llmRequestedContext";
35
35
  export const LLM_FINISHED_UNEXPECTEDLY = "llmFinishedUnexpectedly";
36
36
  export const LLM_ERRORED = "llmErrored";
37
37
  export const LLM_FINISHED = "llmFinished";