@superblocksteam/vite-plugin-file-sync 2.0.159-next.0 → 2.0.160

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 (337) 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/middleware.js +3 -2
  4. package/dist/ai-service/agent/middleware.js.map +1 -1
  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 +4 -5
  7. package/dist/ai-service/agent/prompts/build-base-system-prompt.js.map +1 -1
  8. package/dist/ai-service/agent/tool-message-utils.d.ts.map +1 -1
  9. package/dist/ai-service/agent/tool-message-utils.js +1 -16
  10. package/dist/ai-service/agent/tool-message-utils.js.map +1 -1
  11. package/dist/ai-service/agent/tools/apis/test-api.d.ts +1 -50
  12. package/dist/ai-service/agent/tools/apis/test-api.d.ts.map +1 -1
  13. package/dist/ai-service/agent/tools/apis/test-api.js +10 -132
  14. package/dist/ai-service/agent/tools/apis/test-api.js.map +1 -1
  15. package/dist/ai-service/agent/tools/build-delete-file.d.ts +2 -1
  16. package/dist/ai-service/agent/tools/build-delete-file.d.ts.map +1 -1
  17. package/dist/ai-service/agent/tools/build-delete-file.js +0 -2
  18. package/dist/ai-service/agent/tools/build-delete-file.js.map +1 -1
  19. package/dist/ai-service/agent/tools/build-edit-file.d.ts +2 -1
  20. package/dist/ai-service/agent/tools/build-edit-file.d.ts.map +1 -1
  21. package/dist/ai-service/agent/tools/build-edit-file.js +0 -2
  22. package/dist/ai-service/agent/tools/build-edit-file.js.map +1 -1
  23. package/dist/ai-service/agent/tools/build-install-packages.d.ts +0 -1
  24. package/dist/ai-service/agent/tools/build-install-packages.d.ts.map +1 -1
  25. package/dist/ai-service/agent/tools/build-install-packages.js +16 -123
  26. package/dist/ai-service/agent/tools/build-install-packages.js.map +1 -1
  27. package/dist/ai-service/agent/tools/build-lookup-npm-package.d.ts.map +1 -1
  28. package/dist/ai-service/agent/tools/build-lookup-npm-package.js +16 -4
  29. package/dist/ai-service/agent/tools/build-lookup-npm-package.js.map +1 -1
  30. package/dist/ai-service/agent/tools/build-manage-checklist.d.ts +7 -11
  31. package/dist/ai-service/agent/tools/build-manage-checklist.d.ts.map +1 -1
  32. package/dist/ai-service/agent/tools/build-manage-checklist.js +9 -18
  33. package/dist/ai-service/agent/tools/build-manage-checklist.js.map +1 -1
  34. package/dist/ai-service/agent/tools/build-multi-edit-file.d.ts +2 -1
  35. package/dist/ai-service/agent/tools/build-multi-edit-file.d.ts.map +1 -1
  36. package/dist/ai-service/agent/tools/build-multi-edit-file.js +0 -2
  37. package/dist/ai-service/agent/tools/build-multi-edit-file.js.map +1 -1
  38. package/dist/ai-service/agent/tools/build-read-file.d.ts.map +1 -1
  39. package/dist/ai-service/agent/tools/build-read-file.js +18 -31
  40. package/dist/ai-service/agent/tools/build-read-file.js.map +1 -1
  41. package/dist/ai-service/agent/tools/build-rename-file.d.ts +2 -1
  42. package/dist/ai-service/agent/tools/build-rename-file.d.ts.map +1 -1
  43. package/dist/ai-service/agent/tools/build-rename-file.js +0 -2
  44. package/dist/ai-service/agent/tools/build-rename-file.js.map +1 -1
  45. package/dist/ai-service/agent/tools/build-write-file.d.ts +2 -1
  46. package/dist/ai-service/agent/tools/build-write-file.d.ts.map +1 -1
  47. package/dist/ai-service/agent/tools/build-write-file.js +0 -2
  48. package/dist/ai-service/agent/tools/build-write-file.js.map +1 -1
  49. package/dist/ai-service/agent/tools/databases/dev-database-tasks.d.ts +3 -3
  50. package/dist/ai-service/agent/tools/databases/dev-database-tasks.d.ts.map +1 -1
  51. package/dist/ai-service/agent/tools/databases/dev-database-tasks.js +7 -5
  52. package/dist/ai-service/agent/tools/databases/dev-database-tasks.js.map +1 -1
  53. package/dist/ai-service/agent/tools/debug-cache.d.ts +14 -16
  54. package/dist/ai-service/agent/tools/debug-cache.d.ts.map +1 -1
  55. package/dist/ai-service/agent/tools/debug-cache.js +42 -200
  56. package/dist/ai-service/agent/tools/debug-cache.js.map +1 -1
  57. package/dist/ai-service/agent/tools/integrations/execute-request.d.ts +13 -13
  58. package/dist/ai-service/agent/tools/integrations/execute-request.d.ts.map +1 -1
  59. package/dist/ai-service/agent/tools/integrations/execute-request.js +20 -52
  60. package/dist/ai-service/agent/tools/integrations/execute-request.js.map +1 -1
  61. package/dist/ai-service/agent/tools/integrations/sql-classification.d.ts +1 -7
  62. package/dist/ai-service/agent/tools/integrations/sql-classification.d.ts.map +1 -1
  63. package/dist/ai-service/agent/tools/integrations/sql-classification.js +11 -229
  64. package/dist/ai-service/agent/tools/integrations/sql-classification.js.map +1 -1
  65. package/dist/ai-service/agent/tools/report-security-findings.d.ts +5 -5
  66. package/dist/ai-service/agent/tools.d.ts +0 -32
  67. package/dist/ai-service/agent/tools.d.ts.map +1 -1
  68. package/dist/ai-service/agent/tools.js +33 -54
  69. package/dist/ai-service/agent/tools.js.map +1 -1
  70. package/dist/ai-service/agent/tools2/registry.d.ts +1 -1
  71. package/dist/ai-service/agent/tools2/registry.d.ts.map +1 -1
  72. package/dist/ai-service/agent/tools2/registry.js +4 -21
  73. package/dist/ai-service/agent/tools2/registry.js.map +1 -1
  74. package/dist/ai-service/agent/tools2/tools/end-test-run.d.ts +2 -2
  75. package/dist/ai-service/agent/tools2/tools/exit-plan-mode.d.ts.map +1 -1
  76. package/dist/ai-service/agent/tools2/tools/exit-plan-mode.js +11 -20
  77. package/dist/ai-service/agent/tools2/tools/exit-plan-mode.js.map +1 -1
  78. package/dist/ai-service/agent/tools2/tools/grep-metadata-ripgrep.d.ts +0 -4
  79. package/dist/ai-service/agent/tools2/tools/grep-metadata-ripgrep.d.ts.map +1 -1
  80. package/dist/ai-service/agent/tools2/tools/grep-metadata-ripgrep.js +8 -28
  81. package/dist/ai-service/agent/tools2/tools/grep-metadata-ripgrep.js.map +1 -1
  82. package/dist/ai-service/agent/tools2/tools/update-test-case-status.d.ts +2 -2
  83. package/dist/ai-service/app-interface/shell.d.ts +3 -20
  84. package/dist/ai-service/app-interface/shell.d.ts.map +1 -1
  85. package/dist/ai-service/app-interface/shell.js +65 -139
  86. package/dist/ai-service/app-interface/shell.js.map +1 -1
  87. package/dist/ai-service/attachment-upload.d.ts.map +1 -1
  88. package/dist/ai-service/attachment-upload.js +1 -4
  89. package/dist/ai-service/attachment-upload.js.map +1 -1
  90. package/dist/ai-service/chat/chat-session-store.d.ts +8 -0
  91. package/dist/ai-service/chat/chat-session-store.d.ts.map +1 -1
  92. package/dist/ai-service/chat/chat-session-store.js +611 -34
  93. package/dist/ai-service/chat/chat-session-store.js.map +1 -1
  94. package/dist/ai-service/chat/utils.d.ts +6 -2
  95. package/dist/ai-service/chat/utils.d.ts.map +1 -1
  96. package/dist/ai-service/chat/utils.js +95 -2
  97. package/dist/ai-service/chat/utils.js.map +1 -1
  98. package/dist/ai-service/index.d.ts +2 -3
  99. package/dist/ai-service/index.d.ts.map +1 -1
  100. package/dist/ai-service/index.js +48 -138
  101. package/dist/ai-service/index.js.map +1 -1
  102. package/dist/ai-service/integrations/store.d.ts +0 -9
  103. package/dist/ai-service/integrations/store.d.ts.map +1 -1
  104. package/dist/ai-service/integrations/store.js +1 -11
  105. package/dist/ai-service/integrations/store.js.map +1 -1
  106. package/dist/ai-service/llm/client.d.ts.map +1 -1
  107. package/dist/ai-service/llm/client.js +4 -67
  108. package/dist/ai-service/llm/client.js.map +1 -1
  109. package/dist/ai-service/llm/context-v2/adapter.d.ts +0 -1
  110. package/dist/ai-service/llm/context-v2/adapter.d.ts.map +1 -1
  111. package/dist/ai-service/llm/context-v2/adapter.js +0 -3
  112. package/dist/ai-service/llm/context-v2/adapter.js.map +1 -1
  113. package/dist/ai-service/llm/context-v2/compaction/client-side.d.ts +0 -7
  114. package/dist/ai-service/llm/context-v2/compaction/client-side.d.ts.map +1 -1
  115. package/dist/ai-service/llm/context-v2/compaction/client-side.js +6 -28
  116. package/dist/ai-service/llm/context-v2/compaction/client-side.js.map +1 -1
  117. package/dist/ai-service/llm/context-v2/compaction/compaction-strategy.d.ts +0 -12
  118. package/dist/ai-service/llm/context-v2/compaction/compaction-strategy.d.ts.map +1 -1
  119. package/dist/ai-service/llm/context-v2/compactor.d.ts +0 -8
  120. package/dist/ai-service/llm/context-v2/compactor.d.ts.map +1 -1
  121. package/dist/ai-service/llm/context-v2/compactor.js +3 -15
  122. package/dist/ai-service/llm/context-v2/compactor.js.map +1 -1
  123. package/dist/ai-service/llm/context-v2/config.d.ts.map +1 -1
  124. package/dist/ai-service/llm/context-v2/config.js +0 -1
  125. package/dist/ai-service/llm/context-v2/config.js.map +1 -1
  126. package/dist/ai-service/llm/context-v2/context-metrics.d.ts +1 -44
  127. package/dist/ai-service/llm/context-v2/context-metrics.d.ts.map +1 -1
  128. package/dist/ai-service/llm/context-v2/context-metrics.js +12 -97
  129. package/dist/ai-service/llm/context-v2/context-metrics.js.map +1 -1
  130. package/dist/ai-service/llm/context-v2/context.d.ts +0 -125
  131. package/dist/ai-service/llm/context-v2/context.d.ts.map +1 -1
  132. package/dist/ai-service/llm/context-v2/context.js +14 -478
  133. package/dist/ai-service/llm/context-v2/context.js.map +1 -1
  134. package/dist/ai-service/llm/context-v2/conversation-context.d.ts +0 -12
  135. package/dist/ai-service/llm/context-v2/conversation-context.d.ts.map +1 -1
  136. package/dist/ai-service/llm/context-v2/phase1-tool-summarizer.d.ts.map +1 -1
  137. package/dist/ai-service/llm/context-v2/phase1-tool-summarizer.js +1 -2
  138. package/dist/ai-service/llm/context-v2/phase1-tool-summarizer.js.map +1 -1
  139. package/dist/ai-service/llm/context-v2/phase2-session-summarizer.js +3 -3
  140. package/dist/ai-service/llm/context-v2/phase2-session-summarizer.js.map +1 -1
  141. package/dist/ai-service/llm/context-v2/token-tracker.d.ts +1 -49
  142. package/dist/ai-service/llm/context-v2/token-tracker.d.ts.map +1 -1
  143. package/dist/ai-service/llm/context-v2/token-tracker.js +0 -119
  144. package/dist/ai-service/llm/context-v2/token-tracker.js.map +1 -1
  145. package/dist/ai-service/llm/context-v2/truncation-fallback.d.ts.map +1 -1
  146. package/dist/ai-service/llm/context-v2/truncation-fallback.js +1 -2
  147. package/dist/ai-service/llm/context-v2/truncation-fallback.js.map +1 -1
  148. package/dist/ai-service/llm/context-v2/types.d.ts +0 -9
  149. package/dist/ai-service/llm/context-v2/types.d.ts.map +1 -1
  150. package/dist/ai-service/llm/context-v2/types.js.map +1 -1
  151. package/dist/ai-service/llm/error.d.ts +1 -22
  152. package/dist/ai-service/llm/error.d.ts.map +1 -1
  153. package/dist/ai-service/llm/error.js +22 -159
  154. package/dist/ai-service/llm/error.js.map +1 -1
  155. package/dist/ai-service/llm/stream/empty-tool-call-tracker.d.ts +3 -4
  156. package/dist/ai-service/llm/stream/empty-tool-call-tracker.d.ts.map +1 -1
  157. package/dist/ai-service/llm/stream/empty-tool-call-tracker.js +4 -5
  158. package/dist/ai-service/llm/stream/empty-tool-call-tracker.js.map +1 -1
  159. package/dist/ai-service/llm/stream/idle-monitor.d.ts.map +1 -1
  160. package/dist/ai-service/llm/stream/idle-monitor.js +0 -5
  161. package/dist/ai-service/llm/stream/idle-monitor.js.map +1 -1
  162. package/dist/ai-service/llm/stream/observers/logging.d.ts +0 -6
  163. package/dist/ai-service/llm/stream/observers/logging.d.ts.map +1 -1
  164. package/dist/ai-service/llm/stream/observers/logging.js +3 -44
  165. package/dist/ai-service/llm/stream/observers/logging.js.map +1 -1
  166. package/dist/ai-service/llm/stream/orchestrator.d.ts.map +1 -1
  167. package/dist/ai-service/llm/stream/orchestrator.js +4 -28
  168. package/dist/ai-service/llm/stream/orchestrator.js.map +1 -1
  169. package/dist/ai-service/llm/stream/retry-engine.d.ts +1 -1
  170. package/dist/ai-service/llm/stream/retry-engine.d.ts.map +1 -1
  171. package/dist/ai-service/llm/stream/retry-engine.js +1 -9
  172. package/dist/ai-service/llm/stream/retry-engine.js.map +1 -1
  173. package/dist/ai-service/llm/stream/session.d.ts +0 -6
  174. package/dist/ai-service/llm/stream/session.d.ts.map +1 -1
  175. package/dist/ai-service/llm/stream/session.js +0 -6
  176. package/dist/ai-service/llm/stream/session.js.map +1 -1
  177. package/dist/ai-service/llm/stream/terminal-reason.d.ts.map +1 -1
  178. package/dist/ai-service/llm/stream/terminal-reason.js +1 -11
  179. package/dist/ai-service/llm/stream/terminal-reason.js.map +1 -1
  180. package/dist/ai-service/llm/stream/wait-state-tracker.d.ts +3 -4
  181. package/dist/ai-service/llm/stream/wait-state-tracker.d.ts.map +1 -1
  182. package/dist/ai-service/llm/stream/wait-state-tracker.js +8 -12
  183. package/dist/ai-service/llm/stream/wait-state-tracker.js.map +1 -1
  184. package/dist/ai-service/policy-agent-metrics.d.ts +1 -2
  185. package/dist/ai-service/policy-agent-metrics.d.ts.map +1 -1
  186. package/dist/ai-service/policy-agent-metrics.js +2 -11
  187. package/dist/ai-service/policy-agent-metrics.js.map +1 -1
  188. package/dist/ai-service/resolve-generation-state-for-ui.js +1 -1
  189. package/dist/ai-service/resolve-generation-state-for-ui.js.map +1 -1
  190. package/dist/ai-service/security/secret-scanner-service.d.ts +6 -3
  191. package/dist/ai-service/security/secret-scanner-service.d.ts.map +1 -1
  192. package/dist/ai-service/security/secret-scanner-service.js +97 -229
  193. package/dist/ai-service/security/secret-scanner-service.js.map +1 -1
  194. package/dist/ai-service/security/secret-scanner.d.ts +5 -28
  195. package/dist/ai-service/security/secret-scanner.d.ts.map +1 -1
  196. package/dist/ai-service/security/secret-scanner.js +42 -197
  197. package/dist/ai-service/security/secret-scanner.js.map +1 -1
  198. package/dist/ai-service/skills/system/superblocks-frontend/skill.generated.d.ts +1 -1
  199. package/dist/ai-service/skills/system/superblocks-frontend/skill.generated.d.ts.map +1 -1
  200. package/dist/ai-service/skills/system/superblocks-frontend/skill.generated.js +0 -49
  201. package/dist/ai-service/skills/system/superblocks-frontend/skill.generated.js.map +1 -1
  202. package/dist/ai-service/skills/system/third-party-migration/skill.generated.d.ts +1 -1
  203. package/dist/ai-service/skills/system/third-party-migration/skill.generated.d.ts.map +1 -1
  204. package/dist/ai-service/skills/system/third-party-migration/skill.generated.js +0 -1
  205. package/dist/ai-service/skills/system/third-party-migration/skill.generated.js.map +1 -1
  206. package/dist/ai-service/state-machine/clark-fsm.d.ts +0 -2
  207. package/dist/ai-service/state-machine/clark-fsm.d.ts.map +1 -1
  208. package/dist/ai-service/state-machine/clark-fsm.js +1 -1
  209. package/dist/ai-service/state-machine/clark-fsm.js.map +1 -1
  210. package/dist/ai-service/state-machine/handlers/agent-planning.d.ts +1 -1
  211. package/dist/ai-service/state-machine/handlers/agent-planning.d.ts.map +1 -1
  212. package/dist/ai-service/state-machine/handlers/agent-planning.js +3 -74
  213. package/dist/ai-service/state-machine/handlers/agent-planning.js.map +1 -1
  214. package/dist/ai-service/state-machine/handlers/llm-generating.d.ts.map +1 -1
  215. package/dist/ai-service/state-machine/handlers/llm-generating.js +11 -1
  216. package/dist/ai-service/state-machine/handlers/llm-generating.js.map +1 -1
  217. package/dist/ai-service/state-machine/helpers/policy-gate-usage-metrics.d.ts +2 -3
  218. package/dist/ai-service/state-machine/helpers/policy-gate-usage-metrics.d.ts.map +1 -1
  219. package/dist/ai-service/state-machine/helpers/policy-gate-usage-metrics.js +5 -25
  220. package/dist/ai-service/state-machine/helpers/policy-gate-usage-metrics.js.map +1 -1
  221. package/dist/ai-service/state-machine/helpers/prompt-billing-metrics.d.ts.map +1 -1
  222. package/dist/ai-service/state-machine/helpers/prompt-billing-metrics.js +0 -1
  223. package/dist/ai-service/state-machine/helpers/prompt-billing-metrics.js.map +1 -1
  224. package/dist/ai-service/state-machine/helpers/stable-peer.d.ts +0 -4
  225. package/dist/ai-service/state-machine/helpers/stable-peer.d.ts.map +1 -1
  226. package/dist/ai-service/state-machine/helpers/stable-peer.js +1 -6
  227. package/dist/ai-service/state-machine/helpers/stable-peer.js.map +1 -1
  228. package/dist/ai-service/test-utils/metrics-harness.d.ts +0 -6
  229. package/dist/ai-service/test-utils/metrics-harness.d.ts.map +1 -1
  230. package/dist/ai-service/test-utils/metrics-harness.js.map +1 -1
  231. package/dist/ai-service/transform/api-builder/shared.d.ts.map +1 -1
  232. package/dist/ai-service/transform/api-builder/shared.js +1 -2
  233. package/dist/ai-service/transform/api-builder/shared.js.map +1 -1
  234. package/dist/dev-server-ws-smoke-client.d.ts.map +1 -1
  235. package/dist/dev-server-ws-smoke-client.js +0 -1
  236. package/dist/dev-server-ws-smoke-client.js.map +1 -1
  237. package/dist/file-sync-vite-plugin.d.ts +0 -21
  238. package/dist/file-sync-vite-plugin.d.ts.map +1 -1
  239. package/dist/file-sync-vite-plugin.js +11 -131
  240. package/dist/file-sync-vite-plugin.js.map +1 -1
  241. package/dist/file-system-helpers.d.ts +2 -2
  242. package/dist/file-system-helpers.d.ts.map +1 -1
  243. package/dist/file-system-helpers.js +12 -2
  244. package/dist/file-system-helpers.js.map +1 -1
  245. package/dist/parsing/jsx.d.ts +0 -12
  246. package/dist/parsing/jsx.d.ts.map +1 -1
  247. package/dist/parsing/jsx.js +12 -30
  248. package/dist/parsing/jsx.js.map +1 -1
  249. package/dist/parsing/page.d.ts.map +1 -1
  250. package/dist/parsing/page.js +8 -16
  251. package/dist/parsing/page.js.map +1 -1
  252. package/dist/plugin-options.d.ts +0 -4
  253. package/dist/plugin-options.d.ts.map +1 -1
  254. package/dist/plugin-options.js.map +1 -1
  255. package/dist/policy-gate-callback-mapper.d.ts +1 -2
  256. package/dist/policy-gate-callback-mapper.d.ts.map +1 -1
  257. package/dist/policy-gate-callback-mapper.js +5 -3
  258. package/dist/policy-gate-callback-mapper.js.map +1 -1
  259. package/dist/policy-gate-run-registry.d.ts +2 -4
  260. package/dist/policy-gate-run-registry.d.ts.map +1 -1
  261. package/dist/policy-gate-run-registry.js +2 -17
  262. package/dist/policy-gate-run-registry.js.map +1 -1
  263. package/dist/policy-gate-runner.d.ts +1 -1
  264. package/dist/policy-gate-runner.d.ts.map +1 -1
  265. package/dist/policy-gate-runner.js +7 -41
  266. package/dist/policy-gate-runner.js.map +1 -1
  267. package/dist/router-parser.d.ts +1 -6
  268. package/dist/router-parser.d.ts.map +1 -1
  269. package/dist/router-parser.js +17 -72
  270. package/dist/router-parser.js.map +1 -1
  271. package/dist/scan-scope-merge.d.ts +1 -1
  272. package/dist/scan-scope-merge.js +1 -1
  273. package/dist/source-tracker.d.ts.map +1 -1
  274. package/dist/source-tracker.js +6 -2
  275. package/dist/source-tracker.js.map +1 -1
  276. package/dist/sync-service/download.d.ts.map +1 -1
  277. package/dist/sync-service/download.js +2 -10
  278. package/dist/sync-service/download.js.map +1 -1
  279. package/dist/sync-service/index.d.ts +0 -5
  280. package/dist/sync-service/index.d.ts.map +1 -1
  281. package/dist/sync-service/index.js +14 -66
  282. package/dist/sync-service/index.js.map +1 -1
  283. package/dist/sync-service/list-dir.d.ts.map +1 -1
  284. package/dist/sync-service/list-dir.js +4 -8
  285. package/dist/sync-service/list-dir.js.map +1 -1
  286. package/dist/sync-service/snapshot/upload-snapshot.d.ts.map +1 -1
  287. package/dist/sync-service/snapshot/upload-snapshot.js +0 -20
  288. package/dist/sync-service/snapshot/upload-snapshot.js.map +1 -1
  289. package/dist/util/log-sanitizer.d.ts.map +1 -1
  290. package/dist/util/log-sanitizer.js +8 -10
  291. package/dist/util/log-sanitizer.js.map +1 -1
  292. package/dist/util/logger.d.ts +0 -2
  293. package/dist/util/logger.d.ts.map +1 -1
  294. package/dist/util/logger.js +38 -357
  295. package/dist/util/logger.js.map +1 -1
  296. package/dist/util.d.ts +1 -3
  297. package/dist/util.d.ts.map +1 -1
  298. package/dist/util.js +2 -2
  299. package/dist/util.js.map +1 -1
  300. package/package.json +9 -9
  301. package/dist/ai-service/agent/tool-result-metrics.d.ts +0 -29
  302. package/dist/ai-service/agent/tool-result-metrics.d.ts.map +0 -1
  303. package/dist/ai-service/agent/tool-result-metrics.js +0 -162
  304. package/dist/ai-service/agent/tool-result-metrics.js.map +0 -1
  305. package/dist/ai-service/agent/tools/page-edit-guidance.d.ts +0 -2
  306. package/dist/ai-service/agent/tools/page-edit-guidance.d.ts.map +0 -1
  307. package/dist/ai-service/agent/tools/page-edit-guidance.js +0 -11
  308. package/dist/ai-service/agent/tools/page-edit-guidance.js.map +0 -1
  309. package/dist/ai-service/app-interface/cancellable-exec.d.ts +0 -34
  310. package/dist/ai-service/app-interface/cancellable-exec.d.ts.map +0 -1
  311. package/dist/ai-service/app-interface/cancellable-exec.js +0 -98
  312. package/dist/ai-service/app-interface/cancellable-exec.js.map +0 -1
  313. package/dist/ai-service/attachments/parse-data-url.d.ts +0 -5
  314. package/dist/ai-service/attachments/parse-data-url.d.ts.map +0 -1
  315. package/dist/ai-service/attachments/parse-data-url.js +0 -14
  316. package/dist/ai-service/attachments/parse-data-url.js.map +0 -1
  317. package/dist/ai-service/integrations/mention-safe-tag-name.d.ts +0 -12
  318. package/dist/ai-service/integrations/mention-safe-tag-name.d.ts.map +0 -1
  319. package/dist/ai-service/integrations/mention-safe-tag-name.js +0 -18
  320. package/dist/ai-service/integrations/mention-safe-tag-name.js.map +0 -1
  321. package/dist/ai-service/llm/context-v2/well-formed-text.d.ts +0 -24
  322. package/dist/ai-service/llm/context-v2/well-formed-text.d.ts.map +0 -1
  323. package/dist/ai-service/llm/context-v2/well-formed-text.js +0 -73
  324. package/dist/ai-service/llm/context-v2/well-formed-text.js.map +0 -1
  325. package/dist/ai-service/policy-gate-error.d.ts +0 -3
  326. package/dist/ai-service/policy-gate-error.d.ts.map +0 -1
  327. package/dist/ai-service/policy-gate-error.js +0 -33
  328. package/dist/ai-service/policy-gate-error.js.map +0 -1
  329. package/dist/migration-templates/app-fullstack/.gitignore +0 -50
  330. package/dist/parsing/parse-tsx-module.d.ts +0 -4
  331. package/dist/parsing/parse-tsx-module.d.ts.map +0 -1
  332. package/dist/parsing/parse-tsx-module.js +0 -13
  333. package/dist/parsing/parse-tsx-module.js.map +0 -1
  334. package/dist/router-parser-metrics.d.ts +0 -2
  335. package/dist/router-parser-metrics.d.ts.map +0 -1
  336. package/dist/router-parser-metrics.js +0 -13
  337. package/dist/router-parser-metrics.js.map +0 -1
