@superblocksteam/vite-plugin-file-sync 2.0.141-next.2 → 2.0.142-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 (660) hide show
  1. package/dist/ai-service/agent/middleware.d.ts +2 -1
  2. package/dist/ai-service/agent/middleware.d.ts.map +1 -1
  3. package/dist/ai-service/agent/prompts/api-prompts.d.ts +7 -1
  4. package/dist/ai-service/agent/prompts/api-prompts.d.ts.map +1 -1
  5. package/dist/ai-service/agent/prompts/api-prompts.js +24 -13
  6. package/dist/ai-service/agent/prompts/api-prompts.js.map +1 -1
  7. package/dist/ai-service/agent/prompts/build-base-system-prompt.js +1 -1
  8. package/dist/ai-service/agent/prompts/build-base-system-prompt.js.map +1 -1
  9. package/dist/ai-service/agent/prompts/build-security-scan-prompt.d.ts +0 -1
  10. package/dist/ai-service/agent/prompts/build-security-scan-prompt.d.ts.map +1 -1
  11. package/dist/ai-service/agent/prompts/build-security-scan-prompt.js +1 -1
  12. package/dist/ai-service/agent/prompts/build-security-scan-prompt.js.map +1 -1
  13. package/dist/ai-service/agent/subagents/apis/example-selector.d.ts +1 -1
  14. package/dist/ai-service/agent/subagents/apis/example-selector.d.ts.map +1 -1
  15. package/dist/ai-service/agent/subagents/apis/examples.d.ts +1 -18
  16. package/dist/ai-service/agent/subagents/apis/examples.d.ts.map +1 -1
  17. package/dist/ai-service/agent/subagents/apis/examples.js +3 -3
  18. package/dist/ai-service/agent/subagents/apis/examples.js.map +1 -1
  19. package/dist/ai-service/agent/subagents/apis/prompt-builder.d.ts +2 -1
  20. package/dist/ai-service/agent/subagents/apis/prompt-builder.d.ts.map +1 -1
  21. package/dist/ai-service/agent/tool-permission-delivery.d.ts +41 -0
  22. package/dist/ai-service/agent/tool-permission-delivery.d.ts.map +1 -0
  23. package/dist/ai-service/agent/tool-permission-delivery.js +84 -0
  24. package/dist/ai-service/agent/tool-permission-delivery.js.map +1 -0
  25. package/dist/ai-service/agent/tools/apis/api-executor.d.ts +2 -1
  26. package/dist/ai-service/agent/tools/apis/api-executor.d.ts.map +1 -1
  27. package/dist/ai-service/agent/tools/apis/api-testing-state.d.ts +2 -1
  28. package/dist/ai-service/agent/tools/apis/api-testing-state.d.ts.map +1 -1
  29. package/dist/ai-service/agent/tools/apis/api-validation-orchestrator.d.ts +5 -10
  30. package/dist/ai-service/agent/tools/apis/api-validation-orchestrator.d.ts.map +1 -1
  31. package/dist/ai-service/agent/tools/apis/api-validation-orchestrator.js +2 -2
  32. package/dist/ai-service/agent/tools/apis/api-validation-orchestrator.js.map +1 -1
  33. package/dist/ai-service/agent/tools/apis/build-api-artifact.d.ts +3 -2
  34. package/dist/ai-service/agent/tools/apis/build-api-artifact.d.ts.map +1 -1
  35. package/dist/ai-service/agent/tools/apis/get-api-docs.d.ts +0 -4
  36. package/dist/ai-service/agent/tools/apis/get-api-docs.d.ts.map +1 -1
  37. package/dist/ai-service/agent/tools/apis/get-api-docs.js +1 -1
  38. package/dist/ai-service/agent/tools/apis/get-api-docs.js.map +1 -1
  39. package/dist/ai-service/agent/tools/apis/integration-types.d.ts +2 -10
  40. package/dist/ai-service/agent/tools/apis/integration-types.d.ts.map +1 -1
  41. package/dist/ai-service/agent/tools/apis/integration-types.js +1 -14
  42. package/dist/ai-service/agent/tools/apis/integration-types.js.map +1 -1
  43. package/dist/ai-service/agent/tools/apis/sdk-registry.d.ts +2 -3
  44. package/dist/ai-service/agent/tools/apis/sdk-registry.d.ts.map +1 -1
  45. package/dist/ai-service/agent/tools/apis/sdk-registry.js +1 -1
  46. package/dist/ai-service/agent/tools/apis/sdk-registry.js.map +1 -1
  47. package/dist/ai-service/agent/tools/apis/test-api.d.ts +0 -9
  48. package/dist/ai-service/agent/tools/apis/test-api.d.ts.map +1 -1
  49. package/dist/ai-service/agent/tools/apis/test-api.js +3 -7
  50. package/dist/ai-service/agent/tools/apis/test-api.js.map +1 -1
  51. package/dist/ai-service/agent/tools/build-capture-screenshot.d.ts +1 -21
  52. package/dist/ai-service/agent/tools/build-capture-screenshot.d.ts.map +1 -1
  53. package/dist/ai-service/agent/tools/build-capture-screenshot.js +1 -1
  54. package/dist/ai-service/agent/tools/build-capture-screenshot.js.map +1 -1
  55. package/dist/ai-service/agent/tools/build-edit-file.d.ts +0 -7
  56. package/dist/ai-service/agent/tools/build-edit-file.d.ts.map +1 -1
  57. package/dist/ai-service/agent/tools/build-edit-file.js +6 -6
  58. package/dist/ai-service/agent/tools/build-edit-file.js.map +1 -1
  59. package/dist/ai-service/agent/tools/build-finalize.d.ts.map +1 -1
  60. package/dist/ai-service/agent/tools/build-finalize.js +5 -4
  61. package/dist/ai-service/agent/tools/build-finalize.js.map +1 -1
  62. package/dist/ai-service/agent/tools/build-lookup-npm-package.d.ts +2 -1
  63. package/dist/ai-service/agent/tools/build-lookup-npm-package.d.ts.map +1 -1
  64. package/dist/ai-service/agent/tools/build-manage-checklist.d.ts +32 -5
  65. package/dist/ai-service/agent/tools/build-manage-checklist.d.ts.map +1 -1
  66. package/dist/ai-service/agent/tools/build-manage-checklist.js +67 -7
  67. package/dist/ai-service/agent/tools/build-manage-checklist.js.map +1 -1
  68. package/dist/ai-service/agent/tools/build-navigate-preview.d.ts +2 -1
  69. package/dist/ai-service/agent/tools/build-navigate-preview.d.ts.map +1 -1
  70. package/dist/ai-service/agent/tools/build-read-file.d.ts +0 -12
  71. package/dist/ai-service/agent/tools/build-read-file.d.ts.map +1 -1
  72. package/dist/ai-service/agent/tools/build-read-file.js +0 -30
  73. package/dist/ai-service/agent/tools/build-read-file.js.map +1 -1
  74. package/dist/ai-service/agent/tools/databases/dev-database-tasks.d.ts +3 -4
  75. package/dist/ai-service/agent/tools/databases/dev-database-tasks.d.ts.map +1 -1
  76. package/dist/ai-service/agent/tools/databases/dev-database-tasks.js +32 -10
  77. package/dist/ai-service/agent/tools/databases/dev-database-tasks.js.map +1 -1
  78. package/dist/ai-service/agent/tools/debug-cache.d.ts +4 -3
  79. package/dist/ai-service/agent/tools/debug-cache.d.ts.map +1 -1
  80. package/dist/ai-service/agent/tools/index.d.ts +4 -2
  81. package/dist/ai-service/agent/tools/index.d.ts.map +1 -1
  82. package/dist/ai-service/agent/tools/index.js +4 -2
  83. package/dist/ai-service/agent/tools/index.js.map +1 -1
  84. package/dist/ai-service/agent/tools/mark-api-manually-verified.d.ts +31 -0
  85. package/dist/ai-service/agent/tools/mark-api-manually-verified.d.ts.map +1 -0
  86. package/dist/ai-service/agent/tools/mark-api-manually-verified.js +94 -0
  87. package/dist/ai-service/agent/tools/mark-api-manually-verified.js.map +1 -0
  88. package/dist/ai-service/agent/tools/migration/update-migration-write-policy.d.ts +23 -0
  89. package/dist/ai-service/agent/tools/migration/update-migration-write-policy.d.ts.map +1 -0
  90. package/dist/ai-service/agent/tools/migration/update-migration-write-policy.js +94 -0
  91. package/dist/ai-service/agent/tools/migration/update-migration-write-policy.js.map +1 -0
  92. package/dist/ai-service/agent/tools/screenshot-selector.d.ts +2 -1
  93. package/dist/ai-service/agent/tools/screenshot-selector.d.ts.map +1 -1
  94. package/dist/ai-service/agent/tools/shared-helpers.d.ts +0 -1
  95. package/dist/ai-service/agent/tools/shared-helpers.d.ts.map +1 -1
  96. package/dist/ai-service/agent/tools/shared-helpers.js +0 -6
  97. package/dist/ai-service/agent/tools/shared-helpers.js.map +1 -1
  98. package/dist/ai-service/agent/tools.d.ts.map +1 -1
  99. package/dist/ai-service/agent/tools.js +25 -40
  100. package/dist/ai-service/agent/tools.js.map +1 -1
  101. package/dist/ai-service/agent/tools2/tools/git.d.ts +1 -1
  102. package/dist/ai-service/agent/tools2/tools/grep-metadata-ripgrep.d.ts.map +1 -1
  103. package/dist/ai-service/agent/tools2/tools/grep-metadata-ripgrep.js +44 -38
  104. package/dist/ai-service/agent/tools2/tools/grep-metadata-ripgrep.js.map +1 -1
  105. package/dist/ai-service/agent/tools2/tools/grep.d.ts +1 -1
  106. package/dist/ai-service/agent/tools2/tools/grep.d.ts.map +1 -1
  107. package/dist/ai-service/agent/tools2/tools/grep.js +36 -28
  108. package/dist/ai-service/agent/tools2/tools/grep.js.map +1 -1
  109. package/dist/ai-service/agent/utils.d.ts +0 -1
  110. package/dist/ai-service/agent/utils.d.ts.map +1 -1
  111. package/dist/ai-service/agent/utils.js +0 -4
  112. package/dist/ai-service/agent/utils.js.map +1 -1
  113. package/dist/ai-service/app-interface/constants.d.ts +0 -24
  114. package/dist/ai-service/app-interface/constants.d.ts.map +1 -1
  115. package/dist/ai-service/app-interface/constants.js +4 -16
  116. package/dist/ai-service/app-interface/constants.js.map +1 -1
  117. package/dist/ai-service/app-interface/filesystem/index.d.ts +1 -4
  118. package/dist/ai-service/app-interface/filesystem/index.d.ts.map +1 -1
  119. package/dist/ai-service/app-interface/filesystem/index.js +0 -3
  120. package/dist/ai-service/app-interface/filesystem/index.js.map +1 -1
  121. package/dist/ai-service/app-interface/npm-error-parser.d.ts +0 -77
  122. package/dist/ai-service/app-interface/npm-error-parser.d.ts.map +1 -1
  123. package/dist/ai-service/app-interface/npm-error-parser.js.map +1 -1
  124. package/dist/ai-service/app-interface/npm-package-lookup.d.ts +2 -1
  125. package/dist/ai-service/app-interface/npm-package-lookup.d.ts.map +1 -1
  126. package/dist/ai-service/app-interface/npm-registry.d.ts +5 -5
  127. package/dist/ai-service/app-interface/npm-registry.d.ts.map +1 -1
  128. package/dist/ai-service/app-interface/shell.d.ts +5 -4
  129. package/dist/ai-service/app-interface/shell.d.ts.map +1 -1
  130. package/dist/ai-service/app-skills/helpers.d.ts +0 -9
  131. package/dist/ai-service/app-skills/helpers.d.ts.map +1 -1
  132. package/dist/ai-service/app-skills/helpers.js +2 -75
  133. package/dist/ai-service/app-skills/helpers.js.map +1 -1
  134. package/dist/ai-service/attachment-upload.d.ts +2 -1
  135. package/dist/ai-service/attachment-upload.d.ts.map +1 -1
  136. package/dist/ai-service/attachments/index.d.ts +1 -1
  137. package/dist/ai-service/attachments/index.d.ts.map +1 -1
  138. package/dist/ai-service/attachments/index.js +1 -1
  139. package/dist/ai-service/attachments/index.js.map +1 -1
  140. package/dist/ai-service/attachments/store.d.ts +5 -2
  141. package/dist/ai-service/attachments/store.d.ts.map +1 -1
  142. package/dist/ai-service/attachments/store.js.map +1 -1
  143. package/dist/ai-service/attachments/text-upload-artifacts.d.ts +0 -1
  144. package/dist/ai-service/attachments/text-upload-artifacts.d.ts.map +1 -1
  145. package/dist/ai-service/attachments/text-upload-artifacts.js +1 -1
  146. package/dist/ai-service/attachments/text-upload-artifacts.js.map +1 -1
  147. package/dist/ai-service/attachments/uploaded-content-part.d.ts +2 -15
  148. package/dist/ai-service/attachments/uploaded-content-part.d.ts.map +1 -1
  149. package/dist/ai-service/attachments/uploaded-content-part.js +1 -1
  150. package/dist/ai-service/attachments/uploaded-content-part.js.map +1 -1
  151. package/dist/ai-service/chat/chat-push-metrics.d.ts +2 -1
  152. package/dist/ai-service/chat/chat-push-metrics.d.ts.map +1 -1
  153. package/dist/ai-service/chat/chat-session-store-metrics.d.ts +3 -2
  154. package/dist/ai-service/chat/chat-session-store-metrics.d.ts.map +1 -1
  155. package/dist/ai-service/chat/chat-session-store-metrics.js.map +1 -1
  156. package/dist/ai-service/chat/chat-session-store.d.ts +3 -8
  157. package/dist/ai-service/chat/chat-session-store.d.ts.map +1 -1
  158. package/dist/ai-service/chat/chat-session-store.js +8 -2
  159. package/dist/ai-service/chat/chat-session-store.js.map +1 -1
  160. package/dist/ai-service/chat/transcript-budget.d.ts +3 -5
  161. package/dist/ai-service/chat/transcript-budget.d.ts.map +1 -1
  162. package/dist/ai-service/chat/transcript-budget.js +2 -2
  163. package/dist/ai-service/chat/transcript-budget.js.map +1 -1
  164. package/dist/ai-service/chat/transcript-metrics.d.ts +12 -0
  165. package/dist/ai-service/chat/transcript-metrics.d.ts.map +1 -1
  166. package/dist/ai-service/chat/transcript-metrics.js +14 -0
  167. package/dist/ai-service/chat/transcript-metrics.js.map +1 -1
  168. package/dist/ai-service/checklist/api-migration-checklist-gate.d.ts +2 -0
  169. package/dist/ai-service/checklist/api-migration-checklist-gate.d.ts.map +1 -1
  170. package/dist/ai-service/checklist/api-migration-checklist-gate.js +16 -1
  171. package/dist/ai-service/checklist/api-migration-checklist-gate.js.map +1 -1
  172. package/dist/ai-service/checklist/persisted-checklist-store.d.ts +2 -4
  173. package/dist/ai-service/checklist/persisted-checklist-store.d.ts.map +1 -1
  174. package/dist/ai-service/checklist/persisted-checklist-store.js +5 -5
  175. package/dist/ai-service/checklist/persisted-checklist-store.js.map +1 -1
  176. package/dist/ai-service/const.d.ts +0 -5
  177. package/dist/ai-service/const.d.ts.map +1 -1
  178. package/dist/ai-service/const.js +0 -5
  179. package/dist/ai-service/const.js.map +1 -1
  180. package/dist/ai-service/context/app-context.d.ts +2 -2
  181. package/dist/ai-service/context/app-context.d.ts.map +1 -1
  182. package/dist/ai-service/context-flush-scheduler.d.ts +2 -1
  183. package/dist/ai-service/context-flush-scheduler.d.ts.map +1 -1
  184. package/dist/ai-service/dev-database-client.d.ts +6 -5
  185. package/dist/ai-service/dev-database-client.d.ts.map +1 -1
  186. package/dist/ai-service/dev-database-client.js +2 -2
  187. package/dist/ai-service/dev-database-client.js.map +1 -1
  188. package/dist/ai-service/features.d.ts +1 -1
  189. package/dist/ai-service/features.d.ts.map +1 -1
  190. package/dist/ai-service/filter-disabled-tools-for-migration.d.ts.map +1 -1
  191. package/dist/ai-service/filter-disabled-tools-for-migration.js +3 -0
  192. package/dist/ai-service/filter-disabled-tools-for-migration.js.map +1 -1
  193. package/dist/ai-service/index.d.ts +2 -0
  194. package/dist/ai-service/index.d.ts.map +1 -1
  195. package/dist/ai-service/index.js +33 -14
  196. package/dist/ai-service/index.js.map +1 -1
  197. package/dist/ai-service/integrations/gron.d.ts +18 -0
  198. package/dist/ai-service/integrations/gron.d.ts.map +1 -0
  199. package/dist/ai-service/integrations/gron.js +321 -0
  200. package/dist/ai-service/integrations/gron.js.map +1 -0
  201. package/dist/ai-service/integrations/metadata-binaries.d.ts +28 -0
  202. package/dist/ai-service/integrations/metadata-binaries.d.ts.map +1 -0
  203. package/dist/ai-service/integrations/metadata-binaries.js +48 -0
  204. package/dist/ai-service/integrations/metadata-binaries.js.map +1 -0
  205. package/dist/ai-service/integrations/metadata-storage/local.d.ts +2 -1
  206. package/dist/ai-service/integrations/metadata-storage/local.d.ts.map +1 -1
  207. package/dist/ai-service/integrations/metadata-storage/local.js +61 -58
  208. package/dist/ai-service/integrations/metadata-storage/local.js.map +1 -1
  209. package/dist/ai-service/integrations/ripgrep-path.d.ts +6 -0
  210. package/dist/ai-service/integrations/ripgrep-path.d.ts.map +1 -0
  211. package/dist/ai-service/integrations/ripgrep-path.js +56 -0
  212. package/dist/ai-service/integrations/ripgrep-path.js.map +1 -0
  213. package/dist/ai-service/integrations/store.d.ts +3 -8
  214. package/dist/ai-service/integrations/store.d.ts.map +1 -1
  215. package/dist/ai-service/integrations/store.js +2 -8
  216. package/dist/ai-service/integrations/store.js.map +1 -1
  217. package/dist/ai-service/judge/integration/playwright-bridge.d.ts +2 -1
  218. package/dist/ai-service/judge/integration/playwright-bridge.d.ts.map +1 -1
  219. package/dist/ai-service/judge/tools/index.d.ts +0 -2
  220. package/dist/ai-service/judge/tools/index.d.ts.map +1 -1
  221. package/dist/ai-service/judge/tools/index.js +0 -2
  222. package/dist/ai-service/judge/tools/index.js.map +1 -1
  223. package/dist/ai-service/judge/tools/submit-feedback.d.ts +0 -7
  224. package/dist/ai-service/judge/tools/submit-feedback.d.ts.map +1 -1
  225. package/dist/ai-service/judge/tools/submit-feedback.js +0 -13
  226. package/dist/ai-service/judge/tools/submit-feedback.js.map +1 -1
  227. package/dist/ai-service/knowledge/helpers.d.ts +2 -1
  228. package/dist/ai-service/knowledge/helpers.d.ts.map +1 -1
  229. package/dist/ai-service/knowledge/knowledge-metrics.d.ts +5 -4
  230. package/dist/ai-service/knowledge/knowledge-metrics.d.ts.map +1 -1
  231. package/dist/ai-service/knowledge/knowledge-metrics.js.map +1 -1
  232. package/dist/ai-service/llm/chaos-fetch.d.ts +0 -12
  233. package/dist/ai-service/llm/chaos-fetch.d.ts.map +1 -1
  234. package/dist/ai-service/llm/client.d.ts +3 -3
  235. package/dist/ai-service/llm/client.d.ts.map +1 -1
  236. package/dist/ai-service/llm/context-v2/caching.d.ts +2 -1
  237. package/dist/ai-service/llm/context-v2/caching.d.ts.map +1 -1
  238. package/dist/ai-service/llm/context-v2/compaction/client-side.d.ts +2 -1
  239. package/dist/ai-service/llm/context-v2/compaction/client-side.d.ts.map +1 -1
  240. package/dist/ai-service/llm/context-v2/compactor.d.ts +2 -1
  241. package/dist/ai-service/llm/context-v2/compactor.d.ts.map +1 -1
  242. package/dist/ai-service/llm/context-v2/context-management.d.ts +1 -1
  243. package/dist/ai-service/llm/context-v2/context-management.d.ts.map +1 -1
  244. package/dist/ai-service/llm/context-v2/context-metrics.d.ts +5 -4
  245. package/dist/ai-service/llm/context-v2/context-metrics.d.ts.map +1 -1
  246. package/dist/ai-service/llm/context-v2/context-metrics.js.map +1 -1
  247. package/dist/ai-service/llm/context-v2/context.d.ts +12 -5
  248. package/dist/ai-service/llm/context-v2/context.d.ts.map +1 -1
  249. package/dist/ai-service/llm/context-v2/context.js +29 -2
  250. package/dist/ai-service/llm/context-v2/context.js.map +1 -1
  251. package/dist/ai-service/llm/context-v2/manager.d.ts +2 -1
  252. package/dist/ai-service/llm/context-v2/manager.d.ts.map +1 -1
  253. package/dist/ai-service/llm/context-v2/migrations/index.d.ts +0 -1
  254. package/dist/ai-service/llm/context-v2/migrations/index.d.ts.map +1 -1
  255. package/dist/ai-service/llm/context-v2/migrations/index.js +0 -1
  256. package/dist/ai-service/llm/context-v2/migrations/index.js.map +1 -1
  257. package/dist/ai-service/llm/context-v2/migrations/types.d.ts +0 -5
  258. package/dist/ai-service/llm/context-v2/migrations/types.d.ts.map +1 -1
  259. package/dist/ai-service/llm/context-v2/migrations/types.js +1 -8
  260. package/dist/ai-service/llm/context-v2/migrations/types.js.map +1 -1
  261. package/dist/ai-service/llm/context-v2/phase1-tool-summarizer.d.ts +3 -2
  262. package/dist/ai-service/llm/context-v2/phase1-tool-summarizer.d.ts.map +1 -1
  263. package/dist/ai-service/llm/context-v2/token-tracker.d.ts +0 -1
  264. package/dist/ai-service/llm/context-v2/token-tracker.d.ts.map +1 -1
  265. package/dist/ai-service/llm/context-v2/token-tracker.js +1 -1
  266. package/dist/ai-service/llm/context-v2/token-tracker.js.map +1 -1
  267. package/dist/ai-service/llm/context-v2/turns.d.ts +2 -1
  268. package/dist/ai-service/llm/context-v2/turns.d.ts.map +1 -1
  269. package/dist/ai-service/llm/context-v2/types.d.ts +1 -1
  270. package/dist/ai-service/llm/context-v2/types.d.ts.map +1 -1
  271. package/dist/ai-service/llm/context-v2/utils/get-loaded-context.d.ts +2 -1
  272. package/dist/ai-service/llm/context-v2/utils/get-loaded-context.d.ts.map +1 -1
  273. package/dist/ai-service/llm/error.d.ts +0 -14
  274. package/dist/ai-service/llm/error.d.ts.map +1 -1
  275. package/dist/ai-service/llm/error.js +0 -8
  276. package/dist/ai-service/llm/error.js.map +1 -1
  277. package/dist/ai-service/llm/stream/compaction-text-block.d.ts +2 -1
  278. package/dist/ai-service/llm/stream/compaction-text-block.d.ts.map +1 -1
  279. package/dist/ai-service/llm/stream/config.d.ts +4 -5
  280. package/dist/ai-service/llm/stream/config.d.ts.map +1 -1
  281. package/dist/ai-service/llm/stream/config.js +1 -1
  282. package/dist/ai-service/llm/stream/config.js.map +1 -1
  283. package/dist/ai-service/llm/stream/errors.d.ts +1 -2
  284. package/dist/ai-service/llm/stream/errors.d.ts.map +1 -1
  285. package/dist/ai-service/llm/stream/errors.js +1 -2
  286. package/dist/ai-service/llm/stream/errors.js.map +1 -1
  287. package/dist/ai-service/llm/stream/event-bus.d.ts +4 -3
  288. package/dist/ai-service/llm/stream/event-bus.d.ts.map +1 -1
  289. package/dist/ai-service/llm/stream/idle-monitor.d.ts +3 -2
  290. package/dist/ai-service/llm/stream/idle-monitor.d.ts.map +1 -1
  291. package/dist/ai-service/llm/stream/index.d.ts +1 -1
  292. package/dist/ai-service/llm/stream/index.d.ts.map +1 -1
  293. package/dist/ai-service/llm/stream/index.js.map +1 -1
  294. package/dist/ai-service/llm/stream/observers/context.d.ts +3 -3
  295. package/dist/ai-service/llm/stream/observers/context.d.ts.map +1 -1
  296. package/dist/ai-service/llm/stream/observers/context.js.map +1 -1
  297. package/dist/ai-service/llm/stream/observers/index.d.ts +4 -4
  298. package/dist/ai-service/llm/stream/observers/index.d.ts.map +1 -1
  299. package/dist/ai-service/llm/stream/observers/index.js +4 -4
  300. package/dist/ai-service/llm/stream/observers/index.js.map +1 -1
  301. package/dist/ai-service/llm/stream/observers/llmobs.d.ts +3 -2
  302. package/dist/ai-service/llm/stream/observers/llmobs.d.ts.map +1 -1
  303. package/dist/ai-service/llm/stream/observers/logging.d.ts +3 -2
  304. package/dist/ai-service/llm/stream/observers/logging.d.ts.map +1 -1
  305. package/dist/ai-service/llm/stream/observers/retry-notification.d.ts +2 -1
  306. package/dist/ai-service/llm/stream/observers/retry-notification.d.ts.map +1 -1
  307. package/dist/ai-service/llm/stream/orchestrator.d.ts +3 -2
  308. package/dist/ai-service/llm/stream/orchestrator.d.ts.map +1 -1
  309. package/dist/ai-service/llm/stream/retry-engine.d.ts +3 -6
  310. package/dist/ai-service/llm/stream/retry-engine.d.ts.map +1 -1
  311. package/dist/ai-service/llm/stream/session.d.ts +1 -1
  312. package/dist/ai-service/llm/stream/session.d.ts.map +1 -1
  313. package/dist/ai-service/llm/stream/tests/helpers/mock-provider.d.ts +1 -20
  314. package/dist/ai-service/llm/stream/tests/helpers/mock-provider.d.ts.map +1 -1
  315. package/dist/ai-service/llm/stream/tests/helpers/mock-provider.js +5 -5
  316. package/dist/ai-service/llm/stream/tests/helpers/mock-provider.js.map +1 -1
  317. package/dist/ai-service/llm/tool-context-integrity.d.ts +1 -1
  318. package/dist/ai-service/llm/tool-context-integrity.d.ts.map +1 -1
  319. package/dist/ai-service/llmobs/helpers.d.ts +0 -3
  320. package/dist/ai-service/llmobs/helpers.d.ts.map +1 -1
  321. package/dist/ai-service/llmobs/helpers.js +0 -36
  322. package/dist/ai-service/llmobs/helpers.js.map +1 -1
  323. package/dist/ai-service/llmobs/index.d.ts +1 -1
  324. package/dist/ai-service/llmobs/index.d.ts.map +1 -1
  325. package/dist/ai-service/llmobs/index.js +1 -1
  326. package/dist/ai-service/llmobs/index.js.map +1 -1
  327. package/dist/ai-service/llmobs/tracer.d.ts +1 -1
  328. package/dist/ai-service/llmobs/tracer.d.ts.map +1 -1
  329. package/dist/ai-service/llmobs/tracer.js +1 -1
  330. package/dist/ai-service/llmobs/tracer.js.map +1 -1
  331. package/dist/ai-service/llmobs/types.d.ts +0 -2
  332. package/dist/ai-service/llmobs/types.d.ts.map +1 -1
  333. package/dist/ai-service/mcp/embedded-playwright-mcp-server.d.ts +3 -3
  334. package/dist/ai-service/mcp/embedded-playwright-mcp-server.d.ts.map +1 -1
  335. package/dist/ai-service/mcp/embedded-playwright-mcp-server.js.map +1 -1
  336. package/dist/ai-service/migration-auto-dispatch-readiness.d.ts +4 -3
  337. package/dist/ai-service/migration-auto-dispatch-readiness.d.ts.map +1 -1
  338. package/dist/ai-service/migration-prompt-gating.d.ts +3 -2
  339. package/dist/ai-service/migration-prompt-gating.d.ts.map +1 -1
  340. package/dist/ai-service/migration-prompt-gating.js +1 -0
  341. package/dist/ai-service/migration-prompt-gating.js.map +1 -1
  342. package/dist/ai-service/prompt-builder-service/classifiers/prompt-interpret-task.d.ts +2 -1
  343. package/dist/ai-service/prompt-builder-service/classifiers/prompt-interpret-task.d.ts.map +1 -1
  344. package/dist/ai-service/prompt-builder-service/types.d.ts +0 -10
  345. package/dist/ai-service/prompt-builder-service/types.d.ts.map +1 -1
  346. package/dist/ai-service/prompt-builder-service/types.js +1 -1
  347. package/dist/ai-service/prompt-builder-service/types.js.map +1 -1
  348. package/dist/ai-service/quota-client.d.ts +2 -1
  349. package/dist/ai-service/quota-client.d.ts.map +1 -1
  350. package/dist/ai-service/recording/block-traversal.d.ts +0 -15
  351. package/dist/ai-service/recording/block-traversal.d.ts.map +1 -1
  352. package/dist/ai-service/recording/block-traversal.js +1 -15
  353. package/dist/ai-service/recording/block-traversal.js.map +1 -1
  354. package/dist/ai-service/recording/index.d.ts +1 -1
  355. package/dist/ai-service/recording/index.d.ts.map +1 -1
  356. package/dist/ai-service/recording/index.js +1 -1
  357. package/dist/ai-service/recording/index.js.map +1 -1
  358. package/dist/ai-service/recording/recording-manager.d.ts +2 -1
  359. package/dist/ai-service/recording/recording-manager.d.ts.map +1 -1
  360. package/dist/ai-service/recording/snapshot-manager.d.ts +2 -7
  361. package/dist/ai-service/recording/snapshot-manager.d.ts.map +1 -1
  362. package/dist/ai-service/recording/storage/session-recording-storage.d.ts +2 -1
  363. package/dist/ai-service/recording/storage/session-recording-storage.d.ts.map +1 -1
  364. package/dist/ai-service/recording/types.d.ts +0 -8
  365. package/dist/ai-service/recording/types.d.ts.map +1 -1
  366. package/dist/ai-service/resolve-generation-state-for-ui.d.ts +2 -1
  367. package/dist/ai-service/resolve-generation-state-for-ui.d.ts.map +1 -1
  368. package/dist/ai-service/security/index.d.ts +3 -3
  369. package/dist/ai-service/security/index.d.ts.map +1 -1
  370. package/dist/ai-service/security/index.js +3 -3
  371. package/dist/ai-service/security/index.js.map +1 -1
  372. package/dist/ai-service/security/safety-classifier.d.ts +3 -21
  373. package/dist/ai-service/security/safety-classifier.d.ts.map +1 -1
  374. package/dist/ai-service/security/safety-classifier.js +3 -4
  375. package/dist/ai-service/security/safety-classifier.js.map +1 -1
  376. package/dist/ai-service/security/secret-scanner-service.d.ts +0 -6
  377. package/dist/ai-service/security/secret-scanner-service.d.ts.map +1 -1
  378. package/dist/ai-service/security/secret-scanner-service.js +3 -3
  379. package/dist/ai-service/security/secret-scanner-service.js.map +1 -1
  380. package/dist/ai-service/skills/index.d.ts +1 -1
  381. package/dist/ai-service/skills/index.d.ts.map +1 -1
  382. package/dist/ai-service/skills/system/_registry.generated.d.ts.map +1 -1
  383. package/dist/ai-service/skills/system/_registry.generated.js +2 -0
  384. package/dist/ai-service/skills/system/_registry.generated.js.map +1 -1
  385. package/dist/ai-service/skills/system/materialized.d.ts +2 -1
  386. package/dist/ai-service/skills/system/materialized.d.ts.map +1 -1
  387. package/dist/ai-service/skills/system/migration-api-verification/skill.generated.d.ts +2 -0
  388. package/dist/ai-service/skills/system/migration-api-verification/skill.generated.d.ts.map +1 -0
  389. package/dist/ai-service/skills/system/migration-api-verification/skill.generated.js +119 -0
  390. package/dist/ai-service/skills/system/migration-api-verification/skill.generated.js.map +1 -0
  391. package/dist/ai-service/skills/system/superblocks-migration/skill.generated.d.ts +1 -1
  392. package/dist/ai-service/skills/system/superblocks-migration/skill.generated.d.ts.map +1 -1
  393. package/dist/ai-service/skills/system/superblocks-migration/skill.generated.js +47 -19
  394. package/dist/ai-service/skills/system/superblocks-migration/skill.generated.js.map +1 -1
  395. package/dist/ai-service/skills/types.d.ts +2 -5
  396. package/dist/ai-service/skills/types.d.ts.map +1 -1
  397. package/dist/ai-service/skills/types.js +0 -7
  398. package/dist/ai-service/skills/types.js.map +1 -1
  399. package/dist/ai-service/state-machine/clark-fsm.d.ts +1 -2
  400. package/dist/ai-service/state-machine/clark-fsm.d.ts.map +1 -1
  401. package/dist/ai-service/state-machine/clark-fsm.js.map +1 -1
  402. package/dist/ai-service/state-machine/handlers/llm-generating.d.ts.map +1 -1
  403. package/dist/ai-service/state-machine/handlers/llm-generating.js +24 -5
  404. package/dist/ai-service/state-machine/handlers/llm-generating.js.map +1 -1
  405. package/dist/ai-service/state-machine/helpers/background-chat-record-metrics.d.ts +3 -4
  406. package/dist/ai-service/state-machine/helpers/background-chat-record-metrics.d.ts.map +1 -1
  407. package/dist/ai-service/state-machine/helpers/background-chat-record-metrics.js +0 -5
  408. package/dist/ai-service/state-machine/helpers/background-chat-record-metrics.js.map +1 -1
  409. package/dist/ai-service/state-machine/helpers/change-info.d.ts +0 -1
  410. package/dist/ai-service/state-machine/helpers/change-info.d.ts.map +1 -1
  411. package/dist/ai-service/state-machine/helpers/change-info.js +1 -1
  412. package/dist/ai-service/state-machine/helpers/change-info.js.map +1 -1
  413. package/dist/ai-service/state-machine/helpers/classification.d.ts +1 -1
  414. package/dist/ai-service/state-machine/helpers/classification.d.ts.map +1 -1
  415. package/dist/ai-service/state-machine/helpers/classification.js +1 -2
  416. package/dist/ai-service/state-machine/helpers/classification.js.map +1 -1
  417. package/dist/ai-service/state-machine/helpers/fetch-with-reconnect-retry.d.ts +2 -1
  418. package/dist/ai-service/state-machine/helpers/fetch-with-reconnect-retry.d.ts.map +1 -1
  419. package/dist/ai-service/state-machine/helpers/peer.d.ts +4 -3
  420. package/dist/ai-service/state-machine/helpers/peer.d.ts.map +1 -1
  421. package/dist/ai-service/state-machine/helpers/pre-session-metrics.d.ts +36 -0
  422. package/dist/ai-service/state-machine/helpers/pre-session-metrics.d.ts.map +1 -0
  423. package/dist/ai-service/state-machine/helpers/pre-session-metrics.js +128 -0
  424. package/dist/ai-service/state-machine/helpers/pre-session-metrics.js.map +1 -0
  425. package/dist/ai-service/state-machine/helpers/prompt-failure.d.ts +2 -1
  426. package/dist/ai-service/state-machine/helpers/prompt-failure.d.ts.map +1 -1
  427. package/dist/ai-service/state-machine/helpers/stable-peer.d.ts +14 -3
  428. package/dist/ai-service/state-machine/helpers/stable-peer.d.ts.map +1 -1
  429. package/dist/ai-service/state-machine/helpers/stable-peer.js +32 -13
  430. package/dist/ai-service/state-machine/helpers/stable-peer.js.map +1 -1
  431. package/dist/ai-service/tasks/factory.d.ts +4 -1
  432. package/dist/ai-service/tasks/factory.d.ts.map +1 -1
  433. package/dist/ai-service/tasks/factory.js.map +1 -1
  434. package/dist/ai-service/tasks/index.d.ts +4 -6
  435. package/dist/ai-service/tasks/index.d.ts.map +1 -1
  436. package/dist/ai-service/tasks/index.js +3 -5
  437. package/dist/ai-service/tasks/index.js.map +1 -1
  438. package/dist/ai-service/tasks/poll-loop.d.ts +2 -1
  439. package/dist/ai-service/tasks/poll-loop.d.ts.map +1 -1
  440. package/dist/ai-service/tasks/task-store.d.ts +3 -3
  441. package/dist/ai-service/tasks/task-store.d.ts.map +1 -1
  442. package/dist/ai-service/tasks/task-store.js +1 -1
  443. package/dist/ai-service/tasks/task-store.js.map +1 -1
  444. package/dist/ai-service/tasks/test-utils.d.ts +2 -1
  445. package/dist/ai-service/tasks/test-utils.d.ts.map +1 -1
  446. package/dist/ai-service/tasks/types.d.ts +1 -82
  447. package/dist/ai-service/tasks/types.d.ts.map +1 -1
  448. package/dist/ai-service/tasks/types.js +0 -18
  449. package/dist/ai-service/tasks/types.js.map +1 -1
  450. package/dist/ai-service/test-utils/dd-trace-helpers.d.ts +0 -3
  451. package/dist/ai-service/test-utils/dd-trace-helpers.d.ts.map +1 -1
  452. package/dist/ai-service/test-utils/dd-trace-helpers.js +3 -3
  453. package/dist/ai-service/test-utils/dd-trace-helpers.js.map +1 -1
  454. package/dist/ai-service/test-utils/span-interceptor.d.ts +2 -2
  455. package/dist/ai-service/test-utils/span-interceptor.d.ts.map +1 -1
  456. package/dist/ai-service/transform/api-builder/shared.d.ts +0 -3
  457. package/dist/ai-service/transform/api-builder/shared.d.ts.map +1 -1
  458. package/dist/ai-service/transform/api-builder/shared.js +1 -1
  459. package/dist/ai-service/transform/api-builder/shared.js.map +1 -1
  460. package/dist/ai-service/types.d.ts +6 -101
  461. package/dist/ai-service/types.d.ts.map +1 -1
  462. package/dist/ai-service/types.js +0 -84
  463. package/dist/ai-service/types.js.map +1 -1
  464. package/dist/ai-service/util/archive-extractors.d.ts +0 -13
  465. package/dist/ai-service/util/archive-extractors.d.ts.map +1 -1
  466. package/dist/ai-service/util/archive-extractors.js +3 -3
  467. package/dist/ai-service/util/archive-extractors.js.map +1 -1
  468. package/dist/ai-service/util/llm-config-utils.d.ts +3 -3
  469. package/dist/ai-service/util/llm-config-utils.d.ts.map +1 -1
  470. package/dist/ai-service/util/llm-config-utils.js +1 -1
  471. package/dist/ai-service/util/llm-config-utils.js.map +1 -1
  472. package/dist/ai-service/util/rpc-timeout.d.ts +12 -0
  473. package/dist/ai-service/util/rpc-timeout.d.ts.map +1 -1
  474. package/dist/ai-service/util/rpc-timeout.js +12 -0
  475. package/dist/ai-service/util/rpc-timeout.js.map +1 -1
  476. package/dist/binding-extraction/extract-control-block-identifiers.d.ts +0 -1
  477. package/dist/binding-extraction/extract-control-block-identifiers.d.ts.map +1 -1
  478. package/dist/binding-extraction/extract-control-block-identifiers.js +1 -1
  479. package/dist/binding-extraction/extract-control-block-identifiers.js.map +1 -1
  480. package/dist/binding-extraction/shared.d.ts +0 -4
  481. package/dist/binding-extraction/shared.d.ts.map +1 -1
  482. package/dist/client-error-overlay.d.ts +7 -3
  483. package/dist/client-error-overlay.d.ts.map +1 -1
  484. package/dist/client-error-overlay.js +67 -101
  485. package/dist/client-error-overlay.js.map +1 -1
  486. package/dist/codegen.d.ts +0 -1
  487. package/dist/codegen.d.ts.map +1 -1
  488. package/dist/codegen.js +1 -1
  489. package/dist/codegen.js.map +1 -1
  490. package/dist/dev-server-ws-smoke-client.d.ts +4 -5
  491. package/dist/dev-server-ws-smoke-client.d.ts.map +1 -1
  492. package/dist/dev-server-ws-smoke-client.js +1 -1
  493. package/dist/dev-server-ws-smoke-client.js.map +1 -1
  494. package/dist/errors/error-handler.d.ts +2 -12
  495. package/dist/errors/error-handler.d.ts.map +1 -1
  496. package/dist/errors/error-handler.js +1 -1
  497. package/dist/errors/error-handler.js.map +1 -1
  498. package/dist/file-sync-vite-plugin.d.ts +0 -1
  499. package/dist/file-sync-vite-plugin.d.ts.map +1 -1
  500. package/dist/file-sync-vite-plugin.js +1 -1
  501. package/dist/file-sync-vite-plugin.js.map +1 -1
  502. package/dist/file-system-helpers.d.ts +0 -13
  503. package/dist/file-system-helpers.d.ts.map +1 -1
  504. package/dist/file-system-helpers.js +4 -13
  505. package/dist/file-system-helpers.js.map +1 -1
  506. package/dist/file-system-manager.d.ts +1 -1
  507. package/dist/file-system-manager.d.ts.map +1 -1
  508. package/dist/git-log.d.ts +2 -1
  509. package/dist/git-log.d.ts.map +1 -1
  510. package/dist/git-service/app-layout-guard.d.ts +2 -13
  511. package/dist/git-service/app-layout-guard.d.ts.map +1 -1
  512. package/dist/git-service/app-layout-guard.js +1 -1
  513. package/dist/git-service/app-layout-guard.js.map +1 -1
  514. package/dist/git-service/bitbucket-workflow.d.ts +0 -1
  515. package/dist/git-service/bitbucket-workflow.d.ts.map +1 -1
  516. package/dist/git-service/bitbucket-workflow.js +1 -1
  517. package/dist/git-service/bitbucket-workflow.js.map +1 -1
  518. package/dist/git-service/ensure-workflow-file.d.ts +2 -1
  519. package/dist/git-service/ensure-workflow-file.d.ts.map +1 -1
  520. package/dist/git-service/index.d.ts +2 -2
  521. package/dist/git-service/index.d.ts.map +1 -1
  522. package/dist/git-service/index.js +1 -1
  523. package/dist/git-service/index.js.map +1 -1
  524. package/dist/git-service/live-branch.d.ts.map +1 -1
  525. package/dist/git-service/live-branch.js +5 -0
  526. package/dist/git-service/live-branch.js.map +1 -1
  527. package/dist/git-service/managed-excludes.d.ts +36 -0
  528. package/dist/git-service/managed-excludes.d.ts.map +1 -0
  529. package/dist/git-service/managed-excludes.js +124 -0
  530. package/dist/git-service/managed-excludes.js.map +1 -0
  531. package/dist/lock-service/activity-tracker.d.ts +2 -7
  532. package/dist/lock-service/activity-tracker.d.ts.map +1 -1
  533. package/dist/lock-service/activity-tracker.js +1 -1
  534. package/dist/lock-service/activity-tracker.js.map +1 -1
  535. package/dist/migration/inline-v2-backup-source-files.d.ts +7 -0
  536. package/dist/migration/inline-v2-backup-source-files.d.ts.map +1 -0
  537. package/dist/migration/inline-v2-backup-source-files.js +110 -0
  538. package/dist/migration/inline-v2-backup-source-files.js.map +1 -0
  539. package/dist/migration/integration-write-policy.d.ts +13 -1
  540. package/dist/migration/integration-write-policy.d.ts.map +1 -1
  541. package/dist/migration/integration-write-policy.js +96 -2
  542. package/dist/migration/integration-write-policy.js.map +1 -1
  543. package/dist/migration/mark-api-testing-denied.d.ts +27 -0
  544. package/dist/migration/mark-api-testing-denied.d.ts.map +1 -0
  545. package/dist/migration/mark-api-testing-denied.js +80 -0
  546. package/dist/migration/mark-api-testing-denied.js.map +1 -0
  547. package/dist/migration/migration-checklist.d.ts +4 -33
  548. package/dist/migration/migration-checklist.d.ts.map +1 -1
  549. package/dist/migration/migration-checklist.js +3 -11
  550. package/dist/migration/migration-checklist.js.map +1 -1
  551. package/dist/migration/migration-classifier.d.ts.map +1 -1
  552. package/dist/migration/migration-classifier.js +10 -0
  553. package/dist/migration/migration-classifier.js.map +1 -1
  554. package/dist/migration/migration-metrics.d.ts +8 -3
  555. package/dist/migration/migration-metrics.d.ts.map +1 -1
  556. package/dist/migration/migration-metrics.js +26 -0
  557. package/dist/migration/migration-metrics.js.map +1 -1
  558. package/dist/migration/migration-routes.d.ts.map +1 -1
  559. package/dist/migration/migration-routes.js +32 -10
  560. package/dist/migration/migration-routes.js.map +1 -1
  561. package/dist/migration/migration-verification.d.ts +62 -22
  562. package/dist/migration/migration-verification.d.ts.map +1 -1
  563. package/dist/migration/migration-verification.js +326 -151
  564. package/dist/migration/migration-verification.js.map +1 -1
  565. package/dist/migration/recommended-user-deps.d.ts +2 -1
  566. package/dist/migration/recommended-user-deps.d.ts.map +1 -1
  567. package/dist/migration/resolve-v2-backup-path.d.ts +7 -0
  568. package/dist/migration/resolve-v2-backup-path.d.ts.map +1 -0
  569. package/dist/migration/resolve-v2-backup-path.js +35 -0
  570. package/dist/migration/resolve-v2-backup-path.js.map +1 -0
  571. package/dist/migration/restructure.d.ts +4 -4
  572. package/dist/migration/restructure.d.ts.map +1 -1
  573. package/dist/migration/restructure.js +4 -12
  574. package/dist/migration/restructure.js.map +1 -1
  575. package/dist/migration/translation-prompt.d.ts +2 -1
  576. package/dist/migration/translation-prompt.d.ts.map +1 -1
  577. package/dist/migration/translation-prompt.js +2 -0
  578. package/dist/migration/translation-prompt.js.map +1 -1
  579. package/dist/migration/unsupported-integrations.d.ts +3 -2
  580. package/dist/migration/unsupported-integrations.d.ts.map +1 -1
  581. package/dist/npm/normalize-workspace-protocol-for-npm.d.ts +1 -1
  582. package/dist/npm/normalize-workspace-protocol-for-npm.d.ts.map +1 -1
  583. package/dist/npm/prepare-package-json-for-cloud-npm.d.ts +0 -13
  584. package/dist/npm/prepare-package-json-for-cloud-npm.d.ts.map +1 -1
  585. package/dist/npm/prepare-package-json-for-cloud-npm.js +1 -1
  586. package/dist/npm/prepare-package-json-for-cloud-npm.js.map +1 -1
  587. package/dist/npm/rewrite-platform-workspace-deps.d.ts +1 -1
  588. package/dist/npm/rewrite-platform-workspace-deps.d.ts.map +1 -1
  589. package/dist/parsing/ids.d.ts +0 -1
  590. package/dist/parsing/ids.d.ts.map +1 -1
  591. package/dist/parsing/ids.js +1 -1
  592. package/dist/parsing/ids.js.map +1 -1
  593. package/dist/parsing/imports.d.ts +0 -4
  594. package/dist/parsing/imports.d.ts.map +1 -1
  595. package/dist/parsing/imports.js.map +1 -1
  596. package/dist/parsing/jsx-utils.d.ts +0 -2
  597. package/dist/parsing/jsx-utils.d.ts.map +1 -1
  598. package/dist/parsing/jsx-utils.js +0 -15
  599. package/dist/parsing/jsx-utils.js.map +1 -1
  600. package/dist/parsing/jsx.d.ts +0 -2
  601. package/dist/parsing/jsx.d.ts.map +1 -1
  602. package/dist/parsing/jsx.js +0 -32
  603. package/dist/parsing/jsx.js.map +1 -1
  604. package/dist/parsing/sdk-registry.d.ts +1 -1
  605. package/dist/parsing/sdk-registry.d.ts.map +1 -1
  606. package/dist/parsing/util.d.ts +0 -6
  607. package/dist/parsing/util.d.ts.map +1 -1
  608. package/dist/parsing/util.js +3 -32
  609. package/dist/parsing/util.js.map +1 -1
  610. package/dist/plugin-options.d.ts +0 -1
  611. package/dist/plugin-options.d.ts.map +1 -1
  612. package/dist/plugin-options.js +0 -3
  613. package/dist/plugin-options.js.map +1 -1
  614. package/dist/policy-gate-callback-mapper.d.ts +2 -2
  615. package/dist/policy-gate-callback-mapper.d.ts.map +1 -1
  616. package/dist/policy-gate-runner.d.ts +2 -2
  617. package/dist/policy-gate-runner.d.ts.map +1 -1
  618. package/dist/policy-gate-runner.js +0 -1
  619. package/dist/policy-gate-runner.js.map +1 -1
  620. package/dist/refactor/blocks.d.ts +1 -2
  621. package/dist/refactor/blocks.d.ts.map +1 -1
  622. package/dist/refactor/blocks.js +1 -1
  623. package/dist/refactor/blocks.js.map +1 -1
  624. package/dist/router-parser.d.ts +2 -1
  625. package/dist/router-parser.d.ts.map +1 -1
  626. package/dist/router-parser.js +154 -20
  627. package/dist/router-parser.js.map +1 -1
  628. package/dist/snapshot-routes.d.ts +2 -1
  629. package/dist/snapshot-routes.d.ts.map +1 -1
  630. package/dist/socket-manager.d.ts +0 -1
  631. package/dist/socket-manager.d.ts.map +1 -1
  632. package/dist/socket-manager.js +1 -1
  633. package/dist/socket-manager.js.map +1 -1
  634. package/dist/sync-service/download.d.ts +2 -6
  635. package/dist/sync-service/download.d.ts.map +1 -1
  636. package/dist/sync-service/download.js +1 -1
  637. package/dist/sync-service/download.js.map +1 -1
  638. package/dist/util.d.ts +1 -23
  639. package/dist/util.d.ts.map +1 -1
  640. package/dist/util.js +1 -109
  641. package/dist/util.js.map +1 -1
  642. package/dist/vite-plugin-yaml-types.d.ts +2 -1
  643. package/dist/vite-plugin-yaml-types.d.ts.map +1 -1
  644. package/package.json +9 -18
  645. package/dist/ai-service/app-interface/filesystem/handlers/index.d.ts +0 -6
  646. package/dist/ai-service/app-interface/filesystem/handlers/index.d.ts.map +0 -1
  647. package/dist/ai-service/app-interface/filesystem/handlers/index.js +0 -6
  648. package/dist/ai-service/app-interface/filesystem/handlers/index.js.map +0 -1
  649. package/dist/ai-service/knowledge/index.d.ts +0 -4
  650. package/dist/ai-service/knowledge/index.d.ts.map +0 -1
  651. package/dist/ai-service/knowledge/index.js +0 -3
  652. package/dist/ai-service/knowledge/index.js.map +0 -1
  653. package/dist/ai-service/llm/context-v2/compaction/index.d.ts +0 -5
  654. package/dist/ai-service/llm/context-v2/compaction/index.d.ts.map +0 -1
  655. package/dist/ai-service/llm/context-v2/compaction/index.js +0 -3
  656. package/dist/ai-service/llm/context-v2/compaction/index.js.map +0 -1
  657. package/dist/ai-service/llm/utils.d.ts +0 -7
  658. package/dist/ai-service/llm/utils.d.ts.map +0 -1
  659. package/dist/ai-service/llm/utils.js +0 -52
  660. package/dist/ai-service/llm/utils.js.map +0 -1
