@superblocksteam/vite-plugin-file-sync 2.0.170-next.1 → 2.0.171-next.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (491) hide show
  1. package/dist/ai-service/agent/prompts/api-prompts.d.ts.map +1 -1
  2. package/dist/ai-service/agent/prompts/api-prompts.js +4 -6
  3. package/dist/ai-service/agent/prompts/api-prompts.js.map +1 -1
  4. package/dist/ai-service/agent/prompts/build-base-system-prompt.d.ts +3 -12
  5. package/dist/ai-service/agent/prompts/build-base-system-prompt.d.ts.map +1 -1
  6. package/dist/ai-service/agent/prompts/build-base-system-prompt.js +144 -71
  7. package/dist/ai-service/agent/prompts/build-base-system-prompt.js.map +1 -1
  8. package/dist/ai-service/agent/subagents/testing/types.d.ts +2 -1
  9. package/dist/ai-service/agent/subagents/testing/types.d.ts.map +1 -1
  10. package/dist/ai-service/agent/tool-message-utils.d.ts.map +1 -1
  11. package/dist/ai-service/agent/tool-message-utils.js +47 -36
  12. package/dist/ai-service/agent/tool-message-utils.js.map +1 -1
  13. package/dist/ai-service/agent/tool-result-metrics.d.ts +15 -0
  14. package/dist/ai-service/agent/tool-result-metrics.d.ts.map +1 -1
  15. package/dist/ai-service/agent/tool-result-metrics.js +28 -0
  16. package/dist/ai-service/agent/tool-result-metrics.js.map +1 -1
  17. package/dist/ai-service/agent/tools/apis/analysis.d.ts +24 -2
  18. package/dist/ai-service/agent/tools/apis/analysis.d.ts.map +1 -1
  19. package/dist/ai-service/agent/tools/apis/analysis.js +164 -11
  20. package/dist/ai-service/agent/tools/apis/analysis.js.map +1 -1
  21. package/dist/ai-service/agent/tools/apis/api-comparator.d.ts +2 -1
  22. package/dist/ai-service/agent/tools/apis/api-comparator.d.ts.map +1 -1
  23. package/dist/ai-service/agent/tools/apis/contained-source-reader.d.ts +11 -0
  24. package/dist/ai-service/agent/tools/apis/contained-source-reader.d.ts.map +1 -0
  25. package/dist/ai-service/agent/tools/apis/contained-source-reader.js +48 -0
  26. package/dist/ai-service/agent/tools/apis/contained-source-reader.js.map +1 -0
  27. package/dist/ai-service/agent/tools/apis/get-sdk-api-docs.d.ts +37 -10
  28. package/dist/ai-service/agent/tools/apis/get-sdk-api-docs.d.ts.map +1 -1
  29. package/dist/ai-service/agent/tools/apis/get-sdk-api-docs.js +140 -70
  30. package/dist/ai-service/agent/tools/apis/get-sdk-api-docs.js.map +1 -1
  31. package/dist/ai-service/agent/tools/apis/spreadsheet-csv.d.ts +6 -20
  32. package/dist/ai-service/agent/tools/apis/spreadsheet-csv.d.ts.map +1 -1
  33. package/dist/ai-service/agent/tools/apis/spreadsheet-csv.js +3 -3
  34. package/dist/ai-service/agent/tools/apis/spreadsheet-csv.js.map +1 -1
  35. package/dist/ai-service/agent/tools/apis/test-api-metrics.d.ts +8 -0
  36. package/dist/ai-service/agent/tools/apis/test-api-metrics.d.ts.map +1 -0
  37. package/dist/ai-service/agent/tools/apis/test-api-metrics.js +41 -0
  38. package/dist/ai-service/agent/tools/apis/test-api-metrics.js.map +1 -0
  39. package/dist/ai-service/agent/tools/apis/test-api-timing.d.ts +27 -0
  40. package/dist/ai-service/agent/tools/apis/test-api-timing.d.ts.map +1 -0
  41. package/dist/ai-service/agent/tools/apis/test-api-timing.js +25 -0
  42. package/dist/ai-service/agent/tools/apis/test-api-timing.js.map +1 -0
  43. package/dist/ai-service/agent/tools/apis/test-api.d.ts +4 -0
  44. package/dist/ai-service/agent/tools/apis/test-api.d.ts.map +1 -1
  45. package/dist/ai-service/agent/tools/apis/test-api.js +119 -20
  46. package/dist/ai-service/agent/tools/apis/test-api.js.map +1 -1
  47. package/dist/ai-service/agent/tools/build-capture-screenshot.d.ts +0 -18
  48. package/dist/ai-service/agent/tools/build-capture-screenshot.d.ts.map +1 -1
  49. package/dist/ai-service/agent/tools/build-capture-screenshot.js +2 -2
  50. package/dist/ai-service/agent/tools/build-capture-screenshot.js.map +1 -1
  51. package/dist/ai-service/agent/tools/build-install-packages.d.ts +32 -5
  52. package/dist/ai-service/agent/tools/build-install-packages.d.ts.map +1 -1
  53. package/dist/ai-service/agent/tools/build-install-packages.js +20 -19
  54. package/dist/ai-service/agent/tools/build-install-packages.js.map +1 -1
  55. package/dist/ai-service/agent/tools/build-manage-checklist.d.ts +1 -1
  56. package/dist/ai-service/agent/tools/build-manage-packages.d.ts +19 -0
  57. package/dist/ai-service/agent/tools/build-manage-packages.d.ts.map +1 -0
  58. package/dist/ai-service/agent/tools/build-manage-packages.js +220 -0
  59. package/dist/ai-service/agent/tools/build-manage-packages.js.map +1 -0
  60. package/dist/ai-service/agent/tools/build-read-file.d.ts +5 -14
  61. package/dist/ai-service/agent/tools/build-read-file.d.ts.map +1 -1
  62. package/dist/ai-service/agent/tools/build-read-file.js +5 -8
  63. package/dist/ai-service/agent/tools/build-read-file.js.map +1 -1
  64. package/dist/ai-service/agent/tools/databases/dev-database-tasks.d.ts +2 -90
  65. package/dist/ai-service/agent/tools/databases/dev-database-tasks.d.ts.map +1 -1
  66. package/dist/ai-service/agent/tools/databases/dev-database-tasks.js +1 -2
  67. package/dist/ai-service/agent/tools/databases/dev-database-tasks.js.map +1 -1
  68. package/dist/ai-service/agent/tools/debug-cache.d.ts +0 -12
  69. package/dist/ai-service/agent/tools/debug-cache.d.ts.map +1 -1
  70. package/dist/ai-service/agent/tools/debug-cache.js +1 -1
  71. package/dist/ai-service/agent/tools/debug-cache.js.map +1 -1
  72. package/dist/ai-service/agent/tools/index.d.ts +3 -3
  73. package/dist/ai-service/agent/tools/index.d.ts.map +1 -1
  74. package/dist/ai-service/agent/tools/index.js +2 -2
  75. package/dist/ai-service/agent/tools/index.js.map +1 -1
  76. package/dist/ai-service/agent/tools/integrations/errors.d.ts.map +1 -1
  77. package/dist/ai-service/agent/tools/integrations/errors.js +3 -0
  78. package/dist/ai-service/agent/tools/integrations/errors.js.map +1 -1
  79. package/dist/ai-service/agent/tools/integrations/execute-request.d.ts +27 -0
  80. package/dist/ai-service/agent/tools/integrations/execute-request.d.ts.map +1 -1
  81. package/dist/ai-service/agent/tools/integrations/execute-request.js +85 -11
  82. package/dist/ai-service/agent/tools/integrations/execute-request.js.map +1 -1
  83. package/dist/ai-service/agent/tools/integrations/managed-app-database.d.ts +0 -2
  84. package/dist/ai-service/agent/tools/integrations/managed-app-database.d.ts.map +1 -1
  85. package/dist/ai-service/agent/tools/integrations/managed-app-database.js +1 -1
  86. package/dist/ai-service/agent/tools/integrations/managed-app-database.js.map +1 -1
  87. package/dist/ai-service/agent/tools/integrations/metadata.d.ts.map +1 -1
  88. package/dist/ai-service/agent/tools/integrations/metadata.js +1 -0
  89. package/dist/ai-service/agent/tools/integrations/metadata.js.map +1 -1
  90. package/dist/ai-service/agent/tools/read-state-trackers.d.ts +16 -2
  91. package/dist/ai-service/agent/tools/read-state-trackers.d.ts.map +1 -1
  92. package/dist/ai-service/agent/tools/read-state-trackers.js +11 -2
  93. package/dist/ai-service/agent/tools/read-state-trackers.js.map +1 -1
  94. package/dist/ai-service/agent/tools.d.ts.map +1 -1
  95. package/dist/ai-service/agent/tools.js +13 -6
  96. package/dist/ai-service/agent/tools.js.map +1 -1
  97. package/dist/ai-service/agent/tools2/registry.d.ts +20 -1
  98. package/dist/ai-service/agent/tools2/registry.d.ts.map +1 -1
  99. package/dist/ai-service/agent/tools2/registry.js +55 -9
  100. package/dist/ai-service/agent/tools2/registry.js.map +1 -1
  101. package/dist/ai-service/agent/tools2/tools/grep-metadata-ripgrep.d.ts.map +1 -1
  102. package/dist/ai-service/agent/tools2/tools/grep-metadata-ripgrep.js +25 -0
  103. package/dist/ai-service/agent/tools2/tools/grep-metadata-ripgrep.js.map +1 -1
  104. package/dist/ai-service/agent/tools2/tools/grep-metadata.d.ts +8 -2
  105. package/dist/ai-service/agent/tools2/tools/grep-metadata.d.ts.map +1 -1
  106. package/dist/ai-service/agent/tools2/tools/grep-metadata.js +17 -0
  107. package/dist/ai-service/agent/tools2/tools/grep-metadata.js.map +1 -1
  108. package/dist/ai-service/agent/tools2/tools/grep.d.ts.map +1 -1
  109. package/dist/ai-service/agent/tools2/tools/grep.js +50 -25
  110. package/dist/ai-service/agent/tools2/tools/grep.js.map +1 -1
  111. package/dist/ai-service/agent/utils.d.ts.map +1 -1
  112. package/dist/ai-service/agent/utils.js +3 -3
  113. package/dist/ai-service/agent/utils.js.map +1 -1
  114. package/dist/ai-service/app-interface/file-system-interface.d.ts +0 -6
  115. package/dist/ai-service/app-interface/file-system-interface.d.ts.map +1 -1
  116. package/dist/ai-service/app-interface/file-system-interface.js +39 -97
  117. package/dist/ai-service/app-interface/file-system-interface.js.map +1 -1
  118. package/dist/ai-service/app-interface/filesystem/handlers/skill-handler.d.ts.map +1 -1
  119. package/dist/ai-service/app-interface/filesystem/handlers/skill-handler.js +2 -2
  120. package/dist/ai-service/app-interface/filesystem/handlers/skill-handler.js.map +1 -1
  121. package/dist/ai-service/app-interface/filesystem/validation.js +1 -1
  122. package/dist/ai-service/app-interface/filesystem/validation.js.map +1 -1
  123. package/dist/ai-service/app-interface/npm-package-lookup.d.ts +1 -3
  124. package/dist/ai-service/app-interface/npm-package-lookup.d.ts.map +1 -1
  125. package/dist/ai-service/app-interface/npm-package-lookup.js +1 -1
  126. package/dist/ai-service/app-interface/npm-package-lookup.js.map +1 -1
  127. package/dist/ai-service/app-interface/pnpm-lockfile.d.ts.map +1 -1
  128. package/dist/ai-service/app-interface/pnpm-lockfile.js +2 -4
  129. package/dist/ai-service/app-interface/pnpm-lockfile.js.map +1 -1
  130. package/dist/ai-service/app-interface/shell.d.ts +38 -15
  131. package/dist/ai-service/app-interface/shell.d.ts.map +1 -1
  132. package/dist/ai-service/app-interface/shell.js +646 -48
  133. package/dist/ai-service/app-interface/shell.js.map +1 -1
  134. package/dist/ai-service/app-interface/vulnerability-gate.d.ts +7 -0
  135. package/dist/ai-service/app-interface/vulnerability-gate.d.ts.map +1 -1
  136. package/dist/ai-service/app-interface/vulnerability-gate.js +16 -6
  137. package/dist/ai-service/app-interface/vulnerability-gate.js.map +1 -1
  138. package/dist/ai-service/app-layout.d.ts +3 -0
  139. package/dist/ai-service/app-layout.d.ts.map +1 -1
  140. package/dist/ai-service/app-layout.js +14 -0
  141. package/dist/ai-service/app-layout.js.map +1 -1
  142. package/dist/ai-service/app-skills/parser.d.ts +2 -1
  143. package/dist/ai-service/app-skills/parser.d.ts.map +1 -1
  144. package/dist/ai-service/attachments/store.d.ts +4 -4
  145. package/dist/ai-service/attachments/store.d.ts.map +1 -1
  146. package/dist/ai-service/chat/chat-session-store-metrics.d.ts +1 -2
  147. package/dist/ai-service/chat/chat-session-store-metrics.d.ts.map +1 -1
  148. package/dist/ai-service/chat/chat-session-store-metrics.js +0 -6
  149. package/dist/ai-service/chat/chat-session-store-metrics.js.map +1 -1
  150. package/dist/ai-service/chat/chat-session-store.d.ts +2 -11
  151. package/dist/ai-service/chat/chat-session-store.d.ts.map +1 -1
  152. package/dist/ai-service/chat/chat-session-store.js +21 -4
  153. package/dist/ai-service/chat/chat-session-store.js.map +1 -1
  154. package/dist/ai-service/chat/utils.d.ts +1 -2
  155. package/dist/ai-service/chat/utils.d.ts.map +1 -1
  156. package/dist/ai-service/chat/utils.js +0 -1
  157. package/dist/ai-service/chat/utils.js.map +1 -1
  158. package/dist/ai-service/checklist/persisted-checklist-store.d.ts +3 -3
  159. package/dist/ai-service/checklist/persisted-checklist-store.d.ts.map +1 -1
  160. package/dist/ai-service/checklist/persisted-checklist-store.js +4 -2
  161. package/dist/ai-service/checklist/persisted-checklist-store.js.map +1 -1
  162. package/dist/ai-service/context/app-context.d.ts +7 -39
  163. package/dist/ai-service/context/app-context.d.ts.map +1 -1
  164. package/dist/ai-service/context/app-context.js +29 -110
  165. package/dist/ai-service/context/app-context.js.map +1 -1
  166. package/dist/ai-service/context-clear-metrics.d.ts +11 -0
  167. package/dist/ai-service/context-clear-metrics.d.ts.map +1 -0
  168. package/dist/ai-service/context-clear-metrics.js +64 -0
  169. package/dist/ai-service/context-clear-metrics.js.map +1 -0
  170. package/dist/ai-service/context-download.js +2 -2
  171. package/dist/ai-service/context-download.js.map +1 -1
  172. package/dist/ai-service/edit-after-clark.d.ts +0 -5
  173. package/dist/ai-service/edit-after-clark.d.ts.map +1 -1
  174. package/dist/ai-service/edit-after-clark.js +1 -1
  175. package/dist/ai-service/edit-after-clark.js.map +1 -1
  176. package/dist/ai-service/features.d.ts +20 -4
  177. package/dist/ai-service/features.d.ts.map +1 -1
  178. package/dist/ai-service/features.js +20 -4
  179. package/dist/ai-service/features.js.map +1 -1
  180. package/dist/ai-service/filter-disabled-tools-for-migration.js +1 -1
  181. package/dist/ai-service/filter-disabled-tools-for-migration.js.map +1 -1
  182. package/dist/ai-service/index.d.ts +58 -0
  183. package/dist/ai-service/index.d.ts.map +1 -1
  184. package/dist/ai-service/index.js +186 -21
  185. package/dist/ai-service/index.js.map +1 -1
  186. package/dist/ai-service/integrations/store.d.ts +6 -0
  187. package/dist/ai-service/integrations/store.d.ts.map +1 -1
  188. package/dist/ai-service/integrations/store.js +101 -3
  189. package/dist/ai-service/integrations/store.js.map +1 -1
  190. package/dist/ai-service/live-edit-events/forwarder.d.ts +1 -12
  191. package/dist/ai-service/live-edit-events/forwarder.d.ts.map +1 -1
  192. package/dist/ai-service/live-edit-events/forwarder.js +1 -7
  193. package/dist/ai-service/live-edit-events/forwarder.js.map +1 -1
  194. package/dist/ai-service/llm/context-v2/compaction/client-side.d.ts.map +1 -1
  195. package/dist/ai-service/llm/context-v2/compaction/client-side.js +15 -5
  196. package/dist/ai-service/llm/context-v2/compaction/client-side.js.map +1 -1
  197. package/dist/ai-service/llm/context-v2/compaction/compaction-strategy.d.ts +6 -0
  198. package/dist/ai-service/llm/context-v2/compaction/compaction-strategy.d.ts.map +1 -1
  199. package/dist/ai-service/llm/context-v2/compaction/server-side.d.ts.map +1 -1
  200. package/dist/ai-service/llm/context-v2/compaction/server-side.js +5 -1
  201. package/dist/ai-service/llm/context-v2/compaction/server-side.js.map +1 -1
  202. package/dist/ai-service/llm/context-v2/compactor.d.ts.map +1 -1
  203. package/dist/ai-service/llm/context-v2/compactor.js +34 -12
  204. package/dist/ai-service/llm/context-v2/compactor.js.map +1 -1
  205. package/dist/ai-service/llm/context-v2/context-management.d.ts.map +1 -1
  206. package/dist/ai-service/llm/context-v2/context-management.js +9 -0
  207. package/dist/ai-service/llm/context-v2/context-management.js.map +1 -1
  208. package/dist/ai-service/llm/context-v2/context-metrics.d.ts +4 -0
  209. package/dist/ai-service/llm/context-v2/context-metrics.d.ts.map +1 -1
  210. package/dist/ai-service/llm/context-v2/context-metrics.js +15 -3
  211. package/dist/ai-service/llm/context-v2/context-metrics.js.map +1 -1
  212. package/dist/ai-service/llm/context-v2/context.d.ts +36 -6
  213. package/dist/ai-service/llm/context-v2/context.d.ts.map +1 -1
  214. package/dist/ai-service/llm/context-v2/context.js +72 -28
  215. package/dist/ai-service/llm/context-v2/context.js.map +1 -1
  216. package/dist/ai-service/llm/context-v2/manager.d.ts +3 -3
  217. package/dist/ai-service/llm/context-v2/manager.d.ts.map +1 -1
  218. package/dist/ai-service/llm/context-v2/manager.js +13 -7
  219. package/dist/ai-service/llm/context-v2/manager.js.map +1 -1
  220. package/dist/ai-service/llm/context-v2/migrations/types.d.ts +2 -1
  221. package/dist/ai-service/llm/context-v2/migrations/types.d.ts.map +1 -1
  222. package/dist/ai-service/llm/context-v2/storage/event-types.d.ts +5 -5
  223. package/dist/ai-service/llm/context-v2/storage/event-types.d.ts.map +1 -1
  224. package/dist/ai-service/llm/context-v2/storage/event-types.js +3 -23
  225. package/dist/ai-service/llm/context-v2/storage/event-types.js.map +1 -1
  226. package/dist/ai-service/llm/context-v2/types.d.ts +9 -1
  227. package/dist/ai-service/llm/context-v2/types.d.ts.map +1 -1
  228. package/dist/ai-service/llm/context-v2/types.js.map +1 -1
  229. package/dist/ai-service/llm/context-v2/uniquify-filenames.d.ts +20 -4
  230. package/dist/ai-service/llm/context-v2/uniquify-filenames.d.ts.map +1 -1
  231. package/dist/ai-service/llm/context-v2/uniquify-filenames.js +128 -29
  232. package/dist/ai-service/llm/context-v2/uniquify-filenames.js.map +1 -1
  233. package/dist/ai-service/llm/error.d.ts +1 -1
  234. package/dist/ai-service/llm/error.d.ts.map +1 -1
  235. package/dist/ai-service/llm/error.js +57 -7
  236. package/dist/ai-service/llm/error.js.map +1 -1
  237. package/dist/ai-service/llm/stream/config.d.ts +3 -3
  238. package/dist/ai-service/llm/stream/config.d.ts.map +1 -1
  239. package/dist/ai-service/llm/stream/errors.d.ts +3 -0
  240. package/dist/ai-service/llm/stream/errors.d.ts.map +1 -1
  241. package/dist/ai-service/llm/stream/errors.js +72 -4
  242. package/dist/ai-service/llm/stream/errors.js.map +1 -1
  243. package/dist/ai-service/llm/stream/observers/workflow-usage.d.ts +0 -6
  244. package/dist/ai-service/llm/stream/observers/workflow-usage.d.ts.map +1 -1
  245. package/dist/ai-service/llm/stream/observers/workflow-usage.js +2 -2
  246. package/dist/ai-service/llm/stream/observers/workflow-usage.js.map +1 -1
  247. package/dist/ai-service/llm/stream/orchestrator.d.ts.map +1 -1
  248. package/dist/ai-service/llm/stream/orchestrator.js +6 -1
  249. package/dist/ai-service/llm/stream/orchestrator.js.map +1 -1
  250. package/dist/ai-service/managed-native-db-availability.d.ts +5 -2
  251. package/dist/ai-service/managed-native-db-availability.d.ts.map +1 -1
  252. package/dist/ai-service/managed-native-db-availability.js +5 -1
  253. package/dist/ai-service/managed-native-db-availability.js.map +1 -1
  254. package/dist/ai-service/mcp/embedded-playwright-mcp-server.js +2 -0
  255. package/dist/ai-service/mcp/embedded-playwright-mcp-server.js.map +1 -1
  256. package/dist/ai-service/migration-prompt-gating.d.ts +1 -0
  257. package/dist/ai-service/migration-prompt-gating.d.ts.map +1 -1
  258. package/dist/ai-service/migration-prompt-gating.js +3 -0
  259. package/dist/ai-service/migration-prompt-gating.js.map +1 -1
  260. package/dist/ai-service/migration-turns-log.d.ts +3 -2
  261. package/dist/ai-service/migration-turns-log.d.ts.map +1 -1
  262. package/dist/ai-service/migration-turns-log.js.map +1 -1
  263. package/dist/ai-service/policy-agent-metrics.d.ts +2 -4
  264. package/dist/ai-service/policy-agent-metrics.d.ts.map +1 -1
  265. package/dist/ai-service/policy-agent-metrics.js +3 -3
  266. package/dist/ai-service/policy-agent-metrics.js.map +1 -1
  267. package/dist/ai-service/policy-gate-remediation-usage.d.ts.map +1 -1
  268. package/dist/ai-service/policy-gate-remediation-usage.js +29 -19
  269. package/dist/ai-service/policy-gate-remediation-usage.js.map +1 -1
  270. package/dist/ai-service/prompt-builder-service/classifiers/prompt-interpret-task.js +1 -1
  271. package/dist/ai-service/prompt-builder-service/classifiers/prompt-interpret-task.js.map +1 -1
  272. package/dist/ai-service/recording/types.d.ts +6 -5
  273. package/dist/ai-service/recording/types.d.ts.map +1 -1
  274. package/dist/ai-service/skills/system/_registry.generated.d.ts.map +1 -1
  275. package/dist/ai-service/skills/system/_registry.generated.js +10 -0
  276. package/dist/ai-service/skills/system/_registry.generated.js.map +1 -1
  277. package/dist/ai-service/skills/system/app-database/skill.generated.d.ts +2 -0
  278. package/dist/ai-service/skills/system/app-database/skill.generated.d.ts.map +1 -0
  279. package/dist/ai-service/skills/system/app-database/skill.generated.js +79 -0
  280. package/dist/ai-service/skills/system/app-database/skill.generated.js.map +1 -0
  281. package/dist/ai-service/skills/system/resolve.d.ts +1 -1
  282. package/dist/ai-service/skills/system/resolve.d.ts.map +1 -1
  283. package/dist/ai-service/skills/system/resolve.js +25 -2
  284. package/dist/ai-service/skills/system/resolve.js.map +1 -1
  285. package/dist/ai-service/skills/system/spreadsheet-import/skill.generated.d.ts +1 -1
  286. package/dist/ai-service/skills/system/spreadsheet-import/skill.generated.d.ts.map +1 -1
  287. package/dist/ai-service/skills/system/spreadsheet-import/skill.generated.js +1 -1
  288. package/dist/ai-service/skills/system/superblocks-frontend/_variants/base-ui-plain.generated.d.ts +2 -0
  289. package/dist/ai-service/skills/system/superblocks-frontend/_variants/base-ui-plain.generated.d.ts.map +1 -0
  290. package/dist/ai-service/skills/system/superblocks-frontend/_variants/base-ui-plain.generated.js +5 -0
  291. package/dist/ai-service/skills/system/superblocks-frontend/_variants/base-ui-plain.generated.js.map +1 -0
  292. package/dist/ai-service/skills/system/superblocks-frontend/_variants/base-ui-registered.generated.d.ts +2 -0
  293. package/dist/ai-service/skills/system/superblocks-frontend/_variants/base-ui-registered.generated.d.ts.map +1 -0
  294. package/dist/ai-service/skills/system/superblocks-frontend/_variants/base-ui-registered.generated.js +5 -0
  295. package/dist/ai-service/skills/system/superblocks-frontend/_variants/base-ui-registered.generated.js.map +1 -0
  296. package/dist/ai-service/skills/system/superblocks-frontend/_variants/icons-lucide.generated.d.ts +2 -0
  297. package/dist/ai-service/skills/system/superblocks-frontend/_variants/icons-lucide.generated.d.ts.map +1 -0
  298. package/dist/ai-service/skills/system/superblocks-frontend/_variants/icons-lucide.generated.js +32 -0
  299. package/dist/ai-service/skills/system/superblocks-frontend/_variants/icons-lucide.generated.js.map +1 -0
  300. package/dist/ai-service/skills/system/superblocks-frontend/_variants/icons-wrapper.generated.d.ts +2 -0
  301. package/dist/ai-service/skills/system/superblocks-frontend/_variants/icons-wrapper.generated.d.ts.map +1 -0
  302. package/dist/ai-service/skills/system/superblocks-frontend/_variants/icons-wrapper.generated.js +34 -0
  303. package/dist/ai-service/skills/system/superblocks-frontend/_variants/icons-wrapper.generated.js.map +1 -0
  304. package/dist/ai-service/skills/system/superblocks-frontend/skill.generated.d.ts +1 -1
  305. package/dist/ai-service/skills/system/superblocks-frontend/skill.generated.d.ts.map +1 -1
  306. package/dist/ai-service/skills/system/superblocks-frontend/skill.generated.js +99 -68
  307. package/dist/ai-service/skills/system/superblocks-frontend/skill.generated.js.map +1 -1
  308. package/dist/ai-service/skills/system/superblocks-migration/skill.generated.d.ts +1 -1
  309. package/dist/ai-service/skills/system/superblocks-migration/skill.generated.d.ts.map +1 -1
  310. package/dist/ai-service/skills/system/superblocks-migration/skill.generated.js +4 -4
  311. package/dist/ai-service/skills/system/superblocks-sdk-api/skill.generated.d.ts +1 -1
  312. package/dist/ai-service/skills/system/superblocks-sdk-api/skill.generated.d.ts.map +1 -1
  313. package/dist/ai-service/skills/system/superblocks-sdk-api/skill.generated.js +7 -7
  314. package/dist/ai-service/skills/system/third-party-migration/skill.generated.d.ts +1 -1
  315. package/dist/ai-service/skills/system/third-party-migration/skill.generated.d.ts.map +1 -1
  316. package/dist/ai-service/skills/system/third-party-migration/skill.generated.js +1 -1
  317. package/dist/ai-service/state-machine/clark-fsm.d.ts +2 -3
  318. package/dist/ai-service/state-machine/clark-fsm.d.ts.map +1 -1
  319. package/dist/ai-service/state-machine/clark-fsm.js +1 -1
  320. package/dist/ai-service/state-machine/clark-fsm.js.map +1 -1
  321. package/dist/ai-service/state-machine/handlers/agent-planning.d.ts.map +1 -1
  322. package/dist/ai-service/state-machine/handlers/agent-planning.js +1 -4
  323. package/dist/ai-service/state-machine/handlers/agent-planning.js.map +1 -1
  324. package/dist/ai-service/state-machine/handlers/llm-generating.d.ts.map +1 -1
  325. package/dist/ai-service/state-machine/handlers/llm-generating.js +21 -12
  326. package/dist/ai-service/state-machine/handlers/llm-generating.js.map +1 -1
  327. package/dist/ai-service/state-machine/helpers/prompt-degradation-cause.d.ts +63 -0
  328. package/dist/ai-service/state-machine/helpers/prompt-degradation-cause.d.ts.map +1 -0
  329. package/dist/ai-service/state-machine/helpers/prompt-degradation-cause.js +96 -0
  330. package/dist/ai-service/state-machine/helpers/prompt-degradation-cause.js.map +1 -0
  331. package/dist/ai-service/state-machine/helpers/prompt-degradation-metrics.d.ts +12 -3
  332. package/dist/ai-service/state-machine/helpers/prompt-degradation-metrics.d.ts.map +1 -1
  333. package/dist/ai-service/state-machine/helpers/prompt-degradation-metrics.js +89 -17
  334. package/dist/ai-service/state-machine/helpers/prompt-degradation-metrics.js.map +1 -1
  335. package/dist/ai-service/state-machine/helpers/prompt-org-claims.d.ts +17 -0
  336. package/dist/ai-service/state-machine/helpers/prompt-org-claims.d.ts.map +1 -0
  337. package/dist/ai-service/state-machine/helpers/prompt-org-claims.js +50 -0
  338. package/dist/ai-service/state-machine/helpers/prompt-org-claims.js.map +1 -0
  339. package/dist/ai-service/state-machine/helpers/prompt-request-metrics.d.ts +6 -0
  340. package/dist/ai-service/state-machine/helpers/prompt-request-metrics.d.ts.map +1 -1
  341. package/dist/ai-service/state-machine/helpers/prompt-request-metrics.js +35 -5
  342. package/dist/ai-service/state-machine/helpers/prompt-request-metrics.js.map +1 -1
  343. package/dist/ai-service/state-machine/mocks.d.ts.map +1 -1
  344. package/dist/ai-service/state-machine/mocks.js +1 -4
  345. package/dist/ai-service/state-machine/mocks.js.map +1 -1
  346. package/dist/ai-service/tasks/peer-push.d.ts +2 -1
  347. package/dist/ai-service/tasks/peer-push.d.ts.map +1 -1
  348. package/dist/ai-service/test-utils/metrics-harness.d.ts +2 -1
  349. package/dist/ai-service/test-utils/metrics-harness.d.ts.map +1 -1
  350. package/dist/ai-service/util/llm-config-utils.d.ts +16 -5
  351. package/dist/ai-service/util/llm-config-utils.d.ts.map +1 -1
  352. package/dist/ai-service/util/llm-config-utils.js +25 -3
  353. package/dist/ai-service/util/llm-config-utils.js.map +1 -1
  354. package/dist/ai-service/util/parse-jwt.d.ts +5 -1
  355. package/dist/ai-service/util/parse-jwt.d.ts.map +1 -1
  356. package/dist/ai-service/util/parse-jwt.js +9 -1
  357. package/dist/ai-service/util/parse-jwt.js.map +1 -1
  358. package/dist/app-scope-source.d.ts +13 -0
  359. package/dist/app-scope-source.d.ts.map +1 -0
  360. package/dist/app-scope-source.js +68 -0
  361. package/dist/app-scope-source.js.map +1 -0
  362. package/dist/extract-api-integrations.d.ts +28 -6
  363. package/dist/extract-api-integrations.d.ts.map +1 -1
  364. package/dist/extract-api-integrations.js +166 -98
  365. package/dist/extract-api-integrations.js.map +1 -1
  366. package/dist/file-sync-vite-plugin.d.ts +1 -5
  367. package/dist/file-sync-vite-plugin.d.ts.map +1 -1
  368. package/dist/file-sync-vite-plugin.js +44 -70
  369. package/dist/file-sync-vite-plugin.js.map +1 -1
  370. package/dist/file-system-helpers.d.ts +0 -5
  371. package/dist/file-system-helpers.d.ts.map +1 -1
  372. package/dist/file-system-helpers.js +1 -1
  373. package/dist/file-system-helpers.js.map +1 -1
  374. package/dist/file-system-manager.d.ts +2 -9
  375. package/dist/file-system-manager.d.ts.map +1 -1
  376. package/dist/file-system-manager.js +50 -118
  377. package/dist/file-system-manager.js.map +1 -1
  378. package/dist/git-service/index.d.ts.map +1 -1
  379. package/dist/git-service/index.js +8 -0
  380. package/dist/git-service/index.js.map +1 -1
  381. package/dist/lock-service/index.d.ts +24 -0
  382. package/dist/lock-service/index.d.ts.map +1 -1
  383. package/dist/lock-service/index.js +74 -2
  384. package/dist/lock-service/index.js.map +1 -1
  385. package/dist/migration/integration-write-policy.d.ts +2 -1
  386. package/dist/migration/integration-write-policy.d.ts.map +1 -1
  387. package/dist/migration/integration-write-policy.js.map +1 -1
  388. package/dist/migration/restructure.d.ts +1 -1
  389. package/dist/migration/restructure.d.ts.map +1 -1
  390. package/dist/migration/restructure.js +1 -1
  391. package/dist/migration/restructure.js.map +1 -1
  392. package/dist/migration/translation-prompt.js +1 -1
  393. package/dist/migration-templates/app-fullstack/client/components/ui/accordion.tsx +0 -69
  394. package/dist/migration-templates/app-fullstack/client/components/ui/aspect-ratio.tsx +0 -31
  395. package/dist/migration-templates/app-fullstack/client/components/ui/avatar.tsx +0 -52
  396. package/dist/migration-templates/app-fullstack/client/components/ui/badge.tsx +5 -79
  397. package/dist/migration-templates/app-fullstack/client/components/ui/breadcrumb.tsx +14 -161
  398. package/dist/migration-templates/app-fullstack/client/components/ui/button.tsx +1 -53
  399. package/dist/migration-templates/app-fullstack/client/components/ui/calendar.tsx +4 -56
  400. package/dist/migration-templates/app-fullstack/client/components/ui/card.tsx +0 -34
  401. package/dist/migration-templates/app-fullstack/client/components/ui/chart.tsx +3 -51
  402. package/dist/migration-templates/app-fullstack/client/components/ui/checkbox.tsx +0 -42
  403. package/dist/migration-templates/app-fullstack/client/components/ui/dialog.tsx +0 -55
  404. package/dist/migration-templates/app-fullstack/client/components/ui/dropdown-menu.tsx +0 -29
  405. package/dist/migration-templates/app-fullstack/client/components/ui/hover-card.tsx +0 -64
  406. package/dist/migration-templates/app-fullstack/client/components/ui/input.tsx +0 -57
  407. package/dist/migration-templates/app-fullstack/client/components/ui/label.tsx +0 -30
  408. package/dist/migration-templates/app-fullstack/client/components/ui/navigation-menu.tsx +16 -172
  409. package/dist/migration-templates/app-fullstack/client/components/ui/pagination.tsx +0 -44
  410. package/dist/migration-templates/app-fullstack/client/components/ui/popover.tsx +0 -64
  411. package/dist/migration-templates/app-fullstack/client/components/ui/progress.tsx +0 -31
  412. package/dist/migration-templates/app-fullstack/client/components/ui/scroll-area.tsx +0 -30
  413. package/dist/migration-templates/app-fullstack/client/components/ui/select.tsx +0 -41
  414. package/dist/migration-templates/app-fullstack/client/components/ui/separator.tsx +0 -29
  415. package/dist/migration-templates/app-fullstack/client/components/ui/sheet.tsx +0 -64
  416. package/dist/migration-templates/app-fullstack/client/components/ui/sidebar.tsx +30 -265
  417. package/dist/migration-templates/app-fullstack/client/components/ui/slider.tsx +0 -45
  418. package/dist/migration-templates/app-fullstack/client/components/ui/switch.tsx +0 -41
  419. package/dist/migration-templates/app-fullstack/client/components/ui/table.tsx +0 -32
  420. package/dist/migration-templates/app-fullstack/client/components/ui/tabs.tsx +0 -23
  421. package/dist/migration-templates/app-fullstack/client/components/ui/textarea.tsx +0 -48
  422. package/dist/migration-templates/app-fullstack/client/components/ui/toggle-group.tsx +0 -81
  423. package/dist/migration-templates/app-fullstack/client/components/ui/toggle.tsx +0 -46
  424. package/dist/migration-templates/app-fullstack/client/components/ui/tooltip.tsx +0 -63
  425. package/dist/migration-templates/app-fullstack/eslint.config.js +7 -0
  426. package/dist/migration-templates/app-fullstack/package.json +0 -3
  427. package/dist/parsing/types.d.ts +3 -2
  428. package/dist/parsing/types.d.ts.map +1 -1
  429. package/dist/policy-gate-runner.d.ts +1 -1
  430. package/dist/policy-gate-runner.d.ts.map +1 -1
  431. package/dist/policy-gate-runner.js.map +1 -1
  432. package/dist/reconnect-guard-plugin.d.ts +0 -1
  433. package/dist/reconnect-guard-plugin.d.ts.map +1 -1
  434. package/dist/reconnect-guard-plugin.js +1 -1
  435. package/dist/reconnect-guard-plugin.js.map +1 -1
  436. package/dist/resolver.d.ts +1 -1
  437. package/dist/resolver.d.ts.map +1 -1
  438. package/dist/resolver.js +2 -2
  439. package/dist/resolver.js.map +1 -1
  440. package/dist/socket-manager.d.ts.map +1 -1
  441. package/dist/socket-manager.js +12 -2
  442. package/dist/socket-manager.js.map +1 -1
  443. package/dist/source-tracker.d.ts +5 -15
  444. package/dist/source-tracker.d.ts.map +1 -1
  445. package/dist/source-tracker.js +28 -66
  446. package/dist/source-tracker.js.map +1 -1
  447. package/dist/sync-service/checkpoint-result.d.ts +6 -5
  448. package/dist/sync-service/checkpoint-result.d.ts.map +1 -1
  449. package/dist/sync-service/checkpoint-result.js +9 -8
  450. package/dist/sync-service/checkpoint-result.js.map +1 -1
  451. package/dist/sync-service/index.d.ts +1 -0
  452. package/dist/sync-service/index.d.ts.map +1 -1
  453. package/dist/sync-service/index.js +8 -1
  454. package/dist/sync-service/index.js.map +1 -1
  455. package/dist/sync-service/snapshot/types.d.ts +3 -2
  456. package/dist/sync-service/snapshot/types.d.ts.map +1 -1
  457. package/dist/util/generation-wait-timeout-error.d.ts +12 -0
  458. package/dist/util/generation-wait-timeout-error.d.ts.map +1 -0
  459. package/dist/util/generation-wait-timeout-error.js +16 -0
  460. package/dist/util/generation-wait-timeout-error.js.map +1 -0
  461. package/package.json +9 -13
  462. package/dist/ai-service/agent/tools/apis/sdk-root-documentation.d.ts +0 -20
  463. package/dist/ai-service/agent/tools/apis/sdk-root-documentation.d.ts.map +0 -1
  464. package/dist/ai-service/agent/tools/apis/sdk-root-documentation.js +0 -284
  465. package/dist/ai-service/agent/tools/apis/sdk-root-documentation.js.map +0 -1
  466. package/dist/migration-templates/app-fullstack/client/components/hooks/use-active-page.ts +0 -73
  467. package/dist/migration-templates/app-fullstack/client/components/ui/area-chart.tsx +0 -312
  468. package/dist/migration-templates/app-fullstack/client/components/ui/bar-chart.tsx +0 -264
  469. package/dist/migration-templates/app-fullstack/client/components/ui/code-block-content.tsx +0 -66
  470. package/dist/migration-templates/app-fullstack/client/components/ui/date-range-picker.tsx +0 -255
  471. package/dist/migration-templates/app-fullstack/client/components/ui/file-dropzone.tsx +0 -312
  472. package/dist/migration-templates/app-fullstack/client/components/ui/file-input.tsx +0 -105
  473. package/dist/migration-templates/app-fullstack/client/components/ui/icon.tsx +0 -120
  474. package/dist/migration-templates/app-fullstack/client/components/ui/image.tsx +0 -56
  475. package/dist/migration-templates/app-fullstack/client/components/ui/line-chart.tsx +0 -264
  476. package/dist/migration-templates/app-fullstack/client/components/ui/link.tsx +0 -119
  477. package/dist/migration-templates/app-fullstack/client/components/ui/pie-chart.tsx +0 -181
  478. package/dist/migration-templates/app-fullstack/client/components/ui/radar-chart.tsx +0 -252
  479. package/dist/migration-templates/app-fullstack/client/components/ui/radial-chart.tsx +0 -250
  480. package/dist/refactor/entities.d.ts +0 -6
  481. package/dist/refactor/entities.d.ts.map +0 -1
  482. package/dist/refactor/entities.js +0 -65
  483. package/dist/refactor/entities.js.map +0 -1
  484. package/dist/refactor/javascript.d.ts +0 -15
  485. package/dist/refactor/javascript.d.ts.map +0 -1
  486. package/dist/refactor/javascript.js +0 -283
  487. package/dist/refactor/javascript.js.map +0 -1
  488. package/dist/rename-manager.d.ts +0 -28
  489. package/dist/rename-manager.d.ts.map +0 -1
  490. package/dist/rename-manager.js +0 -161
  491. package/dist/rename-manager.js.map +0 -1