@@ -6,14 +6,14 @@ import { hasToolCall, stepCountIs, } from "ai";
6
6
  import { z } from "zod";
7
7
  import { AiGenerationState, AiMode, resolveAttachmentFileName, } from "@superblocksteam/library-shared/types";
8
8
  import { isToolPermissionClarification } from "@superblocksteam/library-shared/types/tool-permission-response";
9
- import { addTracingToMethods, AiSystemTriggerType, classifyAttachmentDelivery, FactAccessType, FactCreatedSource, FactEntityScope, TracedEventEmitter, getAiQuotaPaywallReasonFromMessage, POLICY_GATE_MAX_TOTAL_TIME_MS, POLICY_GATE_STREAM_IDLE_TIMEOUT_MS, } from "@superblocksteam/shared";
9
+ import { addTracingToMethods, AiSystemTriggerType, classifyAttachmentDelivery, FactAccessType, FactCreatedSource, FactEntityScope, TracedEventEmitter, getAiQuotaPaywallReasonFromMessage, } from "@superblocksteam/shared";
10
10
  import { npmRegistryEmitter } from "@superblocksteam/telemetry";
11
11
  import { applyTestApiDenialSideEffects, buildMigrationTestApiDenialContinuationPrompt, } from "../migration/mark-api-testing-denied.js";
