@superblocksteam/vite-plugin-file-sync 2.0.119-next.1 → 2.0.120-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 (345) hide show
  1. package/dist/ai-service/agent/middleware.d.ts.map +1 -1
  2. package/dist/ai-service/agent/middleware.js +2 -5
  3. package/dist/ai-service/agent/middleware.js.map +1 -1
  4. package/dist/ai-service/agent/prompts/build-base-system-prompt.d.ts.map +1 -1
  5. package/dist/ai-service/agent/prompts/build-base-system-prompt.js +17 -11
  6. package/dist/ai-service/agent/prompts/build-base-system-prompt.js.map +1 -1
  7. package/dist/ai-service/agent/prompts/build-security-scan-prompt.d.ts +17 -0
  8. package/dist/ai-service/agent/prompts/build-security-scan-prompt.d.ts.map +1 -0
  9. package/dist/ai-service/agent/prompts/build-security-scan-prompt.js +219 -0
  10. package/dist/ai-service/agent/prompts/build-security-scan-prompt.js.map +1 -0
  11. package/dist/ai-service/agent/tool-message-utils.d.ts.map +1 -1
  12. package/dist/ai-service/agent/tool-message-utils.js +64 -6
  13. package/dist/ai-service/agent/tool-message-utils.js.map +1 -1
  14. package/dist/ai-service/agent/tools/apis/api-comparator.d.ts +36 -0
  15. package/dist/ai-service/agent/tools/apis/api-comparator.d.ts.map +1 -0
  16. package/dist/ai-service/agent/tools/apis/api-comparator.js +369 -0
  17. package/dist/ai-service/agent/tools/apis/api-comparator.js.map +1 -0
  18. package/dist/ai-service/agent/tools/apis/api-validation-orchestrator.d.ts +4 -0
  19. package/dist/ai-service/agent/tools/apis/api-validation-orchestrator.d.ts.map +1 -1
  20. package/dist/ai-service/agent/tools/apis/api-validation-orchestrator.js +16 -5
  21. package/dist/ai-service/agent/tools/apis/api-validation-orchestrator.js.map +1 -1
  22. package/dist/ai-service/agent/tools/apis/build-api-artifact.d.ts +1 -0
  23. package/dist/ai-service/agent/tools/apis/build-api-artifact.d.ts.map +1 -1
  24. package/dist/ai-service/agent/tools/apis/build-api-artifact.js +17 -2
  25. package/dist/ai-service/agent/tools/apis/build-api-artifact.js.map +1 -1
  26. package/dist/ai-service/agent/tools/apis/build-api.d.ts.map +1 -1
  27. package/dist/ai-service/agent/tools/apis/build-api.js +17 -15
  28. package/dist/ai-service/agent/tools/apis/build-api.js.map +1 -1
  29. package/dist/ai-service/agent/tools/apis/get-api-docs.d.ts +1 -1
  30. package/dist/ai-service/agent/tools/apis/get-sdk-api-docs.d.ts.map +1 -1
  31. package/dist/ai-service/agent/tools/apis/get-sdk-api-docs.js +18 -13
  32. package/dist/ai-service/agent/tools/apis/get-sdk-api-docs.js.map +1 -1
  33. package/dist/ai-service/agent/tools/apis/test-api.d.ts.map +1 -1
  34. package/dist/ai-service/agent/tools/apis/test-api.js +138 -2
  35. package/dist/ai-service/agent/tools/apis/test-api.js.map +1 -1
  36. package/dist/ai-service/agent/tools/build-copy-directory.d.ts +12 -0
  37. package/dist/ai-service/agent/tools/build-copy-directory.d.ts.map +1 -0
  38. package/dist/ai-service/agent/tools/build-copy-directory.js +51 -0
  39. package/dist/ai-service/agent/tools/build-copy-directory.js.map +1 -0
  40. package/dist/ai-service/agent/tools/build-copy-file.d.ts +12 -0
  41. package/dist/ai-service/agent/tools/build-copy-file.d.ts.map +1 -0
  42. package/dist/ai-service/agent/tools/build-copy-file.js +52 -0
  43. package/dist/ai-service/agent/tools/build-copy-file.js.map +1 -0
  44. package/dist/ai-service/agent/tools/build-copy-utils.d.ts +57 -0
  45. package/dist/ai-service/agent/tools/build-copy-utils.d.ts.map +1 -0
  46. package/dist/ai-service/agent/tools/build-copy-utils.js +37 -0
  47. package/dist/ai-service/agent/tools/build-copy-utils.js.map +1 -0
  48. package/dist/ai-service/agent/tools/build-debug.d.ts.map +1 -1
  49. package/dist/ai-service/agent/tools/build-debug.js +17 -5
  50. package/dist/ai-service/agent/tools/build-debug.js.map +1 -1
  51. package/dist/ai-service/agent/tools/build-finalize.d.ts.map +1 -1
  52. package/dist/ai-service/agent/tools/build-finalize.js +42 -50
  53. package/dist/ai-service/agent/tools/build-finalize.js.map +1 -1
  54. package/dist/ai-service/agent/tools/build-manage-checklist.d.ts +7 -5
  55. package/dist/ai-service/agent/tools/build-manage-checklist.d.ts.map +1 -1
  56. package/dist/ai-service/agent/tools/build-manage-checklist.js +54 -108
  57. package/dist/ai-service/agent/tools/build-manage-checklist.js.map +1 -1
  58. package/dist/ai-service/agent/tools/databases/dev-database.d.ts +103 -0
  59. package/dist/ai-service/agent/tools/databases/dev-database.d.ts.map +1 -0
  60. package/dist/ai-service/agent/tools/databases/dev-database.js +117 -0
  61. package/dist/ai-service/agent/tools/databases/dev-database.js.map +1 -0
  62. package/dist/ai-service/agent/tools/get-logs.d.ts +1 -1
  63. package/dist/ai-service/agent/tools/index.d.ts +4 -0
  64. package/dist/ai-service/agent/tools/index.d.ts.map +1 -1
  65. package/dist/ai-service/agent/tools/index.js +4 -0
  66. package/dist/ai-service/agent/tools/index.js.map +1 -1
  67. package/dist/ai-service/agent/tools/integrations/delete-integration.d.ts +18 -0
  68. package/dist/ai-service/agent/tools/integrations/delete-integration.d.ts.map +1 -0
  69. package/dist/ai-service/agent/tools/integrations/delete-integration.js +99 -0
  70. package/dist/ai-service/agent/tools/integrations/delete-integration.js.map +1 -0
  71. package/dist/ai-service/agent/tools/integrations/execute-request.d.ts +1 -1
  72. package/dist/ai-service/agent/tools/integrations/index.d.ts +1 -0
  73. package/dist/ai-service/agent/tools/integrations/index.d.ts.map +1 -1
  74. package/dist/ai-service/agent/tools/integrations/index.js +1 -0
  75. package/dist/ai-service/agent/tools/integrations/index.js.map +1 -1
  76. package/dist/ai-service/agent/tools/integrations/metadata.d.ts.map +1 -1
  77. package/dist/ai-service/agent/tools/integrations/metadata.js +30 -4
  78. package/dist/ai-service/agent/tools/integrations/metadata.js.map +1 -1
  79. package/dist/ai-service/agent/tools/report-security-findings.d.ts +163 -0
  80. package/dist/ai-service/agent/tools/report-security-findings.d.ts.map +1 -0
  81. package/dist/ai-service/agent/tools/report-security-findings.js +52 -0
  82. package/dist/ai-service/agent/tools/report-security-findings.js.map +1 -0
  83. package/dist/ai-service/agent/tools.d.ts +2 -0
  84. package/dist/ai-service/agent/tools.d.ts.map +1 -1
  85. package/dist/ai-service/agent/tools.js +74 -6
  86. package/dist/ai-service/agent/tools.js.map +1 -1
  87. package/dist/ai-service/agent/tools2/example.js +1 -1
  88. package/dist/ai-service/agent/tools2/example.js.map +1 -1
  89. package/dist/ai-service/agent/tools2/tools/ask-multi-choice.d.ts +7 -0
  90. package/dist/ai-service/agent/tools2/tools/ask-multi-choice.d.ts.map +1 -1
  91. package/dist/ai-service/agent/tools2/tools/ask-multi-choice.js +11 -1
  92. package/dist/ai-service/agent/tools2/tools/ask-multi-choice.js.map +1 -1
  93. package/dist/ai-service/agent/tools2/tools/ask-searchable-dropdown.d.ts +7 -0
  94. package/dist/ai-service/agent/tools2/tools/ask-searchable-dropdown.d.ts.map +1 -1
  95. package/dist/ai-service/agent/tools2/tools/ask-searchable-dropdown.js +3 -1
  96. package/dist/ai-service/agent/tools2/tools/ask-searchable-dropdown.js.map +1 -1
  97. package/dist/ai-service/agent/tools2/tools/download-attachments.d.ts.map +1 -1
  98. package/dist/ai-service/agent/tools2/tools/download-attachments.js +4 -3
  99. package/dist/ai-service/agent/tools2/tools/download-attachments.js.map +1 -1
  100. package/dist/ai-service/agent/tools2/tools/exit-plan-mode.d.ts +9 -0
  101. package/dist/ai-service/agent/tools2/tools/exit-plan-mode.d.ts.map +1 -1
  102. package/dist/ai-service/agent/tools2/tools/exit-plan-mode.js +15 -1
  103. package/dist/ai-service/agent/tools2/tools/exit-plan-mode.js.map +1 -1
  104. package/dist/ai-service/agent/tools2/tools/list-attachments.d.ts.map +1 -1
  105. package/dist/ai-service/agent/tools2/tools/list-attachments.js +8 -4
  106. package/dist/ai-service/agent/tools2/tools/list-attachments.js.map +1 -1
  107. package/dist/ai-service/agent/tools2/tools/spawn-coding-subagents.d.ts +21 -4
  108. package/dist/ai-service/agent/tools2/tools/spawn-coding-subagents.d.ts.map +1 -1
  109. package/dist/ai-service/agent/tools2/tools/spawn-coding-subagents.js +87 -11
  110. package/dist/ai-service/agent/tools2/tools/spawn-coding-subagents.js.map +1 -1
  111. package/dist/ai-service/agent/tools2/types.d.ts +10 -2
  112. package/dist/ai-service/agent/tools2/types.d.ts.map +1 -1
  113. package/dist/ai-service/agent/tools2/types.js.map +1 -1
  114. package/dist/ai-service/agent/utils.d.ts.map +1 -1
  115. package/dist/ai-service/agent/utils.js +2 -0
  116. package/dist/ai-service/agent/utils.js.map +1 -1
  117. package/dist/ai-service/app-interface/filesystem/draft-manager.d.ts +1 -1
  118. package/dist/ai-service/app-interface/filesystem/draft-manager.d.ts.map +1 -1
  119. package/dist/ai-service/app-interface/filesystem/draft-manager.js.map +1 -1
  120. package/dist/ai-service/app-interface/npm-registry.d.ts +137 -0
  121. package/dist/ai-service/app-interface/npm-registry.d.ts.map +1 -0
  122. package/dist/ai-service/app-interface/npm-registry.js +415 -0
  123. package/dist/ai-service/app-interface/npm-registry.js.map +1 -0
  124. package/dist/ai-service/app-interface/shell.d.ts +38 -0
  125. package/dist/ai-service/app-interface/shell.d.ts.map +1 -1
  126. package/dist/ai-service/app-interface/shell.js +222 -1
  127. package/dist/ai-service/app-interface/shell.js.map +1 -1
  128. package/dist/ai-service/attachments/uploaded-content-part.d.ts +5 -0
  129. package/dist/ai-service/attachments/uploaded-content-part.d.ts.map +1 -1
  130. package/dist/ai-service/attachments/uploaded-content-part.js +31 -21
  131. package/dist/ai-service/attachments/uploaded-content-part.js.map +1 -1
  132. package/dist/ai-service/checklist/persisted-checklist-store.d.ts +105 -0
  133. package/dist/ai-service/checklist/persisted-checklist-store.d.ts.map +1 -0
  134. package/dist/ai-service/checklist/persisted-checklist-store.js +498 -0
  135. package/dist/ai-service/checklist/persisted-checklist-store.js.map +1 -0
  136. package/dist/ai-service/context-download.d.ts +14 -1
  137. package/dist/ai-service/context-download.d.ts.map +1 -1
  138. package/dist/ai-service/context-download.js +80 -0
  139. package/dist/ai-service/context-download.js.map +1 -1
  140. package/dist/ai-service/dev-database-client.d.ts +90 -0
  141. package/dist/ai-service/dev-database-client.d.ts.map +1 -0
  142. package/dist/ai-service/dev-database-client.js +166 -0
  143. package/dist/ai-service/dev-database-client.js.map +1 -0
  144. package/dist/ai-service/features.d.ts +16 -0
  145. package/dist/ai-service/features.d.ts.map +1 -1
  146. package/dist/ai-service/features.js +10 -0
  147. package/dist/ai-service/features.js.map +1 -1
  148. package/dist/ai-service/filter-disabled-tools-for-migration.d.ts +6 -0
  149. package/dist/ai-service/filter-disabled-tools-for-migration.d.ts.map +1 -0
  150. package/dist/ai-service/filter-disabled-tools-for-migration.js +35 -0
  151. package/dist/ai-service/filter-disabled-tools-for-migration.js.map +1 -0
  152. package/dist/ai-service/index.d.ts +11 -1
  153. package/dist/ai-service/index.d.ts.map +1 -1
  154. package/dist/ai-service/index.js +86 -37
  155. package/dist/ai-service/index.js.map +1 -1
  156. package/dist/ai-service/integrations/store.d.ts +5 -0
  157. package/dist/ai-service/integrations/store.d.ts.map +1 -1
  158. package/dist/ai-service/integrations/store.js +19 -2
  159. package/dist/ai-service/integrations/store.js.map +1 -1
  160. package/dist/ai-service/judge/tools/submit-feedback.d.ts +1 -1
  161. package/dist/ai-service/llm/context-v2/context.d.ts.map +1 -1
  162. package/dist/ai-service/llm/context-v2/context.js +6 -2
  163. package/dist/ai-service/llm/context-v2/context.js.map +1 -1
  164. package/dist/ai-service/llm/context-v2/manager.d.ts +8 -1
  165. package/dist/ai-service/llm/context-v2/manager.d.ts.map +1 -1
  166. package/dist/ai-service/llm/context-v2/manager.js +17 -1
  167. package/dist/ai-service/llm/context-v2/manager.js.map +1 -1
  168. package/dist/ai-service/llm/context-v2/prompts/compaction.d.ts +1 -1
  169. package/dist/ai-service/llm/context-v2/prompts/compaction.d.ts.map +1 -1
  170. package/dist/ai-service/llm/context-v2/prompts/compaction.js +3 -3
  171. package/dist/ai-service/llm/context-v2/types.d.ts +7 -0
  172. package/dist/ai-service/llm/context-v2/types.d.ts.map +1 -1
  173. package/dist/ai-service/llm/context-v2/types.js +33 -0
  174. package/dist/ai-service/llm/context-v2/types.js.map +1 -1
  175. package/dist/ai-service/llm/impl/clark.d.ts.map +1 -1
  176. package/dist/ai-service/llm/impl/clark.js +3 -3
  177. package/dist/ai-service/llm/impl/clark.js.map +1 -1
  178. package/dist/ai-service/llm/provider.d.ts.map +1 -1
  179. package/dist/ai-service/llm/provider.js +22 -7
  180. package/dist/ai-service/llm/provider.js.map +1 -1
  181. package/dist/ai-service/llm/types.d.ts +14 -1
  182. package/dist/ai-service/llm/types.d.ts.map +1 -1
  183. package/dist/ai-service/llmobs/context-registry.d.ts +62 -0
  184. package/dist/ai-service/llmobs/context-registry.d.ts.map +1 -0
  185. package/dist/ai-service/llmobs/context-registry.js +115 -0
  186. package/dist/ai-service/llmobs/context-registry.js.map +1 -0
  187. package/dist/ai-service/llmobs/otel-exporter.d.ts +23 -0
  188. package/dist/ai-service/llmobs/otel-exporter.d.ts.map +1 -1
  189. package/dist/ai-service/llmobs/otel-exporter.js +112 -10
  190. package/dist/ai-service/llmobs/otel-exporter.js.map +1 -1
  191. package/dist/ai-service/llmobs/tracer.d.ts +7 -0
  192. package/dist/ai-service/llmobs/tracer.d.ts.map +1 -1
  193. package/dist/ai-service/llmobs/tracer.js +38 -0
  194. package/dist/ai-service/llmobs/tracer.js.map +1 -1
  195. package/dist/ai-service/skills/system/_registry.generated.d.ts.map +1 -1
  196. package/dist/ai-service/skills/system/_registry.generated.js +2 -0
  197. package/dist/ai-service/skills/system/_registry.generated.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 +2 -0
  201. package/dist/ai-service/skills/system/superblocks-frontend/skill.generated.js.map +1 -1
  202. package/dist/ai-service/skills/system/superblocks-migration/references/focused-debug.generated.d.ts +1 -1
  203. package/dist/ai-service/skills/system/superblocks-migration/references/focused-debug.generated.d.ts.map +1 -1
  204. package/dist/ai-service/skills/system/superblocks-migration/references/focused-debug.generated.js +3 -1
  205. package/dist/ai-service/skills/system/superblocks-migration/references/focused-debug.generated.js.map +1 -1
  206. package/dist/ai-service/skills/system/superblocks-migration/references/yaml-block-mapping.generated.d.ts +1 -1
  207. package/dist/ai-service/skills/system/superblocks-migration/references/yaml-block-mapping.generated.d.ts.map +1 -1
  208. package/dist/ai-service/skills/system/superblocks-migration/references/yaml-block-mapping.generated.js +29 -0
  209. package/dist/ai-service/skills/system/superblocks-migration/references/yaml-block-mapping.generated.js.map +1 -1
  210. package/dist/ai-service/skills/system/superblocks-migration/skill.generated.d.ts +1 -1
  211. package/dist/ai-service/skills/system/superblocks-migration/skill.generated.d.ts.map +1 -1
  212. package/dist/ai-service/skills/system/superblocks-migration/skill.generated.js +139 -7
  213. package/dist/ai-service/skills/system/superblocks-migration/skill.generated.js.map +1 -1
  214. package/dist/ai-service/skills/system/third-party-migration/claude-design.generated.d.ts +2 -0
  215. package/dist/ai-service/skills/system/third-party-migration/claude-design.generated.d.ts.map +1 -0
  216. package/dist/ai-service/skills/system/third-party-migration/claude-design.generated.js +107 -0
  217. package/dist/ai-service/skills/system/third-party-migration/claude-design.generated.js.map +1 -0
  218. package/dist/ai-service/skills/system/third-party-migration/skill.generated.d.ts +1 -1
  219. package/dist/ai-service/skills/system/third-party-migration/skill.generated.d.ts.map +1 -1
  220. package/dist/ai-service/skills/system/third-party-migration/skill.generated.js +33 -3
  221. package/dist/ai-service/skills/system/third-party-migration/skill.generated.js.map +1 -1
  222. package/dist/ai-service/state-machine/clark-fsm.d.ts +21 -0
  223. package/dist/ai-service/state-machine/clark-fsm.d.ts.map +1 -1
  224. package/dist/ai-service/state-machine/clark-fsm.js.map +1 -1
  225. package/dist/ai-service/state-machine/handlers/agent-planning.d.ts.map +1 -1
  226. package/dist/ai-service/state-machine/handlers/agent-planning.js +79 -6
  227. package/dist/ai-service/state-machine/handlers/agent-planning.js.map +1 -1
  228. package/dist/ai-service/state-machine/handlers/llm-generating.d.ts +10 -0
  229. package/dist/ai-service/state-machine/handlers/llm-generating.d.ts.map +1 -1
  230. package/dist/ai-service/state-machine/handlers/llm-generating.js +69 -41
  231. package/dist/ai-service/state-machine/handlers/llm-generating.js.map +1 -1
  232. package/dist/ai-service/state-machine/helpers/peer.d.ts +35 -7
  233. package/dist/ai-service/state-machine/helpers/peer.d.ts.map +1 -1
  234. package/dist/ai-service/state-machine/helpers/peer.js +81 -15
  235. package/dist/ai-service/state-machine/helpers/peer.js.map +1 -1
  236. package/dist/ai-service/template-renderer.d.ts +14 -1
  237. package/dist/ai-service/template-renderer.d.ts.map +1 -1
  238. package/dist/ai-service/template-renderer.js +144 -41
  239. package/dist/ai-service/template-renderer.js.map +1 -1
  240. package/dist/ai-service/transform/api-builder/to-sdk-transformer.js +2 -2
  241. package/dist/ai-service/transform/api-builder/to-sdk-transformer.js.map +1 -1
  242. package/dist/ai-service/transform/api-builder/to-yaml-transformer.js +2 -2
  243. package/dist/ai-service/transform/api-builder/to-yaml-transformer.js.map +1 -1
  244. package/dist/draft-interface.d.ts +1 -1
  245. package/dist/draft-interface.d.ts.map +1 -1
  246. package/dist/file-sync-vite-plugin.d.ts.map +1 -1
  247. package/dist/file-sync-vite-plugin.js +34 -27
  248. package/dist/file-sync-vite-plugin.js.map +1 -1
  249. package/dist/file-system-helpers.d.ts +4 -0
  250. package/dist/file-system-helpers.d.ts.map +1 -1
  251. package/dist/file-system-helpers.js +13 -0
  252. package/dist/file-system-helpers.js.map +1 -1
  253. package/dist/inject-index-vite-plugin.d.ts.map +1 -1
  254. package/dist/inject-index-vite-plugin.js +15 -1
  255. package/dist/inject-index-vite-plugin.js.map +1 -1
  256. package/dist/injected-index.d.ts.map +1 -1
  257. package/dist/injected-index.js +15 -1
  258. package/dist/injected-index.js.map +1 -1
  259. package/dist/lock-service/index.d.ts.map +1 -1
  260. package/dist/lock-service/index.js +8 -10
  261. package/dist/lock-service/index.js.map +1 -1
  262. package/dist/migration/migration-checklist.d.ts +51 -2
  263. package/dist/migration/migration-checklist.d.ts.map +1 -1
  264. package/dist/migration/migration-checklist.js +79 -151
  265. package/dist/migration/migration-checklist.js.map +1 -1
  266. package/dist/migration/migration-routes.d.ts.map +1 -1
  267. package/dist/migration/migration-routes.js +290 -30
  268. package/dist/migration/migration-routes.js.map +1 -1
  269. package/dist/migration/migration-verification.d.ts +206 -0
  270. package/dist/migration/migration-verification.d.ts.map +1 -0
  271. package/dist/migration/migration-verification.js +1006 -0
  272. package/dist/migration/migration-verification.js.map +1 -0
  273. package/dist/migration/recommended-user-deps.d.ts +39 -0
  274. package/dist/migration/recommended-user-deps.d.ts.map +1 -0
  275. package/dist/migration/recommended-user-deps.js +209 -0
  276. package/dist/migration/recommended-user-deps.js.map +1 -0
  277. package/dist/migration/restructure.d.ts +29 -2
  278. package/dist/migration/restructure.d.ts.map +1 -1
  279. package/dist/migration/restructure.js +145 -6
  280. package/dist/migration/restructure.js.map +1 -1
  281. package/dist/migration/scan-imports.d.ts +7 -0
  282. package/dist/migration/scan-imports.d.ts.map +1 -0
  283. package/dist/migration/scan-imports.js +178 -0
  284. package/dist/migration/scan-imports.js.map +1 -0
  285. package/dist/migration/translation-prompt.d.ts.map +1 -1
  286. package/dist/migration/translation-prompt.js +2 -0
  287. package/dist/migration/translation-prompt.js.map +1 -1
  288. package/dist/migration/unsupported-integrations.d.ts.map +1 -1
  289. package/dist/migration/unsupported-integrations.js +9 -0
  290. package/dist/migration/unsupported-integrations.js.map +1 -1
  291. package/dist/migration/yaml-walk.d.ts +18 -0
  292. package/dist/migration/yaml-walk.d.ts.map +1 -0
  293. package/dist/migration/yaml-walk.js +45 -0
  294. package/dist/migration/yaml-walk.js.map +1 -0
  295. package/dist/migration-templates/app-fullstack/client/components/hooks/use-mobile.ts +1 -1
  296. package/dist/migration-templates/app-fullstack/client/components/ui/accordion.tsx +1 -1
  297. package/dist/migration-templates/app-fullstack/client/components/ui/avatar.tsx +1 -1
  298. package/dist/migration-templates/app-fullstack/client/components/ui/breadcrumb.tsx +1 -1
  299. package/dist/migration-templates/app-fullstack/client/components/ui/button.tsx +1 -1
  300. package/dist/migration-templates/app-fullstack/client/components/ui/calendar.tsx +1 -1
  301. package/dist/migration-templates/app-fullstack/client/components/ui/chart.tsx +1 -1
  302. package/dist/migration-templates/app-fullstack/client/components/ui/file-dropzone.tsx +1 -1
  303. package/dist/migration-templates/app-fullstack/client/components/ui/file-input.tsx +1 -1
  304. package/dist/migration-templates/app-fullstack/client/components/ui/hover-card.tsx +1 -1
  305. package/dist/migration-templates/app-fullstack/client/components/ui/image.tsx +1 -1
  306. package/dist/migration-templates/app-fullstack/client/components/ui/input.tsx +1 -1
  307. package/dist/migration-templates/app-fullstack/client/components/ui/label.tsx +1 -1
  308. package/dist/migration-templates/app-fullstack/client/components/ui/navigation-menu.tsx +1 -1
  309. package/dist/migration-templates/app-fullstack/client/components/ui/pagination.tsx +1 -1
  310. package/dist/migration-templates/app-fullstack/client/components/ui/popover.tsx +1 -1
  311. package/dist/migration-templates/app-fullstack/client/components/ui/progress.tsx +1 -1
  312. package/dist/migration-templates/app-fullstack/client/components/ui/select.tsx +1 -1
  313. package/dist/migration-templates/app-fullstack/client/components/ui/sheet.tsx +1 -1
  314. package/dist/migration-templates/app-fullstack/client/components/ui/sidebar.tsx +1 -1
  315. package/dist/migration-templates/app-fullstack/client/components/ui/slider.tsx +1 -1
  316. package/dist/migration-templates/app-fullstack/client/components/ui/switch.tsx +1 -1
  317. package/dist/migration-templates/app-fullstack/client/components/ui/table.tsx +1 -1
  318. package/dist/migration-templates/app-fullstack/client/components/ui/tabs.tsx +1 -1
  319. package/dist/migration-templates/app-fullstack/client/components/ui/toggle-group.tsx +1 -1
  320. package/dist/migration-templates/app-fullstack/client/components/ui/toggle.tsx +1 -1
  321. package/dist/migration-templates/app-fullstack/client/components/ui/tooltip.tsx +1 -1
  322. package/dist/socket-manager.d.ts.map +1 -1
  323. package/dist/socket-manager.js +8 -0
  324. package/dist/socket-manager.js.map +1 -1
  325. package/dist/sync-service/hash-dir-tree.d.ts +1 -1
  326. package/dist/sync-service/hash-dir-tree.d.ts.map +1 -1
  327. package/dist/sync-service/hash-dir-tree.js +3 -3
  328. package/dist/sync-service/hash-dir-tree.js.map +1 -1
  329. package/dist/sync-service/index.d.ts +0 -14
  330. package/dist/sync-service/index.d.ts.map +1 -1
  331. package/dist/sync-service/index.js +1 -44
  332. package/dist/sync-service/index.js.map +1 -1
  333. package/dist/sync-service/list-dir.d.ts +1 -1
  334. package/dist/sync-service/list-dir.d.ts.map +1 -1
  335. package/dist/sync-service/list-dir.js +36 -3
  336. package/dist/sync-service/list-dir.js.map +1 -1
  337. package/dist/sync-service/snapshot/take-snapshot.d.ts +1 -1
  338. package/dist/sync-service/snapshot/take-snapshot.d.ts.map +1 -1
  339. package/dist/sync-service/snapshot/take-snapshot.js +4 -8
  340. package/dist/sync-service/snapshot/take-snapshot.js.map +1 -1
  341. package/dist/util/log-sanitizer.d.ts +6 -5
  342. package/dist/util/log-sanitizer.d.ts.map +1 -1
  343. package/dist/util/log-sanitizer.js +21 -6
  344. package/dist/util/log-sanitizer.js.map +1 -1
  345. package/package.json +9 -8
