@vpxa/kb 0.1.13 → 0.1.15

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 (383) hide show
  1. package/README.md +8 -2
  2. package/package.json +10 -7
  3. package/packages/analyzers/dist/blast-radius-analyzer.d.ts +17 -20
  4. package/packages/analyzers/dist/blast-radius-analyzer.js +6 -12
  5. package/packages/analyzers/dist/dependency-analyzer.d.ts +31 -27
  6. package/packages/analyzers/dist/dependency-analyzer.js +7 -9
  7. package/packages/analyzers/dist/diagram-generator.d.ts +12 -8
  8. package/packages/analyzers/dist/diagram-generator.js +3 -4
  9. package/packages/analyzers/dist/entry-point-analyzer.d.ts +39 -35
  10. package/packages/analyzers/dist/entry-point-analyzer.js +5 -6
  11. package/packages/analyzers/dist/index.d.ts +12 -14
  12. package/packages/analyzers/dist/index.js +1 -1
  13. package/packages/analyzers/dist/knowledge-producer.d.ts +29 -25
  14. package/packages/analyzers/dist/knowledge-producer.js +16 -15
  15. package/packages/analyzers/dist/pattern-analyzer.d.ts +14 -10
  16. package/packages/analyzers/dist/pattern-analyzer.js +3 -5
  17. package/packages/analyzers/dist/regex-call-graph.d.ts +6 -12
  18. package/packages/analyzers/dist/regex-call-graph.js +2 -1
  19. package/packages/analyzers/dist/structure-analyzer.d.ts +13 -9
  20. package/packages/analyzers/dist/structure-analyzer.js +3 -4
  21. package/packages/analyzers/dist/symbol-analyzer.d.ts +12 -8
  22. package/packages/analyzers/dist/symbol-analyzer.js +8 -13
  23. package/packages/analyzers/dist/ts-call-graph.d.ts +16 -13
  24. package/packages/analyzers/dist/ts-call-graph.js +2 -1
  25. package/packages/analyzers/dist/types.d.ts +82 -79
  26. package/packages/analyzers/dist/types.js +1 -0
  27. package/packages/chunker/dist/call-graph-extractor.d.ts +13 -10
  28. package/packages/chunker/dist/call-graph-extractor.js +2 -1
  29. package/packages/chunker/dist/chunker-factory.d.ts +6 -2
  30. package/packages/chunker/dist/chunker-factory.js +2 -1
  31. package/packages/chunker/dist/chunker.interface.d.ts +8 -4
  32. package/packages/chunker/dist/chunker.interface.js +1 -0
  33. package/packages/chunker/dist/code-chunker.d.ts +16 -12
  34. package/packages/chunker/dist/code-chunker.js +12 -14
  35. package/packages/chunker/dist/generic-chunker.d.ts +14 -10
  36. package/packages/chunker/dist/generic-chunker.js +6 -5
  37. package/packages/chunker/dist/index.d.ts +8 -8
  38. package/packages/chunker/dist/index.js +1 -1
  39. package/packages/chunker/dist/markdown-chunker.d.ts +16 -12
  40. package/packages/chunker/dist/markdown-chunker.js +4 -10
  41. package/packages/chunker/dist/treesitter-chunker.d.ts +28 -31
  42. package/packages/chunker/dist/treesitter-chunker.js +7 -8
  43. package/packages/cli/dist/commands/analyze.d.ts +6 -2
  44. package/packages/cli/dist/commands/analyze.js +3 -3
  45. package/packages/cli/dist/commands/context-cmds.d.ts +6 -2
  46. package/packages/cli/dist/commands/context-cmds.js +2 -1
  47. package/packages/cli/dist/commands/environment.d.ts +6 -2
  48. package/packages/cli/dist/commands/environment.js +2 -2
  49. package/packages/cli/dist/commands/execution.d.ts +6 -2
  50. package/packages/cli/dist/commands/execution.js +2 -1
  51. package/packages/cli/dist/commands/graph.d.ts +6 -2
  52. package/packages/cli/dist/commands/graph.js +6 -6
  53. package/packages/cli/dist/commands/init/adapters.d.ts +27 -0
  54. package/packages/cli/dist/commands/init/adapters.js +2 -0
  55. package/packages/cli/dist/commands/init/config.d.ts +11 -0
  56. package/packages/cli/dist/commands/init/config.js +4 -0
  57. package/packages/cli/dist/commands/init/curated.d.ts +8 -0
  58. package/packages/cli/dist/commands/init/curated.js +2 -0
  59. package/packages/cli/dist/commands/init/index.d.ts +23 -0
  60. package/packages/cli/dist/commands/init/index.js +3 -0
  61. package/packages/cli/dist/commands/init/scaffold.d.ts +24 -0
  62. package/packages/cli/dist/commands/init/scaffold.js +2 -0
  63. package/packages/cli/dist/commands/init/templates.d.ts +10 -0
  64. package/packages/cli/dist/commands/init/templates.js +302 -0
  65. package/packages/cli/dist/commands/init.d.ts +8 -3
  66. package/packages/cli/dist/commands/init.js +120 -123
  67. package/packages/cli/dist/commands/knowledge.d.ts +6 -2
  68. package/packages/cli/dist/commands/knowledge.js +2 -1
  69. package/packages/cli/dist/commands/search.d.ts +6 -2
  70. package/packages/cli/dist/commands/search.js +2 -8
  71. package/packages/cli/dist/commands/system.d.ts +6 -2
  72. package/packages/cli/dist/commands/system.js +5 -7
  73. package/packages/cli/dist/commands/workspace.d.ts +6 -2
  74. package/packages/cli/dist/commands/workspace.js +2 -2
  75. package/packages/cli/dist/context.d.ts +7 -4
  76. package/packages/cli/dist/context.js +2 -1
  77. package/packages/cli/dist/helpers.d.ts +51 -47
  78. package/packages/cli/dist/helpers.js +6 -5
  79. package/packages/cli/dist/index.d.ts +4 -1
  80. package/packages/cli/dist/index.js +3 -2
  81. package/packages/cli/dist/kb-init.d.ts +48 -50
  82. package/packages/cli/dist/kb-init.js +2 -1
  83. package/packages/cli/dist/types.d.ts +8 -5
  84. package/packages/cli/dist/types.js +1 -0
  85. package/packages/core/dist/constants.d.ts +36 -33
  86. package/packages/core/dist/constants.js +2 -1
  87. package/packages/core/dist/content-detector.d.ts +8 -7
  88. package/packages/core/dist/content-detector.js +2 -1
  89. package/packages/core/dist/errors.d.ts +15 -12
  90. package/packages/core/dist/errors.js +2 -1
  91. package/packages/core/dist/index.d.ts +6 -6
  92. package/packages/core/dist/index.js +1 -1
  93. package/packages/core/dist/logger.d.ts +16 -7
  94. package/packages/core/dist/logger.js +2 -1
  95. package/packages/core/dist/types.d.ts +107 -91
  96. package/packages/core/dist/types.js +2 -0
  97. package/packages/embeddings/dist/embedder.interface.d.ts +22 -19
  98. package/packages/embeddings/dist/embedder.interface.js +1 -0
  99. package/packages/embeddings/dist/index.d.ts +3 -3
  100. package/packages/embeddings/dist/index.js +1 -1
  101. package/packages/embeddings/dist/onnx-embedder.d.ts +21 -22
  102. package/packages/embeddings/dist/onnx-embedder.js +2 -1
  103. package/packages/enterprise-bridge/dist/cache.d.ts +29 -0
  104. package/packages/enterprise-bridge/dist/cache.js +2 -0
  105. package/packages/enterprise-bridge/dist/er-client.d.ts +38 -0
  106. package/packages/enterprise-bridge/dist/er-client.js +2 -0
  107. package/packages/enterprise-bridge/dist/evolution-collector.d.ts +63 -0
  108. package/packages/enterprise-bridge/dist/evolution-collector.js +2 -0
  109. package/packages/enterprise-bridge/dist/index.d.ts +8 -0
  110. package/packages/enterprise-bridge/dist/index.js +1 -0
  111. package/packages/enterprise-bridge/dist/policy-store.d.ts +46 -0
  112. package/packages/enterprise-bridge/dist/policy-store.js +2 -0
  113. package/packages/enterprise-bridge/dist/push-adapter.d.ts +24 -0
  114. package/packages/enterprise-bridge/dist/push-adapter.js +2 -0
  115. package/packages/enterprise-bridge/dist/result-merger.d.ts +15 -0
  116. package/packages/enterprise-bridge/dist/result-merger.js +2 -0
  117. package/packages/enterprise-bridge/dist/types.d.ts +82 -0
  118. package/packages/enterprise-bridge/dist/types.js +2 -0
  119. package/packages/indexer/dist/file-hasher.d.ts +5 -2
  120. package/packages/indexer/dist/file-hasher.js +2 -1
  121. package/packages/indexer/dist/filesystem-crawler.d.ts +23 -20
  122. package/packages/indexer/dist/filesystem-crawler.js +2 -1
  123. package/packages/indexer/dist/graph-extractor.d.ts +9 -12
  124. package/packages/indexer/dist/graph-extractor.js +2 -1
  125. package/packages/indexer/dist/incremental-indexer.d.ts +49 -43
  126. package/packages/indexer/dist/incremental-indexer.js +2 -1
  127. package/packages/indexer/dist/index.d.ts +5 -5
  128. package/packages/indexer/dist/index.js +1 -1
  129. package/packages/server/dist/api.d.ts +3 -8
  130. package/packages/server/dist/api.js +1 -1
  131. package/packages/server/dist/config.d.ts +6 -2
  132. package/packages/server/dist/config.js +2 -1
  133. package/packages/server/dist/curated-manager.d.ts +79 -76
  134. package/packages/server/dist/curated-manager.js +6 -10
  135. package/packages/server/dist/index.d.ts +1 -2
  136. package/packages/server/dist/index.js +2 -1
  137. package/packages/server/dist/replay-interceptor.d.ts +6 -6
  138. package/packages/server/dist/replay-interceptor.js +2 -1
  139. package/packages/server/dist/resources/resources.d.ts +7 -3
  140. package/packages/server/dist/resources/resources.js +3 -2
  141. package/packages/server/dist/server.d.ts +34 -24
  142. package/packages/server/dist/server.js +2 -1
  143. package/packages/server/dist/tools/analyze.tools.d.ts +14 -10
  144. package/packages/server/dist/tools/analyze.tools.js +2 -3
  145. package/packages/server/dist/tools/audit.tool.d.ts +8 -4
  146. package/packages/server/dist/tools/audit.tool.js +2 -4
  147. package/packages/server/dist/tools/bridge.tools.d.ts +35 -0
  148. package/packages/server/dist/tools/bridge.tools.js +16 -0
  149. package/packages/server/dist/tools/evolution.tools.d.ts +8 -0
  150. package/packages/server/dist/tools/evolution.tools.js +6 -0
  151. package/packages/server/dist/tools/forge.tools.d.ts +13 -11
  152. package/packages/server/dist/tools/forge.tools.js +11 -13
  153. package/packages/server/dist/tools/forget.tool.d.ts +7 -3
  154. package/packages/server/dist/tools/forget.tool.js +2 -7
  155. package/packages/server/dist/tools/graph.tool.d.ts +7 -3
  156. package/packages/server/dist/tools/graph.tool.js +5 -5
  157. package/packages/server/dist/tools/list.tool.d.ts +7 -3
  158. package/packages/server/dist/tools/list.tool.js +3 -8
  159. package/packages/server/dist/tools/lookup.tool.d.ts +7 -3
  160. package/packages/server/dist/tools/lookup.tool.js +3 -9
  161. package/packages/server/dist/tools/onboard.tool.d.ts +8 -4
  162. package/packages/server/dist/tools/onboard.tool.js +3 -2
  163. package/packages/server/dist/tools/policy.tools.d.ts +8 -0
  164. package/packages/server/dist/tools/policy.tools.js +3 -0
  165. package/packages/server/dist/tools/produce.tool.d.ts +6 -2
  166. package/packages/server/dist/tools/produce.tool.js +3 -2
  167. package/packages/server/dist/tools/read.tool.d.ts +7 -3
  168. package/packages/server/dist/tools/read.tool.js +3 -6
  169. package/packages/server/dist/tools/reindex.tool.d.ts +10 -6
  170. package/packages/server/dist/tools/reindex.tool.js +3 -2
  171. package/packages/server/dist/tools/remember.tool.d.ts +8 -3
  172. package/packages/server/dist/tools/remember.tool.js +4 -5
  173. package/packages/server/dist/tools/replay.tool.d.ts +6 -2
  174. package/packages/server/dist/tools/replay.tool.js +3 -6
  175. package/packages/server/dist/tools/search.tool.d.ts +10 -4
  176. package/packages/server/dist/tools/search.tool.js +7 -22
  177. package/packages/server/dist/tools/status.tool.d.ts +7 -3
  178. package/packages/server/dist/tools/status.tool.js +3 -3
  179. package/packages/server/dist/tools/toolkit.tools.d.ts +36 -34
  180. package/packages/server/dist/tools/toolkit.tools.js +20 -24
  181. package/packages/server/dist/tools/update.tool.d.ts +7 -3
  182. package/packages/server/dist/tools/update.tool.js +2 -6
  183. package/packages/server/dist/tools/utility.tools.d.ts +15 -14
  184. package/packages/server/dist/tools/utility.tools.js +11 -23
  185. package/packages/server/dist/version-check.d.ts +5 -1
  186. package/packages/server/dist/version-check.js +2 -1
  187. package/packages/store/dist/graph-store.interface.d.ts +89 -86
  188. package/packages/store/dist/graph-store.interface.js +1 -0
  189. package/packages/store/dist/index.d.ts +6 -6
  190. package/packages/store/dist/index.js +1 -1
  191. package/packages/store/dist/lance-store.d.ts +37 -30
  192. package/packages/store/dist/lance-store.js +2 -1
  193. package/packages/store/dist/sqlite-graph-store.d.ts +43 -46
  194. package/packages/store/dist/sqlite-graph-store.js +14 -13
  195. package/packages/store/dist/store-factory.d.ts +11 -7
  196. package/packages/store/dist/store-factory.js +2 -1
  197. package/packages/store/dist/store.interface.d.ts +47 -46
  198. package/packages/store/dist/store.interface.js +1 -0
  199. package/packages/tools/dist/audit.d.ts +61 -61
  200. package/packages/tools/dist/audit.js +5 -5
  201. package/packages/tools/dist/batch.d.ts +20 -17
  202. package/packages/tools/dist/batch.js +2 -1
  203. package/packages/tools/dist/changelog.d.ts +29 -26
  204. package/packages/tools/dist/changelog.js +3 -2
  205. package/packages/tools/dist/check.d.ts +42 -38
  206. package/packages/tools/dist/check.js +3 -2
  207. package/packages/tools/dist/checkpoint.d.ts +17 -14
  208. package/packages/tools/dist/checkpoint.js +2 -2
  209. package/packages/tools/dist/codemod.d.ts +35 -32
  210. package/packages/tools/dist/codemod.js +3 -2
  211. package/packages/tools/dist/compact.d.ts +34 -37
  212. package/packages/tools/dist/compact.js +3 -2
  213. package/packages/tools/dist/data-transform.d.ts +10 -7
  214. package/packages/tools/dist/data-transform.js +2 -1
  215. package/packages/tools/dist/dead-symbols.d.ts +29 -25
  216. package/packages/tools/dist/dead-symbols.js +3 -2
  217. package/packages/tools/dist/delegate.d.ts +26 -23
  218. package/packages/tools/dist/delegate.js +2 -5
  219. package/packages/tools/dist/diff-parse.d.ts +24 -21
  220. package/packages/tools/dist/diff-parse.js +4 -3
  221. package/packages/tools/dist/digest.d.ts +43 -45
  222. package/packages/tools/dist/digest.js +5 -5
  223. package/packages/tools/dist/encode.d.ts +11 -8
  224. package/packages/tools/dist/encode.js +2 -1
  225. package/packages/tools/dist/env-info.d.ts +25 -22
  226. package/packages/tools/dist/env-info.js +2 -1
  227. package/packages/tools/dist/eval.d.ts +13 -10
  228. package/packages/tools/dist/eval.js +3 -3
  229. package/packages/tools/dist/evidence-map.d.ts +64 -61
  230. package/packages/tools/dist/evidence-map.js +3 -3
  231. package/packages/tools/dist/file-cache.d.ts +42 -0
  232. package/packages/tools/dist/file-cache.js +4 -0
  233. package/packages/tools/dist/file-summary.d.ts +34 -29
  234. package/packages/tools/dist/file-summary.js +3 -2
  235. package/packages/tools/dist/file-walk.d.ts +6 -3
  236. package/packages/tools/dist/file-walk.js +2 -1
  237. package/packages/tools/dist/find-examples.d.ts +26 -21
  238. package/packages/tools/dist/find-examples.js +4 -3
  239. package/packages/tools/dist/find.d.ts +39 -40
  240. package/packages/tools/dist/find.js +2 -1
  241. package/packages/tools/dist/forge-classify.d.ts +35 -38
  242. package/packages/tools/dist/forge-classify.js +3 -2
  243. package/packages/tools/dist/forge-ground.d.ts +58 -60
  244. package/packages/tools/dist/forge-ground.js +2 -1
  245. package/packages/tools/dist/git-context.d.ts +22 -19
  246. package/packages/tools/dist/git-context.js +4 -3
  247. package/packages/tools/dist/graph-query.d.ts +75 -78
  248. package/packages/tools/dist/graph-query.js +2 -1
  249. package/packages/tools/dist/guide.d.ts +14 -11
  250. package/packages/tools/dist/guide.js +2 -1
  251. package/packages/tools/dist/health.d.ts +13 -10
  252. package/packages/tools/dist/health.js +3 -2
  253. package/packages/tools/dist/http-request.d.ts +20 -17
  254. package/packages/tools/dist/http-request.js +2 -1
  255. package/packages/tools/dist/index.d.ts +54 -53
  256. package/packages/tools/dist/index.js +1 -1
  257. package/packages/tools/dist/lane.d.ts +28 -25
  258. package/packages/tools/dist/lane.js +7 -7
  259. package/packages/tools/dist/measure.d.ts +32 -29
  260. package/packages/tools/dist/measure.js +3 -2
  261. package/packages/tools/dist/onboard.d.ts +29 -26
  262. package/packages/tools/dist/onboard.js +18 -41
  263. package/packages/tools/dist/parse-output.d.ts +48 -45
  264. package/packages/tools/dist/parse-output.js +3 -2
  265. package/packages/tools/dist/path-resolver.d.ts +4 -1
  266. package/packages/tools/dist/path-resolver.js +2 -1
  267. package/packages/tools/dist/process-manager.d.ts +18 -15
  268. package/packages/tools/dist/process-manager.js +2 -1
  269. package/packages/tools/dist/queue.d.ts +28 -25
  270. package/packages/tools/dist/queue.js +2 -2
  271. package/packages/tools/dist/regex-test.d.ts +26 -23
  272. package/packages/tools/dist/regex-test.js +2 -1
  273. package/packages/tools/dist/rename.d.ts +28 -25
  274. package/packages/tools/dist/rename.js +3 -2
  275. package/packages/tools/dist/replay.d.ts +32 -29
  276. package/packages/tools/dist/replay.js +5 -6
  277. package/packages/tools/dist/response-envelope.d.ts +32 -29
  278. package/packages/tools/dist/response-envelope.js +2 -1
  279. package/packages/tools/dist/schema-validate.d.ts +15 -12
  280. package/packages/tools/dist/schema-validate.js +2 -1
  281. package/packages/tools/dist/scope-map.d.ts +45 -47
  282. package/packages/tools/dist/scope-map.js +2 -1
  283. package/packages/tools/dist/snippet.d.ts +26 -24
  284. package/packages/tools/dist/snippet.js +2 -1
  285. package/packages/tools/dist/stash.d.ts +13 -10
  286. package/packages/tools/dist/stash.js +2 -2
  287. package/packages/tools/dist/stratum-card.d.ts +27 -27
  288. package/packages/tools/dist/stratum-card.js +4 -5
  289. package/packages/tools/dist/symbol.d.ts +29 -25
  290. package/packages/tools/dist/symbol.js +4 -3
  291. package/packages/tools/dist/test-run.d.ts +19 -15
  292. package/packages/tools/dist/test-run.js +3 -2
  293. package/packages/tools/dist/text-utils.d.ts +6 -3
  294. package/packages/tools/dist/text-utils.js +3 -2
  295. package/packages/tools/dist/time-utils.d.ts +15 -12
  296. package/packages/tools/dist/time-utils.js +2 -1
  297. package/packages/tools/dist/trace.d.ts +24 -20
  298. package/packages/tools/dist/trace.js +3 -2
  299. package/packages/tools/dist/truncation.d.ts +6 -3
  300. package/packages/tools/dist/truncation.js +8 -14
  301. package/packages/tools/dist/watch.d.ts +28 -25
  302. package/packages/tools/dist/watch.js +2 -1
  303. package/packages/tools/dist/web-fetch.d.ts +35 -32
  304. package/packages/tools/dist/web-fetch.js +7 -12
  305. package/packages/tools/dist/web-search.d.ts +16 -13
  306. package/packages/tools/dist/web-search.js +2 -1
  307. package/packages/tools/dist/workset.d.ts +19 -16
  308. package/packages/tools/dist/workset.js +2 -2
  309. package/packages/tui/dist/App-BAlmxCCw.js +3 -0
  310. package/packages/tui/dist/App.d.ts +11 -5
  311. package/packages/tui/dist/App.js +1 -450
  312. package/packages/tui/dist/CuratedPanel-sYdZAICX.js +3 -0
  313. package/packages/tui/dist/LogPanel-DVB8Sv46.js +4 -0
  314. package/packages/tui/dist/SearchPanel-DREo6zgt.js +3 -0
  315. package/packages/tui/dist/StatusPanel-2ex8fLOO.js +3 -0
  316. package/packages/tui/dist/chunk-D6axbAb-.js +2 -0
  317. package/packages/tui/dist/devtools-DUyj952l.js +8 -0
  318. package/packages/tui/dist/embedder.interface-D4ew0HPW.d.ts +29 -0
  319. package/packages/tui/dist/index-B9VpfVPP.d.ts +14 -0
  320. package/packages/tui/dist/index.d.ts +3 -19
  321. package/packages/tui/dist/index.js +2 -476
  322. package/packages/tui/dist/jsx-runtime-Cof-kwFn.js +317 -0
  323. package/packages/tui/dist/panels/CuratedPanel.d.ts +11 -5
  324. package/packages/tui/dist/panels/CuratedPanel.js +1 -371
  325. package/packages/tui/dist/panels/LogPanel.d.ts +7 -2
  326. package/packages/tui/dist/panels/LogPanel.js +1 -449
  327. package/packages/tui/dist/panels/SearchPanel.d.ts +14 -7
  328. package/packages/tui/dist/panels/SearchPanel.js +1 -372
  329. package/packages/tui/dist/panels/StatusPanel.d.ts +11 -5
  330. package/packages/tui/dist/panels/StatusPanel.js +1 -371
  331. package/packages/tui/dist/store.interface-CnY6SPOH.d.ts +151 -0
  332. package/scaffold/adapters/claude-code.mjs +20 -0
  333. package/scaffold/adapters/copilot.mjs +320 -0
  334. package/scaffold/copilot/agents/Architect-Reviewer-Alpha.agent.md +14 -0
  335. package/scaffold/copilot/agents/Architect-Reviewer-Beta.agent.md +14 -0
  336. package/scaffold/copilot/agents/Code-Reviewer-Alpha.agent.md +12 -0
  337. package/scaffold/copilot/agents/Code-Reviewer-Beta.agent.md +12 -0
  338. package/scaffold/copilot/agents/Debugger.agent.md +31 -0
  339. package/scaffold/copilot/agents/Documenter.agent.md +35 -0
  340. package/scaffold/copilot/agents/Explorer.agent.md +50 -0
  341. package/scaffold/copilot/agents/Frontend.agent.md +29 -0
  342. package/scaffold/copilot/agents/Implementer.agent.md +31 -0
  343. package/scaffold/copilot/agents/Orchestrator.agent.md +96 -0
  344. package/scaffold/copilot/agents/Planner.agent.md +45 -0
  345. package/scaffold/copilot/agents/README.md +57 -0
  346. package/scaffold/copilot/agents/Refactor.agent.md +30 -0
  347. package/scaffold/copilot/agents/Researcher-Alpha.agent.md +12 -0
  348. package/scaffold/copilot/agents/Researcher-Beta.agent.md +12 -0
  349. package/scaffold/copilot/agents/Researcher-Delta.agent.md +12 -0
  350. package/scaffold/copilot/agents/Researcher-Gamma.agent.md +12 -0
  351. package/scaffold/copilot/agents/Security.agent.md +42 -0
  352. package/scaffold/copilot/agents/_shared/adr-protocol.md +91 -0
  353. package/scaffold/copilot/agents/_shared/architect-reviewer-base.md +50 -0
  354. package/scaffold/copilot/agents/_shared/code-agent-base.md +70 -0
  355. package/scaffold/copilot/agents/_shared/code-reviewer-base.md +54 -0
  356. package/scaffold/copilot/agents/_shared/decision-protocol.md +27 -0
  357. package/scaffold/copilot/agents/_shared/forge-protocol.md +46 -0
  358. package/scaffold/copilot/agents/_shared/researcher-base.md +61 -0
  359. package/scaffold/copilot/agents/templates/adr-template.md +27 -0
  360. package/scaffold/copilot/agents/templates/execution-state.md +25 -0
  361. package/scaffold/copilot/prompts/ask.prompt.md +20 -0
  362. package/scaffold/copilot/prompts/debug.prompt.md +25 -0
  363. package/scaffold/copilot/prompts/design.prompt.md +22 -0
  364. package/scaffold/copilot/prompts/implement.prompt.md +26 -0
  365. package/scaffold/copilot/prompts/plan.prompt.md +24 -0
  366. package/scaffold/copilot/prompts/review.prompt.md +31 -0
  367. package/scaffold/definitions/agents.mjs +165 -0
  368. package/scaffold/definitions/bodies.mjs +292 -0
  369. package/scaffold/definitions/hooks.mjs +43 -0
  370. package/scaffold/definitions/models.mjs +56 -0
  371. package/scaffold/definitions/plugins.mjs +24 -0
  372. package/scaffold/definitions/prompts.mjs +145 -0
  373. package/scaffold/definitions/protocols.mjs +322 -0
  374. package/scaffold/definitions/tools.mjs +176 -0
  375. package/scaffold/generate.mjs +74 -0
  376. package/skills/brainstorming/SKILL.md +259 -0
  377. package/skills/brainstorming/scripts/frame-template.html +365 -0
  378. package/skills/brainstorming/scripts/helper.js +216 -0
  379. package/skills/brainstorming/scripts/server.cjs +9 -0
  380. package/skills/brainstorming/scripts/server.src.cjs +249 -0
  381. package/skills/brainstorming/spec-document-reviewer-prompt.md +49 -0
  382. package/skills/brainstorming/visual-companion.md +430 -0
  383. package/skills/knowledge-base/SKILL.md +22 -9