12
12
  import { buildTranslationPrompt } from "../migration/translation-prompt.js";
13
13
  import { POLICY_GATE_RUN_IN_PROGRESS_ERROR, policyGateRunRegistry, } from "../policy-gate-run-registry.js";
14
14
  import { getErrorMeta, getLogger, setDefaultLogger } from "../util/logger.js";
15
15
  import { composeSecurityAgentPrompt, } from "./agent/prompts/build-security-scan-prompt.js";
16
- import { getToolCallArguments, getToolErrorCode, getToolErrorMessage, getToolOutput, } from "./agent/tool-message-utils.js";
16
+ import { getToolCallArguments, getToolErrorCode, getToolOutput, } from "./agent/tool-message-utils.js";
17
17
  import { recordToolPermissionDeliveryOutcome } from "./agent/tool-permission-delivery-metrics.js";
18
18
  import { createExpiredPermissionPromptDeliveryError, flushPendingToolPermissionPrompt, inFlightToolPermissionReplay, } from "./agent/tool-permission-delivery.js";
19
19
  import { buildSecurityScanTools, isBackgroundTaskFrameworkEnabled, } from "./agent/tools.js";
@@ -31,7 +31,6 @@ import { NpmPackageLookup } from "./app-interface/npm-package-lookup.js";
31
31
  import { NpmRegistryClient, createDiskRegistryPolicyStore, } from "./app-interface/npm-registry.js";