@@ -11,15 +11,18 @@ import { ApiExecutor, } from "../ai-service/agent/tools/apis/api-executor.js";
11
11
  import { markSdkApiAsVerified } from "../ai-service/agent/tools/apis/api-testing-state.js";
12
12
  import { createToolFactory, PermissionLevel, ToolCategory, } from "../ai-service/agent/tools2/types.js";
13
13
  import { updateChecklistItem } from "../ai-service/checklist/persisted-checklist-store.js";
14
+ import { isPeerUnavailableError, } from "../ai-service/state-machine/helpers/stable-peer.js";
14
15
  import { sanitizeLogMessage } from "../util/log-sanitizer.js";
15
16
  import { getLogger } from "../util/logger.js";
16
17
  import { OperationQueue } from "../util/operation-queue.js";
18
+ import { inlineV2BackupSourceFiles } from "./inline-v2-backup-source-files.js";
19
+ import { readIntegrationWritePolicyForEnforcement } from "./integration-write-policy.js";
17
20
  import { classifyYamlStepMutation } from "./migration-classifier.js";
18
21
  import { recordMigrationVerification } from "./migration-metrics.js";
22
+ import { resolveV2BackupYamlPath } from "./resolve-v2-backup-path.js";
19
23
  import { forEachYamlStep } from "./yaml-walk.js";