@@ -0,0 +1,99 @@
1
+ import z from "zod";
2
+ import { AiEntityType, AiPermissionType, } from "@superblocksteam/library-shared/types";
3
+ import { getLogger } from "../../../../util/logger.js";
4
+ import { createToolFactory, ToolCategory, PermissionLevel, } from "../../tools2/types.js";
5
+ export const deleteIntegrationToolFactory = createToolFactory("deleteIntegration", ({ clark, integrationStore }) => ({
6
+ category: ToolCategory.INTERACTIVE,
7
+ defaultPermission: PermissionLevel.PROMPT,
8
+ description: "Permanently deletes an integration by its ID. " +
9
+ "This action cannot be undone. Any APIs or workflows that reference this integration will break. " +
10
+ "Use searchIntegrations first to find the integration ID if needed. " +
11
+ "The user will be asked to confirm before the integration is deleted.",
12
+ inputSchema: z.object({
13
+ integrationId: z
14
+ .string()
15
+ .describe("The ID of the integration to delete."),
16
+ }),
17
+ execute: async (input) => {
18
+ if (!clark.context.peer) {
19
+ return { success: false, error: "No peer connection available." };
20
+ }
21
+ let result;
22
+ try {
23
+ result = await clark.context.peer.call.aiDeleteIntegration({
24
+ integrationId: input.integrationId,
25
+ });
26
+ }
27
+ catch (err) {
28
+ const message = err instanceof Error ? err.message : String(err);
29
+ getLogger().error(`[deleteIntegration] RPC failed for ${input.integrationId}: ${message}`);
30
+ return { success: false, error: message };
31
+ }
32
+ if (!result?.success && result?.error) {
33
+ getLogger().warn(`[deleteIntegration] delete failed for ${input.integrationId}: ${result.error}`);
34
+ }
35
+ // Remove the deleted integration from the in-memory store so
36
+ // Clark doesn't try to use it in subsequent turns.
37
+ if (result?.success) {
38
+ const deletedId = result.integrationId ?? input.integrationId;
39
+ integrationStore.unregisterIntegration(deletedId);
40
+ if (typeof clark.updateContext === "function") {
41
+ clark.updateContext((context) => {
42
+ const existing = context.availableIntegrations ?? [];
43
+ return {
44
+ ...context,
45
+ availableIntegrations: existing.filter((int) => int.id !== deletedId),
46
+ };
47
+ });
48
+ }
49
+ }
50
+ return result;
51
+ },
52
+ getActionName: () => ({
53
+ future: "delete integration",
54
+ present: "deleting integration",
55
+ past: "deleted integration",
56
+ }),
57
+ formatInput: async (input) => {
58
+ const header = integrationStore.getHeader(input.integrationId);
59
+ const name = header?.displayName ?? header?.name ?? input.integrationId;
60
+ let details;
61
+ if (clark.context.peer) {
62
+ try {
63
+ const deps = await clark.context.peer.call.aiGetIntegrationDependents({ integrationId: input.integrationId });
64
+ if (deps.success && deps.appNames && deps.appNames.length > 0) {
65
+ details =
66
+ `Note: APIs using ${name} in these apps would break: ` +
67
+ deps.appNames.join(", ");
68
+ }
69
+ }
70
+ catch (err) {
71
+ getLogger().warn(`[deleteIntegration] dependent fetch failed for ${input.integrationId}: ${err instanceof Error ? err.message : String(err)}`);
72
+ }
73
+ }
74
+ return {
75
+ targets: [name],
76
+ summary: `Ok if I delete the "${name}" integration? This cannot be undone.`,
77
+ details,
78
+ };
79
+ },
80
+ getRequiredPermissions: (input) => [
81
+ {
82
+ entityType: AiEntityType.INTEGRATION,
83
+ entityId: input.integrationId,
84
+ permissionType: AiPermissionType.DELETE,
85
+ },
86
+ ],
87
+ getSummary: (_input, output) => {
88
+ if (output?.success) {
89
+ const suffix = output.alreadyDeleted ? " (already deleted)" : "";
90
+ return {
91
+ output: `deleted (${output.integrationName ?? output.integrationId})${suffix}`,
92
+ };
93
+ }
94
+ return {
95
+ output: `failed: ${output?.error ?? "unknown error"}`,
96
+ };
97
+ },
98
+ }));
99
+ //# sourceMappingURL=delete-integration.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delete-integration.js","sourceRoot":"","sources":["../../../../../src/ai-service/agent/tools/integrations/delete-integration.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAC;AAEpB,OAAO,EACL,YAAY,EACZ,gBAAgB,GACjB,MAAM,uCAAuC,CAAC;AAE/C,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAGvD,OAAO,EACL,iBAAiB,EACjB,YAAY,EACZ,eAAe,GAChB,MAAM,uBAAuB,CAAC;AAe/B,MAAM,CAAC,MAAM,4BAA4B,GAAG,iBAAiB,CAC3D,mBAAmB,EACnB,CAAC,EAAE,KAAK,EAAE,gBAAgB,EAAyB,EAAE,EAAE,CAAC,CAAC;IACvD,QAAQ,EAAE,YAAY,CAAC,WAAW;IAClC,iBAAiB,EAAE,eAAe,CAAC,MAAM;IACzC,WAAW,EACT,gDAAgD;QAChD,kGAAkG;QAClG,qEAAqE;QACrE,sEAAsE;IACxE,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC;QACpB,aAAa,EAAE,CAAC;aACb,MAAM,EAAE;aACR,QAAQ,CAAC,sCAAsC,CAAC;KACpD,CAAC;IACF,OAAO,EAAE,KAAK,EAA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AK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAC7H,CAAC;YACJ,CAAC;QACH,CAAC;QAED,OAAO;YACL,OAAO,EAAE,CAAC,IAAI,CAAC;YACf,OAAO,EAAE,uBAAuB,IAAI,uCAAuC;YAC3E,OAAO;SACR,CAAC;IACJ,CAAC;IACD,sBAAsB,EAAE,CAAC,KAAgC,EAAE,EAAE,CAAC;QAC5D;YACE,UAAU,EAAE,YAAY,CAAC,WAAW;YACpC,QAAQ,EAAE,KAAK,CAAC,aAAa;YAC7B,cAAc,EAAE,gBAAgB,CAAC,MAAM;SACxC;KACF;IACD,UAAU,EAAE,CACV,MAAiC,EACjC,MAA+B,EAC/B,EAAE;QACF,IAAI,MAAM,EAAE,OAAO,EAAE,CAAC;YACpB,MAAM,MAAM,GAAG,MAAM,CAAC,cAAc,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,EAAE,CAAC;YACjE,OAAO;gBACL,MAAM,EAAE,YAAY,MAAM,CAAC,eAAe,IAAI,MAAM,CAAC,aAAa,IAAI,MAAM,EAAE;aAC/E,CAAC;QACJ,CAAC;QACD,OAAO;YACL,MAAM,EAAE,WAAW,MAAM,EAAE,KAAK,IAAI,eAAe,EAAE;SACtD,CAAC;IACJ,CAAC;CACF,CAAC,CACH,CAAC"}
@@ -55,11 +55,11 @@ export declare const executeRequestToIntegrationToolFactory: import("../../tools
55
55
  action: string;
56
56
  limit?: string | undefined;
57
57
  query?: string | undefined;
58
+ field?: string | undefined;
58
59
  collection?: string | undefined;
59
60
  pipeline?: string | undefined;
60
61
  projection?: string | undefined;
61
62
  sortby?: string | undefined;
62
- field?: string | undefined;
63
63
  } | {
64
64
  type: "salesforce";
65
65
  query: string;
@@ -1,3 +1,4 @@
1
+ export { deleteIntegrationToolFactory } from "./delete-integration.js";
1
2
  export { executeRequestToIntegrationToolFactory } from "./execute-request.js";
2
3
  export { openIntegrationSetupToolFactory, openExistingIntegrationToolFactory, updateIntegrationFieldsToolFactory, testIntegrationConnectionToolFactory, saveIntegrationToolFactory, closeIntegrationSetupToolFactory, getIntegrationFormSchemaToolFactory, listAvailableIntegrationTypesToolFactory, } from "./integration-setup.js";
3
4
  export { searchIntegrationsToolFactory } from "./metadata.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/ai-service/agent/tools/integrations/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sCAAsC,EAAE,MAAM,sBAAsB,CAAC;AAC9E,OAAO,EACL,+BAA+B,EAC/B,kCAAkC,EAClC,kCAAkC,EAClC,oCAAoC,EACpC,0BAA0B,EAC1B,gCAAgC,EAChC,mCAAmC,EACnC,wCAAwC,GACzC,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,6BAA6B,EAAE,MAAM,eAAe,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/ai-service/agent/tools/integrations/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,yBAAyB,CAAC;AACvE,OAAO,EAAE,sCAAsC,EAAE,MAAM,sBAAsB,CAAC;AAC9E,OAAO,EACL,+BAA+B,EAC/B,kCAAkC,EAClC,kCAAkC,EAClC,oCAAoC,EACpC,0BAA0B,EAC1B,gCAAgC,EAChC,mCAAmC,EACnC,wCAAwC,GACzC,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,6BAA6B,EAAE,MAAM,eAAe,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC"}