32
32
  import { AppShell } from "./app-interface/shell.js";
33
33
  import { AppSkillsManager } from "./app-skills/manager.js";
34
- import { parseDataUrl } from "./attachments/parse-data-url.js";
35
34
  import { isUploadedAttachment, toUploadedAttachmentContentPart, } from "./attachments/uploaded-content-part.js";
36
35
  import { ChatSessionStore } from "./chat/chat-session-store.js";
37
36
  import { normalizeTextAttachmentForModel } from "./chat/utils.js";
@@ -70,7 +69,6 @@ import { buildServerMigrationLlmConfig, isMigrationAutoDispatchEnabled, } from "
70
69
  import { isMigrationSessionActive } from "./migration-session-active.js";
71
70
  import { hasSettledNormalMigrationTurn, recordMigrationTurnDispatched, recordMigrationTurnSettled, } from "./migration-turns-log.js";
72
71
  import { recordPolicyAgentExecution, } from "./policy-agent-metrics.js";
73
- import { classifyPolicyGateError } from "./policy-gate-error.js";
74
72
  import { policyGateStreamPartToAgentStep } from "./policy-gate-step.js";
75
73
  import { ClarkProfiler } from "./profiler/clark-profiler.js";
76
74
  import { buildSummarizeApiUsagePrompt } from "./prompts/summarize-api-usage.js";