20
24
  const SCRATCH_DIR = "scratch";
21
25
  const VERIFICATION_DIR = "migration-verification";
22
- const V2_BACKUP_DIR = "v2-backup";
23
26
  const DIFF_SIZE_CAP = 1024 * 1024; // 1 MB
24
27
  const PIPELINE_TIMEOUT_MS = 30_000;
25
28
  /**
@@ -30,6 +33,35 @@ const PIPELINE_TIMEOUT_MS = 30_000;
30
33
  * answer ("yes"); the cap removes that judgment from the loop.
31
34
  */
32
35
  export const MAX_VERIFICATION_ATTEMPTS = 10;
36
+ /**
37
+ * Verification outcomes caused by editor-peer / environment state rather
38
+ * than by the API under test. These do NOT consume `MAX_VERIFICATION_ATTEMPTS`
39
+ * — burning real attempts on a backgrounded tab or dropped socket pushed APIs
40
+ * toward `exhausted` -> `failed`. They are still recorded in history for
41
+ * diagnostics and for the consecutive-transient backstop below.
42
+ *
43
+ * `transient_exhausted` is itself included: it IS a transient outcome (the
44
+ * backstop tripping), so it keeps the consecutive streak alive while the peer
45
+ * stays down (each subsequent transient re-trips the backstop) and never
46
+ * counts as a real attempt.
47
+ */
48
+ const TRANSIENT_OUTCOME_KINDS = new Set(["timeout", "disconnected", "transient_exhausted"]);
49
+ /**
50
+ * Runaway backstop: cap on *consecutive* transient (timeout/disconnected)
51
+ * outcomes for an API. Deliberately generous — transient outcomes don't
52
+ * consume real attempts, so this exists only to stop an unattended retry loop
53
+ * from spinning forever against a dead editor peer.
54
+ *
55
+ * Counted as a trailing streak that resets on any real (non-transient)
56
+ * outcome, and checked AFTER the pipeline runs — so a peer that recovers
57
+ * always gets a fresh real attempt and the API self-heals. Crucially, tripping
58
+ * it yields `transient_exhausted`, NOT `exhausted`: the environment failing is
59
+ * never the API's fault, so it must never mark the checklist item `failed`
60
+ * (that was the Foundever failure mode). Sustained disconnects will get a
61
+ * durable pause/resume as a follow-up; here the backstop just tells the agent
62
+ * to stop auto-retrying and escalate to the user.
63
+ */
64
+ export const MAX_TRANSIENT_VERIFICATION_ATTEMPTS = 30;
33
65
  const LANGUAGE_PLUGIN_IDS = new Set(Object.values(LanguagePluginID));