@@ -1,3 +1,4 @@
1
+ export { deleteIntegrationToolFactory } from "./delete-integration.js";
1
2
  export { executeRequestToIntegrationToolFactory } from "./execute-request.js";
2
3
  export { openIntegrationSetupToolFactory, openExistingIntegrationToolFactory, updateIntegrationFieldsToolFactory, testIntegrationConnectionToolFactory, saveIntegrationToolFactory, closeIntegrationSetupToolFactory, getIntegrationFormSchemaToolFactory, listAvailableIntegrationTypesToolFactory, } from "./integration-setup.js";
3
4
  export { searchIntegrationsToolFactory } from "./metadata.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/ai-service/agent/tools/integrations/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sCAAsC,EAAE,MAAM,sBAAsB,CAAC;AAC9E,OAAO,EACL,+BAA+B,EAC/B,kCAAkC,EAClC,kCAAkC,EAClC,oCAAoC,EACpC,0BAA0B,EAC1B,gCAAgC,EAChC,mCAAmC,EACnC,wCAAwC,GACzC,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,6BAA6B,EAAE,MAAM,eAAe,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/ai-service/agent/tools/integrations/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,yBAAyB,CAAC;AACvE,OAAO,EAAE,sCAAsC,EAAE,MAAM,sBAAsB,CAAC;AAC9E,OAAO,EACL,+BAA+B,EAC/B,kCAAkC,EAClC,kCAAkC,EAClC,oCAAoC,EACpC,0BAA0B,EAC1B,gCAAgC,EAChC,mCAAmC,EACnC,wCAAwC,GACzC,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,6BAA6B,EAAE,MAAM,eAAe,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"metadata.d.ts","sourceRoot":"","sources":["../../../../../src/ai-service/agent/tools/integrations/metadata.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAErD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAC;AAInF,eAAO,MAAM,6BAA6B;WAoBH,UAAU;WAAS,MAAM;;;;;;KAgD/D,CAAC"}