@@ -146,6 +144,7 @@ const MAX_POLICY_GATE_STREAM_ERROR_ARRAY_LENGTH = 10;
146
144
  const MAX_POLICY_GATE_STREAM_ERROR_FIELD_LENGTH = 500;
147
145
  const MAX_POLICY_GATE_STREAM_ERROR_OBJECT_DEPTH = 3;
148
146
  const MAX_POLICY_GATE_STREAM_ERROR_OBJECT_KEYS = 20;
147
+ const POLICY_GATE_MAX_TOTAL_TIME_MS = 15 * 60 * 1000;
149
148
  // Ceiling above the historical 30-step cap; 100 is an existing policy-agent
150
149
  // histogram bucket. Tighten from production p99 if scans complete far below this.
151
150
  const POLICY_GATE_MAX_STEPS = 100;
@@ -162,54 +161,6 @@ const POLICY_GATE_STREAM_ERROR_SECRET_VALUE_PATTERN_SOURCES = [
162
161
  String.raw `\bsk-[a-z0-9_-]{8,}\b`,
163
162
  String.raw `\bxox[baprs]-[a-z0-9-]{10,}\b`,
164
163
  ];
165
- /**
166
- * Fails a policy gate stream that goes idle, independent of whatever
167
- * abort/timeout wiring the stream itself does or doesn't honor. A dropped
168
- * dev-server connection can stall the stream without ever rejecting it
169
- * (APPS-5642), which leaves the run "running" forever since nothing throws
170
- * for the existing catch/classification logic to act on.
171
- */
172
- async function* withPolicyGateIdleTimeout(stream, idleTimeoutMs) {
173
- const iterator = stream[Symbol.asyncIterator]();
174
- try {
175
- while (true) {
176
- const nextResult = iterator.next();
177
- // If the idle timeout wins the race below, this promise is abandoned
178
- // mid-flight; attach a handler now so its eventual settlement (once the
179
- // dead connection is cleaned up, if ever) never surfaces as an
180
- // unhandled rejection. Promise.race still gets its own notification
181
- // from this same promise independently.
182
- nextResult.catch(() => { });
183
- let timer;
184
- const idleTimeout = new Promise((_, reject) => {
185
- timer = setTimeout(() => {
186
- reject(Object.assign(new Error("Policy gate stream went idle"), {
187
- name: "TimeoutError",
188
- }));
189
- }, idleTimeoutMs);
190
- });
191
- let result;
192
- try {
193
- result = await Promise.race([nextResult, idleTimeout]);
194
- }
195
- finally {
196
- clearTimeout(timer);
197
- }
198
- if (result.done) {
199
- return;
200
- }
201
- yield result.value;
202
- }
203
- }
204
- finally {
205
- // Best-effort only: never await this. On the exact connection this
206
- // wrapper exists to fail past — one that stopped responding without
207
- // erroring or closing — iterator.return() can hang the same way
208
- // .next() did, and blocking cleanup on it here would defeat the whole
209
- // point of a timeout that's supposed to guarantee termination.
210
- void iterator.return?.()?.catch(() => { });
211
- }
212
- }
213
164
  function truncatePolicyGateStreamErrorField(value) {
214
165
  if (value.length <= MAX_POLICY_GATE_STREAM_ERROR_FIELD_LENGTH) {
215
166
  return value;
@@ -820,19 +771,6 @@ export class AiService extends TracedEventEmitter {
820
771
  this.getLogger().debug("[ai-service] Failed to report npm-install-blocked audit event", getErrorMeta(error));
821
772
  });
822
773
  },