34
66
  /**
35
67
  * Verify a single API by running both the v2 YAML and v3 TS versions with the
@@ -58,11 +90,24 @@ export async function runMigrationVerification(params) {
58
90
  // APIs use different queues and remain fully parallel.
59
91
  return getVerificationHistoryQueue(params.appRootDir, params.apiName).enqueue(async () => {
60
92
  const history = await readHistory(params.appRootDir, params.apiName);
61
- if (history.attempts.length >= MAX_VERIFICATION_ATTEMPTS) {
93
+ // Real (non-transient) attempts count over the whole migration: a
94
+ // genuinely non-converging API must still hit MAX_VERIFICATION_ATTEMPTS
95
+ // and fail, regardless of transients sprinkled in between.
96
+ const effectiveAttempts = history.attempts.filter((a) => !TRANSIENT_OUTCOME_KINDS.has(a.kind)).length;
97
+ // Transient backstop counts only the CONSECUTIVE trailing transients —
98
+ // it resets on any real outcome. A lifetime total would let unrelated
99
+ // disconnect episodes across a long migration accumulate and, worse,
100
+ // brick an API that is verifying fine between episodes.
101
+ const trailingTransientAttempts = countTrailingTransientAttempts(history);
102
+ // Only the real-attempt cap short-circuits before running: that API
103
+ // genuinely isn't converging. The transient backstop deliberately does
104
+ // NOT short-circuit here — we run the pipeline so a peer that has
105
+ // recovered gets a fresh real attempt and the API self-heals.
106
+ if (effectiveAttempts >= MAX_VERIFICATION_ATTEMPTS) {
62
107
  recordMigrationVerification({ kind: "exhausted" });
63
108
  return {
64
109
  kind: "exhausted",
65
- attempts: history.attempts.length,
110
+ attempts: effectiveAttempts,
66
111
  lastDivergence: await readLastDivergedDiff(params.appRootDir, params.apiName),
67
112
  };
68
113
  }
@@ -81,10 +126,23 @@ export async function runMigrationVerification(params) {
81
126
  outcome = {
82
127
  kind: "diverged",
83
128
  diff: raw.diff,
84
- attempt: history.attempts.length + 1,
129
+ attempt: effectiveAttempts + 1,
85
130
  progress,
86
131
  };
87
132
  }
133
+ else if ((raw.kind === "timeout" || raw.kind === "disconnected") &&
134
+ trailingTransientAttempts + 1 >= MAX_TRANSIENT_VERIFICATION_ATTEMPTS) {
135
+ // This transient outcome pushes the consecutive streak to the backstop.
136
+ // Escalate to `transient_exhausted` (retryable, never marks failed)
137
+ // instead of returning yet another plain transient the agent would
138
+ // keep retrying forever.
139
+ outcome = {
140
+ kind: "transient_exhausted",
141
+ side: raw.side,
142
+ reason: raw.reason,
143
+ transientAttempts: trailingTransientAttempts + 1,
144
+ };
145
+ }
88
146
  else {
89
147
  outcome = raw;
90
148
  }
@@ -96,8 +154,25 @@ export async function runMigrationVerification(params) {
96
154
  // consistent shape. Apply name only; raw failure strings stay scrubbed.
97
155
  getLogger().info(`[migration-verify] outcome`, {
98
156
  apiName: params.apiName,
99
- attempt: history.attempts.length + 1,
157
+ attempt: effectiveAttempts + 1,
100
158
  maxAttempts: MAX_VERIFICATION_ATTEMPTS,
159
+ // `attempt` counts only real (non-transient) attempts — it is the value
160
+ // the `maxAttempts` cap is enforced against. `totalCalls` is the raw
161
+ // ordinal across every call including transients
162
+ // (timeout/disconnected/transient_exhausted), preserving the pre-ENG-4674
163
+ // total-call semantics of `attempt` as an explicit field rather than a
164
+ // silently-changed one.
165
+ totalCalls: history.attempts.length + 1,
166
+ // Consecutive transient streak *including* this outcome when it is
167
+ // itself transient (timeout/disconnected/transient_exhausted); the
168
+ // just-broken prior streak length when a real outcome ends the run.
169
+ // `countTrailingTransientAttempts` reads history only, so it excludes
170
+ // the current outcome — add it back here so a plain transient reports
171
+ // the same streak length that `transient_exhausted` does
172
+ // (`outcome.transientAttempts` === trailingTransientAttempts + 1).
173
+ trailingTransientAttempts: TRANSIENT_OUTCOME_KINDS.has(outcome.kind)
174
+ ? trailingTransientAttempts + 1
175
+ : trailingTransientAttempts,
101
176
  kind: outcome.kind,
102
177
  progress: outcome.kind === "diverged" ? outcome.progress : undefined,
103
178
  divergenceCount: outcome.kind === "diverged"
@@ -118,6 +193,26 @@ export async function runMigrationVerification(params) {
118
193
  return outcome;
119
194
  });
120
195
  }
196
+ /**
197
+ * Extract a human-readable message from a thrown value. Transport-close
198
+ * rejections from `ISocket` (the plain-object `{code: 8}` path — see
199
+ * `isTransportCloseError`) are NOT `Error` instances, so a bare `instanceof
200
+ * Error` check falls through to `String(error)` = "[object Object]", discarding
201
+ * the "[internal] Connection closed" message on exactly the disconnect path we
202
+ * surface for on-call diagnosis. Read `.message` off any object that carries a
203
+ * string one before giving up on `String()`.
204
+ */
205
+ function errorReason(error) {
206
+ if (error instanceof Error)
207
+ return error.message;
208
+ if (typeof error === "object" &&
209
+ error !== null &&
210
+ "message" in error &&
211
+ typeof error.message === "string") {
212
+ return error.message;
213
+ }
214
+ return String(error);
215
+ }
121
216
  async function computeVerificationOutcome({ apiName, appRootDir, inputs, runV2Pipeline, runV3Sdk, }) {
122
217
  const verificationInputs = inputs ?? {};
123
218
  // 1. Detect mutations in the v3 TS source before running anything.
@@ -159,7 +254,7 @@ async function computeVerificationOutcome({ apiName, appRootDir, inputs, runV2Pi
159
254
  ],
160
255
  };
161
256
  }