1
+ {"version":3,"file":"metadata.d.ts","sourceRoot":"","sources":["../../../../../src/ai-service/agent/tools/integrations/metadata.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAErD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAC;AAwBnF,eAAO,MAAM,6BAA6B;WAoBH,UAAU;WAAS,MAAM;;;;;;KAyD/D,CAAC"}
@@ -2,6 +2,23 @@ import z from "zod";
2
2
  import { PluginType } from "@superblocksteam/shared";
3
3
  import { UNSUPPORTED_INTEGRATIONS } from "../../../transform/api-builder/to-sdk-transformer.js";
4
4
  import { createToolFactory, ToolCategory } from "../../tools2/types.js";
5
+ // Strip non-alphanumeric chars (preserves Unicode letters/digits).
6
+ const NON_ALPHANUMERIC_RE = /[^\p{L}\p{N}]+/gu;
7
+ /**
8
+ * Tokenize a search string into normalized whitespace-separated tokens.
9
+ * Each token is lowercased and stripped of non-alphanumeric chars so that
10
+ * names with brackets or punctuation (e.g. `[Demo] Orders`) are matchable.
11
+ */
12
+ function tokenizeSearch(search) {
13
+ return search
14
+ .toLowerCase()
15
+ .split(/\s+/)
16
+ .map((token) => token.replace(NON_ALPHANUMERIC_RE, ""))
17
+ .filter((token) => token.length > 0);
18
+ }
19
+ function normalizeForMatch(str) {
20
+ return str.toLowerCase().replace(NON_ALPHANUMERIC_RE, "");
21
+ }
5
22
  export const searchIntegrationsToolFactory = createToolFactory("searchIntegrations", (services) => {
6
23
  return {
7
24
  category: ToolCategory.METADATA,
@@ -33,10 +50,19 @@ export const searchIntegrationsToolFactory = createToolFactory("searchIntegratio
33
50
  .filter((int) => {
34
51
  if (params.name == undefined)
35
52
  return true;
36
- // Search in both name (slug) and displayName
37
- const searchTerm = params.name.toLowerCase();
38
- return (int.name.toLowerCase().includes(searchTerm) ||
39
- int.displayName?.toLowerCase().includes(searchTerm));
53
+ // Search in both name (slug) and displayName. Normalize each
54
+ // candidate and tokenize the query so names with brackets or
55
+ // punctuation (e.g. `[Demo] Orders`) match queries like
56
+ // `demo orders`.
57
+ const tokens = tokenizeSearch(params.name);
58
+ if (tokens.length === 0)
59
+ return true;
60
+ const nameNorm = normalizeForMatch(int.name);
61
+ const displayNameNorm = int.displayName
62
+ ? normalizeForMatch(int.displayName)
63
+ : "";
64
+ return tokens.every((token) => nameNorm.includes(token) ||
65
+ displayNameNorm.includes(token));
40
66
  })
41
67
  // Filter out integrations that are not yet supported by Clark's API generation
42
68
  .filter((int) => !UNSUPPORTED_INTEGRATIONS.includes(int.plugin.id));
@@ -1 +1 @@
1
- {"version":3,"file":"metadata.js","sourceRoot":"","sources":["../../../../../src/ai-service/agent/tools/integrations/metadata.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAC;AAEpB,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAGrD,OAAO,EAAE,wBAAwB,EAAE,MAAM,sDAAsD,CAAC;AAChG,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAExE,MAAM,CAAC,MAAM,6BAA6B,GAAG,iBAAiB,CAC5D,oBAAoB,EACpB,CAAC,QAAiC,EAAE,EAAE;IACpC,OAAO;QACL,QAAQ,EAAE,YAAY,CAAC,QAAQ;QAC/B,WAAW,EAAE;;;;KAId;QACC,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC;YACpB,IAAI,EAAE,CAAC;iBACJ,UAAU,CAAC,UAAU,CAAC;iBACtB,QAAQ,EAAE;iBACV,QAAQ,CAAC,uCAAuC,CAAC;YACpD,IAAI,EAAE,CAAC;iBACJ,MAAM,EAAE;iBACR,QAAQ,EAAE;iBACV,QAAQ,CAAC,2CAA2C,CAAC;SACzD,CAAC;QACF,OAAO,EAAE,KAAK,EAAE,MAA4C,EAAE,EAAE;YAC9D,IAAI,CAA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AE;gBACF,IAAI,EAAE,WAAW,IAAI,IAAI;gBACzB,OAAO,EAAE,IAAI;gBACb,MAAM;aACP,CAAC,CAAC,CAAC;QACN,CAAC;QACD,QAAQ,EAAE,IAAI;QACd,UAAU,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE;YAC7B,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;YACxD,OAAO;gBACL,MAAM,EAAE,GAAG,KAAK,eAAe,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,EAAE;aACxD,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC,CACF,CAAC"}
1
+ {"version":3,"file":"metadata.js","sourceRoot":"","sources":["../../../../../src/ai-service/agent/tools/integrations/metadata.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAC;AAEpB,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAGrD,OAAO,EAAE,wBAAwB,EAAE,MAAM,sDAAsD,CAAC;AAChG,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAExE,mEAAmE;AACnE,MAAM,mBAAmB,GAAG,kBAAkB,CAAC;AAE/C;;;;GAIG;AACH,SAAS,cAAc,CAAC,MAAc;IACpC,OAAO,MAAM;SACV,WAAW,EAAE;SACb,KAAK,CAAC,KAAK,CAAC;SACZ,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,mBAAmB,EAAE,EAAE,CAAC,CAAC;SACtD,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;AACzC,CAAC;AAED,SAAS,iBAAiB,CAAC,GAAW;IACpC,OAAO,GAAG,CAAC,WAAW,EAAE,C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,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,EAAE;aACxD,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC,CACF,CAAC"}
@@ -0,0 +1,163 @@
1
+ import z from "zod";
2
+ declare const securityScanResultSchema: z.ZodObject<{
3
+ findings: z.ZodArray<z.ZodObject<{
4
+ category: z.ZodEnum<["auth", "config", "crypto", "data_exposure", "injection", "other", "secret", "xss"]>;
5
+ confidence: z.ZodEnum<["high", "low", "medium"]>;
6
+ description: z.ZodString;
7
+ evidence: z.ZodString;
8
+ id: z.ZodString;
9
+ location: z.ZodObject<{
10
+ component: z.ZodOptional<z.ZodString>;
11
+ file: z.ZodString;
12
+ line: z.ZodOptional<z.ZodNumber>;
13
+ }, "strip", z.ZodTypeAny, {
14
+ file: string;
15
+ component?: string | undefined;
16
+ line?: number | undefined;
17
+ }, {
18
+ file: string;
19
+ component?: string | undefined;
20
+ line?: number | undefined;
21
+ }>;
22
+ severity: z.ZodEnum<["critical", "high", "info", "low", "medium"]>;
23
+ suggestedFix: z.ZodOptional<z.ZodString>;
24
+ title: z.ZodString;
25
+ }, "strip", z.ZodTypeAny, {
26
+ id: string;
27
+ description: string;
28
+ title: string;
29
+ severity: "info" | "critical" | "medium" | "high" | "low";
30
+ category: "secret" | "auth" | "config" | "other" | "crypto" | "data_exposure" | "injection" | "xss";
31
+ confidence: "medium" | "high" | "low";
32
+ evidence: string;
33
+ location: {
34
+ file: string;
35
+ component?: string | undefined;
36
+ line?: number | undefined;
37
+ };
38
+ suggestedFix?: string | undefined;
39
+ }, {
40
+ id: string;
41
+ description: string;
42
+ title: string;
43
+ severity: "info" | "critical" | "medium" | "high" | "low";
44
+ category: "secret" | "auth" | "config" | "other" | "crypto" | "data_exposure" | "injection" | "xss";
45
+ confidence: "medium" | "high" | "low";
46
+ evidence: string;
47
+ location: {
48
+ file: string;
49
+ component?: string | undefined;
50
+ line?: number | undefined;
51
+ };
52
+ suggestedFix?: string | undefined;
53
+ }>, "many">;
54
+ scanComplete: z.ZodBoolean;
55
+ scannedFiles: z.ZodNumber;
56
+ summary: z.ZodObject<{
57
+ critical: z.ZodNumber;
58
+ high: z.ZodNumber;
59
+ info: z.ZodNumber;
60
+ low: z.ZodNumber;
61
+ medium: z.ZodNumber;
62
+ total: z.ZodNumber;
63
+ }, "strip", z.ZodTypeAny, {
64
+ info: number;
65
+ critical: number;
66
+ medium: number;
67
+ high: number;
68
+ low: number;
69
+ total: number;
70
+ }, {
71
+ info: number;
72
+ critical: number;
73
+ medium: number;
74
+ high: number;
75
+ low: number;
76
+ total: number;
77
+ }>;
78
+ }, "strip", z.ZodTypeAny, {
79
+ summary: {
80
+ info: number;
81
+ critical: number;
82
+ medium: number;
83
+ high: number;
84
+ low: number;
85
+ total: number;
86
+ };
87
+ findings: {
88
+ id: string;
89
+ description: string;
90
+ title: string;
91
+ severity: "info" | "critical" | "medium" | "high" | "low";
92
+ category: "secret" | "auth" | "config" | "other" | "crypto" | "data_exposure" | "injection" | "xss";
93
+ confidence: "medium" | "high" | "low";
94
+ evidence: string;
95
+ location: {
96
+ file: string;
97
+ component?: string | undefined;
98
+ line?: number | undefined;
99
+ };
100
+ suggestedFix?: string | undefined;
101
+ }[];
102
+ scanComplete: boolean;
103
+ scannedFiles: number;
104
+ }, {
105
+ summary: {
106
+ info: number;
107
+ critical: number;
108
+ medium: number;
109
+ high: number;
110
+ low: number;
111
+ total: number;
112
+ };
113
+ findings: {
114
+ id: string;
115
+ description: string;
116
+ title: string;
117
+ severity: "info" | "critical" | "medium" | "high" | "low";
118
+ category: "secret" | "auth" | "config" | "other" | "crypto" | "data_exposure" | "injection" | "xss";
119
+ confidence: "medium" | "high" | "low";
120
+ evidence: string;
121
+ location: {
122
+ file: string;
123
+ component?: string | undefined;
124
+ line?: number | undefined;
125
+ };
126
+ suggestedFix?: string | undefined;
127
+ }[];
128
+ scanComplete: boolean;
129
+ scannedFiles: number;
130
+ }>;
131
+ export { securityScanResultSchema };
132
+ export type ReportReviewRunInput = z.infer<typeof securityScanResultSchema>;
133
+ export declare const reportReviewRunToolFactory: import("../tools2/types.js").ToolFactory<unknown, import("../tools2/types.js").Tool<{
134
+ summary: {
135
+ info: number;
136
+ critical: number;
137
+ medium: number;
138
+ high: number;
139
+ low: number;
140
+ total: number;
141
+ };
142
+ findings: {
143
+ id: string;
144
+ description: string;
145
+ title: string;
146
+ severity: "info" | "critical" | "medium" | "high" | "low";
147
+ category: "secret" | "auth" | "config" | "other" | "crypto" | "data_exposure" | "injection" | "xss";
148
+ confidence: "medium" | "high" | "low";
149
+ evidence: string;
150
+ location: {
151
+ file: string;
152
+ component?: string | undefined;
153
+ line?: number | undefined;
154
+ };
155
+ suggestedFix?: string | undefined;
156
+ }[];
157
+ scanComplete: boolean;
158
+ scannedFiles: number;
159
+ }, {
160
+ reported: boolean;
161
+ findingsCount: number;
162
+ }>>;
163
+ //# sourceMappingURL=report-security-findings.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"report-security-findings.d.ts","sourceRoot":"","sources":["../../../../src/ai-service/agent/tools/report-security-findings.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAC;AA6BpB,QAAA,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAY5B,CAAC;AAEH,OAAO,EAAE,wBAAwB,EAAE,CAAC;AAEpC,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAE5E,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GActC,CAAC"}
@@ -0,0 +1,52 @@
1
+ import z from "zod";
2
+ import { createToolFactory, ToolCategory } from "../tools2/types.js";
3
+ const securityFindingSchema = z.object({
4
+ category: z.enum([
5
+ "auth",
6
+ "config",
7
+ "crypto",
8
+ "data_exposure",
9
+ "injection",
10
+ "other",
11
+ "secret",
12
+ "xss",
13
+ ]),
14
+ confidence: z.enum(["high", "low", "medium"]),
15
+ description: z.string(),
16
+ evidence: z.string(),
17
+ id: z.string(),
18
+ location: z.object({
19
+ component: z.string().optional(),
20
+ file: z.string(),
21
+ line: z.number().optional(),
22
+ }),
23
+ severity: z.enum(["critical", "high", "info", "low", "medium"]),
24
+ suggestedFix: z.string().optional(),
25
+ title: z.string(),
26
+ });
27
+ const securityScanResultSchema = z.object({
28
+ findings: z.array(securityFindingSchema),
29
+ scanComplete: z.boolean(),
30
+ scannedFiles: z.number(),
31
+ summary: z.object({
32
+ critical: z.number(),
33
+ high: z.number(),
34
+ info: z.number(),
35
+ low: z.number(),
36
+ medium: z.number(),
37
+ total: z.number(),
38
+ }),
39
+ });
40
+ export { securityScanResultSchema };
41
+ export const reportReviewRunToolFactory = createToolFactory("reportReviewRun", () => ({
42
+ category: ToolCategory.GENERAL,
43
+ readOnly: true,
44
+ description: "Submit the final security scan report. Call this tool exactly once " +
45
+ "after you have finished analyzing all files and integrations. " +
46
+ "Pass the complete structured findings as the input.",
47
+ inputSchema: securityScanResultSchema,
48
+ execute: async (input) => {
49
+ return { reported: true, findingsCount: input.findings.length };
50
+ },
51
+ }));
52
+ //# sourceMappingURL=report-security-findings.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"report-security-findings.js","sourceRoot":"","sources":["../../../../src/ai-service/agent/tools/report-security-findings.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAC;AAEpB,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAErE,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC;IACrC,QAAQ,EAAE,CAAC,CAAC,IAAI,CAAC;QACf,MAAM;QACN,QAAQ;QACR,QAAQ;QACR,eAAe;QACf,WAAW;QACX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C;AAEH,OAAO,EAAE,wBAAwB,EAAE,CAAC;AAIpC,MAAM,CAAC,MAAM,0BAA0B,GAAG,iBAAiB,CACzD,iBAAiB,EACjB,GAAG,EAAE,CAAC,CAAC;IACL,QAAQ,EAAE,YAAY,CAAC,OAAO;IAC9B,QAAQ,EAAE,IAAI;IACd,WAAW,EACT,qEAAqE;QACrE,gEAAgE;QAChE,qDAAqD;IACvD,WAAW,EAAE,wBAAwB;IACrC,OAAO,EAAE,KAAK,EAAE,KAA2B,EAAE,EAAE;QAC7C,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,aAAa,EAAE,KAAK,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC;IAClE,CAAC;CACF,CAAC,CACH,CAAC"}
@@ -2,4 +2,6 @@ import type { Clark } from "../state-machine/clark-fsm.js";
2
2
  import type { ClarkStateHandlerParams } from "../state-machine/clark-fsm.js";
3
3
  import { type Tool } from "./tools2/types.js";
4
4
  export declare const buildTools: (clark: Clark, services: ClarkStateHandlerParams) => Promise<Record<string, Tool<any, any>>>;
5
+ export type SecurityScanToolsDeps = Pick<ClarkStateHandlerParams, "appShell" | "features" | "integrationStore" | "llmProvider">;
6
+ export declare const buildSecurityScanTools: (clark: Clark, services: SecurityScanToolsDeps) => Promise<Record<string, any>>;
5
7
  //# sourceMappingURL=tools.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../../src/ai-service/agent/tools.ts"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AAgF7E,OAAO,EAIL,KAAK,IAAI,EAEV,MAAM,mBAAmB,CAAC;AA+D3B,eAAO,MAAM,UAAU,GACrB,OAAO,KAAK,EACZ,UAAU,uBAAuB,4CA6mBlC,CAAC"}
1
+ {"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../../src/ai-service/agent/tools.ts"],"names":[],"mappings":"AA2BA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AA4F7E,OAAO,EAIL,KAAK,IAAI,EAEV,MAAM,mBAAmB,CAAC;AA+D3B,eAAO,MAAM,UAAU,GACrB,OAAO,KAAK,EACZ,UAAU,uBAAuB,4CAypBlC,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,IAAI,CACtC,uBAAuB,EACvB,UAAU,GAAG,UAAU,GAAG,kBAAkB,GAAG,aAAa,CAC7D,CAAC;AAEF,eAAO,MAAM,sBAAsB,GACjC,OAAO,KAAK,EACZ,UAAU,qBAAqB,KAC9B,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAqC7B,CAAC"}
@@ -1,6 +1,7 @@
1
1
  import path from "node:path";
2
2
  import { MCPClient, DOCS_MCP_URL, extractMcpTextContent, } from "@superblocksteam/clark";
3
3
  import { AiToolExecutionErrorCode } from "@superblocksteam/library-shared/types";
4
+ import { checkRunMigrationVerificationPermissions, migrationVerificationToolFactory, } from "../../migration/migration-verification.js";
4
5
  import { getLogger } from "../../util/logger.js";
5
6
  import { OperationQueue } from "../../util/operation-queue.js";
6
7
  import { getActiveContext } from "../llm/context-v2/utils/index.js";
@@ -16,9 +17,9 @@ import { getApiDocsToolFactory } from "./tools/apis/get-api-docs.js";
16
17
  import { getSdkApiDocsToolFactory } from "./tools/apis/get-sdk-api-docs.js";
17
18
  import { checkTestApiPermissions, testApiToolFactory, } from "./tools/apis/test-api.js";
18
19
  import { writeApiToolFactory } from "./tools/apis/write-api.js";
19
- import { buildInstallPackagesToolFactory, buildWriteFileToolFactory, buildEditFileToolFactory, buildMultiEditFileToolFactory, buildReadFileToolFactory, buildListFilesToolFactory, buildDebugToolFactory, clearErrorCacheToolFactory, buildFinalizeToolFactory, buildManageChecklistToolFactory, buildDeleteFileToolFactory, checkDeleteFilePermissions, buildRenameFileToolFactory, buildReloadFileToolFactory, executeRequestToIntegrationToolFactory, openIntegrationSetupToolFactory, openExistingIntegrationToolFactory, updateIntegrationFieldsToolFactory, testIntegrationConnectionToolFactory, saveIntegrationToolFactory, closeIntegrationSetupToolFactory, getIntegrationFormSchemaToolFactory, listAvailableIntegrationTypesToolFactory, grepMetadataToolFactory, searchIntegrationsToolFactory, runCodeToolFactory, exitPlanModeToolFactory, askMultiChoiceToolFactory, askSearchableDropdownToolFactory, listAttachmentsToolFactory, downloadAttachmentsToolFactory, buildCaptureScreenshotToolFactory, buildGetRuntimeErrorsToolFactory, buildGetLogsToolFactory, startTestRunToolFactory, endTestRunToolFactory, updateTestCaseStatusToolFactory, getIntegrationTypesToolFactory, spawnCodingSubagentsToolFactory, } from "./tools/index.js";
20
- import { presets, blockTools, forTools } from "./tools2/access-control.js";
21
- import { summaryInjector, } from "./tools2/registry.js";
20
+ import { buildInstallPackagesToolFactory, buildCopyDirectoryToolFactory, buildCopyFileToolFactory, buildWriteFileToolFactory, buildEditFileToolFactory, buildMultiEditFileToolFactory, buildReadFileToolFactory, buildListFilesToolFactory, buildDebugToolFactory, clearErrorCacheToolFactory, buildFinalizeToolFactory, buildManageChecklistToolFactory, buildDeleteFileToolFactory, checkDeleteFilePermissions, deleteIntegrationToolFactory, buildRenameFileToolFactory, buildReloadFileToolFactory, executeRequestToIntegrationToolFactory, openIntegrationSetupToolFactory, openExistingIntegrationToolFactory, updateIntegrationFieldsToolFactory, testIntegrationConnectionToolFactory, saveIntegrationToolFactory, closeIntegrationSetupToolFactory, getIntegrationFormSchemaToolFactory, listAvailableIntegrationTypesToolFactory, grepMetadataToolFactory, searchIntegrationsToolFactory, runCodeToolFactory, exitPlanModeToolFactory, askMultiChoiceToolFactory, askSearchableDropdownToolFactory, listAttachmentsToolFactory, downloadAttachmentsToolFactory, buildCaptureScreenshotToolFactory, buildGetRuntimeErrorsToolFactory, buildGetLogsToolFactory, createDevDbToolFactory, getDevDbProgressToolFactory, startTestRunToolFactory, endTestRunToolFactory, updateTestCaseStatusToolFactory, getIntegrationTypesToolFactory, spawnCodingSubagentsToolFactory, reportReviewRunToolFactory, } from "./tools/index.js";
21
+ import { blockTools, forTools, presets, readOnly, } from "./tools2/access-control.js";
22
+ import { ToolRegistry, summaryInjector, } from "./tools2/registry.js";
22
23
  import { createDeployService, } from "./tools2/tools/deploy-service.js";
23
24
  import { globToolFactory, grepToolFactory, lsToolFactory, webSearchToolFactory, webFetchToolFactory, gitToolFactory, gitRawToolFactory, rememberKnowledgeToolFactory, } from "./tools2/tools/index.js";
24
25
  import { PermissionLevel, ToolCategory, ToolExecutionError, } from "./tools2/types.js";
@@ -153,11 +154,16 @@ export const buildTools = async (clark, services) => {
153
154
  // Set the prompt handler
154
155
  registry.setPromptHandler(async (tool, input, permissions, _context, options) => {
155
156
  const actionName = tool.getActionName?.(input);
156
- const formattedInput = tool.formatInput?.(input);
157
+ const formattedInput = await tool.formatInput?.(input);
157
158
  const messageId = options?.toolCallId ?? crypto.randomUUID();
158
159
  if (clark.context.pendingToolPermissionRequest ||
159
160
  clark.context.activeInteractiveMessage) {
160
- clark.logger.info("skipping tool permission request as there is already a pending one or active interactive message", messageId);
161
+ clark.logger.info(`[debug] skipping tool permission request: already pending/interactive`, {
162
+ messageId,
163
+ toolName: tool.name,
164
+ hasPendingToolPermissionRequest: Boolean(clark.context.pendingToolPermissionRequest),
165
+ hasActiveInteractiveMessage: Boolean(clark.context.activeInteractiveMessage),
166
+ });
161
167
  return;
162
168
  }
163
169
  const signature = getToolCallSignature(tool.name, input);
@@ -178,10 +184,20 @@ export const buildTools = async (clark, services) => {
178
184
  toolCallTimestamp,
179
185
  },
180
186
  });
187
+ clark.logger.info(`[debug] stored pending tool permission request`, {
188
+ messageId,
189
+ toolName: tool.name,
190
+ signature,
191
+ });
181
192
  try {
182
193
  if (!clark.context.peer) {
183
194
  getLogger().warn(`[ai-service] Cannot request tool permission: no peer. tool=${tool.name}`);
184
195
  }
196
+ clark.logger.info(`[debug] sending aiRequestToolPermission`, {
197
+ messageId,
198
+ toolName: tool.name,
199
+ signature,
200
+ });
185
201
  await clark.context.peer?.call.aiRequestToolPermission({
186
202
  messageId,
187
203
  toolName: tool.name,
@@ -191,10 +207,21 @@ export const buildTools = async (clark, services) => {
191
207
  permissions,
192
208
  signature,
193
209
  });
210
+ clark.logger.info(`[debug] aiRequestToolPermission acknowledged`, {
211
+ messageId,
212
+ toolName: tool.name,
213
+ signature,
214
+ });
194
215
  }
195
216
  catch (error) {
217
+ clark.logger.warn(`[debug] aiRequestToolPermission failed`, {
218
+ messageId,
219
+ toolName: tool.name,
220
+ signature,
221
+ error: error instanceof Error ? error.message : String(error),
222
+ });
196
223
  // Clear pending request on error and notify UI
197
- clearPendingToolPermissionRequest(clark);
224
+ clearPendingToolPermissionRequest(clark, "prompt-rpc-error");
198
225
  throw error;
199
226
  }
200
227
  });
@@ -204,6 +231,9 @@ export const buildTools = async (clark, services) => {
204
231
  registry.addAccessRule(forTools("testApi", async (_tool, _context, input) => {
205
232
  return checkTestApiPermissions(services, input, clark);
206
233
  }));
234
+ registry.addAccessRule(forTools("runMigrationVerification", async (_tool, _context, input) => {
235
+ return checkRunMigrationVerificationPermissions(services, input);
236
+ }));
207
237
  // Deleting files conditionally prompts for pages/APIs (except default Page1)
208
238
  registry.addAccessRule(forTools("build_deleteFile", async (_tool, _context, input) => {
209
239
  return checkDeleteFilePermissions(input);
@@ -213,6 +243,8 @@ export const buildTools = async (clark, services) => {
213
243
  }
214
244
  // Register all factory-based tools
215
245
  registry.register(buildInstallPackagesToolFactory, { clark, services });
246
+ registry.register(buildCopyDirectoryToolFactory, { clark, services });
247
+ registry.register(buildCopyFileToolFactory, { clark, services });
216
248
  registry.register(buildWriteFileToolFactory, { clark, services });
217
249
  registry.register(buildEditFileToolFactory, { clark, services });
218
250
  registry.register(buildMultiEditFileToolFactory, { clark, services });
@@ -223,6 +255,7 @@ export const buildTools = async (clark, services) => {
223
255
  registry.register(buildCaptureScreenshotToolFactory, { clark, services });
224
256
  registry.register(buildFinalizeToolFactory, { clark, services });
225
257
  registry.register(buildManageChecklistToolFactory, { clark, services });
258
+ registry.register(migrationVerificationToolFactory, { clark, services });
226
259
  registry.register(spawnCodingSubagentsToolFactory, { clark, services });
227
260
  registry.register(buildDeleteFileToolFactory, { clark, services });
228
261
  registry.register(buildRenameFileToolFactory, { clark, services });
@@ -234,6 +267,8 @@ export const buildTools = async (clark, services) => {
234
267
  registry.register(runCodeToolFactory, clark);
235
268
  registry.register(grepMetadataToolFactory, { clark, services });
236
269
  registry.register(searchIntegrationsToolFactory, services);
270
+ registry.register(createDevDbToolFactory, { clark, services });
271
+ registry.register(getDevDbProgressToolFactory, { clark, services });
237
272
  // Integration setup tools are feature-flagged
238
273
  if (services.features.integrationSetupEnabled) {
239
274
  registry.register(openIntegrationSetupToolFactory, { clark });
@@ -249,6 +284,10 @@ export const buildTools = async (clark, services) => {
249
284
  registry.register(listAvailableIntegrationTypesToolFactory, {
250
285
  integrationStore: services.integrationStore,
251
286
  });
287
+ registry.register(deleteIntegrationToolFactory, {
288
+ clark,
289
+ integrationStore: services.integrationStore,
290
+ });
252
291
  }
253
292
  registry.register(exitPlanModeToolFactory, { clark, services });
254
293
  registry.register(askMultiChoiceToolFactory, { clark, services });
@@ -564,4 +603,33 @@ export const buildTools = async (clark, services) => {
564
603
  clark.logger.info(`[buildTools] Enabled tools: ${enabledToolNames.join(", ")}`);
565
604
  return tools;
566
605
  };
606
+ export const buildSecurityScanTools = async (clark, services) => {
607
+ const registry = new ToolRegistry();
608
+ registry.setLogger(clark.logger);
609
+ registry.register(buildReadFileToolFactory, { services });
610
+ registry.register(buildListFilesToolFactory, services);
611
+ registry.register(globToolFactory, { appShell: services.appShell });
612
+ registry.register(grepToolFactory, {});
613
+ registry.register(lsToolFactory, { appShell: services.appShell });
614
+ registry.register(grepMetadataToolFactory, {
615
+ clark,
616
+ services: services,
617
+ });
618
+ registry.register(reportReviewRunToolFactory, {});
619
+ registry.register(searchIntegrationsToolFactory, services);
620
+ if (services.features.webToolsEnabled) {
621
+ registry.register(webSearchToolFactory, {});
622
+ registry.register(webFetchToolFactory, {
623
+ llmProvider: services.llmProvider,
624
+ });
625
+ }
626
+ registry.addAccessRule(readOnly());
627
+ registry.addMiddleware(outputLimiter(25_000));
628
+ registry.addMiddleware(toolLoggingMiddleware(clark.logger));
629
+ const secretRedactionLevel = services.features.secretRedactionLevel ?? "full";
630
+ if (secretRedactionLevel === "full") {
631
+ registry.addMiddleware(secretScanningMiddleware());
632
+ }
633
+ return await registry.getToolsRecord();
634
+ };
567
635
  //# sourceMappingURL=tools.js.map