823
- // Privacy-safe install-gate USER_EVENT: outcome + runner only. Same
824
- // fire-and-forget socket path; not gated by audit-v2 or the blocked-
825
- // install throttle. Prefetch/uninstall never call this reporter.
826
- reportNpmInstallOutcome: (report) => {
827
- void this.config.rpcClient
828
- .call(async (client) => {
829
- const rpcClient = client;
830
- return await rpcClient.call.v1.audit.npmInstallOutcome(report);
831
- })
832
- .catch((error) => {
833
- this.getLogger().debug("[ai-service] Failed to report npm-install-outcome user event", getErrorMeta(error));
834
- });
835
- },
836
774
  virtualFileSystem: createDefaultVirtualFileSystem({
837
775
  useSystemSkills: config.features.useSystemSkills,
838
776
  knowledgeManager: this.knowledgeManager,
@@ -2185,9 +2123,7 @@ export class AiService extends TracedEventEmitter {
2185
2123
  // logged so we can audit if this ever fires in prod.
2186
2124
  let promptForContext = request.prompt;
2187
2125
  try {
2188
- const scanResult = await scanContentForSecrets(request.prompt, {
2189
- consumer: "context_persistence",
2190
- });
2126
+ const scanResult = await scanContentForSecrets(request.prompt);
2191
2127
  if (scanResult.success && scanResult.hasSecrets) {
2192
2128
  this.getLogger().warn(`[secret-scan] Redacting ${scanResult.findings.length} secret(s) from pre-call paywall prompt before ContextV2 persist`, {
2193
2129
  findingCount: scanResult.findings.length,
@@ -2197,6 +2133,15 @@ export class AiService extends TracedEventEmitter {
2197
2133
  const redactor = new SecretRedactor(scanResult.findings);
2198
2134
  promptForContext = redactor.redact(request.prompt);
2199
2135
  }
2136
+ else if (!scanResult.success) {
2137
+ // Do NOT log `scanResult.error` directly — it can contain
2138
+ // raw TruffleHog stdout/stderr payloads, which on some
2139
+ // failure paths include excerpts of the scanned prompt
2140
+ // (i.e. unredacted user secret material). Log only that the
2141
+ // scan failed; operators can correlate via timestamp +
2142
+ // peerId. (APPS-4080 security review)
2143
+ this.getLogger().warn("[secret-scan] Secret scan failed on pre-call paywall prompt; persisting unredacted (fail-open, matches mainline)");
2144
+ }
2200
2145
  }
2201
2146
  catch (scanErr) {
2202
2147
  // Same reason — don't pipe raw scanner error meta to logs.
@@ -2729,12 +2674,12 @@ export class AiService extends TracedEventEmitter {
2729
2674
  };
2730
2675
  }
2731
2676
  else if (attachment.type === "pdf" || attachment.type === "archive") {
2732
- const parsed = parseDataUrl(attachment.data);
2733
- const data = parsed?.data ?? attachment.data;
2677
+ const match = attachment.data.match(/^data:([^;]+);base64,(.+)$/);
2678
+ const data = match?.[2] ?? attachment.data;
2734
2679
  const defaultMediaType = attachment.type === "pdf"
2735
2680
  ? "application/pdf"
2736
2681
  : "application/octet-stream";
2737
- const mediaType = parsed?.mediaType ?? defaultMediaType;
2682
+ const mediaType = match?.[1] ?? defaultMediaType;
2738
2683
  return {
2739
2684
  type: "file",
2740
2685
  data,
@@ -3358,7 +3303,7 @@ export class AiService extends TracedEventEmitter {
3358
3303
  type: "tool-error",
3359
3304
  toolCallId,
3360
3305
  toolName,
3361
- error: getToolErrorMessage(result.error.cause ?? result.error),
3306
+ error: result.error.message,
3362
3307
  errorCode,
3363
3308
  });
3364
3309
  }
@@ -4025,16 +3970,13 @@ export class AiService extends TracedEventEmitter {
4025
3970
  // Invalidate context errors cache since runtime errors changed
4026
3971
  debugCache.invalidateContextErrors();
4027
3972
  }
4028
- handleClearBuildSystemErrors(source) {
3973
+ handleClearBuildSystemErrors() {
4029
3974
  this.clark.updateContext((context) => ({
4030
3975
  ...context,
4031
- buildSystemErrors: source
4032
- ? (context.buildSystemErrors ?? []).filter((error) => error.source !== source)
4033
- : [],
3976
+ buildSystemErrors: [],
4034
3977
  }));
4035
- this.getLogger().info(source
4036
- ? `[ai-service] Cleared ${source} build system errors`
4037
- : `[ai-service] Cleared all build system errors`);
3978
+ this.getLogger().info(`[ai-service] Cleared all build system errors`);
3979
+ // Invalidate context errors cache since build system errors changed
4038
3980
  debugCache.invalidateContextErrors();
4039
3981
  }
4040
3982
  async handlePromptInterpretation(request) {
@@ -4147,11 +4089,8 @@ export class AiService extends TracedEventEmitter {
4147
4089
  const streamPartTypeCounts = {};
4148
4090
  let stepCount = 0;
4149
4091
  let textDeltaChars = 0;
4150
- let failureErrorCode;
4151
- let maxOutputTokens;
4152
4092
  let modelName;
4153
4093
  let promptHash;
4154
- let quotaReason;
4155
4094
  // Hoisted so the outer catch can attribute a failed run to the same model as
4156
4095
  // the attempt it belongs to. Usage arrives from the client's usage observer,
4157
4096
  // which also flushes on abort, on error, and for compaction calls.
@@ -4188,10 +4127,8 @@ export class AiService extends TracedEventEmitter {
4188
4127
  finishReasons,
4189
4128
  grepMatchCounts,
4190
4129
  grepPatterns,
4191
- maxOutputTokens,
4192
4130
  model: modelName,
4193
4131
  promptHash,
4194
- quotaReason,
4195
4132
  reportToolCalled: Boolean(scanResult),
4196
4133
  scanComplete: scanResult?.scanComplete === true,
4197
4134
  scanRoot,
@@ -4201,26 +4138,13 @@ export class AiService extends TracedEventEmitter {
4201
4138
  textDeltaChars,
4202
4139
  toolCallCounts,
4203
4140
  });
4204
- const failPolicyGateExecution = (message, errorCode) => {
4205
- failureErrorCode = errorCode;
4206
- recordExecutionMetrics(errorCode);
4207
- throw Object.assign(new Error(message), {
4208
- errorCode,
4209
- runtimeMetadataJson: buildRuntimeMetadata(message),
4210
- });
4141
+ const failPolicyGateExecution = (message, outcome) => {
4142
+ recordExecutionMetrics(outcome);
4143
+ const error = new Error(message);
4144
+ error.runtimeMetadataJson = buildRuntimeMetadata(message);
4145
+ throw error;
4211
4146
  };
4212
4147
  try {
4213
- try {
4214
- await this.ensureAiQuotaAvailable(request.jwt);
4215
- }
4216
- catch (error) {
4217
- const message = error instanceof Error ? error.message : "AI quota unavailable";
4218
- const errorCode = classifyPolicyGateError(error);
4219
- if (errorCode === "out_of_credits") {
4220
- quotaReason = getAiQuotaPaywallReasonFromMessage(message);
4221
- }
4222
- failPolicyGateExecution(message, errorCode);
4223
- }
4224
4148
  const requestLlmConfig = request.llmConfig;
4225
4149
  const contextLlmConfig = this.clark.context.llmConfig;
4226
4150
  const llmConfig = requestLlmConfig ?? contextLlmConfig;
@@ -4249,13 +4173,16 @@ export class AiService extends TracedEventEmitter {
4249
4173
  let scanScopeJson = request.scanScopeJson;
4250
4174
  if (scanScopeJson?.unifiedDiff) {
4251
4175
  try {
4252
- const scanResult = await scanContentForSecrets(scanScopeJson.unifiedDiff, { consumer: "policy_gate" });
4176
+ const scanResult = await scanContentForSecrets(scanScopeJson.unifiedDiff);
4253
4177
  if (scanResult.success && scanResult.hasSecrets) {
4254
4178
  scanScopeJson = {
4255
4179
  ...scanScopeJson,
4256
4180
  unifiedDiff: new SecretRedactor(scanResult.findings).redact(scanScopeJson.unifiedDiff),
4257
4181
  };
4258
4182
  }
4183
+ else if (!scanResult.success) {
4184
+ logger.warn("[secret-scan] Secret scan failed on policy gate diff; using the original diff");
4185
+ }
4259
4186
  }
4260
4187
  catch {
4261
4188
  logger.warn("[secret-scan] Secret scan threw on policy gate diff; using the original diff");
@@ -4265,8 +4192,7 @@ export class AiService extends TracedEventEmitter {
4265
4192
  const systemPrompt = composeSecurityAgentPrompt(appContext, request.adminPrompt, scanScopeJson);
4266
4193
  promptHash = createHash("sha256").update(systemPrompt).digest("hex");
4267
4194
  const scanContext = {};
4268
- const { headers, interleavedThinking, maxOutputTokens: configuredMaxOutputTokens, providerOptions, thinkingBudgetTokens, thinkingEnabled, } = processLLMConfig(llmConfig);
4269
- maxOutputTokens = configuredMaxOutputTokens;
4195
+ const { headers, interleavedThinking, maxOutputTokens, providerOptions, thinkingBudgetTokens, thinkingEnabled, } = processLLMConfig(llmConfig);
4270
4196
  // Scan-owned client: gate JWT, own usage sink, built first so scan tools
4271
4197
  // (webFetch generateObject) use this client instead of Clark's.
4272
4198
  const policyGateLlmClient = new LLMClient({
@@ -4300,11 +4226,8 @@ export class AiService extends TracedEventEmitter {
4300
4226
  },
4301
4227
  };
4302
4228
  const tools = await buildSecurityScanTools(this.clark, scanToolsDeps);
4303
- const timeoutSignal = AbortSignal.timeout(POLICY_GATE_MAX_TOTAL_TIME_MS);
4304
4229
  const result = await policyGateLlmClient.streamText({
4305
- abortSignal: request.abortSignal
4306
- ? AbortSignal.any([request.abortSignal, timeoutSignal])
4307
- : timeoutSignal,
4230
+ abortSignal: AbortSignal.timeout(POLICY_GATE_MAX_TOTAL_TIME_MS),
4308
4231
  context: {
4309
4232
  contextManagement: {
4310
4233
  summarizationModel,
@@ -4319,7 +4242,7 @@ export class AiService extends TracedEventEmitter {
4319
4242
  headers,
4320
4243
  logging: false,
4321
4244
  // processLLMConfig returns the same MAX_OUTPUT_TOKENS cap Clark uses.
4322
- maxOutputTokens: configuredMaxOutputTokens,
4245
+ maxOutputTokens,
4323
4246
  model,
4324
4247
  onContextReady: (ctx) => {
4325
4248
  scanContext.current = ctx;
@@ -4369,7 +4292,7 @@ export class AiService extends TracedEventEmitter {
4369
4292
  });
4370
4293
  };
4371
4294
  try {
4372
- for await (const part of withPolicyGateIdleTimeout(result.fullStream, POLICY_GATE_STREAM_IDLE_TIMEOUT_MS)) {
4295
+ for await (const part of result.fullStream) {
4373
4296
  emitAgentStep(part);
4374
4297
  const partType = typeof part.type === "string"
4375
4298
  ? part.type
@@ -4487,9 +4410,6 @@ export class AiService extends TracedEventEmitter {
4487
4410
  }
4488
4411
  }
4489
4412
  catch (error) {
4490
- if (failureErrorCode !== undefined) {
4491
- throw error;
4492
- }
4493
4413
  if (error instanceof Error &&
4494
4414
  (error.name === "AbortError" ||
4495
4415
  error.name === "AbortedError" ||
@@ -4504,7 +4424,7 @@ export class AiService extends TracedEventEmitter {
4504
4424
  ...getErrorMeta(error),
4505
4425
  elapsedMs,
4506
4426
  });
4507
- failPolicyGateExecution("Policy gate agent timed out", "llm_timeout");
4427
+ failPolicyGateExecution("Policy gate agent timed out", "timeout");
4508
4428
  }
4509
4429
  logger.warn("[ai-service] Policy gate agent aborted", {
4510
4430
  ...policyRunLogContext,
@@ -4513,32 +4433,22 @@ export class AiService extends TracedEventEmitter {
4513
4433
  });
4514
4434
  failPolicyGateExecution("Policy gate agent aborted", "aborted");
4515
4435
  }
4516
- const streamError = serializePolicyGateStreamError(error);
4517
- if (streamErrors.length < MAX_POLICY_GATE_STREAM_ERRORS) {
4518
- streamErrors.push(streamError);
4519
- }
4520
- logger.warn("[ai-service] Policy gate stream error", {
4521
- ...policyRunLogContext,
4522
- streamError,
4523
- });
4524
- const errorCode = classifyPolicyGateError(error);
4525
- if (errorCode === "out_of_credits") {
4526
- quotaReason =
4527
- error instanceof Error
4528
- ? getAiQuotaPaywallReasonFromMessage(error.message)
4529
- : undefined;
4436
+ if (error instanceof Error &&
4437
+ (error.name === "LLMProviderError" ||
4438
+ error.name === "RetriesExhaustedError")) {
4439
+ const streamError = serializePolicyGateStreamError(error);
4440
+ if (streamErrors.length < MAX_POLICY_GATE_STREAM_ERRORS) {
4441
+ streamErrors.push(streamError);
4442
+ }
4443
+ logger.warn("[ai-service] Policy gate stream error", {
4444
+ ...policyRunLogContext,
4445
+ streamError,
4446
+ });
4530
4447
  }
4531
- failPolicyGateExecution(error instanceof Error ? error.message : "Policy gate stream failed", errorCode);
4448
+ throw error;
4532
4449
  }
4533
4450
  if (!scanResult) {
4534
4451
  logger.warn("[ai-service] Policy gate agent did not call reportReviewRun", policyRunLogContext);
4535
- if (finishReasons.includes("length")) {
4536
- const outputTokens = llmUsage.at(-1)?.outputTokens ?? 0;
4537
- failPolicyGateExecution(`Policy gate agent reached the output token limit of ${maxOutputTokens ?? 0} after producing ${outputTokens} output tokens`, "output_token_limit");
4538
- }
4539
- if (finishReasons.includes("content-filter")) {
4540
- failPolicyGateExecution("Policy gate agent output was refused by the provider content filter", "llm_refusal");
4541
- }
4542
4452
  failPolicyGateExecution("Policy gate agent did not complete a report", "missing_report");
4543
4453
  }
4544
4454
  const completedScanResult = scanResult;
@@ -4579,7 +4489,7 @@ export class AiService extends TracedEventEmitter {
4579
4489
  aiAgentRunId: request.aiAgentRunId,
4580
4490
  chatSessionStore: this.chatSessionStore,
4581
4491
  coreModel,
4582
- failure: policyGateFailureFromStream(failureErrorCode, quotaReason),
4492
+ failure: policyGateFailureFromStream(streamErrors),
4583
4493
  hadFallback,
4584
4494
  llmUsage,
4585
4495
  logger,