@@ -1,89 +1,86 @@
1
- /**
2
- * kb_graph — Knowledge graph query tools.
3
- *
4
- * Query, traverse, and manage the entity-relationship knowledge graph.
5
- * The graph complements vector search with structural reasoning:
6
- * vector search finds similar content, graph traversal finds connected concepts.
7
- */
8
- import type { GraphEdge, GraphNode, GraphStats, GraphTraversalResult, IGraphStore } from '@kb/store';
9
- export interface GraphQueryOptions {
10
- /** Action: query nodes, traverse from a node, get stats, or add data */
11
- action: 'find_nodes' | 'find_edges' | 'neighbors' | 'traverse' | 'stats' | 'add' | 'delete' | 'clear';
12
- /** Node type filter (for find_nodes) */
13
- nodeType?: string;
14
- /** Name pattern (LIKE %pattern%) for find_nodes */
15
- namePattern?: string;
16
- /** Source path filter */
1
+ import { GraphEdge, GraphNode, GraphStats, GraphTraversalResult, IGraphStore } from "@kb/store";
2
+
3
+ //#region packages/tools/src/graph-query.d.ts
4
+ interface GraphQueryOptions {
5
+ /** Action: query nodes, traverse from a node, get stats, or add data */
6
+ action: 'find_nodes' | 'find_edges' | 'neighbors' | 'traverse' | 'stats' | 'add' | 'delete' | 'clear';
7
+ /** Node type filter (for find_nodes) */
8
+ nodeType?: string;
9
+ /** Name pattern (LIKE %pattern%) for find_nodes */
10
+ namePattern?: string;
11
+ /** Source path filter */
12
+ sourcePath?: string;
13
+ /** Node ID for neighbors/traverse/delete */
14
+ nodeId?: string;
15
+ /** Edge type filter */
16
+ edgeType?: string;
17
+ /** From node ID (for find_edges) */
18
+ fromId?: string;
19
+ /** To node ID (for find_edges) */
20
+ toId?: string;
21
+ /** Traversal direction */
22
+ direction?: 'outgoing' | 'incoming' | 'both';
23
+ /** Max traversal depth (default: 2) */
24
+ maxDepth?: number;
25
+ /** Max results (default: 50) */
26
+ limit?: number;
27
+ /** Nodes to add (for action=add) */
28
+ nodes?: Array<{
29
+ id?: string;
30
+ type: string;
31
+ name: string;
32
+ properties?: Record<string, unknown>;
33
+ sourceRecordId?: string;
17
34
  sourcePath?: string;
18
- /** Node ID for neighbors/traverse/delete */
19
- nodeId?: string;
20
- /** Edge type filter */
21
- edgeType?: string;
22
- /** From node ID (for find_edges) */
23
- fromId?: string;
24
- /** To node ID (for find_edges) */
25
- toId?: string;
26
- /** Traversal direction */
27
- direction?: 'outgoing' | 'incoming' | 'both';
28
- /** Max traversal depth (default: 2) */
29
- maxDepth?: number;
30
- /** Max results (default: 50) */
31
- limit?: number;
32
- /** Nodes to add (for action=add) */
33
- nodes?: Array<{
34
- id?: string;
35
- type: string;
36
- name: string;
37
- properties?: Record<string, unknown>;
38
- sourceRecordId?: string;
39
- sourcePath?: string;
40
- }>;
41
- /** Edges to add (for action=add) */
42
- edges?: Array<{
43
- id?: string;
44
- fromId: string;
45
- toId: string;
46
- type: string;
47
- weight?: number;
48
- properties?: Record<string, unknown>;
49
- }>;
35
+ }>;
36
+ /** Edges to add (for action=add) */
37
+ edges?: Array<{
38
+ id?: string;
39
+ fromId: string;
40
+ toId: string;
41
+ type: string;
42
+ weight?: number;
43
+ properties?: Record<string, unknown>;
44
+ }>;
50
45
  }
51
- export interface GraphQueryResult {
52
- action: string;
53
- nodes?: GraphNode[];
54
- edges?: GraphEdge[];
55
- stats?: GraphStats;
56
- nodesAdded?: number;
57
- edgesAdded?: number;
58
- deleted?: number;
59
- summary: string;
46
+ interface GraphQueryResult {
47
+ action: string;
48
+ nodes?: GraphNode[];
49
+ edges?: GraphEdge[];
50
+ stats?: GraphStats;
51
+ nodesAdded?: number;
52
+ edgesAdded?: number;
53
+ deleted?: number;
54
+ summary: string;
60
55
  }
61
- export declare function graphQuery(graphStore: IGraphStore, options: GraphQueryOptions): Promise<GraphQueryResult>;
62
- export interface GraphAugmentOptions {
63
- /** Max graph hops from each vector hit (default: 1) */
64
- hops?: number;
65
- /** Edge type filter for graph expansion */
66
- edgeType?: string;
67
- /** Max graph nodes per vector hit (default: 5) */
68
- maxPerHit?: number;
56
+ declare function graphQuery(graphStore: IGraphStore, options: GraphQueryOptions): Promise<GraphQueryResult>;
57
+ interface GraphAugmentOptions {
58
+ /** Max graph hops from each vector hit (default: 1) */
59
+ hops?: number;
60
+ /** Edge type filter for graph expansion */
61
+ edgeType?: string;
62
+ /** Max graph nodes per vector hit (default: 5) */
63
+ maxPerHit?: number;
69
64
  }
70
- export interface GraphAugmentedResult {
71
- /** Original search result record ID */
72
- recordId: string;
73
- /** Original similarity score */
74
- score: number;
75
- /** Source path of the matched record */
76
- sourcePath: string;
77
- /** Graph nodes connected to this record (via sourceRecordId) */
78
- graphContext: GraphTraversalResult;
65
+ interface GraphAugmentedResult {
66
+ /** Original search result record ID */
67
+ recordId: string;
68
+ /** Original similarity score */
69
+ score: number;
70
+ /** Source path of the matched record */
71
+ sourcePath: string;
72
+ /** Graph nodes connected to this record (via sourceRecordId) */
73
+ graphContext: GraphTraversalResult;
79
74
  }
80
75
  /**
81
76
  * Augment vector search results with graph context.
82
77
  * For each search hit, finds linked graph nodes and traverses their connections.
83
78
  */
84
- export declare function graphAugmentSearch(graphStore: IGraphStore, hits: Array<{
85
- recordId: string;
86
- score: number;
87
- sourcePath: string;
79
+ declare function graphAugmentSearch(graphStore: IGraphStore, hits: Array<{
80
+ recordId: string;
81
+ score: number;
82
+ sourcePath: string;
88
83
  }>, options?: GraphAugmentOptions): Promise<GraphAugmentedResult[]>;
84
+ //#endregion
85
+ export { GraphAugmentOptions, GraphAugmentedResult, GraphQueryOptions, GraphQueryResult, graphAugmentSearch, graphQuery };
89
86
  //# sourceMappingURL=graph-query.d.ts.map
@@ -1 +1,2 @@
1
- import{createHash as p}from"node:crypto";function l(s,...e){return`${s}_${p("sha256").update(e.join("|")).digest("hex").slice(0,12)}`}async function I(s,e){const{action:t}=e;switch(t){case"find_nodes":{const r=await s.findNodes({type:e.nodeType,namePattern:e.namePattern,sourcePath:e.sourcePath,limit:e.limit});return{action:t,nodes:r,summary:`Found ${r.length} node(s)${e.nodeType?` of type "${e.nodeType}"`:""}${e.namePattern?` matching "${e.namePattern}"`:""}`}}case"find_edges":{const r=await s.findEdges({type:e.edgeType,fromId:e.fromId,toId:e.toId,limit:e.limit});return{action:t,edges:r,summary:`Found ${r.length} edge(s)${e.edgeType?` of type "${e.edgeType}"`:""}`}}case"neighbors":{if(!e.nodeId)return{action:t,summary:"Error: nodeId is required for neighbors action"};const r=await s.getNeighbors(e.nodeId,{edgeType:e.edgeType,direction:e.direction,limit:e.limit});return{action:t,nodes:r.nodes,edges:r.edges,summary:`Found ${r.nodes.length} neighbor(s) and ${r.edges.length} edge(s) for node "${e.nodeId}"`}}case"traverse":{if(!e.nodeId)return{action:t,summary:"Error: nodeId is required for traverse action"};const r=await s.traverse(e.nodeId,{edgeType:e.edgeType,maxDepth:e.maxDepth,direction:e.direction,limit:e.limit});return{action:t,nodes:r.nodes,edges:r.edges,summary:`Traversed ${r.nodes.length} node(s) and ${r.edges.length} edge(s) from "${e.nodeId}" (depth=${e.maxDepth??2})`}}case"stats":{const r=await s.getStats();return{action:t,stats:r,summary:`Graph: ${r.nodeCount} nodes, ${r.edgeCount} edges. Types: ${Object.entries(r.nodeTypes).map(([a,n])=>`${a}(${n})`).join(", ")||"none"}`}}case"add":{let r=0,a=0;if(e.nodes&&e.nodes.length>0){const n=e.nodes.map(d=>({id:d.id??l("node",d.type,d.name),type:d.type,name:d.name,properties:d.properties??{},sourceRecordId:d.sourceRecordId,sourcePath:d.sourcePath,createdAt:new Date().toISOString()}));await s.upsertNodes(n),r=n.length}if(e.edges&&e.edges.length>0){const n=e.edges.map(d=>({id:d.id??l("edge",d.fromId,d.toId,d.type),fromId:d.fromId,toId:d.toId,type:d.type,weight:d.weight,properties:d.properties}));await s.upsertEdges(n),a=n.length}return{action:t,nodesAdded:r,edgesAdded:a,summary:`Added ${r} node(s) and ${a} edge(s) to the graph`}}case"delete":{if(e.nodeId)return await s.deleteNode(e.nodeId),{action:t,deleted:1,summary:`Deleted node "${e.nodeId}" and its edges`};if(e.sourcePath){const r=await s.deleteBySourcePath(e.sourcePath);return{action:t,deleted:r,summary:`Deleted ${r} node(s) from source "${e.sourcePath}"`}}return{action:t,summary:"Error: nodeId or sourcePath required for delete action"}}case"clear":{const r=await s.getStats();return await s.clear(),{action:t,deleted:r.nodeCount,summary:`Cleared graph: removed ${r.nodeCount} node(s) and ${r.edgeCount} edge(s)`}}default:return{action:t,summary:`Unknown action: ${t}`}}}async function $(s,e,t){const r=t?.hops??1,a=t?.maxPerHit??5,n=[];for(const d of e)try{const y=await s.findNodes({sourcePath:d.sourcePath}),u=[],c=[],i=new Set,m=new Set;for(const g of y.slice(0,a))if(!i.has(g.id)&&(i.add(g.id),u.push(g),r>0)){const h=await s.traverse(g.id,{maxDepth:r,edgeType:t?.edgeType,limit:a});for(const o of h.nodes)i.has(o.id)||(i.add(o.id),u.push(o));for(const o of h.edges)m.has(o.id)||(m.add(o.id),c.push(o))}n.push({recordId:d.recordId,score:d.score,sourcePath:d.sourcePath,graphContext:{nodes:u,edges:c}})}catch{n.push({recordId:d.recordId,score:d.score,sourcePath:d.sourcePath,graphContext:{nodes:[],edges:[]}})}return n}export{$ as graphAugmentSearch,I as graphQuery};
1
+ import{createHash as e}from"node:crypto";function t(t,...n){return`${t}_${e(`sha256`).update(n.join(`|`)).digest(`hex`).slice(0,12)}`}async function n(e,n){let{action:r}=n;switch(r){case`find_nodes`:{let t=await e.findNodes({type:n.nodeType,namePattern:n.namePattern,sourcePath:n.sourcePath,limit:n.limit});return{action:r,nodes:t,summary:`Found ${t.length} node(s)${n.nodeType?` of type "${n.nodeType}"`:``}${n.namePattern?` matching "${n.namePattern}"`:``}`}}case`find_edges`:{let t=await e.findEdges({type:n.edgeType,fromId:n.fromId,toId:n.toId,limit:n.limit});return{action:r,edges:t,summary:`Found ${t.length} edge(s)${n.edgeType?` of type "${n.edgeType}"`:``}`}}case`neighbors`:{if(!n.nodeId)return{action:r,summary:`Error: nodeId is required for neighbors action`};let t=await e.getNeighbors(n.nodeId,{edgeType:n.edgeType,direction:n.direction,limit:n.limit});return{action:r,nodes:t.nodes,edges:t.edges,summary:`Found ${t.nodes.length} neighbor(s) and ${t.edges.length} edge(s) for node "${n.nodeId}"`}}case`traverse`:{if(!n.nodeId)return{action:r,summary:`Error: nodeId is required for traverse action`};let t=await e.traverse(n.nodeId,{edgeType:n.edgeType,maxDepth:n.maxDepth,direction:n.direction,limit:n.limit});return{action:r,nodes:t.nodes,edges:t.edges,summary:`Traversed ${t.nodes.length} node(s) and ${t.edges.length} edge(s) from "${n.nodeId}" (depth=${n.maxDepth??2})`}}case`stats`:{let t=await e.getStats();return{action:r,stats:t,summary:`Graph: ${t.nodeCount} nodes, ${t.edgeCount} edges. Types: ${Object.entries(t.nodeTypes).map(([e,t])=>`${e}(${t})`).join(`, `)||`none`}`}}case`add`:{let i=0,a=0;if(n.nodes&&n.nodes.length>0){let r=n.nodes.map(e=>({id:e.id??t(`node`,e.type,e.name),type:e.type,name:e.name,properties:e.properties??{},sourceRecordId:e.sourceRecordId,sourcePath:e.sourcePath,createdAt:new Date().toISOString()}));await e.upsertNodes(r),i=r.length}if(n.edges&&n.edges.length>0){let r=n.edges.map(e=>({id:e.id??t(`edge`,e.fromId,e.toId,e.type),fromId:e.fromId,toId:e.toId,type:e.type,weight:e.weight,properties:e.properties}));await e.upsertEdges(r),a=r.length}return{action:r,nodesAdded:i,edgesAdded:a,summary:`Added ${i} node(s) and ${a} edge(s) to the graph`}}case`delete`:if(n.nodeId)return await e.deleteNode(n.nodeId),{action:r,deleted:1,summary:`Deleted node "${n.nodeId}" and its edges`};if(n.sourcePath){let t=await e.deleteBySourcePath(n.sourcePath);return{action:r,deleted:t,summary:`Deleted ${t} node(s) from source "${n.sourcePath}"`}}return{action:r,summary:`Error: nodeId or sourcePath required for delete action`};case`clear`:{let t=await e.getStats();return await e.clear(),{action:r,deleted:t.nodeCount,summary:`Cleared graph: removed ${t.nodeCount} node(s) and ${t.edgeCount} edge(s)`}}default:return{action:r,summary:`Unknown action: ${r}`}}}async function r(e,t,n){let r=n?.hops??1,i=n?.maxPerHit??5,a=[];for(let o of t)try{let t=await e.findNodes({sourcePath:o.sourcePath}),s=[],c=[],l=new Set,u=new Set;for(let a of t.slice(0,i))if(!l.has(a.id)&&(l.add(a.id),s.push(a),r>0)){let t=await e.traverse(a.id,{maxDepth:r,edgeType:n?.edgeType,limit:i});for(let e of t.nodes)l.has(e.id)||(l.add(e.id),s.push(e));for(let e of t.edges)u.has(e.id)||(u.add(e.id),c.push(e))}a.push({recordId:o.recordId,score:o.score,sourcePath:o.sourcePath,graphContext:{nodes:s,edges:c}})}catch{a.push({recordId:o.recordId,score:o.score,sourcePath:o.sourcePath,graphContext:{nodes:[],edges:[]}})}return a}export{r as graphAugmentSearch,n as graphQuery};
2
+ //# sourceMappingURL=graph-query.js.map
@@ -1,23 +1,26 @@
1
+ //#region packages/tools/src/guide.d.ts
1
2
  /**
2
3
  * Tool discovery — recommends MCP tools and workflows for a given goal.
3
4
  *
4
5
  * Uses keyword matching against predefined workflow templates.
5
6
  * No embeddings required — pure string matching for instant results.
6
7
  */
7
- export interface GuideRecommendation {
8
- tool: string;
9
- reason: string;
10
- order: number;
11
- suggestedArgs?: Record<string, unknown>;
8
+ interface GuideRecommendation {
9
+ tool: string;
10
+ reason: string;
11
+ order: number;
12
+ suggestedArgs?: Record<string, unknown>;
12
13
  }
13
- export interface GuideResult {
14
- workflow: string;
15
- description: string;
16
- tools: GuideRecommendation[];
17
- alternativeWorkflows: string[];
14
+ interface GuideResult {
15
+ workflow: string;
16
+ description: string;
17
+ tools: GuideRecommendation[];
18
+ alternativeWorkflows: string[];
18
19
  }
19
20
  /**
20
21
  * Match a goal description to the best workflow and return tool recommendations.
21
22
  */
22
- export declare function guide(goal: string, maxRecommendations?: number): GuideResult;
23
+ declare function guide(goal: string, maxRecommendations?: number): GuideResult;
24
+ //#endregion
25
+ export { GuideRecommendation, GuideResult, guide };
23
26
  //# sourceMappingURL=guide.d.ts.map
@@ -1 +1,2 @@
1
- const t=[{name:"onboard",description:"First-time codebase exploration and understanding",keywords:["onboard","new project","understand","explore","first time","getting started","learn","overview"],tools:[{tool:"status",reason:"Check index health and record count",order:1},{tool:"onboard",reason:"Run all analysis tools in one command",order:2,suggestedArgs:{path:"."}},{tool:"search",reason:"Find specific topics of interest",order:3},{tool:"graph",reason:"Explore module relationships",order:4,suggestedArgs:{action:"stats"}}]},{name:"audit",description:"Assess project health, quality, and structure",keywords:["audit","health","quality","assess","review project","check quality","code quality","tech debt"],tools:[{tool:"status",reason:"Check index freshness",order:1},{tool:"audit",reason:"Unified audit report with score and recommendations",order:2,suggestedArgs:{detail:"summary"}},{tool:"check",reason:"Typecheck + lint validation",order:3},{tool:"health",reason:"Detailed health checks on package.json, tsconfig, etc.",order:4}]},{name:"bugfix",description:"Diagnose and fix a bug or failing test",keywords:["bug","fix","debug","error","failing","broken","crash","wrong","issue","problem","not working"],tools:[{tool:"parse_output",reason:"Parse error output from build tools (tsc, vitest, biome)",order:1},{tool:"symbol",reason:"Find definition and all references of the failing symbol",order:2},{tool:"trace",reason:"Trace call chain backward from the failure point",order:3,suggestedArgs:{direction:"backward"}},{tool:"search",reason:"Search for related patterns or similar fixes",order:4},{tool:"test_run",reason:"Re-run tests after fix",order:5}]},{name:"implement",description:"Add a new feature or implement a change",keywords:["implement","add feature","new feature","build","create","add","develop","write code"],tools:[{tool:"scope_map",reason:"Generate a reading plan for affected files",order:1},{tool:"search",reason:"Find related patterns and prior art",order:2},{tool:"find",reason:"Find usage examples of similar patterns",order:3,suggestedArgs:{mode:"examples"}},{tool:"check",reason:"Validate after implementation",order:4},{tool:"test_run",reason:"Run tests to verify",order:5},{tool:"blast_radius",reason:"Check impact of changes",order:6}]},{name:"refactor",description:"Restructure or clean up existing code",keywords:["refactor","restructure","clean up","reorganize","rename","move","extract","DRY","dead code"],tools:[{tool:"dead_symbols",reason:"Find unused exports to remove",order:1},{tool:"symbol",reason:"Find all references before renaming",order:2},{tool:"blast_radius",reason:"Assess impact before making changes",order:3},{tool:"rename",reason:"Safe cross-file rename",order:4},{tool:"check",reason:"Validate after refactoring",order:5},{tool:"test_run",reason:"Ensure no regressions",order:6}]},{name:"search",description:"Find specific code, patterns, or information",keywords:["find","search","where","locate","look for","grep","which file","how does"],tools:[{tool:"search",reason:"Hybrid semantic + keyword search",order:1},{tool:"find",reason:"Federated search with glob and regex",order:2},{tool:"symbol",reason:"Resolve a specific symbol definition and references",order:3},{tool:"graph",reason:"Explore entity relationships",order:4,suggestedArgs:{action:"neighbors"}}]},{name:"context",description:"Compress or manage context for efficient LLM interaction",keywords:["context","compress","summarize","too long","token","budget","reduce","compact"],tools:[{tool:"file_summary",reason:"Quick structural overview without reading full file",order:1},{tool:"compact",reason:"Compress file to relevant sections",order:2,suggestedArgs:{segmentation:"paragraph"}},{tool:"digest",reason:"Compress multiple sources into budgeted summary",order:3},{tool:"stratum_card",reason:"Generate reusable context cards",order:4}]},{name:"memory",description:"Manage persistent knowledge across sessions",keywords:["memory","remember","persist","save","recall","decision","convention","session","checkpoint"],tools:[{tool:"list",reason:"See all stored knowledge entries",order:1},{tool:"search",reason:"Search curated knowledge",order:2,suggestedArgs:{origin:"curated"}},{tool:"remember",reason:"Store a new decision or pattern",order:3},{tool:"checkpoint",reason:"Save/restore session progress",order:4},{tool:"stash",reason:"Temporary key-value storage within session",order:5}]},{name:"validate",description:"Run checks, tests, and validation",keywords:["validate","check","test","lint","typecheck","verify","CI","pass","run tests"],tools:[{tool:"check",reason:"Typecheck + lint in one call",order:1,suggestedArgs:{detail:"errors"}},{tool:"test_run",reason:"Run tests with structured output",order:2},{tool:"health",reason:"Project health assessment",order:3}]},{name:"analyze",description:"Deep analysis of codebase structure, dependencies, or patterns",keywords:["analyze","dependency","structure","pattern","architecture","diagram","entry point","import"],tools:[{tool:"analyze_structure",reason:"Project structure overview",order:1},{tool:"analyze_dependencies",reason:"Dependency graph and analysis",order:2},{tool:"analyze_patterns",reason:"Detect code patterns and conventions",order:3},{tool:"analyze_entry_points",reason:"Find handlers, exports, and entry points",order:4},{tool:"analyze_diagram",reason:"Generate Mermaid diagrams",order:5}]}];function u(n,i=5){const d=n.toLowerCase(),s=t.map(e=>{let r=0;for(const a of e.keywords)d.includes(a)&&(r+=a.includes(" ")?2:1);return{workflow:e,score:r}}).filter(e=>e.score>0).sort((e,r)=>r.score-e.score),l=t.find(e=>e.name==="search")??t[0],o=s[0]?.workflow??l,c=s.slice(1,4).map(e=>e.workflow.name).filter(e=>e!==o.name);return{workflow:o.name,description:o.description,tools:o.tools.slice(0,i),alternativeWorkflows:c}}export{u as guide};
1
+ const e=[{name:`onboard`,description:`First-time codebase exploration and understanding`,keywords:[`onboard`,`new project`,`understand`,`explore`,`first time`,`getting started`,`learn`,`overview`],tools:[{tool:`status`,reason:`Check index health and record count`,order:1},{tool:`onboard`,reason:`Run all analysis tools in one command`,order:2,suggestedArgs:{path:`.`}},{tool:`search`,reason:`Find specific topics of interest`,order:3},{tool:`graph`,reason:`Explore module relationships`,order:4,suggestedArgs:{action:`stats`}}]},{name:`audit`,description:`Assess project health, quality, and structure`,keywords:[`audit`,`health`,`quality`,`assess`,`review project`,`check quality`,`code quality`,`tech debt`],tools:[{tool:`status`,reason:`Check index freshness`,order:1},{tool:`audit`,reason:`Unified audit report with score and recommendations`,order:2,suggestedArgs:{detail:`summary`}},{tool:`check`,reason:`Typecheck + lint validation`,order:3},{tool:`health`,reason:`Detailed health checks on package.json, tsconfig, etc.`,order:4}]},{name:`bugfix`,description:`Diagnose and fix a bug or failing test`,keywords:[`bug`,`fix`,`debug`,`error`,`failing`,`broken`,`crash`,`wrong`,`issue`,`problem`,`not working`],tools:[{tool:`parse_output`,reason:`Parse error output from build tools (tsc, vitest, biome)`,order:1},{tool:`symbol`,reason:`Find definition and all references of the failing symbol`,order:2},{tool:`trace`,reason:`Trace call chain backward from the failure point`,order:3,suggestedArgs:{direction:`backward`}},{tool:`search`,reason:`Search for related patterns or similar fixes`,order:4},{tool:`test_run`,reason:`Re-run tests after fix`,order:5}]},{name:`implement`,description:`Add a new feature or implement a change`,keywords:[`implement`,`add feature`,`new feature`,`build`,`create`,`add`,`develop`,`write code`],tools:[{tool:`scope_map`,reason:`Generate a reading plan for affected files`,order:1},{tool:`search`,reason:`Find related patterns and prior art`,order:2},{tool:`find`,reason:`Find usage examples of similar patterns`,order:3,suggestedArgs:{mode:`examples`}},{tool:`check`,reason:`Validate after implementation`,order:4},{tool:`test_run`,reason:`Run tests to verify`,order:5},{tool:`blast_radius`,reason:`Check impact of changes`,order:6}]},{name:`refactor`,description:`Restructure or clean up existing code`,keywords:[`refactor`,`restructure`,`clean up`,`reorganize`,`rename`,`move`,`extract`,`DRY`,`dead code`],tools:[{tool:`dead_symbols`,reason:`Find unused exports to remove`,order:1},{tool:`symbol`,reason:`Find all references before renaming`,order:2},{tool:`blast_radius`,reason:`Assess impact before making changes`,order:3},{tool:`rename`,reason:`Safe cross-file rename`,order:4},{tool:`check`,reason:`Validate after refactoring`,order:5},{tool:`test_run`,reason:`Ensure no regressions`,order:6}]},{name:`search`,description:`Find specific code, patterns, or information`,keywords:[`find`,`search`,`where`,`locate`,`look for`,`grep`,`which file`,`how does`],tools:[{tool:`search`,reason:`Hybrid semantic + keyword search`,order:1},{tool:`find`,reason:`Federated search with glob and regex`,order:2},{tool:`symbol`,reason:`Resolve a specific symbol definition and references`,order:3},{tool:`graph`,reason:`Explore entity relationships`,order:4,suggestedArgs:{action:`neighbors`}}]},{name:`context`,description:`Compress or manage context for efficient LLM interaction`,keywords:[`context`,`compress`,`summarize`,`too long`,`token`,`budget`,`reduce`,`compact`],tools:[{tool:`file_summary`,reason:`Quick structural overview without reading full file`,order:1},{tool:`compact`,reason:`Compress file to relevant sections`,order:2,suggestedArgs:{segmentation:`paragraph`}},{tool:`digest`,reason:`Compress multiple sources into budgeted summary`,order:3},{tool:`stratum_card`,reason:`Generate reusable context cards`,order:4}]},{name:`memory`,description:`Manage persistent knowledge across sessions`,keywords:[`memory`,`remember`,`persist`,`save`,`recall`,`decision`,`convention`,`session`,`checkpoint`],tools:[{tool:`list`,reason:`See all stored knowledge entries`,order:1},{tool:`search`,reason:`Search curated knowledge`,order:2,suggestedArgs:{origin:`curated`}},{tool:`remember`,reason:`Store a new decision or pattern`,order:3},{tool:`checkpoint`,reason:`Save/restore session progress`,order:4},{tool:`stash`,reason:`Temporary key-value storage within session`,order:5}]},{name:`validate`,description:`Run checks, tests, and validation`,keywords:[`validate`,`check`,`test`,`lint`,`typecheck`,`verify`,`CI`,`pass`,`run tests`],tools:[{tool:`check`,reason:`Typecheck + lint in one call`,order:1,suggestedArgs:{detail:`errors`}},{tool:`test_run`,reason:`Run tests with structured output`,order:2},{tool:`health`,reason:`Project health assessment`,order:3}]},{name:`analyze`,description:`Deep analysis of codebase structure, dependencies, or patterns`,keywords:[`analyze`,`dependency`,`structure`,`pattern`,`architecture`,`diagram`,`entry point`,`import`],tools:[{tool:`analyze_structure`,reason:`Project structure overview`,order:1},{tool:`analyze_dependencies`,reason:`Dependency graph and analysis`,order:2},{tool:`analyze_patterns`,reason:`Detect code patterns and conventions`,order:3},{tool:`analyze_entry_points`,reason:`Find handlers, exports, and entry points`,order:4},{tool:`analyze_diagram`,reason:`Generate Mermaid diagrams`,order:5}]}];function t(t,n=5){let r=t.toLowerCase(),i=e.map(e=>{let t=0;for(let n of e.keywords)r.includes(n)&&(t+=n.includes(` `)?2:1);return{workflow:e,score:t}}).filter(e=>e.score>0).sort((e,t)=>t.score-e.score),a=e.find(e=>e.name===`search`)??e[0],o=i[0]?.workflow??a,s=i.slice(1,4).map(e=>e.workflow.name).filter(e=>e!==o.name);return{workflow:o.name,description:o.description,tools:o.tools.slice(0,n),alternativeWorkflows:s}}export{t as guide};
2
+ //# sourceMappingURL=guide.js.map
@@ -1,14 +1,17 @@
1
- export interface HealthCheck {
2
- name: string;
3
- status: 'pass' | 'warn' | 'fail';
4
- message: string;
1
+ //#region packages/tools/src/health.d.ts
2
+ interface HealthCheck {
3
+ name: string;
4
+ status: 'pass' | 'warn' | 'fail';
5
+ message: string;
5
6
  }
6
- export interface HealthResult {
7
- path: string;
8
- checks: HealthCheck[];
9
- score: number;
10
- summary: string;
7
+ interface HealthResult {
8
+ path: string;
9
+ checks: HealthCheck[];
10
+ score: number;
11
+ summary: string;
11
12
  }
12
13
  /** Run project health checks on a directory. */
13
- export declare function health(rootPath?: string): HealthResult;
14
+ declare function health(rootPath?: string): HealthResult;
15
+ //#endregion
16
+ export { HealthCheck, HealthResult, health };
14
17
  //# sourceMappingURL=health.d.ts.map
@@ -1,2 +1,3 @@
1
- import{existsSync as m,readdirSync as $,readFileSync as d,statSync as j}from"node:fs";import{extname as v,join as c,relative as M,resolve as S}from"node:path";function D(p){const e=S(p??process.cwd()),s=[],r=c(e,"package.json");if(m(r)){s.push({name:"package.json",status:"pass",message:"Found"});try{const t=JSON.parse(d(r,"utf-8"));t.name?s.push({name:"package.name",status:"pass",message:t.name}):s.push({name:"package.name",status:"warn",message:"Missing package name"});const u=t.scripts??{};for(const g of["build","test","lint"])u[g]?s.push({name:`script:${g}`,status:"pass",message:u[g]}):s.push({name:`script:${g}`,status:"warn",message:`No "${g}" script defined`});t.type==="module"?s.push({name:"esm",status:"pass",message:'ESM ("type": "module")'}):t.type==="commonjs"?s.push({name:"esm",status:"pass",message:'CJS ("type": "commonjs")'}):s.push({name:"esm",status:"warn",message:'No "type" field \u2014 defaults to CJS'}),t.engines?.node?s.push({name:"engines.node",status:"pass",message:t.engines.node}):s.push({name:"engines.node",status:"warn",message:"No Node.js engine constraint"})}catch{s.push({name:"package.json",status:"fail",message:"Failed to parse package.json"})}}else s.push({name:"package.json",status:"fail",message:"Missing \u2014 not a Node.js project"});const i=c(e,"tsconfig.json");m(i)?s.push({name:"tsconfig.json",status:"pass",message:"Found"}):s.push({name:"tsconfig.json",status:"warn",message:"Missing"});const n=c(e,".gitignore");if(m(n)){const t=d(n,"utf-8"),u=t.includes("node_modules"),g=t.includes("dist");u&&g?s.push({name:".gitignore",status:"pass",message:"Includes node_modules and dist"}):s.push({name:".gitignore",status:"warn",message:`Missing: ${u?"":"node_modules "}${g?"":"dist"}`.trim()})}else s.push({name:".gitignore",status:"warn",message:"Missing"});const o=["pnpm-lock.yaml","package-lock.json","yarn.lock","bun.lock"].find(t=>m(c(e,t)));o?s.push({name:"lockfile",status:"pass",message:o}):s.push({name:"lockfile",status:"warn",message:"No lock file found"});const l=c(e,"README.md");if(m(l)){const t=d(l,"utf-8").length;s.push({name:"README.md",status:t>100?"pass":"warn",message:t>100?`Found (${t} chars)`:"Found but very short"})}else s.push({name:"README.md",status:"warn",message:"Missing"});if(m(c(e,"LICENSE"))||m(c(e,"LICENSE.md"))?s.push({name:"LICENSE",status:"pass",message:"Found"}):s.push({name:"LICENSE",status:"warn",message:"Missing"}),m(i))try{const u=d(i,"utf-8").replace(/\/\/.*$/gm,"").replace(/\/\*[\s\S]*?\*\//g,"");JSON.parse(u).compilerOptions?.strict===!0?s.push({name:"typescript.strict",status:"pass",message:"strict: true"}):s.push({name:"typescript.strict",status:"warn",message:"strict mode not enabled in tsconfig.json"})}catch{}if(m(r))try{const t=JSON.parse(d(r,"utf-8"));t.exports?s.push({name:"package.exports",status:"pass",message:"Has exports field"}):t.workspaces||m(c(e,"pnpm-workspace.yaml"))||s.push({name:"package.exports",status:"warn",message:"Missing \u2014 consider adding exports field for explicit public API"});const u=P(e,t);u.length>0&&_(e,u,s)}catch{}const f=c(e,"dist"),h=c(e,"src");if(m(f)&&m(h))try{const t=j(f).mtimeMs;x(h)>t?s.push({name:"build.freshness",status:"warn",message:"Source files are newer than dist/ \u2014 rebuild may be needed"}):s.push({name:"build.freshness",status:"pass",message:"Build output is fresh"})}catch{}if(m(h)){const t=F(h);if(t.length===0)s.push({name:"circular_deps",status:"pass",message:"No circular imports detected"});else{const u=t.slice(0,3).map(g=>g.join(" \u2192 "));s.push({name:"circular_deps",status:"warn",message:`${t.length} circular import(s): ${u.join("; ")}${t.length>3?` (+${t.length-3} more)`:""}`})}}const w=s.length,k=s.filter(t=>t.status==="pass").length,y=s.filter(t=>t.status==="fail").length,N=Math.round(k/w*100),b=y>0?`${y} critical issue(s), ${w-k-y} warning(s)`:w-k>0?`${w-k} warning(s)`:"All checks passed";return{path:e,checks:s,score:N,summary:b}}function P(p,e){const s=[];Array.isArray(e.workspaces)?s.push(...e.workspaces):e.workspaces&&typeof e.workspaces=="object"&&Array.isArray(e.workspaces.packages)&&s.push(...e.workspaces.packages);const r=c(p,"pnpm-workspace.yaml");if(m(r)){const n=d(r,"utf-8");for(const a of n.split(`
2
- `)){const o=a.match(/^\s*-\s+['"]?([^'"#\s]+)['"]?\s*$/);o&&s.push(o[1])}}const i=[];for(const n of s)if(n.endsWith("/*")||n.endsWith("/**")){const a=c(p,n.replace(/\/\*+$/,""));if(m(a))try{for(const o of $(a,{withFileTypes:!0}))o.isDirectory()&&m(c(a,o.name,"package.json"))&&i.push(c(a,o.name))}catch{}}else{const a=c(p,n);m(c(a,"package.json"))&&i.push(a)}return i}function _(p,e,s){let r=0,i=0;const n=new Map;for(const a of e)try{const o=JSON.parse(d(c(a,"package.json"),"utf-8"));o.scripts?.test||r++,!o.exports&&!o.main&&i++;const l={...o.dependencies,...o.devDependencies};for(const f of Object.values(l))if(typeof f=="string"&&f.startsWith("workspace:")){const h=f.startsWith("workspace:*")?"workspace:*":f.startsWith("workspace:^")?"workspace:^":"workspace:~";n.set(h,(n.get(h)??0)+1)}}catch{}if(r>0?s.push({name:"workspace.test-scripts",status:"warn",message:`${r}/${e.length} workspace packages missing test script`}):s.push({name:"workspace.test-scripts",status:"pass",message:`All ${e.length} workspace packages have test scripts`}),i>0?s.push({name:"workspace.exports",status:"warn",message:`${i}/${e.length} packages missing exports field`}):e.length>0&&s.push({name:"workspace.exports",status:"pass",message:`All ${e.length} packages have exports or main field`}),n.size>1){const a=[...n.entries()].map(([o,l])=>`${o} (${l})`).join(", ");s.push({name:"workspace.protocol",status:"warn",message:`Mixed workspace protocols: ${a} \u2014 consider standardizing`})}else if(n.size===1){const[a]=n.keys();s.push({name:"workspace.protocol",status:"pass",message:`Consistent workspace protocol: ${a}`})}}function x(p){let e=0;try{for(const s of $(p,{withFileTypes:!0})){if(s.name.startsWith(".")||s.name==="node_modules")continue;const r=c(p,s.name);s.isDirectory()?e=Math.max(e,x(r)):e=Math.max(e,j(r).mtimeMs)}}catch{}return e}const A=/(?:import|export)\s+.*?from\s+['"](\.[^'"]+)['"]/g,C=new Set([".ts",".tsx",".mts"]);function F(p){const e=new Map;E(p,p,e);const s=[],r=new Set,i=new Set;function n(a,o){if(i.has(a)){const l=o.indexOf(a);l>=0&&s.push(o.slice(l).concat(a));return}if(!r.has(a)){r.add(a),i.add(a),o.push(a);for(const l of e.get(a)??[])n(l,o);o.pop(),i.delete(a)}}for(const a of e.keys())n(a,[]);return s}function E(p,e,s){let r;try{r=$(p)}catch{return}for(const i of r){if(i.startsWith(".")||i==="node_modules"||i==="__tests__")continue;const n=c(p,i);try{if(j(n).isDirectory())E(n,e,s);else if(C.has(v(i))){const o=M(e,n).replace(/\\/g,"/"),l=d(n,"utf-8"),f=[];for(const h of l.matchAll(A)){const w=h[1],k=I(p,w,e);k&&f.push(k)}s.set(o,f)}}catch{}}}function I(p,e,s){const r=S(p,e);for(const i of[".ts",".tsx",".mts",".js",".mjs",""]){const n=i?r.replace(/\.[^.]+$/,"")+i:r;return M(s,n).replace(/\\/g,"/").replace(/\.js$/,".ts").replace(/\.mjs$/,".mts")}return null}export{D as health};
1
+ import{extname as e,join as t,relative as n,resolve as r}from"node:path";import{existsSync as i,readFileSync as a,readdirSync as o,statSync as s}from"node:fs";function c(e){let n=r(e??process.cwd()),o=[],c=t(n,`package.json`);if(i(c)){o.push({name:`package.json`,status:`pass`,message:`Found`});try{let e=JSON.parse(a(c,`utf-8`));e.name?o.push({name:`package.name`,status:`pass`,message:e.name}):o.push({name:`package.name`,status:`warn`,message:`Missing package name`});let t=e.scripts??{};for(let e of[`build`,`test`,`lint`])t[e]?o.push({name:`script:${e}`,status:`pass`,message:t[e]}):o.push({name:`script:${e}`,status:`warn`,message:`No "${e}" script defined`});e.type===`module`?o.push({name:`esm`,status:`pass`,message:`ESM ("type": "module")`}):e.type===`commonjs`?o.push({name:`esm`,status:`pass`,message:`CJS ("type": "commonjs")`}):o.push({name:`esm`,status:`warn`,message:`No "type" field defaults to CJS`}),e.engines?.node?o.push({name:`engines.node`,status:`pass`,message:e.engines.node}):o.push({name:`engines.node`,status:`warn`,message:`No Node.js engine constraint`})}catch{o.push({name:`package.json`,status:`fail`,message:`Failed to parse package.json`})}}else o.push({name:`package.json`,status:`fail`,message:`Missing not a Node.js project`});let f=t(n,`tsconfig.json`);i(f)?o.push({name:`tsconfig.json`,status:`pass`,message:`Found`}):o.push({name:`tsconfig.json`,status:`warn`,message:`Missing`});let p=t(n,`.gitignore`);if(i(p)){let e=a(p,`utf-8`),t=e.includes(`node_modules`),n=e.includes(`dist`);t&&n?o.push({name:`.gitignore`,status:`pass`,message:`Includes node_modules and dist`}):o.push({name:`.gitignore`,status:`warn`,message:`Missing: ${t?``:`node_modules `}${n?``:`dist`}`.trim()})}else o.push({name:`.gitignore`,status:`warn`,message:`Missing`});let h=[`pnpm-lock.yaml`,`package-lock.json`,`yarn.lock`,`bun.lock`].find(e=>i(t(n,e)));h?o.push({name:`lockfile`,status:`pass`,message:h}):o.push({name:`lockfile`,status:`warn`,message:`No lock file found`});let g=t(n,`README.md`);if(i(g)){let e=a(g,`utf-8`).length;o.push({name:`README.md`,status:e>100?`pass`:`warn`,message:e>100?`Found (${e} chars)`:`Found but very short`})}else o.push({name:`README.md`,status:`warn`,message:`Missing`});if(i(t(n,`LICENSE`))||i(t(n,`LICENSE.md`))?o.push({name:`LICENSE`,status:`pass`,message:`Found`}):o.push({name:`LICENSE`,status:`warn`,message:`Missing`}),i(f))try{let e=a(f,`utf-8`).replace(/\/\/.*$/gm,``).replace(/\/\*[\s\S]*?\*\//g,``);JSON.parse(e).compilerOptions?.strict===!0?o.push({name:`typescript.strict`,status:`pass`,message:`strict: true`}):o.push({name:`typescript.strict`,status:`warn`,message:`strict mode not enabled in tsconfig.json`})}catch{}if(i(c))try{let e=JSON.parse(a(c,`utf-8`));e.exports?o.push({name:`package.exports`,status:`pass`,message:`Has exports field`}):e.workspaces||i(t(n,`pnpm-workspace.yaml`))||o.push({name:`package.exports`,status:`warn`,message:`Missing consider adding exports field for explicit public API`});let r=l(n,e);r.length>0&&u(n,r,o)}catch{}let _=t(n,`dist`),v=t(n,`src`);if(i(_)&&i(v))try{let e=s(_).mtimeMs;d(v)>e?o.push({name:`build.freshness`,status:`warn`,message:`Source files are newer than dist/ rebuild may be needed`}):o.push({name:`build.freshness`,status:`pass`,message:`Build output is fresh`})}catch{}if(i(v)){let e=m(v);if(e.length===0)o.push({name:`circular_deps`,status:`pass`,message:`No circular imports detected`});else{let t=e.slice(0,3).map(e=>e.join(` `));o.push({name:`circular_deps`,status:`warn`,message:`${e.length} circular import(s): ${t.join(`; `)}${e.length>3?` (+${e.length-3} more)`:``}`})}}let y=o.length,b=o.filter(e=>e.status===`pass`).length,x=o.filter(e=>e.status===`fail`).length;return{path:n,checks:o,score:y>0?Math.round(b/y*100):0,summary:x>0?`${x} critical issue(s), ${y-b-x} warning(s)`:y-b>0?`${y-b} warning(s)`:`All checks passed`}}function l(e,n){let r=[];Array.isArray(n.workspaces)?r.push(...n.workspaces):n.workspaces&&typeof n.workspaces==`object`&&Array.isArray(n.workspaces.packages)&&r.push(...n.workspaces.packages);let s=t(e,`pnpm-workspace.yaml`);if(i(s)){let e=a(s,`utf-8`);for(let t of e.split(`
2
+ `)){let e=t.match(/^\s*-\s+['"]?([^'"#\s]+)['"]?\s*$/);e&&r.push(e[1])}}let c=[];for(let n of r)if(n.endsWith(`/*`)||n.endsWith(`/**`)){let r=t(e,n.replace(/\/\*+$/,``));if(i(r))try{for(let e of o(r,{withFileTypes:!0}))e.isDirectory()&&i(t(r,e.name,`package.json`))&&c.push(t(r,e.name))}catch{}}else{let r=t(e,n);i(t(r,`package.json`))&&c.push(r)}return c}function u(e,n,r){let i=0,o=0,s=new Map;for(let e of n)try{let n=JSON.parse(a(t(e,`package.json`),`utf-8`));n.scripts?.test||i++,!n.exports&&!n.main&&o++;let r={...n.dependencies,...n.devDependencies};for(let e of Object.values(r))if(typeof e==`string`&&e.startsWith(`workspace:`)){let t=e.startsWith(`workspace:*`)?`workspace:*`:e.startsWith(`workspace:^`)?`workspace:^`:`workspace:~`;s.set(t,(s.get(t)??0)+1)}}catch{}if(i>0?r.push({name:`workspace.test-scripts`,status:`warn`,message:`${i}/${n.length} workspace packages missing test script`}):r.push({name:`workspace.test-scripts`,status:`pass`,message:`All ${n.length} workspace packages have test scripts`}),o>0?r.push({name:`workspace.exports`,status:`warn`,message:`${o}/${n.length} packages missing exports field`}):n.length>0&&r.push({name:`workspace.exports`,status:`pass`,message:`All ${n.length} packages have exports or main field`}),s.size>1){let e=[...s.entries()].map(([e,t])=>`${e} (${t})`).join(`, `);r.push({name:`workspace.protocol`,status:`warn`,message:`Mixed workspace protocols: ${e} consider standardizing`})}else if(s.size===1){let[e]=s.keys();r.push({name:`workspace.protocol`,status:`pass`,message:`Consistent workspace protocol: ${e}`})}}function d(e){let n=0;try{for(let r of o(e,{withFileTypes:!0})){if(r.name.startsWith(`.`)||r.name===`node_modules`)continue;let i=t(e,r.name);n=r.isDirectory()?Math.max(n,d(i)):Math.max(n,s(i).mtimeMs)}}catch{}return n}const f=/(?:import|export)\s+.*?from\s+['"](\.[^'"]+)['"]/g,p=new Set([`.ts`,`.tsx`,`.mts`]);function m(e){let t=new Map;h(e,e,t);let n=[],r=new Set,i=new Set;function a(e,o){if(i.has(e)){let t=o.indexOf(e);t>=0&&n.push(o.slice(t).concat(e));return}if(!r.has(e)){r.add(e),i.add(e),o.push(e);for(let n of t.get(e)??[])a(n,o);o.pop(),i.delete(e)}}for(let e of t.keys())a(e,[]);return n}function h(r,i,c){let l;try{l=o(r)}catch{return}for(let o of l){if(o.startsWith(`.`)||o===`node_modules`||o===`__tests__`)continue;let l=t(r,o);try{if(s(l).isDirectory())h(l,i,c);else if(p.has(e(o))){let e=n(i,l).replace(/\\/g,`/`),t=a(l,`utf-8`),o=[];for(let e of t.matchAll(f)){let t=e[1],n=g(r,t,i);n&&o.push(n)}c.set(e,o)}}catch{}}}function g(e,t,i){let a=r(e,t);for(let e of[`.ts`,`.tsx`,`.mts`,`.js`,`.mjs`,``])return n(i,e?a.replace(/\.[^.]+$/,``)+e:a).replace(/\\/g,`/`).replace(/\.js$/,`.ts`).replace(/\.mjs$/,`.mts`);return null}export{c as health};
3
+ //# sourceMappingURL=health.js.map
@@ -1,23 +1,26 @@
1
+ //#region packages/tools/src/http-request.d.ts
1
2
  /**
2
3
  * kb_http — Make HTTP requests for API testing and debugging.
3
4
  */
4
- export type HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'HEAD';
5
- export interface HttpRequestOptions {
6
- url: string;
7
- method?: HttpMethod;
8
- headers?: Record<string, string>;
9
- body?: string;
10
- timeout?: number;
5
+ type HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'HEAD';
6
+ interface HttpRequestOptions {
7
+ url: string;
8
+ method?: HttpMethod;
9
+ headers?: Record<string, string>;
10
+ body?: string;
11
+ timeout?: number;
11
12
  }
12
- export interface HttpRequestResult {
13
- status: number;
14
- statusText: string;
15
- headers: Record<string, string>;
16
- body: string;
17
- durationMs: number;
18
- contentType: string;
19
- sizeBytes: number;
20
- truncated: boolean;
13
+ interface HttpRequestResult {
14
+ status: number;
15
+ statusText: string;
16
+ headers: Record<string, string>;
17
+ body: string;
18
+ durationMs: number;
19
+ contentType: string;
20
+ sizeBytes: number;
21
+ truncated: boolean;
21
22
  }
22
- export declare function httpRequest(options: HttpRequestOptions): Promise<HttpRequestResult>;
23
+ declare function httpRequest(options: HttpRequestOptions): Promise<HttpRequestResult>;
24
+ //#endregion
25
+ export { HttpMethod, HttpRequestOptions, HttpRequestResult, httpRequest };
23
26
  //# sourceMappingURL=http-request.d.ts.map
@@ -1 +1,2 @@
1
- import{headTailTruncate as E}from"./truncation.js";const u=5e4,R=15e3;async function H(d){const{url:n,method:s="GET",headers:l={},body:h,timeout:T=R}=d,o=new URL(n);if(o.protocol!=="http:"&&o.protocol!=="https:")throw new Error(`Unsupported protocol: ${o.protocol} \u2014 only http/https allowed`);const a=new AbortController,g=setTimeout(()=>a.abort(),T),y=Date.now();let t;try{t=await fetch(n,{method:s,headers:{"User-Agent":"kb-http/1.0",...l},body:s!=="GET"&&s!=="HEAD"?h:void 0,signal:a.signal,redirect:"follow"})}finally{clearTimeout(g)}const f=Date.now()-y,r=await t.text(),i=t.headers.get("content-type")??"";let e=r;if(i.includes("json"))try{e=JSON.stringify(JSON.parse(r),null,2)}catch{}let c=!1;e.length>u&&(e=E(e,u),c=!0);const p={};return t.headers.forEach((m,b)=>{p[b]=m}),{status:t.status,statusText:t.statusText,headers:p,body:e,durationMs:f,contentType:i,sizeBytes:r.length,truncated:c}}export{H as httpRequest};
1
+ import{headTailTruncate as e}from"./truncation.js";const t=5e4;async function n(n){let{url:r,method:i=`GET`,headers:a={},body:o,timeout:s=15e3}=n,c=new URL(r);if(c.protocol!==`http:`&&c.protocol!==`https:`)throw Error(`Unsupported protocol: ${c.protocol} only http/https allowed`);let l=c.hostname;if(l===`169.254.169.254`||l===`metadata.google.internal`||l.startsWith(`fd`)||/^(10\.|172\.(1[6-9]|2\d|3[01])\.|192\.168\.)/.test(l)||l===`0.0.0.0`||l===`[::]`)throw Error(`Blocked request to private/metadata address: ${l}`);let u=new AbortController,d=setTimeout(()=>u.abort(),s),f=Date.now(),p;try{p=await fetch(r,{method:i,headers:{"User-Agent":`kb-http/1.0`,...a},body:i!==`GET`&&i!==`HEAD`?o:void 0,signal:u.signal,redirect:`follow`})}finally{clearTimeout(d)}let m=Date.now()-f,h=await p.text(),g=p.headers.get(`content-type`)??``,_=h;if(g.includes(`json`))try{_=JSON.stringify(JSON.parse(h),null,2)}catch{}let v=!1;_.length>t&&(_=e(_,t),v=!0);let y={};return p.headers.forEach((e,t)=>{y[t]=e}),{status:p.status,statusText:p.statusText,headers:y,body:_,durationMs:m,contentType:g,sizeBytes:h.length,truncated:v}}export{n as httpRequest};
2
+ //# sourceMappingURL=http-request.js.map
@@ -1,53 +1,54 @@
1
- export { type AuditCheck, type AuditData, type AuditOptions, type AuditRecommendation, audit, } from './audit.js';
2
- export { type BatchOperation, type BatchOptions, type BatchResult, batch, } from './batch.js';
3
- export { type ChangelogEntry, type ChangelogFormat, type ChangelogOptions, type ChangelogResult, changelog, formatChangelog, } from './changelog.js';
4
- export { type CheckOptions, type CheckResult, type CheckSummaryResult, check, summarizeCheckResult, } from './check.js';
5
- export { type Checkpoint, checkpointLatest, checkpointList, checkpointLoad, checkpointSave, } from './checkpoint.js';
6
- export { type CodemodChange, type CodemodOptions, type CodemodResult, type CodemodRule, codemod, } from './codemod.js';
7
- export { type CompactOptions, type CompactResult, compact } from './compact.js';
8
- export { dataTransform, type TransformOptions, type TransformResult, } from './data-transform.js';
9
- export { type DeadSymbol, type DeadSymbolOptions, type DeadSymbolResult, findDeadSymbols, } from './dead-symbols.js';
10
- export { type DelegateOptions, type DelegateResult, delegate, delegateListModels, } from './delegate.js';
11
- export { type DiffChange, type DiffFile, type DiffHunk, type DiffParseOptions, diffParse, } from './diff-parse.js';
12
- export { type DigestFieldEntry, type DigestOptions, type DigestResult, type DigestSource, digest, } from './digest.js';
13
- export { type EncodeOperation, type EncodeOptions, type EncodeResult, encode, } from './encode.js';
14
- export { type EnvInfoOptions, type EnvInfoResult, envInfo, } from './env-info.js';
15
- export { type EvalOptions, type EvalResult, evaluate } from './eval.js';
16
- export { type EvidenceEntry, type EvidenceMapAction, type EvidenceMapResult, type EvidenceMapState, type EvidenceStatus, evidenceMap, type ForgeTier, type GateDecision, type GateResult, type UnknownType, } from './evidence-map.js';
17
- export { type FileSummaryOptions, type FileSummaryResult, fileSummary, } from './file-summary.js';
18
- export { type FindOptions, type FindResult, type FindResults, find } from './find.js';
19
- export { type Example, type FindExamplesOptions, type FindExamplesResult, findExamples, } from './find-examples.js';
20
- export { type ClassifyTrigger, type ForgeClassifyCeremony, type ForgeClassifyOptions, type ForgeClassifyResult, forgeClassify, type TypedUnknownSeed, } from './forge-classify.js';
21
- export { type ConstraintRef, type ForgeGroundOptions, type ForgeGroundResult, forgeGround, } from './forge-ground.js';
22
- export { type GitContextOptions, type GitContextResult, gitContext, } from './git-context.js';
23
- export { type GraphAugmentedResult, type GraphAugmentOptions, type GraphQueryOptions, type GraphQueryResult, graphAugmentSearch, graphQuery, } from './graph-query.js';
24
- export { type GuideRecommendation, type GuideResult, guide } from './guide.js';
25
- export { type HealthCheck, type HealthResult, health, } from './health.js';
26
- export { type HttpMethod, type HttpRequestOptions, type HttpRequestResult, httpRequest, } from './http-request.js';
27
- export { type LaneDiffEntry, type LaneDiffResult, type LaneMergeResult, type LaneMeta, laneCreate, laneDiff, laneDiscard, laneList, laneMerge, laneStatus, } from './lane.js';
28
- export { analyzeFile, type FileMetrics, type MeasureOptions, type MeasureResult, measure, } from './measure.js';
29
- export { type OnboardMode, type OnboardOptions, type OnboardResult, type OnboardStepResult, onboard, } from './onboard.js';
30
- export { type ParsedError, type ParsedGitStatus, type ParsedOutput, type ParsedTestResult, type ParsedTestSummary, parseBiome, parseGitStatus, parseOutput, parseTsc, parseVitest, } from './parse-output.js';
31
- export { resolvePath } from './path-resolver.js';
32
- export { type ManagedProcess, processList, processLogs, processStart, processStatus, processStop, } from './process-manager.js';
33
- export { type QueueItem, type QueueState, queueClear, queueCreate, queueDelete, queueDone, queueFail, queueGet, queueList, queueNext, queuePush, } from './queue.js';
34
- export { type RegexTestOptions, type RegexTestResult, regexTest, } from './regex-test.js';
35
- export { type RenameChange, type RenameOptions, type RenameResult, rename, } from './rename.js';
36
- export { type ReplayEntry, type ReplayOptions, replayAppend, replayCapture, replayClear, replayList, replayTrim, } from './replay.js';
37
- export { errorResponse, type KBError, type KBErrorCode, type KBNextHint, type KBResponse, type KBResponseMeta, okResponse, } from './response-envelope.js';
38
- export { type SchemaValidateOptions, type SchemaValidateResult, schemaValidate, type ValidationError, } from './schema-validate.js';
39
- export { type ScopeMapEntry, type ScopeMapOptions, type ScopeMapResult, scopeMap, } from './scope-map.js';
40
- export { type Snippet, type SnippetAction, type SnippetOptions, type SnippetResult, snippet, } from './snippet.js';
41
- export { type StashEntry, stashClear, stashDelete, stashGet, stashList, stashSet, } from './stash.js';
42
- export { type StratumCard, type StratumCardOptions, type StratumCardResult, stratumCard, } from './stratum-card.js';
43
- export { type SymbolInfo, type SymbolOptions, symbol } from './symbol.js';
44
- export { classifyExitCode, type TestRunOptions, type TestRunResult, testRun } from './test-run.js';
45
- export { cosineSimilarity, estimateTokens, segment, } from './text-utils.js';
46
- export { type TimeOptions, type TimeResult, timeUtils, } from './time-utils.js';
47
- export { type TraceNode, type TraceOptions, type TraceResult, trace } from './trace.js';
48
- export { headTailTruncate, paragraphTruncate, truncateToTokenBudget } from './truncation.js';
49
- export { type WatchEvent, type WatchHandle, type WatchOptions, watchList, watchStart, watchStop, } from './watch.js';
50
- export { type WebFetchMode, type WebFetchOptions, type WebFetchResult, webFetch, } from './web-fetch.js';
51
- export { parseSearchResults, type WebSearchOptions, type WebSearchResult, type WebSearchResultItem, webSearch, } from './web-search.js';
52
- export { addToWorkset, deleteWorkset, getWorkset, listWorksets, removeFromWorkset, saveWorkset, type Workset, } from './workset.js';
53
- //# sourceMappingURL=index.d.ts.map
1
+ import { KBError, KBErrorCode, KBNextHint, KBResponse, KBResponseMeta, errorResponse, okResponse } from "./response-envelope.js";
2
+ import { AuditCheck, AuditData, AuditOptions, AuditRecommendation, audit } from "./audit.js";
3
+ import { BatchOperation, BatchOptions, BatchResult, batch } from "./batch.js";
4
+ import { ChangelogEntry, ChangelogFormat, ChangelogOptions, ChangelogResult, changelog, formatChangelog } from "./changelog.js";
5
+ import { ParsedError, ParsedGitStatus, ParsedOutput, ParsedTestResult, ParsedTestSummary, parseBiome, parseGitStatus, parseOutput, parseTsc, parseVitest } from "./parse-output.js";
6
+ import { CheckOptions, CheckResult, CheckSummaryResult, check, summarizeCheckResult } from "./check.js";
7
+ import { Checkpoint, checkpointLatest, checkpointList, checkpointLoad, checkpointSave } from "./checkpoint.js";
8
+ import { CodemodChange, CodemodOptions, CodemodResult, CodemodRule, codemod } from "./codemod.js";
9
+ import { FileCache, FileCacheEntry, FileCacheStats } from "./file-cache.js";
10
+ import { CompactOptions, CompactResult, compact } from "./compact.js";
11
+ import { TransformOptions, TransformResult, dataTransform } from "./data-transform.js";
12
+ import { DeadSymbol, DeadSymbolOptions, DeadSymbolResult, findDeadSymbols } from "./dead-symbols.js";
13
+ import { DelegateOptions, DelegateResult, delegate, delegateListModels } from "./delegate.js";
14
+ import { DiffChange, DiffFile, DiffHunk, DiffParseOptions, diffParse } from "./diff-parse.js";
15
+ import { DigestFieldEntry, DigestOptions, DigestResult, DigestSource, digest } from "./digest.js";
16
+ import { EncodeOperation, EncodeOptions, EncodeResult, encode } from "./encode.js";
17
+ import { EnvInfoOptions, EnvInfoResult, envInfo } from "./env-info.js";
18
+ import { EvalOptions, EvalResult, evaluate } from "./eval.js";
19
+ import { EvidenceEntry, EvidenceMapAction, EvidenceMapResult, EvidenceMapState, EvidenceStatus, ForgeTier, GateDecision, GateResult, UnknownType, evidenceMap } from "./evidence-map.js";
20
+ import { FileSummaryOptions, FileSummaryResult, fileSummary } from "./file-summary.js";
21
+ import { Example, FindExamplesOptions, FindExamplesResult, findExamples } from "./find-examples.js";
22
+ import { FindOptions, FindResult, FindResults, find } from "./find.js";
23
+ import { ClassifyTrigger, ForgeClassifyCeremony, ForgeClassifyOptions, ForgeClassifyResult, TypedUnknownSeed, forgeClassify } from "./forge-classify.js";
24
+ import { ScopeMapEntry, ScopeMapOptions, ScopeMapResult, scopeMap } from "./scope-map.js";
25
+ import { ConstraintRef, ForgeGroundOptions, ForgeGroundResult, forgeGround } from "./forge-ground.js";
26
+ import { GitContextOptions, GitContextResult, gitContext } from "./git-context.js";
27
+ import { GraphAugmentOptions, GraphAugmentedResult, GraphQueryOptions, GraphQueryResult, graphAugmentSearch, graphQuery } from "./graph-query.js";
28
+ import { GuideRecommendation, GuideResult, guide } from "./guide.js";
29
+ import { HealthCheck, HealthResult, health } from "./health.js";
30
+ import { HttpMethod, HttpRequestOptions, HttpRequestResult, httpRequest } from "./http-request.js";
31
+ import { LaneDiffEntry, LaneDiffResult, LaneMergeResult, LaneMeta, laneCreate, laneDiff, laneDiscard, laneList, laneMerge, laneStatus } from "./lane.js";
32
+ import { FileMetrics, MeasureOptions, MeasureResult, analyzeFile, measure } from "./measure.js";
33
+ import { OnboardMode, OnboardOptions, OnboardResult, OnboardStepResult, onboard } from "./onboard.js";
34
+ import { resolvePath } from "./path-resolver.js";
35
+ import { ManagedProcess, processList, processLogs, processStart, processStatus, processStop } from "./process-manager.js";
36
+ import { QueueItem, QueueState, queueClear, queueCreate, queueDelete, queueDone, queueFail, queueGet, queueList, queueNext, queuePush } from "./queue.js";
37
+ import { RegexTestOptions, RegexTestResult, regexTest } from "./regex-test.js";
38
+ import { RenameChange, RenameOptions, RenameResult, rename } from "./rename.js";
39
+ import { ReplayEntry, ReplayOptions, replayAppend, replayCapture, replayClear, replayList, replayTrim } from "./replay.js";
40
+ import { SchemaValidateOptions, SchemaValidateResult, ValidationError, schemaValidate } from "./schema-validate.js";
41
+ import { Snippet, SnippetAction, SnippetOptions, SnippetResult, snippet } from "./snippet.js";
42
+ import { StashEntry, stashClear, stashDelete, stashGet, stashList, stashSet } from "./stash.js";
43
+ import { StratumCard, StratumCardOptions, StratumCardResult, stratumCard } from "./stratum-card.js";
44
+ import { SymbolInfo, SymbolOptions, symbol } from "./symbol.js";
45
+ import { TestRunOptions, TestRunResult, classifyExitCode, testRun } from "./test-run.js";
46
+ import { cosineSimilarity, estimateTokens, segment } from "./text-utils.js";
47
+ import { TimeOptions, TimeResult, timeUtils } from "./time-utils.js";
48
+ import { TraceNode, TraceOptions, TraceResult, trace } from "./trace.js";
49
+ import { headTailTruncate, paragraphTruncate, truncateToTokenBudget } from "./truncation.js";
50
+ import { WatchEvent, WatchHandle, WatchOptions, watchList, watchStart, watchStop } from "./watch.js";
51
+ import { WebFetchMode, WebFetchOptions, WebFetchResult, webFetch } from "./web-fetch.js";
52
+ import { WebSearchOptions, WebSearchResult, WebSearchResultItem, parseSearchResults, webSearch } from "./web-search.js";
53
+ import { Workset, addToWorkset, deleteWorkset, getWorkset, listWorksets, removeFromWorkset, saveWorkset } from "./workset.js";
54
+ export { type AuditCheck, type AuditData, type AuditOptions, type AuditRecommendation, type BatchOperation, type BatchOptions, type BatchResult, type ChangelogEntry, type ChangelogFormat, type ChangelogOptions, type ChangelogResult, type CheckOptions, type CheckResult, type CheckSummaryResult, type Checkpoint, type ClassifyTrigger, type CodemodChange, type CodemodOptions, type CodemodResult, type CodemodRule, type CompactOptions, type CompactResult, type ConstraintRef, type DeadSymbol, type DeadSymbolOptions, type DeadSymbolResult, type DelegateOptions, type DelegateResult, type DiffChange, type DiffFile, type DiffHunk, type DiffParseOptions, type DigestFieldEntry, type DigestOptions, type DigestResult, type DigestSource, type EncodeOperation, type EncodeOptions, type EncodeResult, type EnvInfoOptions, type EnvInfoResult, type EvalOptions, type EvalResult, type EvidenceEntry, type EvidenceMapAction, type EvidenceMapResult, type EvidenceMapState, type EvidenceStatus, type Example, FileCache, type FileCacheEntry, type FileCacheStats, type FileMetrics, type FileSummaryOptions, type FileSummaryResult, type FindExamplesOptions, type FindExamplesResult, type FindOptions, type FindResult, type FindResults, type ForgeClassifyCeremony, type ForgeClassifyOptions, type ForgeClassifyResult, type ForgeGroundOptions, type ForgeGroundResult, type ForgeTier, type GateDecision, type GateResult, type GitContextOptions, type GitContextResult, type GraphAugmentOptions, type GraphAugmentedResult, type GraphQueryOptions, type GraphQueryResult, type GuideRecommendation, type GuideResult, type HealthCheck, type HealthResult, type HttpMethod, type HttpRequestOptions, type HttpRequestResult, type KBError, type KBErrorCode, type KBNextHint, type KBResponse, type KBResponseMeta, type LaneDiffEntry, type LaneDiffResult, type LaneMergeResult, type LaneMeta, type ManagedProcess, type MeasureOptions, type MeasureResult, type OnboardMode, type OnboardOptions, type OnboardResult, type OnboardStepResult, type ParsedError, type ParsedGitStatus, type ParsedOutput, type ParsedTestResult, type ParsedTestSummary, type QueueItem, type QueueState, type RegexTestOptions, type RegexTestResult, type RenameChange, type RenameOptions, type RenameResult, type ReplayEntry, type ReplayOptions, type SchemaValidateOptions, type SchemaValidateResult, type ScopeMapEntry, type ScopeMapOptions, type ScopeMapResult, type Snippet, type SnippetAction, type SnippetOptions, type SnippetResult, type StashEntry, type StratumCard, type StratumCardOptions, type StratumCardResult, type SymbolInfo, type SymbolOptions, type TestRunOptions, type TestRunResult, type TimeOptions, type TimeResult, type TraceNode, type TraceOptions, type TraceResult, type TransformOptions, type TransformResult, type TypedUnknownSeed, type UnknownType, type ValidationError, type WatchEvent, type WatchHandle, type WatchOptions, type WebFetchMode, type WebFetchOptions, type WebFetchResult, type WebSearchOptions, type WebSearchResult, type WebSearchResultItem, type Workset, addToWorkset, analyzeFile, audit, batch, changelog, check, checkpointLatest, checkpointList, checkpointLoad, checkpointSave, classifyExitCode, codemod, compact, cosineSimilarity, dataTransform, delegate, delegateListModels, deleteWorkset, diffParse, digest, encode, envInfo, errorResponse, estimateTokens, evaluate, evidenceMap, fileSummary, find, findDeadSymbols, findExamples, forgeClassify, forgeGround, formatChangelog, getWorkset, gitContext, graphAugmentSearch, graphQuery, guide, headTailTruncate, health, httpRequest, laneCreate, laneDiff, laneDiscard, laneList, laneMerge, laneStatus, listWorksets, measure, okResponse, onboard, paragraphTruncate, parseBiome, parseGitStatus, parseOutput, parseSearchResults, parseTsc, parseVitest, processList, processLogs, processStart, processStatus, processStop, queueClear, queueCreate, queueDelete, queueDone, queueFail, queueGet, queueList, queueNext, queuePush, regexTest, removeFromWorkset, rename, replayAppend, replayCapture, replayClear, replayList, replayTrim, resolvePath, saveWorkset, schemaValidate, scopeMap, segment, snippet, stashClear, stashDelete, stashGet, stashList, stashSet, stratumCard, summarizeCheckResult, symbol, testRun, timeUtils, trace, truncateToTokenBudget, watchList, watchStart, watchStop, webFetch, webSearch };