162
- const v2BackupPath = join(appRootDir, SCRATCH_DIR, V2_BACKUP_DIR, "apis", apiName, "api.yaml");
257
+ const v2BackupPath = await resolveV2BackupYamlPath(appRootDir, apiName);
163
258
  // Also check the v2 backup for writes — a half-migrated API where v3 looks
164
259
  // read-only but the original v2 still mutates would otherwise bypass the
165
260
  // policy gate and run the v2 pipeline against real integrations.
@@ -198,12 +293,22 @@ async function computeVerificationOutcome({ apiName, appRootDir, inputs, runV2Pi
198
293
  if (error instanceof PipelineTimeoutError) {
199
294
  return { kind: "timeout", side: "v2", reason: error.message };
200
295
  }
201
- if (error instanceof EditorClientUnavailableError) {
202
- return { kind: "disconnected", side: "v2", reason: error.message };
296
+ // The editor peer dying while the RPC was in flight (transport close) OR
297
+ // while it sat queued waiting to reconnect (StablePeer's `peer_closed:` /
298
+ // `peer_queue_overflow`) is the same diagnosis as the pre-flight gate, so
299
+ // the same outcome. It must never fall through to `v2_unrunnable`, which
300
+ // auto-completes the checklist item on a dead editor tab.
301
+ if (error instanceof EditorClientUnavailableError ||
302
+ isPeerUnavailableError(error)) {
303
+ return {
304
+ kind: "disconnected",
305
+ side: "v2",
306
+ reason: errorReason(error),
307
+ };
203
308
  }
204
309
  return {
205
310
  kind: "v2_unrunnable",
206
- reason: error instanceof Error ? error.message : String(error),
311
+ reason: formatV2UnrunnableReason(error),
207
312
  };
208
313
  }
209
314
  // 3. Run v3 SDK.
@@ -215,12 +320,17 @@ async function computeVerificationOutcome({ apiName, appRootDir, inputs, runV2Pi
215
320
  if (error instanceof PipelineTimeoutError) {
216
321
  return { kind: "timeout", side: "v3", reason: error.message };
217
322
  }
218
- if (error instanceof EditorClientUnavailableError) {
219
- return { kind: "disconnected", side: "v3", reason: error.message };
323
+ if (error instanceof EditorClientUnavailableError ||
324
+ isPeerUnavailableError(error)) {
325
+ return {
326
+ kind: "disconnected",
327
+ side: "v3",
328
+ reason: errorReason(error),
329
+ };
220
330
  }
221
331
  return {
222
332
  kind: "error",
223
- reason: error instanceof Error ? error.message : String(error),
333
+ reason: errorReason(error),
224
334
  };
225
335
  }
226
336
  // 3.5. If both executions returned failure, surface that explicitly rather
@@ -305,9 +415,122 @@ async function computeVerificationOutcome({ apiName, appRootDir, inputs, runV2Pi
305
415
  return { kind: "diverged", diff };
306
416
  }
307
417
  /** Relative path (from appRootDir) for a diff JSON file. */
308
- export function diffRelativePath(apiName) {
418
+ function diffRelativePath(apiName) {
309
419
  return `${SCRATCH_DIR}/${VERIFICATION_DIR}/${apiName}.diff.json`;
310
420
  }
421
+ function assertNever(value) {
422
+ throw new Error(`Unexpected verification outcome: ${JSON.stringify(value)}`);
423
+ }
424
+ async function clearTransientVerificationFields(params) {
425
+ const { apiName, appRootDirPath } = params;
426
+ // Transient outcomes (`error`, `timeout`, `disconnected`,
427
+ // `transient_exhausted`) must never mark the checklist item complete or stamp
428
+ // a skip reason — the agent should retry once the environment recovers. Clear
429
+ // stale fields from a prior run so the UI does not show outdated pass/skip
430
+ // metadata.
431
+ await updateChecklistItem({
432
+ appRootDirPath,
433
+ itemId: `api_${apiName}`,
434
+ verificationOutcome: null,
435
+ verificationSkippedReason: null,
436
+ lastVerificationAt: new Date().toISOString(),
437
+ });
438
+ }
439
+ export async function syncVerificationOutcomeToChecklist(params) {
440
+ const { apiName, appRootDirPath, clark, outcome } = params;
441
+ if (outcome.kind === "passed") {
442
+ markSdkApiAsVerified(clark, apiName);
443
+ await updateChecklistItem({
444
+ appRootDirPath,
445
+ itemId: `api_${apiName}`,
446
+ verificationOutcome: "auto_passed",
447
+ verificationSkippedReason: null,
448
+ lastVerificationAt: new Date().toISOString(),
449
+ });
450
+ return;
451
+ }
452
+ if (outcome.kind === "skipped_mutation") {
453
+ // Deliberate behavior change (ENG-4484): mutation-skipped APIs are marked
454
+ // `completed` immediately so the user can verify them manually at finalize
455
+ // time instead of leaving rows stuck `in_progress`.
456
+ await updateChecklistItem({
457
+ appRootDirPath,
458
+ itemId: `api_${apiName}`,
459
+ status: "completed",
460
+ verificationSkippedReason: "mutation",
461
+ verificationOutcome: null,
462
+ lastVerificationAt: new Date().toISOString(),
463
+ });
464
+ return;
465
+ }
466
+ if (outcome.kind === "v2_unrunnable") {
467
+ await updateChecklistItem({
468
+ appRootDirPath,
469
+ itemId: `api_${apiName}`,
470
+ verificationSkippedReason: "v2_unrunnable",
471
+ verificationOutcome: null,
472
+ lastVerificationAt: new Date().toISOString(),
473
+ });
474
+ return;
475
+ }
476
+ if (outcome.kind === "both_failed") {
477
+ // Deliberately do NOT mark `status: completed` — the agent should retry
478
+ // with synthesized inputs rather than treat this as terminal.
479
+ await updateChecklistItem({
480
+ appRootDirPath,
481
+ itemId: `api_${apiName}`,
482
+ verificationSkippedReason: "both_failed",
483
+ verificationOutcome: null,
484
+ lastVerificationAt: new Date().toISOString(),
485
+ });
486
+ return;
487
+ }
488
+ if (outcome.kind === "diverged") {
489
+ await updateChecklistItem({
490
+ appRootDirPath,
491
+ itemId: `api_${apiName}`,
492
+ verificationOutcome: null,
493
+ verificationSkippedReason: null,
494
+ lastVerificationAt: new Date().toISOString(),
495
+ lastVerificationDiffPath: diffRelativePath(apiName),
496
+ });
497
+ return;
498
+ }
499
+ if (outcome.kind === "exhausted") {
500
+ // Terminal failure: the hard attempt cap was reached without convergence.
501
+ await updateChecklistItem({
502
+ appRootDirPath,
503
+ itemId: `api_${apiName}`,
504
+ status: "failed",
505
+ failureReason: `verification_exhausted: hit MAX_VERIFICATION_ATTEMPTS (${MAX_VERIFICATION_ATTEMPTS}) without converging. See scratch/migration-verification/${apiName}.history.json for the per-attempt log.`,
506
+ verificationOutcome: null,
507
+ verificationSkippedReason: null,
508
+ lastVerificationAt: new Date().toISOString(),
509
+ ...(outcome.lastDivergence
510
+ ? { lastVerificationDiffPath: diffRelativePath(apiName) }
511
+ : {}),
512
+ });
513
+ return;
514
+ }
515
+ if (outcome.kind === "error" ||
516
+ outcome.kind === "timeout" ||
517
+ outcome.kind === "disconnected" ||
518
+ outcome.kind === "transient_exhausted") {
519
+ // `transient_exhausted` (the consecutive-transient backstop) belongs here,
520
+ // NOT with `exhausted`: the environment being unreachable is never the
521
+ // API's fault, so the item must stay retryable and must never be marked
522
+ // failed. It self-heals once the editor peer reconnects.
523
+ await clearTransientVerificationFields({
524
+ apiName,
525
+ appRootDirPath,
526
+ });
527
+ return;
528
+ }
529
+ return assertNever(outcome);
530
+ }
531
+ export function verificationCountsAsApiTest(kind) {
532
+ return kind === "passed" || kind === "diverged" || kind === "both_failed";
533
+ }
311
534
  export const migrationVerificationToolFactory = createToolFactory("runMigrationVerification", ({ clark, services, }) => ({
312
535
  category: ToolCategory.DEBUG,
313
536
  timeoutMs: 300_000, // 5 minutes — verification runs both v2+v3 pipelines which regularly exceed 60s
@@ -345,7 +568,11 @@ export const migrationVerificationToolFactory = createToolFactory("runMigrationV
345
568
  apiName,
346
569
  integrationIds,
347
570
  });
348
- if (effective === "allow" || sourceIds.length === 0) {
571
+ // Deny short-circuits to skipped_mutation without writes; allow runs
572
+ // pipelines under the migration-wide policy — neither needs per-entity WRITE.
573
+ if (effective === "deny" ||
574
+ effective === "allow" ||
575
+ sourceIds.length === 0) {
349
576
  return [];
350
577
  }
351
578
  return sourceIds.map((entityId) => ({
@@ -428,19 +655,20 @@ export const migrationVerificationToolFactory = createToolFactory("runMigrationV
428
655
  // Load the backup YAML directly and execute inline instead.
429
656
  const yamlContent = await readFile(sourcePath, "utf-8");
430
657
  const apiDefinition = yaml.parse(yamlContent);
658
+ await inlineV2BackupSourceFiles(apiDefinition, sourcePath);
431
659
  const editorClient = clark.context.peer;
432
- if (!editorClient) {
433
- throw new EditorClientUnavailableError("No editor client available");
434
- }
660
+ // `peer` is a StablePeer proxy: always truthy, queues calls while
661
+ // disconnected. Gate on real connection state so a dead tab yields
662
+ // `disconnected` immediately instead of a 30s `timeout`, and so no
663
+ // stale execution enters the reconnect replay queue.
664
+ await assertEditorClientConnected(editorClient, "v2 pipeline");
435
665
  const executor = new ApiExecutor(editorClient, services.integrationStore);
436
666
  const executionResult = await executor.execute({ type: "inline", definition: apiDefinition }, pipelineInputs, { includeStepOutputs: false });
437
667
  return { success: executionResult.success, executionResult };
438
668
  },
439
669
  runV3Sdk: async (integrationIds, sdkInputs) => {
440
670
  const editorClient = clark.context.peer;
441
- if (!editorClient) {
442
- throw new EditorClientUnavailableError("No editor client available");
443
- }
671
+ await assertEditorClientConnected(editorClient, "v3 SDK");
444
672
  const sdkResult = await editorClient.call.aiExecuteSdkApi({
445
673
  apiName,
446
674
  input: sdkInputs,
@@ -466,97 +694,17 @@ export const migrationVerificationToolFactory = createToolFactory("runMigrationV
466
694
  };
467
695
  },
468
696
  });
469
- // Update checklist with verification metadata. Each branch explicitly
470
- // clears fields from the previous run that no longer apply (null = clear).
471
- if (outcome.kind === "passed") {
697
+ if (verificationCountsAsApiTest(outcome.kind)) {
472
698
  markSdkApiAsVerified(clark, apiName);
473
- await updateChecklistItem({
474
- appRootDirPath: appRootDir,
475
- itemId: `api_${apiName}`,
476
- verificationOutcome: "auto_passed",
477
- verificationSkippedReason: null,
478
- lastVerificationAt: new Date().toISOString(),
479
- });
480
- }
481
- else if (outcome.kind === "skipped_mutation") {
482
- await updateChecklistItem({
483
- appRootDirPath: appRootDir,
484
- itemId: `api_${apiName}`,
485
- verificationSkippedReason: "mutation",
486
- verificationOutcome: null,
487
- lastVerificationAt: new Date().toISOString(),
488
- });
489
- }
490
- else if (outcome.kind === "v2_unrunnable") {
491
- await updateChecklistItem({
492
- appRootDirPath: appRootDir,
493
- itemId: `api_${apiName}`,
494
- verificationSkippedReason: "v2_unrunnable",
495
- verificationOutcome: null,
496
- lastVerificationAt: new Date().toISOString(),
497
- });
498
- }
499
- else if (outcome.kind === "both_failed") {
500
- // Both v2 and v3 errored — most often because the API reads bindings
501
- // we didn't supply. Per the migration skill, the agent should
502
- // synthesize realistic inputs and retry rather than treat this as a
503
- // terminal outcome, so we deliberately do NOT mark `status: completed`
504
- // here (a previous version did, which contradicted the skill and left
505
- // the item stuck `completed` even after the agent kept iterating).
506
- // We still record `verificationSkippedReason: "both_failed"` so the
507
- // UI can surface the transient state; subsequent diverged/passed
508
- // attempts clear it via `verificationSkippedReason: null`.
509
- await updateChecklistItem({
510
- appRootDirPath: appRootDir,
511
- itemId: `api_${apiName}`,
512
- verificationSkippedReason: "both_failed",
513
- verificationOutcome: null,
514
- lastVerificationAt: new Date().toISOString(),
515
- });
516
- }
517
- else if (outcome.kind === "diverged") {
518
- await updateChecklistItem({
519
- appRootDirPath: appRootDir,
520
- itemId: `api_${apiName}`,
521
- verificationOutcome: null,
522
- verificationSkippedReason: null,
523
- lastVerificationAt: new Date().toISOString(),
524
- lastVerificationDiffPath: diffRelativePath(apiName),
525
- });
526
- }
527
- else if (outcome.kind === "exhausted") {
528
- // Hard cap reached. Mark the item failed so classifyItem routes it to
529
- // the manual-verification lane and the user knows automatic
530
- // reconciliation gave up. The agent must NOT keep calling
531
- // runMigrationVerification for this API in this migration run; the
532
- // tool will return `exhausted` again until the migration is reset.
533
- await updateChecklistItem({
534
- appRootDirPath: appRootDir,
535
- itemId: `api_${apiName}`,
536
- status: "failed",
537
- failureReason: `verification_exhausted: hit MAX_VERIFICATION_ATTEMPTS (${MAX_VERIFICATION_ATTEMPTS}) without converging. See scratch/migration-verification/${apiName}.history.json for the per-attempt log.`,
538
- verificationOutcome: null,
539
- verificationSkippedReason: null,
540
- lastVerificationAt: new Date().toISOString(),
541
- ...(outcome.lastDivergence
542
- ? { lastVerificationDiffPath: diffRelativePath(apiName) }
543
- : {}),
544
- });
545
- }
546
- else {
547
- // outcome.kind === "error" | "timeout" | "disconnected": clear stale
548
- // fields so classifyItem doesn't misclassify this item as verified or
549
- // skipped. Timeout and disconnected deliberately share this branch —
550
- // they must NOT set a verificationSkippedReason or mark the item
551
- // complete; the agent is told to retry via the tool result below.
552
- await updateChecklistItem({
553
- appRootDirPath: appRootDir,
554
- itemId: `api_${apiName}`,
555
- verificationOutcome: null,
556
- verificationSkippedReason: null,
557
- lastVerificationAt: new Date().toISOString(),
558
- });
559
699
  }
700
+ // Update checklist with verification metadata. Each branch explicitly
701
+ // clears fields from the previous run that no longer apply (null = clear).
702
+ await syncVerificationOutcomeToChecklist({
703
+ apiName,
704
+ appRootDirPath: appRootDir,
705
+ clark,
706
+ outcome,
707
+ });
560
708
  if (outcome.kind === "diverged") {
561
709
  return {
562
710
  kind: "diverged",
@@ -644,6 +792,19 @@ export const migrationVerificationToolFactory = createToolFactory("runMigrationV
644
792
  `needs to stay open and focused for verification, then call runMigrationVerification again.`,
645
793
  };
646
794
  }
795
+ if (outcome.kind === "transient_exhausted") {
796
+ return {
797
+ kind: "transient_exhausted",
798
+ side: outcome.side,
799
+ summary: `Verification of \`${apiName}\` has failed to reach the editor ${outcome.transientAttempts} times in a row ` +
800
+ `without it becoming runnable (most recent: ${outcome.side === "v2" ? "original (v2)" : "migrated (v3)"} — ${outcome.reason}). ` +
801
+ `This is a persistent environment problem — the app tab is closed/backgrounded or the connection keeps dropping — ` +
802
+ `NOT a problem with the API, and the item has NOT been marked complete or failed. STOP calling ` +
803
+ `runMigrationVerification for this API now: tell the user verification is blocked because the editor/app tab ` +
804
+ `is disconnected, ask them to reopen it and keep it focused, and only retry once they confirm. Verification ` +
805
+ `resumes automatically for this API the moment the connection is restored.`,
806
+ };
807
+ }
647
808
  // outcome.kind === "error" — the only remaining case
648
809
  return {
649
810
  kind: "error",
@@ -707,6 +868,38 @@ class PipelineTimeoutError extends Error {
707
868
  */
708
869
  export class EditorClientUnavailableError extends Error {
709
870
  }
871
+ const FILE_REFERENCE_PROTO_DECODE_PATTERN = /plugins\.javascript\.v1\.Plugin\.body from JSON: object|plugins\.python\.v1\.Plugin\.body from JSON: object/;
872
+ function formatV2UnrunnableReason(error) {
873
+ const message = error instanceof Error ? error.message : String(error);
874
+ if (FILE_REFERENCE_PROTO_DECODE_PATTERN.test(message)) {
875
+ return ("v2 backup uses file-referenced JS/Python blocks but migration verification " +
876
+ "failed to inline their source files before proto validation. " +
877
+ `Original error: ${message}`);
878
+ }
879
+ return message;
880
+ }
881
+ /**
882
+ * How long a pipeline runner waits for the editor peer to (re)connect before
883
+ * failing with `disconnected`. This is a pre-flight gate, not a retry budget:
884
+ * long enough to ride out a heartbeat flap mid-reconnect, short enough that a
885
+ * genuinely-gone tab fails fast instead of burning the full 30s reporting
886
+ * timeout.
887
+ */
888
+ export const EDITOR_CONNECT_GRACE_MS = 5_000;
889
+ /**
890
+ * Pre-flight connectivity gate for the pipeline runners. The editor peer
891
+ * (`clark.context.peer`) is a StablePeer proxy — always truthy even when the
892
+ * underlying socket is gone, and it silently queues calls while disconnected
893
+ * (replayed on reconnect). A bare truthiness check therefore never fires and
894
+ * a dead tab surfaces as a 30s `timeout` instead of `disconnected`. Gate on
895
+ * real connection state instead, tolerating a brief reconnect window.
896
+ * Exported for direct unit testing.
897
+ */
898
+ export async function assertEditorClientConnected(peer, label) {
899
+ if (await peer.whenConnected(EDITOR_CONNECT_GRACE_MS))
900
+ return;
901
+ throw new EditorClientUnavailableError(`editor peer disconnected (${label}): no reconnect within ${EDITOR_CONNECT_GRACE_MS / 1000}s`);
902
+ }
710
903
  /**
711
904
  * Inspect a v2 backup YAML for mutating steps and the integrations they touch.
712
905
  *
@@ -724,7 +917,7 @@ export class EditorClientUnavailableError extends Error {
724
917
  * Treats `unknown` step classifications (dynamic SQL bodies, plugins we don't
725
918
  * recognize) as mutations: better to ask the user than silently run a write.
726
919
  */
727
- export async function analyzeV2BackupMutations(v2BackupPath) {
920
+ async function analyzeV2BackupMutations(v2BackupPath) {
728
921
  let raw;
729
922
  try {
730
923
  raw = await readFile(v2BackupPath, "utf-8");
@@ -757,34 +950,14 @@ export async function analyzeV2BackupMutations(v2BackupPath) {
757
950
  integrationIds: Array.from(integrationIds),
758
951
  };
759
952
  }
760
- async function readIntegrationWritePolicy(appRootDir) {
761
- try {
762
- const raw = await readFile(join(appRootDir, SCRATCH_DIR, "migration-state.json"), "utf-8");
763
- const parsed = JSON.parse(raw);
764
- const pol = parsed.integrationWritePolicy;
765
- if (pol !== null && typeof pol === "object" && !Array.isArray(pol)) {
766
- // Coerce any legacy persisted "ask" values to "deny" — the modal no
767
- // longer offers "ask", and "deny" preserves the "don't auto-run writes"
768
- // behavior it used to imply during verification.
769
- return Object.fromEntries(Object.entries(pol).map(([id, value]) => [
770
- id,
771
- value === "allow" ? "allow" : "deny",
772
- ]));
773
- }
774
- }
775
- catch {
776
- // missing or unreadable — default to deny
777
- }
778
- return {};
779
- }
780
953
  function mostRestrictivePolicy(policies) {
781
954
  if (policies.includes("deny"))
782
955
  return "deny";
783
956
  return "allow";
784
957
  }
785
958
  async function getEffectiveMigrationWritePolicy({ appRootDir, apiName, integrationIds, }) {
786
- const policy = await readIntegrationWritePolicy(appRootDir);
787
- const v2BackupPath = join(appRootDir, SCRATCH_DIR, V2_BACKUP_DIR, "apis", apiName, "api.yaml");
959
+ const policy = await readIntegrationWritePolicyForEnforcement(appRootDir);
960
+ const v2BackupPath = await resolveV2BackupYamlPath(appRootDir, apiName);
788
961
  // Use IDs from source — not Object.keys(policy) — so a UUID present in
789
962
  // source but absent from the policy map gets a real "deny" vote rather
790
963
  // than being ignored. Otherwise an "allow" on one integration would be
@@ -815,30 +988,15 @@ export const checkRunMigrationVerificationPermissions = async (services, input)
815
988
  catch {
816
989
  return PermissionLevel.PROMPT;
817
990
  }
818
- let mutations;
819
991
  try {
820
- mutations = extractMutations(source);
992
+ extractMutations(source);
821
993
  }
822
994
  catch {
823
995
  return PermissionLevel.PROMPT;
824
996
  }
825
- if (mutations.length === 0)
826
- return PermissionLevel.ALLOW;
827
- let integrationIds;
828
- try {
829
- const ids = extractIntegrationIdsFromSource(source);
830
- if (ids.length > 0)
831
- integrationIds = ids;
832
- }
833
- catch {
834
- integrationIds = undefined;
835
- }
836
- const { effective } = await getEffectiveMigrationWritePolicy({
837
- appRootDir: services.appRootDirPath,
838
- apiName,
839
- integrationIds,
840
- });
841
- return effective === "allow" ? PermissionLevel.ALLOW : PermissionLevel.BLOCK;
997
+ // Non-mutating APIs are safe to verify; mutating APIs short-circuit to
998
+ // skipped_mutation when write policy is deny, so the tool must be callable.
999
+ return PermissionLevel.ALLOW;
842
1000
  };
843
1001
  /**
844
1002
  * Extract the most specific failure message from a Pick<ApiExecutionResult>.
@@ -873,6 +1031,23 @@ function redactForAgent(msg, maxLen = REDACTED_AGENT_FAILURE_MAX_LEN) {
873
1031
  return sanitized;
874
1032
  return sanitized.slice(0, maxLen) + "… [truncated]";
875
1033
  }
1034
+ /**
1035
+ * Count the consecutive transient outcomes at the tail of the history (the
1036
+ * current run's streak), stopping at the first real outcome. This resets the
1037
+ * transient backstop on any real progress, so separate disconnect episodes
1038
+ * across a long migration never accumulate — only an unbroken run of
1039
+ * transient failures trips it.
1040
+ */
1041
+ function countTrailingTransientAttempts(history) {
1042
+ let count = 0;
1043
+ for (let i = history.attempts.length - 1; i >= 0; i--) {
1044
+ const entry = history.attempts[i];
1045
+ if (!entry || !TRANSIENT_OUTCOME_KINDS.has(entry.kind))
1046
+ break;
1047
+ count++;
1048
+ }
1049
+ return count;
1050
+ }
876
1051
  /**
877
1052
  * Reject any `apiName` that could escape `scratch/migration-verification/`.
878
1053
  * Checklist items are persisted to disk and parsed back in without a strict