@@ -1,284 +0,0 @@
1
- import { createHash } from "node:crypto";
2
- import { fromMarkdown } from "mdast-util-from-markdown";
3
- import { safeJsonStringify } from "../../../../util/log-sanitizer.js";
4
- const EMPTY_SOURCE_ID = "missing";
5
- const INDEX_SECTION_ID = "@index";
6
- function nodeOffset(node, edge) {
7
- return node.position?.[edge].offset;
8
- }
9
- function nodeText(node) {
10
- if ("value" in node && typeof node.value === "string") {
11
- return node.value;
12
- }
13
- if (node.type === "image" || node.type === "imageReference") {
14
- return node.alt ?? "";
15
- }
16
- if ("children" in node) {
17
- return node.children.map((child) => nodeText(child)).join("");
18
- }
19
- return "";
20
- }
21
- function sectionSlug(title) {
22
- return (title
23
- .normalize("NFKD")
24
- .replace(/[\u0300-\u036f]/g, "")
25
- .toLowerCase()
26
- .replace(/[^a-z0-9]+/g, "-")
27
- .replace(/^-|-$/g, "")
28
- .slice(0, 80) || "section");
29
- }
30
- function parseRootDocumentation(markdown) {
31
- const tree = fromMarkdown(markdown);
32
- const sourceId = markdown
33
- ? createHash("sha256").update(markdown).digest("hex").slice(0, 12)
34
- : EMPTY_SOURCE_ID;
35
- const headings = tree.children.flatMap((node, childIndex) => {
36
- if (node.type !== "heading") {
37
- return [];
38
- }
39
- const start = nodeOffset(node, "start");
40
- if (start === undefined) {
41
- return [];
42
- }
43
- return [{ node, childIndex, start }];
44
- });
45
- const slugCounts = new Map();
46
- const sections = headings.map(({ node, childIndex, start }, headingIndex) => {
47
- const title = nodeText(node).trim();
48
- const slug = sectionSlug(title);
49
- const occurrence = (slugCounts.get(slug) ?? 0) + 1;
50
- slugCounts.set(slug, occurrence);
51
- const nextBoundaryIndex = headings.findIndex((candidate, candidateIndex) => candidateIndex > headingIndex && candidate.node.depth <= node.depth);
52
- const boundary = nextBoundaryIndex === -1 ? undefined : headings[nextBoundaryIndex];
53
- return {
54
- id: occurrence === 1 ? slug : `${slug}-${occurrence}`,
55
- title,
56
- depth: node.depth,
57
- start,
58
- end: boundary?.start ?? markdown.length,
59
- childStart: childIndex,
60
- childEnd: boundary?.childIndex ?? tree.children.length,
61
- };
62
- });
63
- return { markdown, tree, sourceId, sections };
64
- }
65
- function rootResult(documentation, root) {
66
- return { documentation, root };
67
- }
68
- function buildIndex(parsed, notice, orientation, budget = Number.POSITIVE_INFINITY, offset = 0) {
69
- if (!parsed.markdown) {
70
- return rootResult([
71
- orientation,
72
- "SDK root documentation is unavailable in the installed @superblocksteam/sdk-api package. Do not guess SDK contracts; retry after the package installation is repaired.",
73
- ]
74
- .filter(Boolean)
75
- .join("\n\n"), { sourceId: parsed.sourceId });
76
- }
77
- const lines = parsed.sections.map((section) => `${" ".repeat(Math.max(0, section.depth - 1))}- \`${section.id}\` — ${section.title.slice(0, 160)}`);
78
- if (lines.length === 0) {
79
- return rootResult("The installed SDK README contains no discoverable Markdown headings. Do not guess SDK contracts; repair or update the installed @superblocksteam/sdk-api package.", { sourceId: parsed.sourceId });
80
- }
81
- const header = [
82
- "## SDK root documentation index",
83
- "",
84
- ...(notice ? [`> ${notice}`, ""] : []),
85
- ...(orientation ? [orientation, ""] : []),
86
- 'Request an ID below with `getSdkApiDocs({ section: "<id>" })`. If `root.continuation` is present, pass it exactly to `getSdkApiDocs({ continuation: "<token>" })`.',
87
- "",
88
- ];
89
- let end = offset;
90
- let best = rootResult(header.join("\n"), {
91
- sourceId: parsed.sourceId,
92
- section: INDEX_SECTION_ID,
93
- range: { start: offset, end, total: lines.length },
94
- continuation: encodeContinuation({
95
- sourceId: parsed.sourceId,
96
- section: INDEX_SECTION_ID,
97
- offset: Math.max(1, end),
98
- }),
99
- });
100
- while (end < lines.length) {
101
- const candidateEnd = end + 1;
102
- const continuation = candidateEnd < lines.length
103
- ? encodeContinuation({
104
- sourceId: parsed.sourceId,
105
- section: INDEX_SECTION_ID,
106
- offset: candidateEnd,
107
- })
108
- : undefined;
109
- const candidate = rootResult([...header, ...lines.slice(offset, candidateEnd)].join("\n"), {
110
- sourceId: parsed.sourceId,
111
- section: INDEX_SECTION_ID,
112
- range: { start: offset, end: candidateEnd, total: lines.length },
113
- ...(continuation ? { continuation } : {}),
114
- });
115
- if (!resultFitsBudget(candidate, budget)) {
116
- break;
117
- }
118
- best = candidate;
119
- end = candidateEnd;
120
- }
121
- return best;
122
- }
123
- function encodeContinuation(value) {
124
- return Buffer.from(JSON.stringify(value)).toString("base64url");
125
- }
126
- function decodeContinuation(value) {
127
- try {
128
- const parsed = JSON.parse(Buffer.from(value, "base64url").toString("utf8"));
129
- if (typeof parsed.sourceId !== "string" ||
130
- typeof parsed.section !== "string" ||
131
- typeof parsed.offset !== "number" ||
132
- !Number.isSafeInteger(parsed.offset) ||
133
- parsed.offset <= 0) {
134
- return undefined;
135
- }
136
- return {
137
- sourceId: parsed.sourceId,
138
- section: parsed.section,
139
- offset: parsed.offset,
140
- };
141
- }
142
- catch {
143
- return undefined;
144
- }
145
- }
146
- function collectReferenceIdentifiers(node, identifiers) {
147
- if (node.type === "linkReference" || node.type === "imageReference") {
148
- identifiers.add(node.identifier.toLowerCase());
149
- }
150
- if ("children" in node) {
151
- for (const child of node.children) {
152
- collectReferenceIdentifiers(child, identifiers);
153
- }
154
- }
155
- }
156
- function externalDefinitions(parsed, section) {
157
- const identifiers = new Set();
158
- for (const node of parsed.tree.children.slice(section.childStart, section.childEnd)) {
159
- collectReferenceIdentifiers(node, identifiers);
160
- }
161
- if (identifiers.size === 0) {
162
- return "";
163
- }
164
- const definitions = parsed.tree.children.flatMap((node) => {
165
- if (node.type !== "definition") {
166
- return [];
167
- }
168
- const start = nodeOffset(node, "start");
169
- const end = nodeOffset(node, "end");
170
- if (start === undefined ||
171
- end === undefined ||
172
- (start >= section.start && end <= section.end) ||
173
- !identifiers.has(node.identifier.toLowerCase())) {
174
- return [];
175
- }
176
- return [parsed.markdown.slice(start, end)];
177
- });
178
- return definitions.length > 0
179
- ? `\n\n<!-- Reference definitions used by this section -->\n${definitions.join("\n")}`
180
- : "";
181
- }
182
- function resultFitsBudget(result, budget) {
183
- return safeJsonStringify({ ...result, plugins: [] }).length <= budget;
184
- }
185
- function pageResult(parsed, section, offset, end, preamble, definitions) {
186
- const total = section.end - section.start;
187
- const continuation = end < total
188
- ? encodeContinuation({
189
- sourceId: parsed.sourceId,
190
- section: section.id,
191
- offset: end,
192
- })
193
- : undefined;
194
- return rootResult(preamble +
195
- parsed.markdown.slice(section.start + offset, section.start + end) +
196
- definitions, {
197
- sourceId: parsed.sourceId,
198
- section: section.id,
199
- range: { start: offset, end, total },
200
- ...(continuation ? { continuation } : {}),
201
- });
202
- }
203
- function blockBoundaries(parsed, section) {
204
- const nodes = parsed.tree.children.slice(section.childStart, section.childEnd);
205
- const boundaries = nodes.slice(1).flatMap((node) => {
206
- const start = nodeOffset(node, "start");
207
- return start === undefined ? [] : [start - section.start];
208
- });
209
- boundaries.push(section.end - section.start);
210
- return boundaries;
211
- }
212
- function paginateSection(parsed, section, offset, budget, preamble) {
213
- const total = section.end - section.start;
214
- const definitions = externalDefinitions(parsed, section);
215
- const boundaries = blockBoundaries(parsed, section).filter((boundary) => boundary > offset);
216
- let best = offset;
217
- for (const boundary of boundaries) {
218
- if (resultFitsBudget(pageResult(parsed, section, offset, boundary, preamble, definitions), budget)) {
219
- best = boundary;
220
- continue;
221
- }
222
- break;
223
- }
224
- if (best === offset) {
225
- let low = offset + 1;
226
- let high = boundaries[0] ?? total;
227
- while (low <= high) {
228
- const candidate = Math.floor((low + high) / 2);
229
- if (resultFitsBudget(pageResult(parsed, section, offset, candidate, preamble, definitions), budget)) {
230
- best = candidate;
231
- low = candidate + 1;
232
- }
233
- else {
234
- high = candidate - 1;
235
- }
236
- }
237
- }
238
- if (best === offset) {
239
- return rootResult("This SDK README section cannot fit within the tool response budget. Request a narrower nested section from getSdkApiDocs() instead.", { sourceId: parsed.sourceId, section: section.id });
240
- }
241
- return pageResult(parsed, section, offset, best, preamble, definitions);
242
- }
243
- export function buildRootDocumentation(markdown, selector, budget, notice, orientation) {
244
- const parsed = parseRootDocumentation(markdown);
245
- const invalidSelector = (message) => buildIndex(parsed, [notice, message].filter(Boolean).join(" "), orientation, budget);
246
- if (!selector.section && !selector.continuation) {
247
- return buildIndex(parsed, notice, orientation, budget);
248
- }
249
- if (selector.section && selector.continuation) {
250
- return invalidSelector("Pass either section or continuation, not both.");
251
- }
252
- let sectionId = selector.section;
253
- let offset = 0;
254
- if (selector.continuation) {
255
- const continuation = decodeContinuation(selector.continuation);
256
- if (!continuation) {
257
- return invalidSelector("The continuation token is invalid. Choose a section from the current index and start again.");
258
- }
259
- if (continuation.sourceId !== parsed.sourceId) {
260
- return invalidSelector("The continuation token is stale because the installed SDK README changed. Choose a section from this refreshed index and start again.");
261
- }
262
- sectionId = continuation.section;
263
- offset = continuation.offset;
264
- }
265
- if (sectionId === INDEX_SECTION_ID) {
266
- return buildIndex(parsed, notice, orientation, budget, offset);
267
- }
268
- const section = parsed.sections.find((candidate) => candidate.id === sectionId);
269
- if (!section) {
270
- return invalidSelector(`Unknown SDK README section \`${sectionId ?? ""}\`. Choose an ID from this index.`);
271
- }
272
- const total = section.end - section.start;
273
- if (offset >= total) {
274
- return invalidSelector("The continuation token points beyond the current section. Choose a section from the index and start again.");
275
- }
276
- // Every page repeats the notice and orientation so a section fetched
277
- // directly, or refetched after compaction, still carries them.
278
- const preamble = [notice && `> ${notice}`, orientation]
279
- .filter(Boolean)
280
- .map((part) => `${part}\n\n`)
281
- .join("");
282
- return paginateSection(parsed, section, offset, budget, preamble);
283
- }
284
- //# sourceMappingURL=sdk-root-documentation.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sdk-root-documentation.js","sourceRoot":"","sources":["../../../../../src/ai-service/agent/tools/apis/sdk-root-documentation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAGzC,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAExD,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AA0CtE,MAAM,eAAe,GAAG,SAAS,CAAC;AAClC,MAAM,gBAAgB,GAAG,QAAQ,CAAC;AAElC,SAAS,UAAU,CAAC,IAAW,EAAE,IAAqB;IACpD,OAAO,IAAI,CAAC,QAAQ,EAAE,CAAC,IAAI,CAAC,CAAC,M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AAK,gBAAgB,EAAE,CAAC;QACnC,OAAO,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IACjE,CAAC;IAED,MAAM,OAAO,GAAG,MAAM,CAAC,QAAQ,CAAC,IAAI,CAClC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,EAAE,KAAK,SAAS,CAC1C,CAAC;IACF,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO,eAAe,CACpB,gCAAgC,SAAS,IAAI,EAAE,mCAAmC,CACnF,CAAC;IACJ,CAAC;IACD,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,GAAG,OAAO,CAAC,KAAK,CAAC;IAC1C,IAAI,MAAM,IAAI,KAAK,EAAE,CAAC;QACpB,OAAO,eAAe,CACpB,4GAA4G,CAC7G,CAAC;IACJ,CAAC;IACD,qEAAqE;IACrE,+DAA+D;IAC/D,MAAM,QAAQ,GAAG,CAAC,MAAM,IAAI,KAAK,MAAM,EAAE,EAAE,WAAW,CAAC;SACpD,MAAM,CAAC,OAAO,CAAC;SACf,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,GAAG,IAAI,MAAM,CAAC;SAC5B,IAAI,CAAC,EAAE,CAAC,CAAC;IACZ,OAAO,eAAe,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC;AACpE,CAAC"}
@@ -1,73 +0,0 @@
1
- import React from "react";
2
-
3
- // Custom hook to track current pathname and determine active menu items
4
- export const useActivePage = () => {
5
- // Track current pathname
6
- const [currentPath, setCurrentPath] = React.useState(
7
- window.location.pathname,
8
- );
9
-
10
- // Update current path when location changes
11
- React.useEffect(() => {
12
- const handleLocationChange = () => {
13
- setCurrentPath(window.location.pathname);
14
- };
15
-
16
- // Listen for navigation events
17
- window.addEventListener("popstate", handleLocationChange);
18
-
19
- // Custom event listener for programmatic navigation
20
- const handleNavigationEvent = () => {
21
- setTimeout(() => {
22
- setCurrentPath(window.location.pathname);
23
- }, 0);
24
- };
25
-
26
- // Listen for hash changes too
27
- window.addEventListener("hashchange", handleLocationChange);
28
-
29
- // Add custom navigation listener
30
- window.addEventListener("navigation", handleNavigationEvent);
31
-
32
- return () => {
33
- window.removeEventListener("popstate", handleLocationChange);
34
- window.removeEventListener("hashchange", handleLocationChange);
35
- window.removeEventListener("navigation", handleNavigationEvent);
36
- };
37
- }, []);
38
-
39
- // Function to determine if a menu item is active
40
- const isPageActive = React.useCallback(
41
- (pageUrl: string) => {
42
- if (!pageUrl) {
43
- return false;
44
- }
45
-
46
- // Handle different URL formats
47
- if (pageUrl.startsWith("http") || pageUrl.startsWith("//")) {
48
- // External URLs - not active
49
- return false;
50
- }
51
-
52
- // Remove leading slash if present for comparison
53
- const cleanUrl = pageUrl.startsWith("/") ? pageUrl : `/${pageUrl}`;
54
- const cleanCurrentPath = currentPath || "/";
55
-
56
- // Exact match
57
- if (cleanUrl === cleanCurrentPath) {
58
- return true;
59
- }
60
-
61
- // For root page, only match exact
62
- if (cleanUrl === "/" || cleanCurrentPath === "/") {
63
- return cleanUrl === cleanCurrentPath;
64
- }
65
-
66
- // Check if current path starts with the menu item URL (for nested routes)
67
- return cleanCurrentPath.startsWith(cleanUrl);
68
- },
69
- [currentPath],
70
- );
71
-
72
- return { isPageActive };
73
- };
@@ -1,312 +0,0 @@
1
- import React from "react";
2
- import {
3
- AreaChart as AreaChartComponent,
4
- Area,
5
- XAxis,
6
- YAxis,
7
- CartesianGrid,
8
- } from "recharts";
9
-
10
- import {
11
- registerComponent,
12
- Prop,
13
- Section,
14
- PropsCategory,
15
- type EditorConfig,
16
- } from "@superblocksteam/library";
17
-
18
- import { cn } from "@/lib/utils";
19
-
20
- import type { ChartConfig } from "./chart";
21
- import {
22
- ChartContainer,
23
- ChartTooltip,
24
- ChartTooltipContent,
25
- ChartLegend,
26
- ChartLegendContent,
27
- sanitizeForCssVar,
28
- fixColorFormat,
29
- createKeyMapping,
30
- } from "./chart";
31
-
32
- type ComponentProps = Omit<
33
- React.ComponentPropsWithoutRef<typeof ChartContainer>,
34
- "children" | "config"
35
- > & {
36
- data?: any[];
37
- xAxisKey?: string;
38
- categories?: string[];
39
- seriesLabels?: Record<string, string>;
40
- colors?: string[];
41
- gridStyle?: "solid" | "dashed" | "hidden";
42
- showXAxis?: boolean;
43
- showYAxis?: boolean;
44
- showTooltip?: boolean;
45
- showLegend?: boolean;
46
- areaType?:
47
- | "monotone"
48
- | "linear"
49
- | "step"
50
- | "bump"
51
- | "basis"
52
- | "stepBefore"
53
- | "stepAfter"
54
- | "natural";
55
- useGradient?: boolean;
56
- fillOpacity?: number;
57
- strokeWidth?: number;
58
- connectNulls?: boolean;
59
- enableAnimation?: boolean;
60
- showDots?: boolean;
61
- onDataClick?: (data: any) => void;
62
- };
63
-
64
- const AreaChart = ({ className, ...props }: ComponentProps) => {
65
- const chartConfig: ChartConfig = React.useMemo(() => {
66
- const effectiveCategories =
67
- props.categories && props.categories.length > 0
68
- ? props.categories
69
- : props.data && props.data.length > 0
70
- ? Object.keys(props.data[0]).filter((key) => {
71
- if (key === props.xAxisKey) return false;
72
- const value = props.data![0][key];
73
- return typeof value === "number";
74
- })
75
- : [];
76
-
77
- if (!effectiveCategories.length) return {};
78
-
79
- const config: ChartConfig = {};
80
- effectiveCategories.forEach((key, index) => {
81
- const sanitizedKey = sanitizeForCssVar(key);
82
- const label = props.seriesLabels?.[key] || key;
83
- const color = fixColorFormat(
84
- props.colors?.[index] || `var(--chart-${(index % 5) + 1})`,
85
- );
86
-
87
- config[sanitizedKey] = {
88
- label,
89
- color,
90
- };
91
- });
92
-
93
- return config;
94
- }, [
95
- props.categories,
96
- props.seriesLabels,
97
- props.colors,
98
- props.data,
99
- props.xAxisKey,
100
- ]);
101
-
102
- const keyMapping = React.useMemo(() => {
103
- const effectiveCategories =
104
- props.categories && props.categories.length > 0
105
- ? props.categories
106
- : props.data && props.data.length > 0
107
- ? Object.keys(props.data[0]).filter((key) => {
108
- if (key === props.xAxisKey) return false;
109
- const value = props.data![0][key];
110
- return typeof value === "number";
111
- })
112
- : [];
113
-
114
- return effectiveCategories.length > 0
115
- ? createKeyMapping(
116
- Object.fromEntries(effectiveCategories.map((k) => [k, { label: k }])),
117
- )
118
- : new Map();
119
- }, [props.categories, props.data, props.xAxisKey]);
120
-
121
- const hasData = Array.isArray(props.data) && props.data?.length;
122
-
123
- const renderGradients = () => {
124
- if (!props.useGradient || !hasData) return null;
125
-
126
- return (
127
- <defs>
128
- {Object.keys(chartConfig).map((key) => {
129
- return (
130
- <linearGradient
131
- key={key}
132
- id={`${key}-gradient`}
133
- x1="0"
134
- y1="0"
135
- x2="0"
136
- y2="1"
137
- >
138
- <stop
139
- offset="0%"
140
- stopColor={chartConfig[key]?.color}
141
- stopOpacity={props.fillOpacity}
142
- />
143
- <stop
144
- offset="100%"
145
- stopColor={chartConfig[key]?.color}
146
- stopOpacity={0.05}
147
- />
148
- </linearGradient>
149
- );
150
- })}
151
- </defs>
152
- );
153
- };
154
-
155
- return (
156
- <ChartContainer
157
- className={cn("h-full w-full pt-4 pb-4 pr-4", className)}
158
- {...props}
159
- config={chartConfig}
160
- >
161
- {hasData ? (
162
- <AreaChartComponent
163
- data={props.data}
164
- onClick={props.onDataClick}
165
- accessibilityLayer
166
- >
167
- {renderGradients()}
168
-
169
- {props.gridStyle !== "hidden" && (
170
- <CartesianGrid
171
- vertical={false}
172
- strokeDasharray={props.gridStyle === "dashed" ? "3 3" : "0"}
173
- />
174
- )}
175
-
176
- {props.showXAxis && (
177
- <XAxis
178
- dataKey={props.xAxisKey}
179
- tickLine={false}
180
- axisLine={false}
181
- tickMargin={8}
182
- />
183
- )}
184
-
185
- {props.showYAxis && (
186
- <YAxis tickLine={false} axisLine={false} tickMargin={8} />
187
- )}
188
-
189
- {props.showTooltip && (
190
- <ChartTooltip cursor={false} content={<ChartTooltipContent />} />
191
- )}
192
-
193
- {props.showLegend && <ChartLegend content={<ChartLegendContent />} />}
194
-
195
- {Object.keys(chartConfig).map((key) => {
196
- // Use memoized mapping instead of O(n²) find operation
197
- const originalKey = keyMapping.get(key) || key;
198
- const effectiveFillOpacity = props.useGradient
199
- ? 1
200
- : props.fillOpacity;
201
- const wouldHideChart =
202
- props.fillOpacity === 0 && props.strokeWidth === 0;
203
-
204
- return (
205
- <Area
206
- key={key}
207
- dataKey={originalKey}
208
- type={props.areaType}
209
- fill={
210
- props.useGradient
211
- ? `url(#${key}-gradient)`
212
- : `var(--color-${key})`
213
- }
214
- {...(!wouldHideChart && { fillOpacity: effectiveFillOpacity })}
215
- stroke={`var(--color-${key})`}
216
- {...(!wouldHideChart && { strokeWidth: props.strokeWidth })}
217
- connectNulls={props.connectNulls}
218
- isAnimationActive={props.enableAnimation}
219
- activeDot={{
220
- fill: `var(--color-${key})`,
221
- strokeWidth: 2,
222
- r: 4,
223
- }}
224
- dot={
225
- props.showDots
226
- ? {
227
- fill: `var(--color-${key})`,
228
- strokeWidth: 2,
229
- r: 2,
230
- }
231
- : false
232
- }
233
- />
234
- );
235
- })}
236
- </AreaChartComponent>
237
- ) : (
238
- <div className="flex items-center justify-center h-full w-full min-h-32 text-muted-foreground">
239
- No data available
240
- </div>
241
- )}
242
- </ChartContainer>
243
- );
244
- };
245
-
246
- const properties = {
247
- general: Section.category(PropsCategory.Content).children({
248
- data: Prop.array<any>().docs({
249
- description:
250
- "Array of objects where each object represents a data point with X-axis and Y-axis values. Each object should contain the xAxisKey property and properties for each data series defined in categories. Example: [{month: 'January', desktop: 186, mobile: 80}, {month: 'February', desktop: 305, mobile: 200}]. Multiple Y-value properties create multiple area series.",
251
- }),
252
-
253
- xAxisKey: Prop.string().docs({
254
- description:
255
- "The property name in your data objects that contains the X-axis values (categories, dates, or labels). This determines the horizontal positioning of data points. Should be consistent across all data objects.",
256
- }),
257
-
258
- categories: Prop.array<string>().docs({
259
- description:
260
- "Array of property names from your data objects to plot as separate area series. Example: ['desktop', 'mobile'] will create two area series. Each category should correspond to a numeric property in your data. If not provided, automatically detects all numeric properties (excluding xAxisKey) from the data.",
261
- }),
262
-
263
- seriesLabels: Prop.any<Record<string, string>>().docs({
264
- description:
265
- "Optional object mapping category keys to display labels. Example: {desktop: 'Desktop Users', mobile: 'Mobile Users'}. If not provided, the category keys are used as labels.",
266
- }),
267
-
268
- colors: Prop.array<string>().docs({
269
- description:
270
- "Optional array of color values to use for series in order. Can be hex codes, rgb values, or CSS variables like 'var(--chart-1)'. Falls back to theme colors if not provided.",
271
- }),
272
- }),
273
- appearance: Section.category(PropsCategory.Appearance).children({
274
- gridStyle: Prop.string<"solid" | "dashed" | "hidden">(),
275
- showXAxis: Prop.boolean(),
276
- showYAxis: Prop.boolean(),
277
- showTooltip: Prop.boolean(),
278
- showLegend: Prop.boolean(),
279
- fillOpacity: Prop.number(),
280
- strokeWidth: Prop.number(),
281
- useGradient: Prop.boolean(),
282
- showDots: Prop.boolean(),
283
- connectNulls: Prop.boolean(),
284
- areaType: Prop.string<
285
- | "linear"
286
- | "bump"
287
- | "step"
288
- | "basis"
289
- | "stepBefore"
290
- | "stepAfter"
291
- | "natural"
292
- | "monotone"
293
- >().docs({
294
- description:
295
- "Curve interpolation type for area paths. 'linear' creates straight lines, 'monotone' creates smooth curves that preserve monotonicity, 'natural' creates natural spline curves, 'step' creates step functions, 'basis' creates B-spline curves, 'bump' creates rounded bumps, 'stepBefore' steps before point, 'stepAfter' steps after point.",
296
- }),
297
- }),
298
- interaction: Section.category(PropsCategory.Interaction).children({
299
- enableAnimation: Prop.boolean(),
300
- }),
301
- events: Section.category(PropsCategory.EventHandlers).children({
302
- onDataClick: Prop.eventHandler(),
303
- }),
304
- };
305
-
306
- const editorConfig: EditorConfig = {
307
- icon: "chart",
308
- };
309
-
310
- registerComponent(AreaChart, properties).editorConfig(editorConfig);
311
-
312
- export { AreaChart };