kirograph 0.19.0 → 0.20.1

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 (690) hide show
  1. package/README.md +10 -8
  2. package/dist/architecture/layers/dart.d.ts +10 -0
  3. package/dist/architecture/layers/dart.d.ts.map +1 -0
  4. package/dist/architecture/layers/elixir.d.ts +6 -0
  5. package/dist/architecture/layers/elixir.d.ts.map +1 -0
  6. package/dist/architecture/layers/index.d.ts.map +1 -1
  7. package/dist/architecture/layers/ocaml.d.ts +6 -0
  8. package/dist/architecture/layers/ocaml.d.ts.map +1 -0
  9. package/dist/architecture/layers/scala.d.ts +6 -0
  10. package/dist/architecture/layers/scala.d.ts.map +1 -0
  11. package/dist/architecture/layers/solidity.d.ts +6 -0
  12. package/dist/architecture/layers/solidity.d.ts.map +1 -0
  13. package/dist/architecture/layers/vue.d.ts +6 -0
  14. package/dist/architecture/layers/vue.d.ts.map +1 -0
  15. package/dist/architecture/manifest/elm.d.ts +3 -0
  16. package/dist/architecture/manifest/elm.d.ts.map +1 -0
  17. package/dist/architecture/manifest/index.d.ts.map +1 -1
  18. package/dist/architecture/manifest/ocaml.d.ts +3 -0
  19. package/dist/architecture/manifest/ocaml.d.ts.map +1 -0
  20. package/dist/architecture/manifest/scala.d.ts +3 -0
  21. package/dist/architecture/manifest/scala.d.ts.map +1 -0
  22. package/dist/bin/banner.d.ts.map +1 -1
  23. package/dist/bin/commands/affected.d.ts.map +1 -1
  24. package/dist/bin/commands/attack-surface.d.ts +3 -0
  25. package/dist/bin/commands/attack-surface.d.ts.map +1 -0
  26. package/dist/bin/commands/attack-surface.js +7 -0
  27. package/dist/bin/commands/attack-surface.js.map +2 -2
  28. package/dist/bin/commands/benchmark.d.ts +9 -0
  29. package/dist/bin/commands/benchmark.d.ts.map +1 -0
  30. package/dist/bin/commands/budget.d.ts +6 -0
  31. package/dist/bin/commands/budget.d.ts.map +1 -0
  32. package/dist/bin/commands/caveman.d.ts +7 -0
  33. package/dist/bin/commands/caveman.d.ts.map +1 -0
  34. package/dist/bin/commands/communities.d.ts +3 -0
  35. package/dist/bin/commands/communities.d.ts.map +1 -0
  36. package/dist/bin/commands/compression.d.ts +7 -0
  37. package/dist/bin/commands/compression.d.ts.map +1 -0
  38. package/dist/bin/commands/context.d.ts.map +1 -1
  39. package/dist/bin/commands/data.d.ts +3 -0
  40. package/dist/bin/commands/data.d.ts.map +1 -0
  41. package/dist/bin/commands/dead-code.d.ts +3 -0
  42. package/dist/bin/commands/dead-code.d.ts.map +1 -0
  43. package/dist/bin/commands/dep-confusion.d.ts +3 -0
  44. package/dist/bin/commands/dep-confusion.d.ts.map +1 -0
  45. package/dist/bin/commands/docs.d.ts +3 -0
  46. package/dist/bin/commands/docs.d.ts.map +1 -0
  47. package/dist/bin/commands/exec.d.ts +11 -0
  48. package/dist/bin/commands/exec.d.ts.map +1 -0
  49. package/dist/bin/commands/export.d.ts +3 -0
  50. package/dist/bin/commands/export.d.ts.map +1 -0
  51. package/dist/bin/commands/flows.d.ts +3 -0
  52. package/dist/bin/commands/flows.d.ts.map +1 -0
  53. package/dist/bin/commands/gain.d.ts +6 -0
  54. package/dist/bin/commands/gain.d.ts.map +1 -0
  55. package/dist/bin/commands/help.d.ts +7 -0
  56. package/dist/bin/commands/help.d.ts.map +1 -1
  57. package/dist/bin/commands/help.js +20 -3
  58. package/dist/bin/commands/help.js.map +2 -2
  59. package/dist/bin/commands/hotspots.d.ts +3 -0
  60. package/dist/bin/commands/hotspots.d.ts.map +1 -0
  61. package/dist/bin/commands/hotspots.js +94 -1
  62. package/dist/bin/commands/hotspots.js.map +3 -3
  63. package/dist/bin/commands/install.d.ts.map +1 -1
  64. package/dist/bin/commands/install.js +3 -3
  65. package/dist/bin/commands/install.js.map +2 -2
  66. package/dist/bin/commands/licenses.d.ts +3 -0
  67. package/dist/bin/commands/licenses.d.ts.map +1 -0
  68. package/dist/bin/commands/memory.d.ts +16 -0
  69. package/dist/bin/commands/memory.d.ts.map +1 -0
  70. package/dist/bin/commands/memory.js +151 -4
  71. package/dist/bin/commands/memory.js.map +2 -2
  72. package/dist/bin/commands/path.d.ts +3 -0
  73. package/dist/bin/commands/path.d.ts.map +1 -0
  74. package/dist/bin/commands/pattern.d.ts +3 -0
  75. package/dist/bin/commands/pattern.d.ts.map +1 -0
  76. package/dist/bin/commands/pattern.js +592 -0
  77. package/dist/bin/commands/pattern.js.map +7 -0
  78. package/dist/bin/commands/query.d.ts.map +1 -1
  79. package/dist/bin/commands/reachability.d.ts +3 -0
  80. package/dist/bin/commands/reachability.d.ts.map +1 -0
  81. package/dist/bin/commands/read.d.ts +6 -0
  82. package/dist/bin/commands/read.d.ts.map +1 -0
  83. package/dist/bin/commands/refactor.d.ts +3 -0
  84. package/dist/bin/commands/refactor.d.ts.map +1 -0
  85. package/dist/bin/commands/remediation.d.ts +3 -0
  86. package/dist/bin/commands/remediation.d.ts.map +1 -0
  87. package/dist/bin/commands/sbom.d.ts +3 -0
  88. package/dist/bin/commands/sbom.d.ts.map +1 -0
  89. package/dist/bin/commands/security-ci-report.d.ts +9 -0
  90. package/dist/bin/commands/security-ci-report.d.ts.map +1 -0
  91. package/dist/bin/commands/security-export.d.ts +2 -0
  92. package/dist/bin/commands/security-export.d.ts.map +1 -0
  93. package/dist/bin/commands/security-flows.d.ts +3 -0
  94. package/dist/bin/commands/security-flows.d.ts.map +1 -0
  95. package/dist/bin/commands/security-secrets.d.ts +3 -0
  96. package/dist/bin/commands/security-secrets.d.ts.map +1 -0
  97. package/dist/bin/commands/security.d.ts +3 -0
  98. package/dist/bin/commands/security.d.ts.map +1 -0
  99. package/dist/bin/commands/security.js +15 -0
  100. package/dist/bin/commands/security.js.map +2 -2
  101. package/dist/bin/commands/snapshot.d.ts +3 -0
  102. package/dist/bin/commands/snapshot.d.ts.map +1 -0
  103. package/dist/bin/commands/staleness.d.ts +3 -0
  104. package/dist/bin/commands/staleness.d.ts.map +1 -0
  105. package/dist/bin/commands/status.d.ts.map +1 -1
  106. package/dist/bin/commands/status.js +27 -0
  107. package/dist/bin/commands/status.js.map +2 -2
  108. package/dist/bin/commands/supply-chain.d.ts +3 -0
  109. package/dist/bin/commands/supply-chain.d.ts.map +1 -0
  110. package/dist/bin/commands/surprising.d.ts +3 -0
  111. package/dist/bin/commands/surprising.d.ts.map +1 -0
  112. package/dist/bin/commands/sync.d.ts.map +1 -1
  113. package/dist/bin/commands/uninit.d.ts.map +1 -1
  114. package/dist/bin/commands/utils.d.ts +5 -0
  115. package/dist/bin/commands/utils.d.ts.map +1 -1
  116. package/dist/bin/commands/vex.d.ts +3 -0
  117. package/dist/bin/commands/vex.d.ts.map +1 -0
  118. package/dist/bin/commands/vuln-suppress.d.ts +3 -0
  119. package/dist/bin/commands/vuln-suppress.d.ts.map +1 -0
  120. package/dist/bin/commands/vulns.d.ts +3 -0
  121. package/dist/bin/commands/vulns.d.ts.map +1 -0
  122. package/dist/bin/installer/archive.d.ts +47 -0
  123. package/dist/bin/installer/archive.d.ts.map +1 -0
  124. package/dist/bin/installer/auto-detect.d.ts +16 -0
  125. package/dist/bin/installer/auto-detect.d.ts.map +1 -0
  126. package/dist/bin/installer/caveman.d.ts +12 -0
  127. package/dist/bin/installer/caveman.d.ts.map +1 -0
  128. package/dist/bin/installer/cli-agent.d.ts +7 -2
  129. package/dist/bin/installer/cli-agent.d.ts.map +1 -1
  130. package/dist/bin/installer/cli-agent.js +6 -2
  131. package/dist/bin/installer/cli-agent.js.map +2 -2
  132. package/dist/bin/installer/common.d.ts +36 -0
  133. package/dist/bin/installer/common.d.ts.map +1 -0
  134. package/dist/bin/installer/common.js +2 -1
  135. package/dist/bin/installer/common.js.map +2 -2
  136. package/dist/bin/installer/config-prompt.d.ts +1 -1
  137. package/dist/bin/installer/config-prompt.d.ts.map +1 -1
  138. package/dist/bin/installer/config-prompt.js +74 -2
  139. package/dist/bin/installer/config-prompt.js.map +2 -2
  140. package/dist/bin/installer/dashboard.d.ts.map +1 -1
  141. package/dist/bin/installer/detect.d.ts +30 -0
  142. package/dist/bin/installer/detect.d.ts.map +1 -0
  143. package/dist/bin/installer/hooks.d.ts +4 -1
  144. package/dist/bin/installer/hooks.d.ts.map +1 -1
  145. package/dist/bin/installer/hooks.js +34 -0
  146. package/dist/bin/installer/hooks.js.map +2 -2
  147. package/dist/bin/installer/index.d.ts +5 -4
  148. package/dist/bin/installer/index.d.ts.map +1 -1
  149. package/dist/bin/installer/index.js +67 -8
  150. package/dist/bin/installer/index.js.map +2 -2
  151. package/dist/bin/installer/instructions.d.ts +14 -0
  152. package/dist/bin/installer/instructions.d.ts.map +1 -0
  153. package/dist/bin/installer/instructions.js +15 -1
  154. package/dist/bin/installer/instructions.js.map +2 -2
  155. package/dist/bin/installer/mcp.d.ts.map +1 -1
  156. package/dist/bin/installer/prompts.d.ts +17 -0
  157. package/dist/bin/installer/prompts.d.ts.map +1 -1
  158. package/dist/bin/installer/qdrant-dashboard.d.ts.map +1 -1
  159. package/dist/bin/installer/steering.d.ts +14 -2
  160. package/dist/bin/installer/steering.d.ts.map +1 -1
  161. package/dist/bin/installer/steering.js +81 -0
  162. package/dist/bin/installer/steering.js.map +2 -2
  163. package/dist/bin/installer/targets/aider.d.ts +6 -0
  164. package/dist/bin/installer/targets/aider.d.ts.map +1 -0
  165. package/dist/bin/installer/targets/aider.js +3 -3
  166. package/dist/bin/installer/targets/aider.js.map +2 -2
  167. package/dist/bin/installer/targets/amp.d.ts +6 -0
  168. package/dist/bin/installer/targets/amp.d.ts.map +1 -0
  169. package/dist/bin/installer/targets/amp.js +3 -3
  170. package/dist/bin/installer/targets/amp.js.map +2 -2
  171. package/dist/bin/installer/targets/antigravity.d.ts +13 -0
  172. package/dist/bin/installer/targets/antigravity.d.ts.map +1 -0
  173. package/dist/bin/installer/targets/antigravity.js +2 -2
  174. package/dist/bin/installer/targets/antigravity.js.map +2 -2
  175. package/dist/bin/installer/targets/augment.d.ts +6 -0
  176. package/dist/bin/installer/targets/augment.d.ts.map +1 -0
  177. package/dist/bin/installer/targets/augment.js +3 -3
  178. package/dist/bin/installer/targets/augment.js.map +2 -2
  179. package/dist/bin/installer/targets/claude.d.ts +6 -0
  180. package/dist/bin/installer/targets/claude.d.ts.map +1 -0
  181. package/dist/bin/installer/targets/claude.js +2 -2
  182. package/dist/bin/installer/targets/claude.js.map +2 -2
  183. package/dist/bin/installer/targets/cline.d.ts +13 -0
  184. package/dist/bin/installer/targets/cline.d.ts.map +1 -0
  185. package/dist/bin/installer/targets/cline.js +2 -2
  186. package/dist/bin/installer/targets/cline.js.map +2 -2
  187. package/dist/bin/installer/targets/codex.d.ts +6 -0
  188. package/dist/bin/installer/targets/codex.d.ts.map +1 -0
  189. package/dist/bin/installer/targets/codex.js +2 -2
  190. package/dist/bin/installer/targets/codex.js.map +2 -2
  191. package/dist/bin/installer/targets/continue.d.ts +12 -0
  192. package/dist/bin/installer/targets/continue.d.ts.map +1 -0
  193. package/dist/bin/installer/targets/continue.js +2 -2
  194. package/dist/bin/installer/targets/continue.js.map +2 -2
  195. package/dist/bin/installer/targets/copilot-cli.d.ts +12 -0
  196. package/dist/bin/installer/targets/copilot-cli.d.ts.map +1 -0
  197. package/dist/bin/installer/targets/copilot-cli.js +2 -2
  198. package/dist/bin/installer/targets/copilot-cli.js.map +2 -2
  199. package/dist/bin/installer/targets/copilot.d.ts +6 -0
  200. package/dist/bin/installer/targets/copilot.d.ts.map +1 -0
  201. package/dist/bin/installer/targets/copilot.js +2 -2
  202. package/dist/bin/installer/targets/copilot.js.map +2 -2
  203. package/dist/bin/installer/targets/cursor.d.ts +6 -0
  204. package/dist/bin/installer/targets/cursor.d.ts.map +1 -0
  205. package/dist/bin/installer/targets/cursor.js +2 -2
  206. package/dist/bin/installer/targets/cursor.js.map +2 -2
  207. package/dist/bin/installer/targets/devin.d.ts +13 -0
  208. package/dist/bin/installer/targets/devin.d.ts.map +1 -0
  209. package/dist/bin/installer/targets/devin.js +2 -2
  210. package/dist/bin/installer/targets/devin.js.map +2 -2
  211. package/dist/bin/installer/targets/gemini-cli.d.ts +16 -0
  212. package/dist/bin/installer/targets/gemini-cli.d.ts.map +1 -0
  213. package/dist/bin/installer/targets/gemini-cli.js +2 -2
  214. package/dist/bin/installer/targets/gemini-cli.js.map +2 -2
  215. package/dist/bin/installer/targets/generic.d.ts +59 -0
  216. package/dist/bin/installer/targets/generic.d.ts.map +1 -0
  217. package/dist/bin/installer/targets/generic.js +2 -2
  218. package/dist/bin/installer/targets/generic.js.map +2 -2
  219. package/dist/bin/installer/targets/goose.d.ts +6 -0
  220. package/dist/bin/installer/targets/goose.d.ts.map +1 -0
  221. package/dist/bin/installer/targets/goose.js +3 -3
  222. package/dist/bin/installer/targets/goose.js.map +2 -2
  223. package/dist/bin/installer/targets/index.d.ts +11 -0
  224. package/dist/bin/installer/targets/index.d.ts.map +1 -0
  225. package/dist/bin/installer/targets/index.js.map +1 -1
  226. package/dist/bin/installer/targets/junie.d.ts +13 -0
  227. package/dist/bin/installer/targets/junie.d.ts.map +1 -0
  228. package/dist/bin/installer/targets/junie.js +2 -2
  229. package/dist/bin/installer/targets/junie.js.map +2 -2
  230. package/dist/bin/installer/targets/kilo.d.ts +12 -0
  231. package/dist/bin/installer/targets/kilo.d.ts.map +1 -0
  232. package/dist/bin/installer/targets/kilo.js +2 -2
  233. package/dist/bin/installer/targets/kilo.js.map +2 -2
  234. package/dist/bin/installer/targets/kiro.d.ts +5 -0
  235. package/dist/bin/installer/targets/kiro.d.ts.map +1 -0
  236. package/dist/bin/installer/targets/kiro.js +4 -4
  237. package/dist/bin/installer/targets/kiro.js.map +2 -2
  238. package/dist/bin/installer/targets/opencode.d.ts +13 -0
  239. package/dist/bin/installer/targets/opencode.d.ts.map +1 -0
  240. package/dist/bin/installer/targets/opencode.js +2 -2
  241. package/dist/bin/installer/targets/opencode.js.map +2 -2
  242. package/dist/bin/installer/targets/openhands.d.ts +6 -0
  243. package/dist/bin/installer/targets/openhands.d.ts.map +1 -0
  244. package/dist/bin/installer/targets/openhands.js +3 -3
  245. package/dist/bin/installer/targets/openhands.js.map +2 -2
  246. package/dist/bin/installer/targets/qoder.d.ts +12 -0
  247. package/dist/bin/installer/targets/qoder.d.ts.map +1 -0
  248. package/dist/bin/installer/targets/qoder.js +2 -2
  249. package/dist/bin/installer/targets/qoder.js.map +2 -2
  250. package/dist/bin/installer/targets/qwen.d.ts +12 -0
  251. package/dist/bin/installer/targets/qwen.d.ts.map +1 -0
  252. package/dist/bin/installer/targets/qwen.js +2 -2
  253. package/dist/bin/installer/targets/qwen.js.map +2 -2
  254. package/dist/bin/installer/targets/replit.d.ts +6 -0
  255. package/dist/bin/installer/targets/replit.d.ts.map +1 -0
  256. package/dist/bin/installer/targets/replit.js +3 -3
  257. package/dist/bin/installer/targets/replit.js.map +2 -2
  258. package/dist/bin/installer/targets/roo.d.ts +13 -0
  259. package/dist/bin/installer/targets/roo.d.ts.map +1 -0
  260. package/dist/bin/installer/targets/roo.js +2 -2
  261. package/dist/bin/installer/targets/roo.js.map +2 -2
  262. package/dist/bin/installer/targets/tabnine.d.ts +6 -0
  263. package/dist/bin/installer/targets/tabnine.d.ts.map +1 -0
  264. package/dist/bin/installer/targets/tabnine.js +3 -3
  265. package/dist/bin/installer/targets/tabnine.js.map +2 -2
  266. package/dist/bin/installer/targets/trae.d.ts +6 -0
  267. package/dist/bin/installer/targets/trae.d.ts.map +1 -0
  268. package/dist/bin/installer/targets/trae.js +3 -3
  269. package/dist/bin/installer/targets/trae.js.map +2 -2
  270. package/dist/bin/installer/targets/warp.d.ts +12 -0
  271. package/dist/bin/installer/targets/warp.d.ts.map +1 -0
  272. package/dist/bin/installer/targets/warp.js +2 -2
  273. package/dist/bin/installer/targets/warp.js.map +2 -2
  274. package/dist/bin/installer/targets/windsurf.d.ts +13 -0
  275. package/dist/bin/installer/targets/windsurf.d.ts.map +1 -0
  276. package/dist/bin/installer/targets/windsurf.js +2 -2
  277. package/dist/bin/installer/targets/windsurf.js.map +2 -2
  278. package/dist/bin/kirograph.js +3 -1
  279. package/dist/bin/kirograph.js.map +3 -3
  280. package/dist/bin/progress.d.ts +16 -1
  281. package/dist/bin/progress.d.ts.map +1 -1
  282. package/dist/compression/filters/aws.d.ts +9 -0
  283. package/dist/compression/filters/aws.d.ts.map +1 -0
  284. package/dist/compression/filters/docker.d.ts +6 -0
  285. package/dist/compression/filters/docker.d.ts.map +1 -0
  286. package/dist/compression/filters/files.d.ts +6 -0
  287. package/dist/compression/filters/files.d.ts.map +1 -0
  288. package/dist/compression/filters/generic.d.ts +7 -0
  289. package/dist/compression/filters/generic.d.ts.map +1 -0
  290. package/dist/compression/filters/git.d.ts +6 -0
  291. package/dist/compression/filters/git.d.ts.map +1 -0
  292. package/dist/compression/filters/github.d.ts +6 -0
  293. package/dist/compression/filters/github.d.ts.map +1 -0
  294. package/dist/compression/filters/lint.d.ts +6 -0
  295. package/dist/compression/filters/lint.d.ts.map +1 -0
  296. package/dist/compression/filters/misc.d.ts +6 -0
  297. package/dist/compression/filters/misc.d.ts.map +1 -0
  298. package/dist/compression/filters/package.d.ts +6 -0
  299. package/dist/compression/filters/package.d.ts.map +1 -0
  300. package/dist/compression/filters/test.d.ts +6 -0
  301. package/dist/compression/filters/test.d.ts.map +1 -0
  302. package/dist/compression/index.d.ts +29 -0
  303. package/dist/compression/index.d.ts.map +1 -0
  304. package/dist/compression/naive-cost.d.ts +26 -0
  305. package/dist/compression/naive-cost.d.ts.map +1 -0
  306. package/dist/compression/tracker.d.ts +155 -0
  307. package/dist/compression/tracker.d.ts.map +1 -0
  308. package/dist/compression/types.d.ts +49 -0
  309. package/dist/compression/types.d.ts.map +1 -0
  310. package/dist/config.d.ts +90 -0
  311. package/dist/config.d.ts.map +1 -1
  312. package/dist/config.js +55 -1
  313. package/dist/config.js.map +2 -2
  314. package/dist/core/lock-manager.d.ts +2 -0
  315. package/dist/core/lock-manager.d.ts.map +1 -1
  316. package/dist/core/pipeline.d.ts +4 -1
  317. package/dist/core/pipeline.d.ts.map +1 -1
  318. package/dist/core/pipeline.js +42 -0
  319. package/dist/core/pipeline.js.map +2 -2
  320. package/dist/core/snapshot.d.ts +58 -0
  321. package/dist/core/snapshot.d.ts.map +1 -0
  322. package/dist/data/filters.d.ts +23 -0
  323. package/dist/data/filters.d.ts.map +1 -0
  324. package/dist/data/indexer.d.ts +25 -0
  325. package/dist/data/indexer.d.ts.map +1 -0
  326. package/dist/data/linker.d.ts +37 -0
  327. package/dist/data/linker.d.ts.map +1 -0
  328. package/dist/data/lint.d.ts +27 -0
  329. package/dist/data/lint.d.ts.map +1 -0
  330. package/dist/data/parsers/csv.d.ts +11 -0
  331. package/dist/data/parsers/csv.d.ts.map +1 -0
  332. package/dist/data/parsers/excel.d.ts +10 -0
  333. package/dist/data/parsers/excel.d.ts.map +1 -0
  334. package/dist/data/parsers/index.d.ts +28 -0
  335. package/dist/data/parsers/index.d.ts.map +1 -0
  336. package/dist/data/parsers/json-array.d.ts +9 -0
  337. package/dist/data/parsers/json-array.d.ts.map +1 -0
  338. package/dist/data/parsers/jsonl.d.ts +9 -0
  339. package/dist/data/parsers/jsonl.d.ts.map +1 -0
  340. package/dist/data/parsers/parquet.d.ts +10 -0
  341. package/dist/data/parsers/parquet.d.ts.map +1 -0
  342. package/dist/data/profiler.d.ts +29 -0
  343. package/dist/data/profiler.d.ts.map +1 -0
  344. package/dist/data/queries.d.ts +95 -0
  345. package/dist/data/queries.d.ts.map +1 -0
  346. package/dist/data/types.d.ts +103 -0
  347. package/dist/data/types.d.ts.map +1 -0
  348. package/dist/db/database.d.ts +57 -0
  349. package/dist/db/database.d.ts.map +1 -1
  350. package/dist/db/database.js +19 -0
  351. package/dist/db/database.js.map +2 -2
  352. package/dist/db/patterns-schema.sql +23 -0
  353. package/dist/docs/formats/asciidoc.d.ts +9 -0
  354. package/dist/docs/formats/asciidoc.d.ts.map +1 -0
  355. package/dist/docs/formats/html.d.ts +10 -0
  356. package/dist/docs/formats/html.d.ts.map +1 -0
  357. package/dist/docs/formats/index.d.ts +31 -0
  358. package/dist/docs/formats/index.d.ts.map +1 -0
  359. package/dist/docs/formats/markdown.d.ts +11 -0
  360. package/dist/docs/formats/markdown.d.ts.map +1 -0
  361. package/dist/docs/formats/openapi.d.ts +17 -0
  362. package/dist/docs/formats/openapi.d.ts.map +1 -0
  363. package/dist/docs/formats/org.d.ts +9 -0
  364. package/dist/docs/formats/org.d.ts.map +1 -0
  365. package/dist/docs/formats/plaintext.d.ts +11 -0
  366. package/dist/docs/formats/plaintext.d.ts.map +1 -0
  367. package/dist/docs/formats/rdoc.d.ts +10 -0
  368. package/dist/docs/formats/rdoc.d.ts.map +1 -0
  369. package/dist/docs/formats/rst.d.ts +11 -0
  370. package/dist/docs/formats/rst.d.ts.map +1 -0
  371. package/dist/docs/indexer.d.ts +49 -0
  372. package/dist/docs/indexer.d.ts.map +1 -0
  373. package/dist/docs/linker.d.ts +30 -0
  374. package/dist/docs/linker.d.ts.map +1 -0
  375. package/dist/docs/lint.d.ts +27 -0
  376. package/dist/docs/lint.d.ts.map +1 -0
  377. package/dist/docs/queries.d.ts +78 -0
  378. package/dist/docs/queries.d.ts.map +1 -0
  379. package/dist/docs/section-id.d.ts +48 -0
  380. package/dist/docs/section-id.d.ts.map +1 -0
  381. package/dist/docs/summarizer.d.ts +13 -0
  382. package/dist/docs/summarizer.d.ts.map +1 -0
  383. package/dist/docs/types.d.ts +71 -0
  384. package/dist/docs/types.d.ts.map +1 -0
  385. package/dist/docs/vectors.d.ts +54 -0
  386. package/dist/docs/vectors.d.ts.map +1 -0
  387. package/dist/extraction/extractor.d.ts +1 -1
  388. package/dist/extraction/extractor.d.ts.map +1 -1
  389. package/dist/extraction/extractor.js +26 -3
  390. package/dist/extraction/extractor.js.map +2 -2
  391. package/dist/extraction/grammars.d.ts +6 -0
  392. package/dist/extraction/grammars.d.ts.map +1 -1
  393. package/dist/extraction/grammars.js +1 -0
  394. package/dist/extraction/grammars.js.map +2 -2
  395. package/dist/extraction/languages.d.ts.map +1 -1
  396. package/dist/extraction/languages.js +5 -1
  397. package/dist/extraction/languages.js.map +2 -2
  398. package/dist/extraction/notebook.d.ts +14 -0
  399. package/dist/extraction/notebook.d.ts.map +1 -0
  400. package/dist/frameworks/amplify.d.ts +9 -0
  401. package/dist/frameworks/amplify.d.ts.map +1 -0
  402. package/dist/frameworks/angular.d.ts +9 -0
  403. package/dist/frameworks/angular.d.ts.map +1 -0
  404. package/dist/frameworks/ansible.d.ts +8 -0
  405. package/dist/frameworks/ansible.d.ts.map +1 -0
  406. package/dist/frameworks/cloudformation.d.ts +9 -0
  407. package/dist/frameworks/cloudformation.d.ts.map +1 -0
  408. package/dist/frameworks/docker.d.ts +9 -0
  409. package/dist/frameworks/docker.d.ts.map +1 -0
  410. package/dist/frameworks/elixir.d.ts +6 -0
  411. package/dist/frameworks/elixir.d.ts.map +1 -0
  412. package/dist/frameworks/flutter.d.ts +12 -0
  413. package/dist/frameworks/flutter.d.ts.map +1 -0
  414. package/dist/frameworks/iac.d.ts +10 -0
  415. package/dist/frameworks/iac.d.ts.map +1 -0
  416. package/dist/frameworks/index.d.ts +14 -0
  417. package/dist/frameworks/index.d.ts.map +1 -1
  418. package/dist/frameworks/kubernetes.d.ts +9 -0
  419. package/dist/frameworks/kubernetes.d.ts.map +1 -0
  420. package/dist/frameworks/pulumi.d.ts +9 -0
  421. package/dist/frameworks/pulumi.d.ts.map +1 -0
  422. package/dist/frameworks/scala.d.ts +6 -0
  423. package/dist/frameworks/scala.d.ts.map +1 -0
  424. package/dist/frameworks/solidity.d.ts +6 -0
  425. package/dist/frameworks/solidity.d.ts.map +1 -0
  426. package/dist/frameworks/terraform.d.ts +14 -0
  427. package/dist/frameworks/terraform.d.ts.map +1 -0
  428. package/dist/frameworks/vue.d.ts +7 -0
  429. package/dist/frameworks/vue.d.ts.map +1 -0
  430. package/dist/graph/communities.d.ts +43 -0
  431. package/dist/graph/communities.d.ts.map +1 -0
  432. package/dist/graph/flows.d.ts +55 -0
  433. package/dist/graph/flows.d.ts.map +1 -0
  434. package/dist/graph/refactor.d.ts +43 -0
  435. package/dist/graph/refactor.d.ts.map +1 -0
  436. package/dist/index.d.ts +36 -4
  437. package/dist/index.d.ts.map +1 -1
  438. package/dist/mcp/cache.d.ts +69 -0
  439. package/dist/mcp/cache.d.ts.map +1 -0
  440. package/dist/mcp/read-modes.d.ts +31 -0
  441. package/dist/mcp/read-modes.d.ts.map +1 -0
  442. package/dist/mcp/server.d.ts +1 -0
  443. package/dist/mcp/server.d.ts.map +1 -1
  444. package/dist/mcp/server.js +15 -2
  445. package/dist/mcp/server.js.map +2 -2
  446. package/dist/mcp/tool-names.d.ts +2 -0
  447. package/dist/mcp/tool-names.d.ts.map +1 -0
  448. package/dist/mcp/tool-names.js +4 -1
  449. package/dist/mcp/tool-names.js.map +2 -2
  450. package/dist/mcp/tools.d.ts +12 -0
  451. package/dist/mcp/tools.d.ts.map +1 -1
  452. package/dist/mcp/tools.js +397 -0
  453. package/dist/mcp/tools.js.map +2 -2
  454. package/dist/memory/compress.d.ts +19 -0
  455. package/dist/memory/compress.d.ts.map +1 -0
  456. package/dist/memory/database.d.ts +92 -0
  457. package/dist/memory/database.d.ts.map +1 -0
  458. package/dist/memory/database.js +38 -0
  459. package/dist/memory/database.js.map +2 -2
  460. package/dist/memory/index.d.ts +71 -0
  461. package/dist/memory/index.d.ts.map +1 -0
  462. package/dist/memory/index.js +12 -2
  463. package/dist/memory/index.js.map +2 -2
  464. package/dist/memory/symbols.d.ts +21 -0
  465. package/dist/memory/symbols.d.ts.map +1 -0
  466. package/dist/memory/types.d.ts +78 -0
  467. package/dist/memory/types.d.ts.map +1 -0
  468. package/dist/memory/types.js.map +1 -1
  469. package/dist/memory/vectors.d.ts +43 -0
  470. package/dist/memory/vectors.d.ts.map +1 -0
  471. package/dist/patterns/graph.d.ts +16 -0
  472. package/dist/patterns/graph.d.ts.map +1 -0
  473. package/dist/patterns/graph.js +45 -0
  474. package/dist/patterns/graph.js.map +7 -0
  475. package/dist/patterns/index.d.ts +4 -0
  476. package/dist/patterns/index.d.ts.map +1 -0
  477. package/dist/patterns/index.js +39 -0
  478. package/dist/patterns/index.js.map +7 -0
  479. package/dist/patterns/indexer.d.ts +15 -0
  480. package/dist/patterns/indexer.d.ts.map +1 -0
  481. package/dist/patterns/indexer.js +97 -0
  482. package/dist/patterns/indexer.js.map +7 -0
  483. package/dist/patterns/library/code-eval-elixir.yaml +11 -0
  484. package/dist/patterns/library/command-injection-c.yaml +11 -0
  485. package/dist/patterns/library/command-injection-go.yaml +29 -0
  486. package/dist/patterns/library/command-injection-kotlin.yaml +10 -0
  487. package/dist/patterns/library/command-injection-php.yaml +11 -0
  488. package/dist/patterns/library/command-injection-ruby.yaml +11 -0
  489. package/dist/patterns/library/command-injection-rust.yaml +11 -0
  490. package/dist/patterns/library/dangerous-eval-bash.yaml +11 -0
  491. package/dist/patterns/library/dangerous-eval-js.yaml +14 -0
  492. package/dist/patterns/library/dangerous-eval-php.yaml +11 -0
  493. package/dist/patterns/library/dangerous-eval-ruby.yaml +11 -0
  494. package/dist/patterns/library/dangerous-exec-py.yaml +13 -0
  495. package/dist/patterns/library/dangerous-reflection-java.yaml +8 -0
  496. package/dist/patterns/library/dynamic-load-lua.yaml +10 -0
  497. package/dist/patterns/library/os-cmd-elixir.yaml +16 -0
  498. package/dist/patterns/library/os-execute-lua.yaml +10 -0
  499. package/dist/patterns/library/path-traversal-go.yaml +11 -0
  500. package/dist/patterns/library/path-traversal-py.yaml +12 -0
  501. package/dist/patterns/library/path-traversal-readfile-js.yaml +14 -0
  502. package/dist/patterns/library/process-launch-swift.yaml +11 -0
  503. package/dist/patterns/library/process-run-dart.yaml +15 -0
  504. package/dist/patterns/library/prototype-pollution-js.yaml +12 -0
  505. package/dist/patterns/library/source-injection-bash.yaml +11 -0
  506. package/dist/patterns/library/sql-injection-concat-js.yaml +12 -0
  507. package/dist/patterns/library/sql-injection-dart.yaml +9 -0
  508. package/dist/patterns/library/sql-injection-java.yaml +13 -0
  509. package/dist/patterns/library/sql-injection-kotlin.yaml +11 -0
  510. package/dist/patterns/library/sql-injection-php.yaml +9 -0
  511. package/dist/patterns/library/sql-injection-py.yaml +12 -0
  512. package/dist/patterns/library/sql-injection-swift.yaml +11 -0
  513. package/dist/patterns/library/sql-injection-template-js.yaml +13 -0
  514. package/dist/patterns/library/subshell-injection-ruby.yaml +8 -0
  515. package/dist/patterns/library/unsafe-block-rust.yaml +8 -0
  516. package/dist/patterns/library/unsafe-string-c.yaml +11 -0
  517. package/dist/patterns/library/weak-crypto-md5-js.yaml +13 -0
  518. package/dist/patterns/library/weak-crypto-py.yaml +13 -0
  519. package/dist/patterns/loader.d.ts +18 -0
  520. package/dist/patterns/loader.d.ts.map +1 -0
  521. package/dist/patterns/loader.js +277 -0
  522. package/dist/patterns/loader.js.map +7 -0
  523. package/dist/patterns/runner.d.ts +42 -0
  524. package/dist/patterns/runner.d.ts.map +1 -0
  525. package/dist/patterns/runner.js +295 -0
  526. package/dist/patterns/runner.js.map +7 -0
  527. package/dist/patterns/types.d.ts +27 -0
  528. package/dist/patterns/types.d.ts.map +1 -0
  529. package/dist/patterns/types.js +34 -0
  530. package/dist/patterns/types.js.map +7 -0
  531. package/dist/resolution/bridges/android-rn.d.ts +13 -0
  532. package/dist/resolution/bridges/android-rn.d.ts.map +1 -0
  533. package/dist/resolution/bridges/expo-modules.d.ts +10 -0
  534. package/dist/resolution/bridges/expo-modules.d.ts.map +1 -0
  535. package/dist/resolution/bridges/flutter-channel.d.ts +14 -0
  536. package/dist/resolution/bridges/flutter-channel.d.ts.map +1 -0
  537. package/dist/resolution/bridges/index.d.ts +40 -0
  538. package/dist/resolution/bridges/index.d.ts.map +1 -0
  539. package/dist/resolution/bridges/native-events.d.ts +10 -0
  540. package/dist/resolution/bridges/native-events.d.ts.map +1 -0
  541. package/dist/resolution/bridges/native-views.d.ts +13 -0
  542. package/dist/resolution/bridges/native-views.d.ts.map +1 -0
  543. package/dist/resolution/bridges/react-native.d.ts +9 -0
  544. package/dist/resolution/bridges/react-native.d.ts.map +1 -0
  545. package/dist/resolution/bridges/swift-objc.d.ts +14 -0
  546. package/dist/resolution/bridges/swift-objc.d.ts.map +1 -0
  547. package/dist/resolution/bridges/turbomodules.d.ts +10 -0
  548. package/dist/resolution/bridges/turbomodules.d.ts.map +1 -0
  549. package/dist/resolution/index.d.ts +28 -3
  550. package/dist/resolution/index.d.ts.map +1 -1
  551. package/dist/security/attack-surface.d.ts +46 -0
  552. package/dist/security/attack-surface.d.ts.map +1 -0
  553. package/dist/security/attack-surface.js +43 -1
  554. package/dist/security/attack-surface.js.map +2 -2
  555. package/dist/security/context-warnings.d.ts +40 -0
  556. package/dist/security/context-warnings.d.ts.map +1 -0
  557. package/dist/security/data-flows.d.ts +33 -0
  558. package/dist/security/data-flows.d.ts.map +1 -0
  559. package/dist/security/data-flows.js +65 -7
  560. package/dist/security/data-flows.js.map +2 -2
  561. package/dist/security/dep-confusion.d.ts +23 -0
  562. package/dist/security/dep-confusion.d.ts.map +1 -0
  563. package/dist/security/errors.d.ts +16 -0
  564. package/dist/security/errors.d.ts.map +1 -0
  565. package/dist/security/export/fix-suggestions.d.ts +21 -0
  566. package/dist/security/export/fix-suggestions.d.ts.map +1 -0
  567. package/dist/security/export/sbom.d.ts +33 -0
  568. package/dist/security/export/sbom.d.ts.map +1 -0
  569. package/dist/security/export/serialization.d.ts +62 -0
  570. package/dist/security/export/serialization.d.ts.map +1 -0
  571. package/dist/security/export/vex.d.ts +58 -0
  572. package/dist/security/export/vex.d.ts.map +1 -0
  573. package/dist/security/index.d.ts +21 -0
  574. package/dist/security/index.d.ts.map +1 -0
  575. package/dist/security/integrator.d.ts +63 -0
  576. package/dist/security/integrator.d.ts.map +1 -0
  577. package/dist/security/integrator.js +8 -8
  578. package/dist/security/integrator.js.map +2 -2
  579. package/dist/security/license.d.ts +33 -0
  580. package/dist/security/license.d.ts.map +1 -0
  581. package/dist/security/manifest/adapter.d.ts +92 -0
  582. package/dist/security/manifest/adapter.d.ts.map +1 -0
  583. package/dist/security/manifest/parser.d.ts +73 -0
  584. package/dist/security/manifest/parser.d.ts.map +1 -0
  585. package/dist/security/manifest/plugins/cargo.d.ts +11 -0
  586. package/dist/security/manifest/plugins/cargo.d.ts.map +1 -0
  587. package/dist/security/manifest/plugins/composer.d.ts +11 -0
  588. package/dist/security/manifest/plugins/composer.d.ts.map +1 -0
  589. package/dist/security/manifest/plugins/go.d.ts +12 -0
  590. package/dist/security/manifest/plugins/go.d.ts.map +1 -0
  591. package/dist/security/manifest/plugins/gradle.d.ts +12 -0
  592. package/dist/security/manifest/plugins/gradle.d.ts.map +1 -0
  593. package/dist/security/manifest/plugins/hex.d.ts +11 -0
  594. package/dist/security/manifest/plugins/hex.d.ts.map +1 -0
  595. package/dist/security/manifest/plugins/maven.d.ts +11 -0
  596. package/dist/security/manifest/plugins/maven.d.ts.map +1 -0
  597. package/dist/security/manifest/plugins/npm.d.ts +11 -0
  598. package/dist/security/manifest/plugins/npm.d.ts.map +1 -0
  599. package/dist/security/manifest/plugins/nuget.d.ts +12 -0
  600. package/dist/security/manifest/plugins/nuget.d.ts.map +1 -0
  601. package/dist/security/manifest/plugins/pip.d.ts +11 -0
  602. package/dist/security/manifest/plugins/pip.d.ts.map +1 -0
  603. package/dist/security/manifest/plugins/pubspec.d.ts +11 -0
  604. package/dist/security/manifest/plugins/pubspec.d.ts.map +1 -0
  605. package/dist/security/manifest/plugins/pyproject.d.ts +3 -0
  606. package/dist/security/manifest/plugins/pyproject.d.ts.map +1 -0
  607. package/dist/security/manifest/plugins/rubygems.d.ts +11 -0
  608. package/dist/security/manifest/plugins/rubygems.d.ts.map +1 -0
  609. package/dist/security/manifest/plugins/swift.d.ts +11 -0
  610. package/dist/security/manifest/plugins/swift.d.ts.map +1 -0
  611. package/dist/security/owasp.d.ts +16 -0
  612. package/dist/security/owasp.d.ts.map +1 -0
  613. package/dist/security/pipeline.d.ts +37 -0
  614. package/dist/security/pipeline.d.ts.map +1 -0
  615. package/dist/security/reachability.d.ts +67 -0
  616. package/dist/security/reachability.d.ts.map +1 -0
  617. package/dist/security/remediation.d.ts +51 -0
  618. package/dist/security/remediation.d.ts.map +1 -0
  619. package/dist/security/secrets.d.ts +38 -0
  620. package/dist/security/secrets.d.ts.map +1 -0
  621. package/dist/security/staleness.d.ts +43 -0
  622. package/dist/security/staleness.d.ts.map +1 -0
  623. package/dist/security/supply-chain.d.ts +34 -0
  624. package/dist/security/supply-chain.d.ts.map +1 -0
  625. package/dist/security/suppressions.d.ts +18 -0
  626. package/dist/security/suppressions.d.ts.map +1 -0
  627. package/dist/security/types.d.ts +144 -0
  628. package/dist/security/types.d.ts.map +1 -0
  629. package/dist/security/vuln/client.d.ts +90 -0
  630. package/dist/security/vuln/client.d.ts.map +1 -0
  631. package/dist/security/vuln/client.js.map +2 -2
  632. package/dist/security/vuln/epss-client.d.ts +26 -0
  633. package/dist/security/vuln/epss-client.d.ts.map +1 -0
  634. package/dist/security/vuln/index.d.ts +6 -0
  635. package/dist/security/vuln/index.d.ts.map +1 -0
  636. package/dist/security/vuln/osv-adapter.d.ts +58 -0
  637. package/dist/security/vuln/osv-adapter.d.ts.map +1 -0
  638. package/dist/security/vuln/types.d.ts +29 -0
  639. package/dist/security/vuln/types.d.ts.map +1 -0
  640. package/dist/sync/index.d.ts +4 -2
  641. package/dist/sync/index.d.ts.map +1 -1
  642. package/dist/types.d.ts +10 -4
  643. package/dist/types.d.ts.map +1 -1
  644. package/dist/types.js.map +2 -2
  645. package/dist/vectors/index.d.ts +11 -3
  646. package/dist/vectors/index.d.ts.map +1 -1
  647. package/dist/vectors/qdrant-index.d.ts +10 -3
  648. package/dist/vectors/qdrant-index.d.ts.map +1 -1
  649. package/dist/vectors/turboquant-index.js +261 -0
  650. package/dist/vectors/turboquant-index.js.map +7 -0
  651. package/dist/vectors/typesense-index.d.ts.map +1 -1
  652. package/dist/watchmen/index.js +83 -0
  653. package/dist/watchmen/index.js.map +7 -0
  654. package/dist/watchmen/synthesize.js +475 -0
  655. package/dist/watchmen/synthesize.js.map +7 -0
  656. package/package.json +24 -2
  657. package/dist/security/context-warnings.test.js +0 -300
  658. package/dist/security/context-warnings.test.js.map +0 -7
  659. package/dist/security/export/fix-suggestions.test.js +0 -74
  660. package/dist/security/export/fix-suggestions.test.js.map +0 -7
  661. package/dist/security/export/sbom.test.js +0 -288
  662. package/dist/security/export/sbom.test.js.map +0 -7
  663. package/dist/security/export/serialization.test.js +0 -310
  664. package/dist/security/export/serialization.test.js.map +0 -7
  665. package/dist/security/export/vex.test.js +0 -278
  666. package/dist/security/export/vex.test.js.map +0 -7
  667. package/dist/security/integrator-transitives.test.js +0 -359
  668. package/dist/security/integrator-transitives.test.js.map +0 -7
  669. package/dist/security/integrator.test.js +0 -237
  670. package/dist/security/integrator.test.js.map +0 -7
  671. package/dist/security/manifest/adapter.test.js +0 -272
  672. package/dist/security/manifest/adapter.test.js.map +0 -7
  673. package/dist/security/manifest/parser.test.js +0 -110
  674. package/dist/security/manifest/parser.test.js.map +0 -7
  675. package/dist/security/manifest/plugins/cargo.test.js +0 -304
  676. package/dist/security/manifest/plugins/cargo.test.js.map +0 -7
  677. package/dist/security/manifest/plugins/go.test.js +0 -341
  678. package/dist/security/manifest/plugins/go.test.js.map +0 -7
  679. package/dist/security/manifest/plugins/maven.test.js +0 -389
  680. package/dist/security/manifest/plugins/maven.test.js.map +0 -7
  681. package/dist/security/manifest/plugins/npm.test.js +0 -298
  682. package/dist/security/manifest/plugins/npm.test.js.map +0 -7
  683. package/dist/security/manifest/plugins/pip.test.js +0 -208
  684. package/dist/security/manifest/plugins/pip.test.js.map +0 -7
  685. package/dist/security/reachability.test.js +0 -394
  686. package/dist/security/reachability.test.js.map +0 -7
  687. package/dist/security/vuln/client.test.js +0 -288
  688. package/dist/security/vuln/client.test.js.map +0 -7
  689. package/dist/security/vuln/osv-adapter.test.js +0 -391
  690. package/dist/security/vuln/osv-adapter.test.js.map +0 -7
@@ -35,6 +35,33 @@ var fs = __toESM(require("fs"));
35
35
  var path = __toESM(require("path"));
36
36
  var import_errors = require("../../errors");
37
37
  const HOOK_EXT = ".kiro.hook";
38
+ function buildWatchmenHook(synthesisMode) {
39
+ if (synthesisMode === "local") {
40
+ return {
41
+ name: "KiroGraph Watchmen",
42
+ version: "1.0.0",
43
+ description: "After memory capture, run local model synthesis if enough observations have accumulated.",
44
+ when: { type: "agentStop" },
45
+ then: { type: "runCommand", command: "kirograph mem watchmen synthesize --quiet 2>&1 || true" }
46
+ };
47
+ }
48
+ return {
49
+ name: "KiroGraph Watchmen",
50
+ version: "1.0.0",
51
+ description: "After memory capture, check if enough observations have accumulated. If so, synthesize them into workspace brief files.",
52
+ when: { type: "agentStop" },
53
+ then: {
54
+ type: "askAgent",
55
+ prompt: `Check if KiroGraph Watchmen synthesis should run: call kirograph_mem_store with kind='note' and content='watchmen check'. If the response does not include watchmenReady: true, do nothing and stop.
56
+
57
+ If watchmenReady: true:
58
+ 1. Call kirograph_mem_search for each kind (decision, error, pattern, architecture, note) with limit 20.
59
+ 2. Write or update the workspace brief: upsert the ## KiroGraph Watchmen section in each file listed in targetFiles. For .kiro/steering/kirograph-watchmen.md use inclusion: always frontmatter with sections for Decisions, Known Errors & Fixes, Recurring Patterns, and Architecture Notes. For all other files write a compact ## KiroGraph Watchmen block.
60
+ 3. Generate skill files: if skillTargetDir is present in the response, identify recurring procedures (any procedure appearing in 3+ observations). For each, write a .kiro/steering/watchmen-<slug>.md file with inclusion: manual frontmatter, a short title, a "When to use" line with trigger phrases, and numbered steps. Prefix all generated files with watchmen- so they are distinguishable from hand-written steering files. Remove any .kiro/steering/watchmen-*.md files from previous runs that no longer match current patterns. If skillTargetDir is absent, embed a ## Recurring Procedures section in each targetFile instead, listing each procedure with trigger context and steps.
61
+ 4. Store a kind='summary' observation briefly describing what was synthesized (e.g. "Synthesized 8 observations: updated kirograph-watchmen.md, wrote watchmen-auth-flow.md and watchmen-test-pattern.md").`
62
+ }
63
+ };
64
+ }
38
65
  const HOOKS = [
39
66
  {
40
67
  filename: `kirograph-sync-if-dirty${HOOK_EXT}`,
@@ -162,6 +189,13 @@ function writeHooks(kiroDir, opts) {
162
189
  }
163
190
  writeJson(path.join(hooksDir, filename), hook);
164
191
  }
192
+ const watchmenHookPath = path.join(hooksDir, `kirograph-watchmen${HOOK_EXT}`);
193
+ if (opts?.enableWatchmen) {
194
+ const mode = opts.watchmenSynthesisMode ?? "local";
195
+ writeJson(watchmenHookPath, buildWatchmenHook(mode));
196
+ } else {
197
+ if (fs.existsSync(watchmenHookPath)) fs.unlinkSync(watchmenHookPath);
198
+ }
165
199
  console.log(` \u2713 Auto-sync hooks written to ${hooksDir}`);
166
200
  }
167
201
  // Annotate the CommonJS export names for ESM import in node:
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/bin/installer/hooks.ts"],
4
- "sourcesContent": ["/**\n * KiroGraph Installer \u2014 Kiro hook file management\n */\n\nimport * as fs from 'fs';\nimport * as path from 'path';\nimport { logWarn } from '../../errors';\n\n// \u2500\u2500 Constants \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nconst HOOK_EXT = '.kiro.hook';\n\nconst HOOKS: Array<{ filename: string; hook: object }> = [\n {\n filename: `kirograph-sync-if-dirty${HOOK_EXT}`,\n hook: {\n name: 'KiroGraph Sync on Agent Stop',\n version: '1.0.0',\n description: 'Sync the KiroGraph index when the agent stops, picking up any file edits, creates, or deletes from the session.',\n when: { type: 'agentStop' },\n then: { type: 'runCommand', command: 'kirograph sync --quiet 2>&1 > /dev/null' },\n },\n },\n {\n filename: `kirograph-compress-hint${HOOK_EXT}`,\n hook: {\n name: 'KiroGraph Compression Hint',\n version: '1.0.0',\n description: 'Remind the agent to use kirograph_exec for shell commands that benefit from token compression (git, gh, test, lint, build, docker, aws, grep).',\n when: { type: 'preToolUse', toolTypes: ['shell'] },\n then: {\n type: 'askAgent',\n prompt: 'If this shell command is a git operation, GitHub CLI, test runner, linter, build tool, file listing, grep/rg, docker/kubectl, AWS CLI, or package manager command, consider using the kirograph_exec MCP tool instead for 60-90% token savings. The tool compresses output automatically while preserving error details.',\n },\n },\n },\n {\n filename: `kirograph-mem-capture${HOOK_EXT}`,\n hook: {\n name: 'KiroGraph Memory Capture',\n version: '1.0.0',\n description: 'Prompt the agent to store important observations in memory at the end of each session.',\n when: { type: 'agentStop' },\n then: {\n type: 'askAgent',\n prompt: 'Before ending, review what happened in this session. If there were any important decisions, bug root causes, architecture insights, error patterns, or lessons learned, store them using kirograph_mem_store with the appropriate kind (decision, error, pattern, architecture, note). Keep observations concise \u2014 one fact per observation. Skip if nothing noteworthy happened.',\n },\n },\n },\n];\n\n// \u2500\u2500 Helpers \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nfunction ensureDir(p: string): void {\n fs.mkdirSync(p, { recursive: true });\n}\n\nfunction writeJson(p: string, data: unknown): void {\n fs.writeFileSync(p, JSON.stringify(data, null, 2) + '\\n');\n}\n\nfunction migrateOnIdleHooks(hooksDir: string): void {\n if (!fs.existsSync(hooksDir)) return;\n let files: string[];\n try {\n files = fs.readdirSync(hooksDir).filter(f => f.endsWith('.json') || f.endsWith(HOOK_EXT));\n } catch {\n return;\n }\n for (const file of files) {\n const filePath = path.join(hooksDir, file);\n let raw: string;\n try {\n raw = fs.readFileSync(filePath, 'utf8');\n } catch {\n logWarn(`KiroGraph installer: could not read hook file ${filePath}`);\n continue;\n }\n let obj: any;\n try {\n obj = JSON.parse(raw);\n } catch {\n logWarn(`KiroGraph installer: could not parse hook file ${filePath}`);\n continue;\n }\n let changed = false;\n if (obj?.when?.type === 'onIdle') {\n obj.when.type = 'agentStop';\n changed = true;\n }\n // Migrate .json \u2192 .kiro.hook extension\n if (file.endsWith('.json') && file.startsWith('kirograph-')) {\n const newName = file.replace(/\\.json$/, HOOK_EXT);\n const newPath = path.join(hooksDir, newName);\n try {\n fs.writeFileSync(newPath, JSON.stringify(obj, null, 2) + '\\n');\n fs.unlinkSync(filePath);\n } catch {\n logWarn(`KiroGraph installer: could not migrate hook file ${filePath} \u2192 ${newName}`);\n }\n } else if (changed) {\n try {\n fs.writeFileSync(filePath, JSON.stringify(obj, null, 2) + '\\n');\n } catch {\n logWarn(`KiroGraph installer: could not write migrated hook file ${filePath}`);\n }\n }\n }\n}\n\n// \u2500\u2500 Public \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nexport function writeHooks(kiroDir: string, opts?: { enableCompression?: boolean; enableMemory?: boolean }): void {\n const hooksDir = path.join(kiroDir, 'hooks');\n ensureDir(hooksDir);\n\n migrateOnIdleHooks(hooksDir);\n\n const oldHooks = [\n 'kirograph-sync-on-save.json', 'kirograph-sync-on-create.json',\n // Legacy .json versions (migrated to .kiro.hook)\n 'kirograph-mark-dirty-on-save.json', 'kirograph-mark-dirty-on-create.json',\n 'kirograph-sync-on-delete.json', 'kirograph-sync-if-dirty.json',\n 'kirograph-compress-hint.json', 'kirograph-mem-capture.json',\n // Removed per-file hooks (consolidated into agentStop sync)\n `kirograph-mark-dirty-on-save${HOOK_EXT}`,\n `kirograph-mark-dirty-on-create${HOOK_EXT}`,\n `kirograph-sync-on-delete${HOOK_EXT}`,\n ];\n for (const old of oldHooks) {\n const p = path.join(hooksDir, old);\n if (fs.existsSync(p)) fs.unlinkSync(p);\n }\n\n for (const { filename, hook } of HOOKS) {\n // Skip compression hook if compression is disabled\n if (filename === `kirograph-compress-hint${HOOK_EXT}` && opts?.enableCompression === false) {\n const p = path.join(hooksDir, filename);\n if (fs.existsSync(p)) fs.unlinkSync(p);\n continue;\n }\n // Skip memory hook if memory is disabled\n if (filename === `kirograph-mem-capture${HOOK_EXT}` && !opts?.enableMemory) {\n const p = path.join(hooksDir, filename);\n if (fs.existsSync(p)) fs.unlinkSync(p);\n continue;\n }\n writeJson(path.join(hooksDir, filename), hook);\n }\n\n console.log(` \u2713 Auto-sync hooks written to ${hooksDir}`);\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,SAAoB;AACpB,WAAsB;AACtB,oBAAwB;AAIxB,MAAM,WAAW;AAEjB,MAAM,QAAmD;AAAA,EACvD;AAAA,IACE,UAAU,0BAA0B,QAAQ;AAAA,IAC5C,MAAM;AAAA,MACJ,MAAM;AAAA,MACN,SAAS;AAAA,MACT,aAAa;AAAA,MACb,MAAM,EAAE,MAAM,YAAY;AAAA,MAC1B,MAAM,EAAE,MAAM,cAAc,SAAS,0CAA0C;AAAA,IACjF;AAAA,EACF;AAAA,EACA;AAAA,IACE,UAAU,0BAA0B,QAAQ;AA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,CAAC,EAAG,IAAG,WAAW,CAAC;AACrC;AAAA,IACF;AAEA,QAAI,aAAa,wBAAwB,QAAQ,MAAM,CAAC,MAAM,cAAc;AAC1E,YAAM,IAAI,KAAK,KAAK,UAAU,QAAQ;AACtC,UAAI,GAAG,WAAW,CAAC,EAAG,IAAG,WAAW,CAAC;AACrC;AAAA,IACF;AACA,cAAU,KAAK,KAAK,UAAU,QAAQ,GAAG,IAAI;AAAA,EAC/C;AAEA,UAAQ,IAAI,uCAAkC,QAAQ,EAAE;AAC1D;",
4
+ "sourcesContent": ["/**\n * KiroGraph Installer \u2014 Kiro hook file management\n */\n\nimport * as fs from 'fs';\nimport * as path from 'path';\nimport { logWarn } from '../../errors';\n\n// \u2500\u2500 Constants \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nconst HOOK_EXT = '.kiro.hook';\n\n// \u2500\u2500 Hook builders \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nfunction buildWatchmenHook(synthesisMode: 'local' | 'agent'): object {\n if (synthesisMode === 'local') {\n return {\n name: 'KiroGraph Watchmen',\n version: '1.0.0',\n description: 'After memory capture, run local model synthesis if enough observations have accumulated.',\n when: { type: 'agentStop' },\n then: { type: 'runCommand', command: 'kirograph mem watchmen synthesize --quiet 2>&1 || true' },\n };\n }\n return {\n name: 'KiroGraph Watchmen',\n version: '1.0.0',\n description: 'After memory capture, check if enough observations have accumulated. If so, synthesize them into workspace brief files.',\n when: { type: 'agentStop' },\n then: {\n type: 'askAgent',\n prompt: `Check if KiroGraph Watchmen synthesis should run: call kirograph_mem_store with kind='note' and content='watchmen check'. If the response does not include watchmenReady: true, do nothing and stop.\n\nIf watchmenReady: true:\n1. Call kirograph_mem_search for each kind (decision, error, pattern, architecture, note) with limit 20.\n2. Write or update the workspace brief: upsert the ## KiroGraph Watchmen section in each file listed in targetFiles. For .kiro/steering/kirograph-watchmen.md use inclusion: always frontmatter with sections for Decisions, Known Errors & Fixes, Recurring Patterns, and Architecture Notes. For all other files write a compact ## KiroGraph Watchmen block.\n3. Generate skill files: if skillTargetDir is present in the response, identify recurring procedures (any procedure appearing in 3+ observations). For each, write a .kiro/steering/watchmen-<slug>.md file with inclusion: manual frontmatter, a short title, a \"When to use\" line with trigger phrases, and numbered steps. Prefix all generated files with watchmen- so they are distinguishable from hand-written steering files. Remove any .kiro/steering/watchmen-*.md files from previous runs that no longer match current patterns. If skillTargetDir is absent, embed a ## Recurring Procedures section in each targetFile instead, listing each procedure with trigger context and steps.\n4. Store a kind='summary' observation briefly describing what was synthesized (e.g. \"Synthesized 8 observations: updated kirograph-watchmen.md, wrote watchmen-auth-flow.md and watchmen-test-pattern.md\").`,\n },\n };\n}\n\nconst HOOKS: Array<{ filename: string; hook: object }> = [\n {\n filename: `kirograph-sync-if-dirty${HOOK_EXT}`,\n hook: {\n name: 'KiroGraph Sync on Agent Stop',\n version: '1.0.0',\n description: 'Sync the KiroGraph index when the agent stops, picking up any file edits, creates, or deletes from the session.',\n when: { type: 'agentStop' },\n then: { type: 'runCommand', command: 'kirograph sync --quiet 2>&1 > /dev/null' },\n },\n },\n {\n filename: `kirograph-compress-hint${HOOK_EXT}`,\n hook: {\n name: 'KiroGraph Compression Hint',\n version: '1.0.0',\n description: 'Remind the agent to use kirograph_exec for shell commands that benefit from token compression (git, gh, test, lint, build, docker, aws, grep).',\n when: { type: 'preToolUse', toolTypes: ['shell'] },\n then: {\n type: 'askAgent',\n prompt: 'If this shell command is a git operation, GitHub CLI, test runner, linter, build tool, file listing, grep/rg, docker/kubectl, AWS CLI, or package manager command, consider using the kirograph_exec MCP tool instead for 60-90% token savings. The tool compresses output automatically while preserving error details.',\n },\n },\n },\n {\n filename: `kirograph-mem-capture${HOOK_EXT}`,\n hook: {\n name: 'KiroGraph Memory Capture',\n version: '1.0.0',\n description: 'Prompt the agent to store important observations in memory at the end of each session.',\n when: { type: 'agentStop' },\n then: {\n type: 'askAgent',\n prompt: 'Before ending, review what happened in this session. If there were any important decisions, bug root causes, architecture insights, error patterns, or lessons learned, store them using kirograph_mem_store with the appropriate kind (decision, error, pattern, architecture, note). Keep observations concise \u2014 one fact per observation. Skip if nothing noteworthy happened.',\n },\n },\n },\n];\n\n// \u2500\u2500 Helpers \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nfunction ensureDir(p: string): void {\n fs.mkdirSync(p, { recursive: true });\n}\n\nfunction writeJson(p: string, data: unknown): void {\n fs.writeFileSync(p, JSON.stringify(data, null, 2) + '\\n');\n}\n\nfunction migrateOnIdleHooks(hooksDir: string): void {\n if (!fs.existsSync(hooksDir)) return;\n let files: string[];\n try {\n files = fs.readdirSync(hooksDir).filter(f => f.endsWith('.json') || f.endsWith(HOOK_EXT));\n } catch {\n return;\n }\n for (const file of files) {\n const filePath = path.join(hooksDir, file);\n let raw: string;\n try {\n raw = fs.readFileSync(filePath, 'utf8');\n } catch {\n logWarn(`KiroGraph installer: could not read hook file ${filePath}`);\n continue;\n }\n let obj: any;\n try {\n obj = JSON.parse(raw);\n } catch {\n logWarn(`KiroGraph installer: could not parse hook file ${filePath}`);\n continue;\n }\n let changed = false;\n if (obj?.when?.type === 'onIdle') {\n obj.when.type = 'agentStop';\n changed = true;\n }\n // Migrate .json \u2192 .kiro.hook extension\n if (file.endsWith('.json') && file.startsWith('kirograph-')) {\n const newName = file.replace(/\\.json$/, HOOK_EXT);\n const newPath = path.join(hooksDir, newName);\n try {\n fs.writeFileSync(newPath, JSON.stringify(obj, null, 2) + '\\n');\n fs.unlinkSync(filePath);\n } catch {\n logWarn(`KiroGraph installer: could not migrate hook file ${filePath} \u2192 ${newName}`);\n }\n } else if (changed) {\n try {\n fs.writeFileSync(filePath, JSON.stringify(obj, null, 2) + '\\n');\n } catch {\n logWarn(`KiroGraph installer: could not write migrated hook file ${filePath}`);\n }\n }\n }\n}\n\n// \u2500\u2500 Public \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nexport function writeHooks(kiroDir: string, opts?: { enableCompression?: boolean; enableMemory?: boolean; enableWatchmen?: boolean; watchmenSynthesisMode?: 'local' | 'agent' }): void {\n const hooksDir = path.join(kiroDir, 'hooks');\n ensureDir(hooksDir);\n\n migrateOnIdleHooks(hooksDir);\n\n const oldHooks = [\n 'kirograph-sync-on-save.json', 'kirograph-sync-on-create.json',\n // Legacy .json versions (migrated to .kiro.hook)\n 'kirograph-mark-dirty-on-save.json', 'kirograph-mark-dirty-on-create.json',\n 'kirograph-sync-on-delete.json', 'kirograph-sync-if-dirty.json',\n 'kirograph-compress-hint.json', 'kirograph-mem-capture.json',\n // Removed per-file hooks (consolidated into agentStop sync)\n `kirograph-mark-dirty-on-save${HOOK_EXT}`,\n `kirograph-mark-dirty-on-create${HOOK_EXT}`,\n `kirograph-sync-on-delete${HOOK_EXT}`,\n ];\n for (const old of oldHooks) {\n const p = path.join(hooksDir, old);\n if (fs.existsSync(p)) fs.unlinkSync(p);\n }\n\n for (const { filename, hook } of HOOKS) {\n // Skip compression hook if compression is disabled\n if (filename === `kirograph-compress-hint${HOOK_EXT}` && opts?.enableCompression === false) {\n const p = path.join(hooksDir, filename);\n if (fs.existsSync(p)) fs.unlinkSync(p);\n continue;\n }\n // Skip memory hook if memory is disabled\n if (filename === `kirograph-mem-capture${HOOK_EXT}` && !opts?.enableMemory) {\n const p = path.join(hooksDir, filename);\n if (fs.existsSync(p)) fs.unlinkSync(p);\n continue;\n }\n writeJson(path.join(hooksDir, filename), hook);\n }\n\n // Watchmen hook \u2014 built dynamically based on synthesis mode\n const watchmenHookPath = path.join(hooksDir, `kirograph-watchmen${HOOK_EXT}`);\n if (opts?.enableWatchmen) {\n const mode = opts.watchmenSynthesisMode ?? 'local';\n writeJson(watchmenHookPath, buildWatchmenHook(mode));\n } else {\n if (fs.existsSync(watchmenHookPath)) fs.unlinkSync(watchmenHookPath);\n }\n\n console.log(` \u2713 Auto-sync hooks written to ${hooksDir}`);\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,SAAoB;AACpB,WAAsB;AACtB,oBAAwB;AAIxB,MAAM,WAAW;AAIjB,SAAS,kBAAkB,eAA0C;AACnE,MAAI,kBAAkB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IAAI,uCAAkC,QAAQ,EAAE;AAC1D;",
6
6
  "names": []
7
7
  }
@@ -1,11 +1,12 @@
1
1
  /**
2
- * KiroGraph Installer for Kiro
2
+ * KiroGraph Installer
3
3
  *
4
- * Wires up:
4
+ * The default target wires up Kiro:
5
5
  * 1. .kiro/settings/mcp.json — registers the MCP server (IDE + CLI)
6
- * 2. .kiro/hooks/*.json — auto-sync hooks for Kiro IDE
6
+ * 2. .kiro/hooks/*.kiro.hook — auto-sync hooks for Kiro IDE
7
7
  * 3. .kiro/steering/kirograph.md — teaches Kiro to use the graph tools (IDE + CLI)
8
8
  * 4. .kiro/agents/kirograph.json — custom agent config for Kiro CLI
9
9
  */
10
- export declare function runInstaller(): Promise<void>;
10
+ import type { InstallTarget } from './common';
11
+ export declare function runInstaller(target?: InstallTarget): Promise<void>;
11
12
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/bin/installer/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAkBH,wBAAsB,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC,CAqJlD"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/bin/installer/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAcH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAI9C,wBAAsB,YAAY,CAAC,MAAM,GAAE,aAAsB,GAAG,OAAO,CAAC,IAAI,CAAC,CA4QhF"}
@@ -44,7 +44,7 @@ var import_config_prompt = require("./config-prompt");
44
44
  var import_dashboard = require("./dashboard");
45
45
  var import_qdrant_dashboard = require("./qdrant-dashboard");
46
46
  var import_targets = require("./targets");
47
- async function runInstaller(target = "kiro") {
47
+ async function runInstaller(target = "kiro", opts = {}) {
48
48
  (0, import_banner.printBanner)();
49
49
  const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
50
50
  try {
@@ -52,11 +52,15 @@ async function runInstaller(target = "kiro") {
52
52
  const installer = (0, import_targets.getTargetInstaller)(target);
53
53
  console.log(` Workspace: ${cwd}
54
54
  `);
55
- const proceed = await (0, import_prompts.askToggle)(rl, `Install KiroGraph for ${installer.label}?`, "Registers the MCP server and writes integration files for this workspace.");
56
- if (!proceed) {
57
- console.log(" Cancelled.");
58
- rl.close();
59
- return;
55
+ if (!opts.yes) {
56
+ const proceed = await (0, import_prompts.askToggle)(rl, `Install KiroGraph for ${installer.label}?`, "Registers the MCP server and writes integration files for this workspace.");
57
+ if (!proceed) {
58
+ console.log(" Cancelled.");
59
+ rl.close();
60
+ return;
61
+ }
62
+ } else {
63
+ console.log(` Installing KiroGraph for ${installer.label} (--yes)`);
60
64
  }
61
65
  console.log();
62
66
  installer.installEarly(cwd);
@@ -67,7 +71,10 @@ async function runInstaller(target = "kiro") {
67
71
  let enableDocs = false;
68
72
  let enableData = false;
69
73
  let enableSecurity = false;
74
+ let enablePatterns = false;
70
75
  let enableArchitecture = false;
76
+ let enableWatchmen = false;
77
+ let watchmenSynthesisMode = "local";
71
78
  let shouldOfferIndex = false;
72
79
  let typesenseDashboard = false;
73
80
  let qdrantDashboard = false;
@@ -80,6 +87,9 @@ async function runInstaller(target = "kiro") {
80
87
  enableDocs = config.enableDocs ?? false;
81
88
  enableData = config.enableData ?? false;
82
89
  enableSecurity = config.enableSecurity ?? false;
90
+ enableWatchmen = config.enableWatchmen ?? false;
91
+ watchmenSynthesisMode = config.watchmenSynthesisMode ?? "local";
92
+ enablePatterns = config.enablePatterns ?? false;
83
93
  enableArchitecture = config.enableArchitecture ?? false;
84
94
  console.log(` \u2713 Reusing existing KiroGraph data in ${cwd}/.kirograph/`);
85
95
  console.log(` \u2022 semanticEngine: ${config.semanticEngine}`);
@@ -91,6 +101,7 @@ async function runInstaller(target = "kiro") {
91
101
  console.log(` \u2022 enableDocs: ${enableDocs}`);
92
102
  console.log(` \u2022 enableData: ${enableData}`);
93
103
  console.log(` \u2022 enableSecurity: ${enableSecurity}`);
104
+ console.log(` \u2022 enablePatterns: ${enablePatterns}`);
94
105
  } else {
95
106
  shouldOfferIndex = true;
96
107
  const patch = await (0, import_config_prompt.promptConfigOptions)(rl);
@@ -101,7 +112,10 @@ async function runInstaller(target = "kiro") {
101
112
  enableDocs = patch.enableDocs ?? false;
102
113
  enableData = patch.enableData ?? false;
103
114
  enableSecurity = patch.enableSecurity ?? false;
115
+ enablePatterns = patch.enablePatterns ?? false;
104
116
  enableArchitecture = patch.enableArchitecture ?? false;
117
+ enableWatchmen = patch.enableWatchmen ?? false;
118
+ watchmenSynthesisMode = patch.watchmenSynthesisMode ?? "local";
105
119
  typesenseDashboard = patch.typesenseDashboard;
106
120
  qdrantDashboard = patch.qdrantDashboard;
107
121
  console.log(`
@@ -184,6 +198,7 @@ async function runInstaller(target = "kiro") {
184
198
  console.log(` \u2022 enableDocs: ${enableDocs}`);
185
199
  console.log(` \u2022 enableData: ${enableData}`);
186
200
  console.log(` \u2022 enableSecurity: ${enableSecurity}`);
201
+ console.log(` \u2022 enablePatterns: ${enablePatterns}`);
187
202
  if (enableData) {
188
203
  if (patch.dataInstallExcel) {
189
204
  console.log(`
@@ -206,8 +221,51 @@ async function runInstaller(target = "kiro") {
206
221
  }
207
222
  }
208
223
  }
224
+ if (enablePatterns) {
225
+ console.log(`
226
+ Installing @ast-grep/napi...`);
227
+ const astGrepResult = (0, import_child_process.spawnSync)("npm", ["install", "@ast-grep/napi", "--save-optional"], {
228
+ stdio: "inherit",
229
+ shell: true
230
+ });
231
+ if (astGrepResult.status === 0) {
232
+ console.log(` \u2713 @ast-grep/napi installed`);
233
+ const langPackages = [
234
+ "@ast-grep/lang-go",
235
+ "@ast-grep/lang-python",
236
+ "@ast-grep/lang-java",
237
+ "@ast-grep/lang-rust",
238
+ "@ast-grep/lang-c",
239
+ "@ast-grep/lang-cpp",
240
+ "@ast-grep/lang-csharp",
241
+ "@ast-grep/lang-kotlin",
242
+ "@ast-grep/lang-swift",
243
+ "@ast-grep/lang-ruby",
244
+ "@ast-grep/lang-php",
245
+ "@ast-grep/lang-bash",
246
+ "@ast-grep/lang-scala",
247
+ "@ast-grep/lang-dart",
248
+ "@ast-grep/lang-lua",
249
+ "@ast-grep/lang-elixir",
250
+ "@ast-grep/lang-haskell"
251
+ ];
252
+ const langResult = (0, import_child_process.spawnSync)("npm", ["install", ...langPackages, "--save-optional"], {
253
+ stdio: "inherit",
254
+ shell: true
255
+ });
256
+ if (langResult.status === 0) {
257
+ console.log(` \u2713 @ast-grep language grammars installed`);
258
+ } else {
259
+ console.warn(` \u2717 Language grammar install failed. Pattern matching will be limited to JS/TS/HTML/CSS.`);
260
+ console.warn(` Run manually: npm install ${langPackages.join(" ")}`);
261
+ }
262
+ } else {
263
+ console.warn(` \u2717 @ast-grep/napi install failed. Run manually: npm install @ast-grep/napi`);
264
+ console.warn(` KiroGraph will continue but kirograph pattern and kirograph_live_search will be unavailable.`);
265
+ }
266
+ }
209
267
  }
210
- installer.installLate(cwd, cavemanMode, shellCompressionLevel, enableMemory, enableDocs, enableData, enableSecurity, enableArchitecture);
268
+ installer.installLate(cwd, cavemanMode, shellCompressionLevel, enableMemory, enableDocs, enableData, enableSecurity, enableArchitecture, enablePatterns, enableWatchmen, watchmenSynthesisMode);
211
269
  } catch (err) {
212
270
  const reason = err instanceof Error ? err.message : String(err);
213
271
  console.error(`
@@ -217,7 +275,8 @@ async function runInstaller(target = "kiro") {
217
275
  if (qdrantDashboard) {
218
276
  await (0, import_qdrant_dashboard.ensureQdrantUI)(cwd);
219
277
  }
220
- if (shouldOfferIndex && await (0, import_prompts.askToggle)(rl, "Initialize and index this project now?", "Creates .kirograph/ and indexes all source files. Takes a few seconds for small projects, longer for large ones.")) {
278
+ const doIndex = shouldOfferIndex && (opts.yes || await (0, import_prompts.askToggle)(rl, "Initialize and index this project now?", "Creates .kirograph/ and indexes all source files. Takes a few seconds for small projects, longer for large ones."));
279
+ if (doIndex) {
221
280
  const KiroGraph = (await Promise.resolve().then(() => require("../../index.js"))).default;
222
281
  const fileBytes = /* @__PURE__ */ new Map();
223
282
  const modelProgress = (file, loaded, total, done) => {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/bin/installer/index.ts"],
4
- "sourcesContent": ["/**\n * KiroGraph Installer\n *\n * The default target wires up Kiro:\n * 1. .kiro/settings/mcp.json \u2014 registers the MCP server (IDE + CLI)\n * 2. .kiro/hooks/*.kiro.hook \u2014 auto-sync hooks for Kiro IDE\n * 3. .kiro/steering/kirograph.md \u2014 teaches Kiro to use the graph tools (IDE + CLI)\n * 4. .kiro/agents/kirograph.json \u2014 custom agent config for Kiro CLI\n */\n\nimport * as readline from 'readline';\nimport * as fs from 'fs';\nimport * as path from 'path';\nimport { spawnSync } from 'child_process';\nimport { loadConfig, updateConfig } from '../../config';\nimport { printBanner } from '../banner';\nimport { renderIndexProgress } from '../progress';\nimport { dim, reset } from '../ui';\nimport { ask, askToggle } from './prompts';\nimport { promptConfigOptions } from './config-prompt';\nimport { openTypesenseDashboard } from './dashboard';\nimport { ensureQdrantUI, openQdrantDashboard } from './qdrant-dashboard';\nimport type { InstallTarget } from './common';\nimport { getTargetInstaller } from './targets';\nimport type { CavemanMode } from './caveman';\n\nexport async function runInstaller(target: InstallTarget = 'kiro'): Promise<void> {\n printBanner();\n\n const rl = readline.createInterface({ input: process.stdin, output: process.stdout });\n\n try {\n const cwd = process.cwd();\n const installer = getTargetInstaller(target);\n\n console.log(` Workspace: ${cwd}\\n`);\n\n const proceed = await askToggle(rl, `Install KiroGraph for ${installer.label}?`, 'Registers the MCP server and writes integration files for this workspace.');\n if (!proceed) { console.log(' Cancelled.'); rl.close(); return; }\n console.log();\n\n installer.installEarly(cwd);\n\n const alreadyInitialized = fs.existsSync(path.join(cwd, '.kirograph'));\n let cavemanMode: CavemanMode | 'off' = 'off';\n let shellCompressionLevel: 'off' | 'normal' | 'aggressive' | 'ultra' = 'normal';\n let enableMemory = false;\n let enableDocs = false;\n let enableData = false;\n let enableSecurity = false;\n let enableArchitecture = false;\n let shouldOfferIndex = false;\n let typesenseDashboard = false;\n let qdrantDashboard = false;\n\n try {\n if (alreadyInitialized) {\n const config = await loadConfig(cwd);\n cavemanMode = config.cavemanMode ?? 'off';\n shellCompressionLevel = config.shellCompressionLevel ?? 'normal';\n enableMemory = config.enableMemory ?? false;\n enableDocs = config.enableDocs ?? false;\n enableData = (config as any).enableData ?? false;\n enableSecurity = (config as any).enableSecurity ?? false;\n enableArchitecture = config.enableArchitecture ?? false;\n console.log(` \u2713 Reusing existing KiroGraph data in ${cwd}/.kirograph/`);\n console.log(` \u2022 semanticEngine: ${config.semanticEngine}`);\n console.log(` \u2022 enableEmbeddings: ${config.enableEmbeddings}`);\n console.log(` \u2022 enableArchitecture: ${config.enableArchitecture}`);\n console.log(` \u2022 cavemanMode: ${cavemanMode}`);\n console.log(` \u2022 shellCompressionLevel: ${shellCompressionLevel}`);\n console.log(` \u2022 enableMemory: ${enableMemory}`);\n console.log(` \u2022 enableDocs: ${enableDocs}`);\n console.log(` \u2022 enableData: ${enableData}`);\n console.log(` \u2022 enableSecurity: ${enableSecurity}`);\n } else {\n shouldOfferIndex = true;\n const patch = await promptConfigOptions(rl);\n await updateConfig(cwd, patch);\n cavemanMode = patch.cavemanMode ?? 'off';\n shellCompressionLevel = patch.shellCompressionLevel ?? 'normal';\n enableMemory = patch.enableMemory ?? false;\n enableDocs = patch.enableDocs ?? false;\n enableData = patch.enableData ?? false;\n enableSecurity = patch.enableSecurity ?? false;\n enableArchitecture = patch.enableArchitecture ?? false;\n typesenseDashboard = patch.typesenseDashboard;\n qdrantDashboard = patch.qdrantDashboard;\n\n console.log(`\\n Configuration saved to ${cwd}/.kirograph/config.json`);\n console.log(` \u2022 enableEmbeddings: ${patch.enableEmbeddings}`);\n if ('embeddingModel' in patch) {\n console.log(` \u2022 embeddingModel: ${patch.embeddingModel} ${dim}(${patch.embeddingDim}-dim)${reset}`);\n }\n if (patch.enableEmbeddings) {\n console.log(` \u2022 semanticEngine: ${patch.semanticEngine}`);\n if (patch.semanticEngine === 'sqlite-vec') {\n console.log(`\\n Installing sqlite-vec dependencies...`);\n const result = spawnSync('npm', ['install', 'better-sqlite3', 'sqlite-vec'], { stdio: 'inherit', shell: true });\n if (result.status === 0) {\n console.log(` \u2713 better-sqlite3 and sqlite-vec installed`);\n } else {\n console.warn(` \u2717 npm install failed (exit ${result.status}). Run manually:`);\n console.warn(` npm install better-sqlite3 sqlite-vec`);\n }\n } else if (patch.semanticEngine === 'orama') {\n console.log(`\\n Installing Orama dependencies...`);\n const result = spawnSync('npm', ['install', '@orama/orama', '@orama/plugin-data-persistence'], { stdio: 'inherit', shell: true });\n if (result.status === 0) {\n console.log(` \u2713 @orama/orama and @orama/plugin-data-persistence installed`);\n } else {\n console.warn(` \u2717 npm install failed (exit ${result.status}). Run manually:`);\n console.warn(` npm install @orama/orama @orama/plugin-data-persistence`);\n }\n } else if (patch.semanticEngine === 'pglite') {\n console.log(`\\n Installing PGlite dependencies...`);\n const result = spawnSync('npm', ['install', '@electric-sql/pglite'], { stdio: 'inherit', shell: true });\n if (result.status === 0) {\n console.log(` \u2713 @electric-sql/pglite installed`);\n } else {\n console.warn(` \u2717 npm install failed (exit ${result.status}). Run manually:`);\n console.warn(` npm install @electric-sql/pglite`);\n }\n } else if (patch.semanticEngine === 'lancedb') {\n console.log(`\\n Installing LanceDB dependencies...`);\n const result = spawnSync('npm', ['install', '@lancedb/lancedb'], { stdio: 'inherit', shell: true });\n if (result.status === 0) {\n console.log(` \u2713 @lancedb/lancedb installed`);\n } else {\n console.warn(` \u2717 npm install failed (exit ${result.status}). Run manually:`);\n console.warn(` npm install @lancedb/lancedb`);\n }\n } else if (patch.semanticEngine === 'qdrant') {\n console.log(`\\n Installing Qdrant dependencies...`);\n const result = spawnSync('npm', ['install', 'qdrant-local'], { stdio: 'inherit', shell: true });\n if (result.status === 0) {\n console.log(` \u2713 qdrant-local installed`);\n } else {\n console.warn(` \u2717 npm install failed (exit ${result.status}). Run manually:`);\n console.warn(` npm install qdrant-local`);\n }\n } else if (patch.semanticEngine === 'typesense') {\n console.log(`\\n Installing Typesense dependencies...`);\n const result = spawnSync('npm', ['install', 'typesense'], { stdio: 'inherit', shell: true });\n if (result.status === 0) {\n console.log(` \u2713 typesense installed`);\n console.log(` \u2139 The Typesense binary (~37MB) will be auto-downloaded on first index run.`);\n } else {\n console.warn(` \u2717 npm install failed (exit ${result.status}). Run manually:`);\n console.warn(` npm install typesense`);\n }\n }\n }\n console.log(` \u2022 extractDocstrings: ${patch.extractDocstrings}`);\n console.log(` \u2022 trackCallSites: ${patch.trackCallSites}`);\n console.log(` \u2022 enableArchitecture: ${patch.enableArchitecture}`);\n console.log(` \u2022 cavemanMode: ${cavemanMode}`);\n console.log(` \u2022 shellCompressionLevel: ${shellCompressionLevel}`);\n console.log(` \u2022 enableMemory: ${enableMemory}`);\n console.log(` \u2022 enableDocs: ${enableDocs}`);\n console.log(` \u2022 enableData: ${enableData}`);\n console.log(` \u2022 enableSecurity: ${enableSecurity}`);\n\n // Install optional data format deps if enableData is on\n if (enableData) {\n if ((patch as any).dataInstallExcel) {\n console.log(`\\n Installing xlsx...`);\n const xlsxResult = spawnSync('npm', ['install', 'xlsx'], { stdio: 'inherit', shell: true });\n if (xlsxResult.status === 0) {\n console.log(` \u2713 xlsx installed`);\n } else {\n console.warn(` \u2717 npm install failed. Run manually: npm install xlsx`);\n }\n }\n if ((patch as any).dataInstallParquet) {\n console.log(`\\n Installing parquetjs-lite...`);\n const pqResult = spawnSync('npm', ['install', 'parquetjs-lite'], { stdio: 'inherit', shell: true });\n if (pqResult.status === 0) {\n console.log(` \u2713 parquetjs-lite installed`);\n } else {\n console.warn(` \u2717 npm install failed. Run manually: npm install parquetjs-lite`);\n }\n }\n }\n }\n\n installer.installLate(cwd, cavemanMode, shellCompressionLevel, enableMemory, enableDocs, enableData, enableSecurity, enableArchitecture);\n } catch (err) {\n const reason = err instanceof Error ? err.message : String(err);\n console.error(`\\n \u2717 Failed to write configuration: ${reason}`);\n process.exit(1);\n }\n\n // 5. Pre-download Qdrant UI before indexing so Qdrant starts with static content dir\n if (qdrantDashboard) {\n await ensureQdrantUI(cwd);\n }\n\n // 6. Optionally init + index\n if (shouldOfferIndex && await askToggle(rl, 'Initialize and index this project now?', 'Creates .kirograph/ and indexes all source files. Takes a few seconds for small projects, longer for large ones.')) {\n const KiroGraph = (await Promise.resolve().then(() => require('../../index.js'))).default;\n\n const fileBytes = new Map<string, { loaded: number; total: number }>();\n const modelProgress = (file: string, loaded: number, total: number, done: boolean): void => {\n const entry = fileBytes.get(file) ?? { loaded: 0, total: 0 };\n if (total > 0) entry.total = total;\n entry.loaded = done ? entry.total : loaded;\n fileBytes.set(file, entry);\n\n // Only count files where we know the size (content-length was present)\n const knownFiles = Array.from(fileBytes.values()).filter(f => f.total > 0);\n const totalLoaded = knownFiles.reduce((s, f) => s + f.loaded, 0);\n const totalBytes = knownFiles.reduce((s, f) => s + f.total, 0);\n const pct = totalBytes > 0 ? Math.min((totalLoaded / totalBytes) * 100, 100) : 0;\n\n const filled = Math.round(pct / 5);\n const bar = '\u2588'.repeat(filled) + '\u2591'.repeat(20 - filled);\n const mb = (totalLoaded / 1024 / 1024).toFixed(1);\n const totalMb = (totalBytes / 1024 / 1024).toFixed(1);\n process.stdout.write(`\\r [${bar}] ${pct.toFixed(0).padStart(3)}% ${mb} / ${totalMb} MB `);\n };\n\n // Suppress noisy internal warnings from @huggingface/transformers during download\n const originalStderrWrite = process.stderr.write.bind(process.stderr);\n const stderrFilter = (chunk: unknown, ...args: unknown[]): boolean => {\n const str = typeof chunk === 'string' ? chunk : String(chunk);\n if (str.includes('content-length') || str.includes('dtype not specified')) return true;\n return (originalStderrWrite as (...a: unknown[]) => boolean)(chunk, ...args);\n };\n process.stderr.write = stderrFilter as typeof process.stderr.write;\n\n let cg;\n try {\n if (!KiroGraph.isInitialized(cwd)) {\n process.stdout.write(' Downloading embedding model\u2026\\n');\n cg = await KiroGraph.init(cwd, undefined, modelProgress);\n process.stdout.write('\\n');\n console.log(' \u2713 Created .kirograph/');\n } else {\n cg = await KiroGraph.open(cwd, modelProgress);\n if (fileBytes.size > 0) process.stdout.write('\\n');\n }\n } finally {\n process.stderr.write = originalStderrWrite;\n }\n console.log(' Indexing...');\n const result = await cg.indexAll({ onProgress: renderIndexProgress });\n process.stdout.write('\\n');\n console.log(` \u2713 Indexed ${result.filesIndexed} files, ${result.nodesCreated} symbols, ${result.edgesCreated} edges`);\n cg.close();\n\n if (typesenseDashboard) {\n const dashboardServer = await openTypesenseDashboard(cwd);\n console.log(` ${dim}Press Ctrl+C to stop the dashboard server when done.${reset}`);\n await new Promise<void>(resolve => {\n process.on('SIGINT', () => {\n if (dashboardServer) {\n dashboardServer.close(() => resolve());\n } else {\n resolve();\n }\n });\n });\n return; // rl.close() handled in finally\n }\n\n if (qdrantDashboard) {\n await openQdrantDashboard(cwd);\n }\n }\n\n installer.printNextSteps(cwd);\n } finally {\n rl.close();\n }\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAUA,eAA0B;AAC1B,SAAoB;AACpB,WAAsB;AACtB,2BAA0B;AAC1B,oBAAyC;AACzC,oBAA4B;AAC5B,sBAAoC;AACpC,gBAA2B;AAC3B,qBAA+B;AAC/B,2BAAoC;AACpC,uBAAuC;AACvC,8BAAoD;AAEpD,qBAAmC;AAGnC,eAAsB,aAAa,SAAwB,QAAuB;AAChF,iCAAY;AAEZ,QAAM,KAAK,SAAS,gBAAgB,EAAE,OAAO,QAAQ,OAAO,QAAQ,QAAQ,OAAO,CAAC;AAEpF,MAAI;AACF,UAAM,MAAM,QAAQ,IAAI;AACxB,UAAM,gBAAY,mCAAmB,MAAM;AAE3C,YAAQ,IAAI,gBAAgB,GAAG;AAAA,CAAI;AAEnC,UAAM,UAAU,UAAM,0BAAU,IAAI,yBAAyB,UAAU,KAAK,KAA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AQ;AAAA,YACV;AAAA,UACF,CAAC;AAAA,QACH,CAAC;AACD;AAAA,MACF;AAEA,UAAI,iBAAiB;AACnB,kBAAM,6CAAoB,GAAG;AAAA,MAC/B;AAAA,IACF;AAEA,cAAU,eAAe,GAAG;AAAA,EAC9B,UAAE;AACA,OAAG,MAAM;AAAA,EACX;AACF;",
4
+ "sourcesContent": ["/**\n * KiroGraph Installer\n *\n * The default target wires up Kiro:\n * 1. .kiro/settings/mcp.json \u2014 registers the MCP server (IDE + CLI)\n * 2. .kiro/hooks/*.kiro.hook \u2014 auto-sync hooks for Kiro IDE\n * 3. .kiro/steering/kirograph.md \u2014 teaches Kiro to use the graph tools (IDE + CLI)\n * 4. .kiro/agents/kirograph.json \u2014 custom agent config for Kiro CLI\n */\n\nimport * as readline from 'readline';\nimport * as fs from 'fs';\nimport * as path from 'path';\nimport { spawnSync } from 'child_process';\nimport { loadConfig, updateConfig } from '../../config';\nimport { printBanner } from '../banner';\nimport { renderIndexProgress } from '../progress';\nimport { dim, reset } from '../ui';\nimport { ask, askToggle } from './prompts';\nimport { promptConfigOptions } from './config-prompt';\nimport { openTypesenseDashboard } from './dashboard';\nimport { ensureQdrantUI, openQdrantDashboard } from './qdrant-dashboard';\nimport type { InstallTarget } from './common';\nimport { getTargetInstaller } from './targets';\nimport type { CavemanMode } from './caveman';\n\nexport async function runInstaller(target: InstallTarget = 'kiro', opts: { yes?: boolean } = {}): Promise<void> {\n printBanner();\n\n const rl = readline.createInterface({ input: process.stdin, output: process.stdout });\n\n try {\n const cwd = process.cwd();\n const installer = getTargetInstaller(target);\n\n console.log(` Workspace: ${cwd}\\n`);\n\n if (!opts.yes) {\n const proceed = await askToggle(rl, `Install KiroGraph for ${installer.label}?`, 'Registers the MCP server and writes integration files for this workspace.');\n if (!proceed) { console.log(' Cancelled.'); rl.close(); return; }\n } else {\n console.log(` Installing KiroGraph for ${installer.label} (--yes)`);\n }\n console.log();\n\n installer.installEarly(cwd);\n\n const alreadyInitialized = fs.existsSync(path.join(cwd, '.kirograph'));\n let cavemanMode: CavemanMode | 'off' = 'off';\n let shellCompressionLevel: 'off' | 'normal' | 'aggressive' | 'ultra' = 'normal';\n let enableMemory = false;\n let enableDocs = false;\n let enableData = false;\n let enableSecurity = false;\n let enablePatterns = false;\n let enableArchitecture = false;\n let enableWatchmen = false;\n let watchmenSynthesisMode: 'local' | 'agent' = 'local';\n let shouldOfferIndex = false;\n let typesenseDashboard = false;\n let qdrantDashboard = false;\n\n try {\n if (alreadyInitialized) {\n const config = await loadConfig(cwd);\n cavemanMode = config.cavemanMode ?? 'off';\n shellCompressionLevel = config.shellCompressionLevel ?? 'normal';\n enableMemory = config.enableMemory ?? false;\n enableDocs = config.enableDocs ?? false;\n enableData = (config as any).enableData ?? false;\n enableSecurity = (config as any).enableSecurity ?? false;\n enableWatchmen = config.enableWatchmen ?? false;\n watchmenSynthesisMode = config.watchmenSynthesisMode ?? 'local';\n enablePatterns = (config as any).enablePatterns ?? false;\n enableArchitecture = config.enableArchitecture ?? false;\n console.log(` \u2713 Reusing existing KiroGraph data in ${cwd}/.kirograph/`);\n console.log(` \u2022 semanticEngine: ${config.semanticEngine}`);\n console.log(` \u2022 enableEmbeddings: ${config.enableEmbeddings}`);\n console.log(` \u2022 enableArchitecture: ${config.enableArchitecture}`);\n console.log(` \u2022 cavemanMode: ${cavemanMode}`);\n console.log(` \u2022 shellCompressionLevel: ${shellCompressionLevel}`);\n console.log(` \u2022 enableMemory: ${enableMemory}`);\n console.log(` \u2022 enableDocs: ${enableDocs}`);\n console.log(` \u2022 enableData: ${enableData}`);\n console.log(` \u2022 enableSecurity: ${enableSecurity}`);\n console.log(` \u2022 enablePatterns: ${enablePatterns}`);\n } else {\n shouldOfferIndex = true;\n const patch = await promptConfigOptions(rl);\n await updateConfig(cwd, patch);\n cavemanMode = patch.cavemanMode ?? 'off';\n shellCompressionLevel = patch.shellCompressionLevel ?? 'normal';\n enableMemory = patch.enableMemory ?? false;\n enableDocs = patch.enableDocs ?? false;\n enableData = patch.enableData ?? false;\n enableSecurity = patch.enableSecurity ?? false;\n enablePatterns = patch.enablePatterns ?? false;\n enableArchitecture = patch.enableArchitecture ?? false;\n enableWatchmen = patch.enableWatchmen ?? false;\n watchmenSynthesisMode = patch.watchmenSynthesisMode ?? 'local';\n typesenseDashboard = patch.typesenseDashboard;\n qdrantDashboard = patch.qdrantDashboard;\n\n console.log(`\\n Configuration saved to ${cwd}/.kirograph/config.json`);\n console.log(` \u2022 enableEmbeddings: ${patch.enableEmbeddings}`);\n if ('embeddingModel' in patch) {\n console.log(` \u2022 embeddingModel: ${patch.embeddingModel} ${dim}(${patch.embeddingDim}-dim)${reset}`);\n }\n if (patch.enableEmbeddings) {\n console.log(` \u2022 semanticEngine: ${patch.semanticEngine}`);\n if (patch.semanticEngine === 'sqlite-vec') {\n console.log(`\\n Installing sqlite-vec dependencies...`);\n const result = spawnSync('npm', ['install', 'better-sqlite3', 'sqlite-vec'], { stdio: 'inherit', shell: true });\n if (result.status === 0) {\n console.log(` \u2713 better-sqlite3 and sqlite-vec installed`);\n } else {\n console.warn(` \u2717 npm install failed (exit ${result.status}). Run manually:`);\n console.warn(` npm install better-sqlite3 sqlite-vec`);\n }\n } else if (patch.semanticEngine === 'orama') {\n console.log(`\\n Installing Orama dependencies...`);\n const result = spawnSync('npm', ['install', '@orama/orama', '@orama/plugin-data-persistence'], { stdio: 'inherit', shell: true });\n if (result.status === 0) {\n console.log(` \u2713 @orama/orama and @orama/plugin-data-persistence installed`);\n } else {\n console.warn(` \u2717 npm install failed (exit ${result.status}). Run manually:`);\n console.warn(` npm install @orama/orama @orama/plugin-data-persistence`);\n }\n } else if (patch.semanticEngine === 'pglite') {\n console.log(`\\n Installing PGlite dependencies...`);\n const result = spawnSync('npm', ['install', '@electric-sql/pglite'], { stdio: 'inherit', shell: true });\n if (result.status === 0) {\n console.log(` \u2713 @electric-sql/pglite installed`);\n } else {\n console.warn(` \u2717 npm install failed (exit ${result.status}). Run manually:`);\n console.warn(` npm install @electric-sql/pglite`);\n }\n } else if (patch.semanticEngine === 'lancedb') {\n console.log(`\\n Installing LanceDB dependencies...`);\n const result = spawnSync('npm', ['install', '@lancedb/lancedb'], { stdio: 'inherit', shell: true });\n if (result.status === 0) {\n console.log(` \u2713 @lancedb/lancedb installed`);\n } else {\n console.warn(` \u2717 npm install failed (exit ${result.status}). Run manually:`);\n console.warn(` npm install @lancedb/lancedb`);\n }\n } else if (patch.semanticEngine === 'qdrant') {\n console.log(`\\n Installing Qdrant dependencies...`);\n const result = spawnSync('npm', ['install', 'qdrant-local'], { stdio: 'inherit', shell: true });\n if (result.status === 0) {\n console.log(` \u2713 qdrant-local installed`);\n } else {\n console.warn(` \u2717 npm install failed (exit ${result.status}). Run manually:`);\n console.warn(` npm install qdrant-local`);\n }\n } else if (patch.semanticEngine === 'typesense') {\n console.log(`\\n Installing Typesense dependencies...`);\n const result = spawnSync('npm', ['install', 'typesense'], { stdio: 'inherit', shell: true });\n if (result.status === 0) {\n console.log(` \u2713 typesense installed`);\n console.log(` \u2139 The Typesense binary (~37MB) will be auto-downloaded on first index run.`);\n } else {\n console.warn(` \u2717 npm install failed (exit ${result.status}). Run manually:`);\n console.warn(` npm install typesense`);\n }\n }\n }\n console.log(` \u2022 extractDocstrings: ${patch.extractDocstrings}`);\n console.log(` \u2022 trackCallSites: ${patch.trackCallSites}`);\n console.log(` \u2022 enableArchitecture: ${patch.enableArchitecture}`);\n console.log(` \u2022 cavemanMode: ${cavemanMode}`);\n console.log(` \u2022 shellCompressionLevel: ${shellCompressionLevel}`);\n console.log(` \u2022 enableMemory: ${enableMemory}`);\n console.log(` \u2022 enableDocs: ${enableDocs}`);\n console.log(` \u2022 enableData: ${enableData}`);\n console.log(` \u2022 enableSecurity: ${enableSecurity}`);\n console.log(` \u2022 enablePatterns: ${enablePatterns}`);\n\n // Install optional data format deps if enableData is on\n if (enableData) {\n if ((patch as any).dataInstallExcel) {\n console.log(`\\n Installing xlsx...`);\n const xlsxResult = spawnSync('npm', ['install', 'xlsx'], { stdio: 'inherit', shell: true });\n if (xlsxResult.status === 0) {\n console.log(` \u2713 xlsx installed`);\n } else {\n console.warn(` \u2717 npm install failed. Run manually: npm install xlsx`);\n }\n }\n if ((patch as any).dataInstallParquet) {\n console.log(`\\n Installing parquetjs-lite...`);\n const pqResult = spawnSync('npm', ['install', 'parquetjs-lite'], { stdio: 'inherit', shell: true });\n if (pqResult.status === 0) {\n console.log(` \u2713 parquetjs-lite installed`);\n } else {\n console.warn(` \u2717 npm install failed. Run manually: npm install parquetjs-lite`);\n }\n }\n }\n\n if (enablePatterns) {\n console.log(`\\n Installing @ast-grep/napi...`);\n const astGrepResult = spawnSync('npm', ['install', '@ast-grep/napi', '--save-optional'], {\n stdio: 'inherit',\n shell: true,\n });\n if (astGrepResult.status === 0) {\n console.log(` \u2713 @ast-grep/napi installed`);\n\n // Install tree-sitter grammar packages for languages beyond the built-in\n // JS/TS/HTML/CSS set. These are optional \u2014 missing packages are silently\n // skipped at runtime, so a failed install here isn't fatal.\n const langPackages = [\n '@ast-grep/lang-go',\n '@ast-grep/lang-python',\n '@ast-grep/lang-java',\n '@ast-grep/lang-rust',\n '@ast-grep/lang-c',\n '@ast-grep/lang-cpp',\n '@ast-grep/lang-csharp',\n '@ast-grep/lang-kotlin',\n '@ast-grep/lang-swift',\n '@ast-grep/lang-ruby',\n '@ast-grep/lang-php',\n '@ast-grep/lang-bash',\n '@ast-grep/lang-scala',\n '@ast-grep/lang-dart',\n '@ast-grep/lang-lua',\n '@ast-grep/lang-elixir',\n '@ast-grep/lang-haskell',\n ];\n const langResult = spawnSync('npm', ['install', ...langPackages, '--save-optional'], {\n stdio: 'inherit',\n shell: true,\n });\n if (langResult.status === 0) {\n console.log(` \u2713 @ast-grep language grammars installed`);\n } else {\n console.warn(` \u2717 Language grammar install failed. Pattern matching will be limited to JS/TS/HTML/CSS.`);\n console.warn(` Run manually: npm install ${langPackages.join(' ')}`);\n }\n } else {\n console.warn(` \u2717 @ast-grep/napi install failed. Run manually: npm install @ast-grep/napi`);\n console.warn(` KiroGraph will continue but kirograph pattern and kirograph_live_search will be unavailable.`);\n }\n }\n }\n\n installer.installLate(cwd, cavemanMode, shellCompressionLevel, enableMemory, enableDocs, enableData, enableSecurity, enableArchitecture, enablePatterns, enableWatchmen, watchmenSynthesisMode);\n } catch (err) {\n const reason = err instanceof Error ? err.message : String(err);\n console.error(`\\n \u2717 Failed to write configuration: ${reason}`);\n process.exit(1);\n }\n\n // 5. Pre-download Qdrant UI before indexing so Qdrant starts with static content dir\n if (qdrantDashboard) {\n await ensureQdrantUI(cwd);\n }\n\n // 6. Optionally init + index\n const doIndex = shouldOfferIndex && (opts.yes || await askToggle(rl, 'Initialize and index this project now?', 'Creates .kirograph/ and indexes all source files. Takes a few seconds for small projects, longer for large ones.'));\n if (doIndex) {\n const KiroGraph = (await Promise.resolve().then(() => require('../../index.js'))).default;\n\n const fileBytes = new Map<string, { loaded: number; total: number }>();\n const modelProgress = (file: string, loaded: number, total: number, done: boolean): void => {\n const entry = fileBytes.get(file) ?? { loaded: 0, total: 0 };\n if (total > 0) entry.total = total;\n entry.loaded = done ? entry.total : loaded;\n fileBytes.set(file, entry);\n\n // Only count files where we know the size (content-length was present)\n const knownFiles = Array.from(fileBytes.values()).filter(f => f.total > 0);\n const totalLoaded = knownFiles.reduce((s, f) => s + f.loaded, 0);\n const totalBytes = knownFiles.reduce((s, f) => s + f.total, 0);\n const pct = totalBytes > 0 ? Math.min((totalLoaded / totalBytes) * 100, 100) : 0;\n\n const filled = Math.round(pct / 5);\n const bar = '\u2588'.repeat(filled) + '\u2591'.repeat(20 - filled);\n const mb = (totalLoaded / 1024 / 1024).toFixed(1);\n const totalMb = (totalBytes / 1024 / 1024).toFixed(1);\n process.stdout.write(`\\r [${bar}] ${pct.toFixed(0).padStart(3)}% ${mb} / ${totalMb} MB `);\n };\n\n // Suppress noisy internal warnings from @huggingface/transformers during download\n const originalStderrWrite = process.stderr.write.bind(process.stderr);\n const stderrFilter = (chunk: unknown, ...args: unknown[]): boolean => {\n const str = typeof chunk === 'string' ? chunk : String(chunk);\n if (str.includes('content-length') || str.includes('dtype not specified')) return true;\n return (originalStderrWrite as (...a: unknown[]) => boolean)(chunk, ...args);\n };\n process.stderr.write = stderrFilter as typeof process.stderr.write;\n\n let cg;\n try {\n if (!KiroGraph.isInitialized(cwd)) {\n process.stdout.write(' Downloading embedding model\u2026\\n');\n cg = await KiroGraph.init(cwd, undefined, modelProgress);\n process.stdout.write('\\n');\n console.log(' \u2713 Created .kirograph/');\n } else {\n cg = await KiroGraph.open(cwd, modelProgress);\n if (fileBytes.size > 0) process.stdout.write('\\n');\n }\n } finally {\n process.stderr.write = originalStderrWrite;\n }\n console.log(' Indexing...');\n const result = await cg.indexAll({ onProgress: renderIndexProgress });\n process.stdout.write('\\n');\n console.log(` \u2713 Indexed ${result.filesIndexed} files, ${result.nodesCreated} symbols, ${result.edgesCreated} edges`);\n cg.close();\n\n if (typesenseDashboard) {\n const dashboardServer = await openTypesenseDashboard(cwd);\n console.log(` ${dim}Press Ctrl+C to stop the dashboard server when done.${reset}`);\n await new Promise<void>(resolve => {\n process.on('SIGINT', () => {\n if (dashboardServer) {\n dashboardServer.close(() => resolve());\n } else {\n resolve();\n }\n });\n });\n return; // rl.close() handled in finally\n }\n\n if (qdrantDashboard) {\n await openQdrantDashboard(cwd);\n }\n }\n\n installer.printNextSteps(cwd);\n } finally {\n rl.close();\n }\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAUA,eAA0B;AAC1B,SAAoB;AACpB,WAAsB;AACtB,2BAA0B;AAC1B,oBAAyC;AACzC,oBAA4B;AAC5B,sBAAoC;AACpC,gBAA2B;AAC3B,qBAA+B;AAC/B,2BAAoC;AACpC,uBAAuC;AACvC,8BAAoD;AAEpD,qBAAmC;AAGnC,eAAsB,aAAa,SAAwB,QAAQ,OAA0B,CAAC,GAA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AQ,OAAO,MAAM,IAAI;AACzB,cAAQ,IAAI,oBAAe,OAAO,YAAY,WAAW,OAAO,YAAY,aAAa,OAAO,YAAY,QAAQ;AACpH,SAAG,MAAM;AAET,UAAI,oBAAoB;AACtB,cAAM,kBAAkB,UAAM,yCAAuB,GAAG;AACxD,gBAAQ,IAAI,KAAK,aAAG,uDAAuD,eAAK,EAAE;AAClF,cAAM,IAAI,QAAc,aAAW;AACjC,kBAAQ,GAAG,UAAU,MAAM;AACzB,gBAAI,iBAAiB;AACnB,8BAAgB,MAAM,MAAM,QAAQ,CAAC;AAAA,YACvC,OAAO;AACL,sBAAQ;AAAA,YACV;AAAA,UACF,CAAC;AAAA,QACH,CAAC;AACD;AAAA,MACF;AAEA,UAAI,iBAAiB;AACnB,kBAAM,6CAAoB,GAAG;AAAA,MAC/B;AAAA,IACF;AAEA,cAAU,eAAe,GAAG;AAAA,EAC9B,UAAE;AACA,OAAG,MAAM;AAAA,EACX;AACF;",
6
6
  "names": []
7
7
  }
@@ -0,0 +1,14 @@
1
+ import { CavemanMode } from './caveman';
2
+ export interface InstructionOptions {
3
+ cavemanMode?: CavemanMode | 'off';
4
+ shellCompressionLevel?: 'off' | 'normal' | 'aggressive' | 'ultra';
5
+ enableArchitecture?: boolean;
6
+ enableMemory?: boolean;
7
+ enableDocs?: boolean;
8
+ enableData?: boolean;
9
+ enableSecurity?: boolean;
10
+ enablePatterns?: boolean;
11
+ hasHooks?: boolean;
12
+ }
13
+ export declare function buildAgentInstructions(cavemanModeOrOpts?: CavemanMode | 'off' | InstructionOptions): string;
14
+ //# sourceMappingURL=instructions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"instructions.d.ts","sourceRoot":"","sources":["../../../src/bin/installer/instructions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,WAAW,EAAE,MAAM,WAAW,CAAC;AAEvD,MAAM,WAAW,kBAAkB;IACjC,WAAW,CAAC,EAAE,WAAW,GAAG,KAAK,CAAC;IAClC,qBAAqB,CAAC,EAAE,KAAK,GAAG,QAAQ,GAAG,YAAY,GAAG,OAAO,CAAC;IAClE,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AA6BD,wBAAgB,sBAAsB,CAAC,iBAAiB,CAAC,EAAE,WAAW,GAAG,KAAK,GAAG,kBAAkB,GAAG,MAAM,CA2O3G"}
@@ -57,6 +57,7 @@ function buildAgentInstructions(cavemanModeOrOpts) {
57
57
  const enableDocs = opts.enableDocs ?? false;
58
58
  const enableData = opts.enableData ?? false;
59
59
  const enableSecurity = opts.enableSecurity ?? false;
60
+ const enablePatterns = opts.enablePatterns ?? false;
60
61
  let content = `# KiroGraph
61
62
 
62
63
  KiroGraph builds a local semantic knowledge graph of this codebase. When the \`kirograph\` MCP server is available, prefer its tools over broad grep/glob/file-read exploration.
@@ -81,7 +82,7 @@ KiroGraph builds a local semantic knowledge graph of this codebase. When the \`k
81
82
  | Any unexpected cross-module coupling? | \`kirograph_surprising\` |
82
83
  | What changed since the last snapshot? | \`kirograph_diff\` |
83
84
  ${enableArchitecture ? "| What packages/layers exist? | `kirograph_architecture` |\n| How coupled is package X? | `kirograph_coupling` |\n| What does package X depend on? | `kirograph_package` |\n" : ""}
84
- ${enableCompression ? "| Run a command with token savings | `kirograph_exec` |\n| Check token savings stats | `kirograph_gain` |\n" : ""}${enableMemory ? "| Search past decisions/patterns | `kirograph_mem_search` |\n| Store an observation | `kirograph_mem_store` |\n" : ""}${enableDocs ? "| Find a doc section | `kirograph_docs_search` |\n| Get doc table of contents | `kirograph_docs_toc` |\n" : ""}${enableData ? "| What datasets are indexed? | `kirograph_data_list` |\n| Query rows with filters | `kirograph_data_query` |\n| Aggregate data server-side | `kirograph_data_aggregate` |\n" : ""}${enableSecurity ? "| Are there vulnerable dependencies? | `kirograph_security` |\n| Which CVEs affect my project? | `kirograph_vulns` |\n| Is this vulnerability reachable? | `kirograph_reachability` |\n| What licenses do my deps use? | `kirograph_licenses` |\n| Are dependencies outdated? | `kirograph_staleness` |\n" : ""}
85
+ ${enableCompression ? "| Run a command with token savings | `kirograph_exec` |\n| Check token savings stats | `kirograph_gain` |\n" : ""}${enableMemory ? "| Search past decisions/patterns | `kirograph_mem_search` |\n| Store an observation | `kirograph_mem_store` |\n" : ""}${enableDocs ? "| Find a doc section | `kirograph_docs_search` |\n| Get doc table of contents | `kirograph_docs_toc` |\n" : ""}${enableData ? "| What datasets are indexed? | `kirograph_data_list` |\n| Query rows with filters | `kirograph_data_query` |\n| Aggregate data server-side | `kirograph_data_aggregate` |\n" : ""}${enableSecurity ? "| Are there vulnerable dependencies? | `kirograph_security` |\n| Which CVEs affect my project? | `kirograph_vulns` |\n| Is this vulnerability reachable? | `kirograph_reachability` |\n| What licenses do my deps use? | `kirograph_licenses` |\n| Are dependencies outdated? | `kirograph_staleness` |\n" : ""}${enablePatterns ? "| Find structural code patterns? | `kirograph_live_search` |\n| Browse SAST rules | `kirograph pattern --list` |\n" : ""}
85
86
  ## Tool selection
86
87
 
87
88
  - Start code tasks with \`kirograph_context\`.
@@ -227,6 +228,19 @@ production deploy, or when the user asks about security/compliance.
227
228
  **EPSS scores:** >= 0.5 = patch immediately; 0.1\u20130.5 = elevated risk; < 0.1 = low probability.
228
229
 
229
230
  **Workflow:** \`kirograph_security\` \u2192 \`kirograph_vulns --verdict affected\` \u2192 \`kirograph_reachability <cve>\` \u2192 fix \u2192 \`kirograph_vulns --refresh\`
231
+ `;
232
+ }
233
+ if (enablePatterns) {
234
+ content += `
235
+ ## Pattern Search
236
+
237
+ KiroGraph supports AST structural pattern search via \`kirograph_live_search\` (only available when \`enablePatterns: true\` and \`@ast-grep/napi\` is installed).
238
+
239
+ - \`kirograph_live_search\` \u2014 find any structural code pattern across the indexed file list
240
+ - \`kirograph pattern --list\` \u2014 browse 10 bundled SAST rules (SQL injection, eval, path traversal, etc.)
241
+ - \`kirograph pattern --library <id>\` \u2014 run a specific library rule
242
+
243
+ Use \`kirograph_live_search\` when you need to find patterns that can't be expressed as symbol names: anonymous functions, specific code structures, or security anti-patterns.
230
244
  `;
231
245
  }
232
246
  if (!opts.hasHooks) {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/bin/installer/instructions.ts"],
4
- "sourcesContent": ["import { CAVEMAN_RULES, CavemanMode } from './caveman';\n\nexport interface InstructionOptions {\n cavemanMode?: CavemanMode | 'off';\n shellCompressionLevel?: 'off' | 'normal' | 'aggressive' | 'ultra';\n enableArchitecture?: boolean;\n enableMemory?: boolean;\n enableDocs?: boolean;\n enableData?: boolean;\n enableSecurity?: boolean;\n hasHooks?: boolean;\n}\n\nconst LEVEL_DESCRIPTIONS: Record<string, string> = {\n normal: 'Balanced: removes noise, keeps structure.',\n aggressive: 'Compact: groups by category, limits output.',\n ultra: 'Maximum compression: counts and summaries only.',\n};\n\nconst LEVEL_EXAMPLES: Record<string, string> = {\n normal: `\\`\\`\\`\nkirograph_exec(command: \"git status\")\nkirograph_exec(command: \"npm test\")\nkirograph_exec(command: \"cargo build\")\nkirograph_exec(command: \"ls -la src/\")\n\\`\\`\\``,\n aggressive: `\\`\\`\\`\nkirograph_exec(command: \"git status\", level: \"aggressive\")\nkirograph_exec(command: \"npm test\", level: \"aggressive\")\nkirograph_exec(command: \"eslint .\", level: \"aggressive\")\nkirograph_exec(command: \"find . -name '*.ts'\", level: \"aggressive\")\n\\`\\`\\``,\n ultra: `\\`\\`\\`\nkirograph_exec(command: \"git status\", level: \"ultra\")\nkirograph_exec(command: \"npm test\", level: \"ultra\")\nkirograph_exec(command: \"docker ps\", level: \"ultra\")\nkirograph_exec(command: \"ls -la src/\", level: \"ultra\")\n\\`\\`\\``,\n};\n\nexport function buildAgentInstructions(cavemanModeOrOpts?: CavemanMode | 'off' | InstructionOptions): string {\n // Support both old signature (cavemanMode string) and new signature (options object)\n const opts: InstructionOptions = typeof cavemanModeOrOpts === 'object' && cavemanModeOrOpts !== null\n ? cavemanModeOrOpts\n : { cavemanMode: cavemanModeOrOpts ?? undefined };\n\n const cavemanMode = opts.cavemanMode;\n const enableCompression = opts.shellCompressionLevel && opts.shellCompressionLevel !== 'off';\n const shellCompressionLevel = opts.shellCompressionLevel ?? 'normal';\n const enableArchitecture = opts.enableArchitecture ?? false;\n const enableMemory = opts.enableMemory ?? false;\n const enableDocs = opts.enableDocs ?? false;\n const enableData = opts.enableData ?? false;\n const enableSecurity = opts.enableSecurity ?? false;\n\n let content = `# KiroGraph\n\nKiroGraph builds a local semantic knowledge graph of this codebase. When the \\`kirograph\\` MCP server is available, prefer its tools over broad grep/glob/file-read exploration.\n\n## Quick decision guide\n\n| Question | Tool |\n|----------|------|\n| Where do I start on this task? | \\`kirograph_context\\` |\n| What is this symbol / show me its code | \\`kirograph_node\\` with \\`includeCode: true\\` |\n| Find a symbol by name | \\`kirograph_search\\` |\n| Who calls function X? | \\`kirograph_callers\\` |\n| What does function X call? | \\`kirograph_callees\\` |\n| What breaks if I change X? | \\`kirograph_impact\\` |\n| How are X and Y connected? | \\`kirograph_path\\` |\n| What extends / implements this type? | \\`kirograph_type_hierarchy\\` |\n| Which code is never called? | \\`kirograph_dead_code\\` |\n| Are there import cycles? | \\`kirograph_circular_deps\\` |\n| What files are indexed? | \\`kirograph_files\\` |\n| Is the index healthy? | \\`kirograph_status\\` |\n| What are the most critical symbols? | \\`kirograph_hotspots\\` |\n| Any unexpected cross-module coupling? | \\`kirograph_surprising\\` |\n| What changed since the last snapshot? | \\`kirograph_diff\\` |\n${enableArchitecture ? '| What packages/layers exist? | `kirograph_architecture` |\\n| How coupled is package X? | `kirograph_coupling` |\\n| What does package X depend on? | `kirograph_package` |\\n' : ''}\n${enableCompression ? '| Run a command with token savings | `kirograph_exec` |\\n| Check token savings stats | `kirograph_gain` |\\n' : ''}${enableMemory ? '| Search past decisions/patterns | `kirograph_mem_search` |\\n| Store an observation | `kirograph_mem_store` |\\n' : ''}${enableDocs ? '| Find a doc section | `kirograph_docs_search` |\\n| Get doc table of contents | `kirograph_docs_toc` |\\n' : ''}${enableData ? '| What datasets are indexed? | `kirograph_data_list` |\\n| Query rows with filters | `kirograph_data_query` |\\n| Aggregate data server-side | `kirograph_data_aggregate` |\\n' : ''}${enableSecurity ? '| Are there vulnerable dependencies? | `kirograph_security` |\\n| Which CVEs affect my project? | `kirograph_vulns` |\\n| Is this vulnerability reachable? | `kirograph_reachability` |\\n| What licenses do my deps use? | `kirograph_licenses` |\\n| Are dependencies outdated? | `kirograph_staleness` |\\n' : ''}\n## Tool selection\n\n- Start code tasks with \\`kirograph_context\\`.\n- Find symbols by name with \\`kirograph_search\\`.\n- Inspect a symbol with \\`kirograph_node\\`; set \\`includeCode: true\\` only when source is needed.\n- Trace call flow with \\`kirograph_callers\\` and \\`kirograph_callees\\`.\n- Check blast radius before edits with \\`kirograph_impact\\`.\n- Use \\`kirograph_path\\` to explain how two symbols connect.\n- Use \\`kirograph_type_hierarchy\\` for inheritance/interface questions.\n- Use \\`kirograph_files\\` to inspect indexed file structure.\n- Use \\`kirograph_status\\` if results seem stale or incomplete.\n- Use \\`kirograph_architecture\\`, \\`kirograph_coupling\\`, and \\`kirograph_package\\` for package/layer questions when architecture analysis is enabled.\n- Use \\`kirograph_hotspots\\`, \\`kirograph_surprising\\`, and \\`kirograph_diff\\` for refactor planning and review.\n\n## Workflow\n\n1. Call \\`kirograph_context\\` for orientation.\n2. Drill into specific symbols with \\`kirograph_node\\`.\n3. Use graph traversal tools before reading unrelated files.\n4. Fall back to normal filesystem tools only when the graph is missing, stale, or lacks the needed detail.\n\nIf \\`.kirograph/\\` does not exist, ask whether to run \\`kirograph init --index\\`.\n`;\n\n // Shell compression section\n if (enableCompression) {\n const level = shellCompressionLevel as 'normal' | 'aggressive' | 'ultra';\n content += `\n## Shell Compression (\\`kirograph_exec\\`)\n\nWhen running shell commands, prefer \\`kirograph_exec\\` over raw shell execution for:\n- **git** operations (status, log, diff, push, pull, commit, add, fetch, branch)\n- **GitHub CLI** (gh pr list/view, gh issue list, gh run list)\n- **test runners** (jest, vitest, pytest, cargo test, go test, rspec, minitest, playwright)\n- **linters/build** (eslint, tsc, ruff, clippy, cargo build, prettier, biome, golangci-lint, rubocop, next build)\n- **file listings** (ls, find, tree)\n- **search** (grep, rg/ripgrep: grouped by file)\n- **diff** (diff file1 file2: condensed context)\n- **docker/k8s** (docker ps, images, logs, compose ps, kubectl pods, logs, services)\n- **package managers** (npm/pnpm install/list, pip list/install, bundle install, prisma generate)\n- **AWS CLI** (sts, ec2, lambda, logs, cloudformation, dynamodb, iam, s3, ecs, sqs, sns)\n- **network** (curl, wget: strip progress bars and headers)\n\nThis saves 60-90% of tokens compared to raw output.\n\nCompression level: **${level}**: ${LEVEL_DESCRIPTIONS[level]}\n\n${LEVEL_EXAMPLES[level]}\n\n**Important:** Error details are always preserved. Failed commands show full diagnostic output regardless of level.\n\n**Do NOT re-run commands:** When \\`kirograph_exec\\` returns a result, treat it as the final answer. Never re-run the same command with raw shell execution to \"get more details.\" The compressed output preserves all essential information. If you genuinely need something missing from the output, explain what's missing before making a second call.\n\nUse \\`kirograph_gain\\` to check token savings statistics.\n`;\n }\n\n // Memory section\n if (enableMemory) {\n content += `\n## Memory\n\nKiroGraph has persistent memory. Use \\`kirograph_mem_search\\` to recall past decisions,\nerrors, and patterns before making changes. Use \\`kirograph_mem_store\\` to save important\nobservations (architecture decisions, bug root causes, patterns discovered).\n\nMemory is searchable via hybrid FTS + vector search. Observations are automatically\nlinked to code symbols in the graph and surface in \\`kirograph_context\\` and\n\\`kirograph_impact\\` results when relevant.\n\n**When to store:** After fixing a bug, making an architecture decision, discovering a pattern,\nencountering a non-obvious error, or learning something about the codebase that future sessions\nshould know. Keep observations concise \u2014 one fact per store call.\n`;\n }\n\n // Architecture section\n if (enableArchitecture) {\n content += `\n## Architecture\n\nKiroGraph analyzes the package structure and layer dependencies of the codebase.\n\n- \\`kirograph_architecture\\` \u2014 full package graph, detected layers (api/service/data/ui/shared), dependency edges\n- \\`kirograph_coupling\\` \u2014 Ca (afferent), Ce (efferent), instability per package; high Ca = load-bearing, high Ce = volatile\n- \\`kirograph_package\\` \u2014 drill into a single package: coupling metrics, deps, dependents, files\n\nUse \\`kirograph_architecture\\` for architectural questions instead of reading directory trees.\nHigh Ca + low instability = risky to change interface. High Ce + high instability = safe to refactor internals.\n`;\n }\n\n // Documentation section\n if (enableDocs) {\n content += `\n## Documentation\n\nKiroGraph indexes project documentation by heading structure. Use \\`kirograph_docs_search\\`\nto find relevant sections instead of reading entire files.\n\n- \\`kirograph_docs_toc\\` \u2014 table of contents for a file or the whole project\n- \\`kirograph_docs_search\\` \u2014 search sections by query\n- \\`kirograph_docs_section\\` \u2014 retrieve full section content by ID\n- \\`kirograph_docs_outline\\` \u2014 heading hierarchy for a single file\n- \\`kirograph_docs_refs\\` \u2014 code \u2194 doc cross-references\n\nBefore reading a doc file directly, try \\`kirograph_docs_search\\` or \\`kirograph_docs_outline\\` first.\n`;\n }\n\n // Data section\n if (enableData) {\n content += `\n## Data\n\nKiroGraph indexes tabular data files (CSV, TSV, JSONL, JSON, Excel, Parquet).\n\n- \\`kirograph_data_list\\` \u2014 list all indexed datasets\n- \\`kirograph_data_describe\\` \u2014 schema profile: column names, types, cardinality, samples\n- \\`kirograph_data_query\\` \u2014 filtered row retrieval (eq, gt, contains, in, between)\n- \\`kirograph_data_aggregate\\` \u2014 server-side GROUP BY: count, sum, avg, min, max\n\nUse \\`kirograph_data_describe\\` before reading a data file. Use \\`kirograph_data_query\\` with\nfilters instead of loading all rows. Use \\`kirograph_data_aggregate\\` for statistics.\nThis saves 95-99% of tokens compared to reading raw data files.\n`;\n }\n\n // Security section\n if (enableSecurity) {\n content += `\n## Security\n\nKiroGraph scans dependency manifests across 14 ecosystems for known vulnerabilities, performs\ncall-graph reachability analysis, tracks EPSS exploitation probability, checks license\ncompliance, and monitors dependency staleness.\n\n**Available tools:**\n- \\`kirograph_security\\` \u2014 overview: dep count, CVE count, verdict breakdown, stale warnings\n- \\`kirograph_vulns\\` \u2014 list CVEs with severity, EPSS score, reachability verdict, fix suggestion\n- \\`kirograph_reachability\\` \u2014 call paths, entry points, affected layers for one CVE or package\n- \\`kirograph_licenses\\` \u2014 list dependency licenses; flag policy violations\n- \\`kirograph_staleness\\` \u2014 identify outdated dependencies (staleness score 0.0\u20131.0)\n- \\`kirograph_sbom\\` / \\`kirograph_vex\\` \u2014 export CycloneDX 1.5 SBOM and VEX documents\n- \\`kirograph_vuln_add\\` \u2014 manually register a private/internal CVE\n\n**Proactive triggers:** Run \\`kirograph_security\\` when a dependency is added/updated, before a\nproduction deploy, or when the user asks about security/compliance.\n\n**Interpreting verdicts:**\n- \\`affected\\` \u2014 a call path exists from an entry point to the vulnerable code. Act on this.\n- \\`not_affected\\` \u2014 no reachable path found. Strong signal: likely safe.\n- \\`under_investigation\\` \u2014 unresolved symbols in traversal. Treat with caution.\n\n**EPSS scores:** >= 0.5 = patch immediately; 0.1\u20130.5 = elevated risk; < 0.1 = low probability.\n\n**Workflow:** \\`kirograph_security\\` \u2192 \\`kirograph_vulns --verdict affected\\` \u2192 \\`kirograph_reachability <cve>\\` \u2192 fix \u2192 \\`kirograph_vulns --refresh\\`\n`;\n }\n\n // Session hygiene for tools without hooks\n if (!opts.hasHooks) {\n content += `\n## Session Hygiene\n\nThis tool does not have automatic sync hooks. To keep the index fresh:\n- Run \\`kirograph sync\\` at the **start** of each session if files changed outside the agent.\n- Run \\`kirograph sync\\` at the **end** of each session after making changes.\n- If results from graph tools seem stale, run \\`kirograph sync\\` before retrying.\n${enableMemory ? '- Store important observations with `kirograph_mem_store` before ending your session.\\n' : ''}`;\n }\n\n // Caveman mode\n const caveman = cavemanMode && cavemanM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;AACpF,MAAI,SAAS;AACX,cAAU,QAAQ,QAAQ,IAAI,SAAS,UAAU;AAAA,EACnD;AAEA,SAAO;AACT;",
4
+ "sourcesContent": ["import { CAVEMAN_RULES, CavemanMode } from './caveman';\n\nexport interface InstructionOptions {\n cavemanMode?: CavemanMode | 'off';\n shellCompressionLevel?: 'off' | 'normal' | 'aggressive' | 'ultra';\n enableArchitecture?: boolean;\n enableMemory?: boolean;\n enableDocs?: boolean;\n enableData?: boolean;\n enableSecurity?: boolean;\n enablePatterns?: boolean;\n hasHooks?: boolean;\n}\n\nconst LEVEL_DESCRIPTIONS: Record<string, string> = {\n normal: 'Balanced: removes noise, keeps structure.',\n aggressive: 'Compact: groups by category, limits output.',\n ultra: 'Maximum compression: counts and summaries only.',\n};\n\nconst LEVEL_EXAMPLES: Record<string, string> = {\n normal: `\\`\\`\\`\nkirograph_exec(command: \"git status\")\nkirograph_exec(command: \"npm test\")\nkirograph_exec(command: \"cargo build\")\nkirograph_exec(command: \"ls -la src/\")\n\\`\\`\\``,\n aggressive: `\\`\\`\\`\nkirograph_exec(command: \"git status\", level: \"aggressive\")\nkirograph_exec(command: \"npm test\", level: \"aggressive\")\nkirograph_exec(command: \"eslint .\", level: \"aggressive\")\nkirograph_exec(command: \"find . -name '*.ts'\", level: \"aggressive\")\n\\`\\`\\``,\n ultra: `\\`\\`\\`\nkirograph_exec(command: \"git status\", level: \"ultra\")\nkirograph_exec(command: \"npm test\", level: \"ultra\")\nkirograph_exec(command: \"docker ps\", level: \"ultra\")\nkirograph_exec(command: \"ls -la src/\", level: \"ultra\")\n\\`\\`\\``,\n};\n\nexport function buildAgentInstructions(cavemanModeOrOpts?: CavemanMode | 'off' | InstructionOptions): string {\n // Support both old signature (cavemanMode string) and new signature (options object)\n const opts: InstructionOptions = typeof cavemanModeOrOpts === 'object' && cavemanModeOrOpts !== null\n ? cavemanModeOrOpts\n : { cavemanMode: cavemanModeOrOpts ?? undefined };\n\n const cavemanMode = opts.cavemanMode;\n const enableCompression = opts.shellCompressionLevel && opts.shellCompressionLevel !== 'off';\n const shellCompressionLevel = opts.shellCompressionLevel ?? 'normal';\n const enableArchitecture = opts.enableArchitecture ?? false;\n const enableMemory = opts.enableMemory ?? false;\n const enableDocs = opts.enableDocs ?? false;\n const enableData = opts.enableData ?? false;\n const enableSecurity = opts.enableSecurity ?? false;\n const enablePatterns = opts.enablePatterns ?? false;\n\n let content = `# KiroGraph\n\nKiroGraph builds a local semantic knowledge graph of this codebase. When the \\`kirograph\\` MCP server is available, prefer its tools over broad grep/glob/file-read exploration.\n\n## Quick decision guide\n\n| Question | Tool |\n|----------|------|\n| Where do I start on this task? | \\`kirograph_context\\` |\n| What is this symbol / show me its code | \\`kirograph_node\\` with \\`includeCode: true\\` |\n| Find a symbol by name | \\`kirograph_search\\` |\n| Who calls function X? | \\`kirograph_callers\\` |\n| What does function X call? | \\`kirograph_callees\\` |\n| What breaks if I change X? | \\`kirograph_impact\\` |\n| How are X and Y connected? | \\`kirograph_path\\` |\n| What extends / implements this type? | \\`kirograph_type_hierarchy\\` |\n| Which code is never called? | \\`kirograph_dead_code\\` |\n| Are there import cycles? | \\`kirograph_circular_deps\\` |\n| What files are indexed? | \\`kirograph_files\\` |\n| Is the index healthy? | \\`kirograph_status\\` |\n| What are the most critical symbols? | \\`kirograph_hotspots\\` |\n| Any unexpected cross-module coupling? | \\`kirograph_surprising\\` |\n| What changed since the last snapshot? | \\`kirograph_diff\\` |\n${enableArchitecture ? '| What packages/layers exist? | `kirograph_architecture` |\\n| How coupled is package X? | `kirograph_coupling` |\\n| What does package X depend on? | `kirograph_package` |\\n' : ''}\n${enableCompression ? '| Run a command with token savings | `kirograph_exec` |\\n| Check token savings stats | `kirograph_gain` |\\n' : ''}${enableMemory ? '| Search past decisions/patterns | `kirograph_mem_search` |\\n| Store an observation | `kirograph_mem_store` |\\n' : ''}${enableDocs ? '| Find a doc section | `kirograph_docs_search` |\\n| Get doc table of contents | `kirograph_docs_toc` |\\n' : ''}${enableData ? '| What datasets are indexed? | `kirograph_data_list` |\\n| Query rows with filters | `kirograph_data_query` |\\n| Aggregate data server-side | `kirograph_data_aggregate` |\\n' : ''}${enableSecurity ? '| Are there vulnerable dependencies? | `kirograph_security` |\\n| Which CVEs affect my project? | `kirograph_vulns` |\\n| Is this vulnerability reachable? | `kirograph_reachability` |\\n| What licenses do my deps use? | `kirograph_licenses` |\\n| Are dependencies outdated? | `kirograph_staleness` |\\n' : ''}${enablePatterns ? '| Find structural code patterns? | `kirograph_live_search` |\\n| Browse SAST rules | `kirograph pattern --list` |\\n' : ''}\n## Tool selection\n\n- Start code tasks with \\`kirograph_context\\`.\n- Find symbols by name with \\`kirograph_search\\`.\n- Inspect a symbol with \\`kirograph_node\\`; set \\`includeCode: true\\` only when source is needed.\n- Trace call flow with \\`kirograph_callers\\` and \\`kirograph_callees\\`.\n- Check blast radius before edits with \\`kirograph_impact\\`.\n- Use \\`kirograph_path\\` to explain how two symbols connect.\n- Use \\`kirograph_type_hierarchy\\` for inheritance/interface questions.\n- Use \\`kirograph_files\\` to inspect indexed file structure.\n- Use \\`kirograph_status\\` if results seem stale or incomplete.\n- Use \\`kirograph_architecture\\`, \\`kirograph_coupling\\`, and \\`kirograph_package\\` for package/layer questions when architecture analysis is enabled.\n- Use \\`kirograph_hotspots\\`, \\`kirograph_surprising\\`, and \\`kirograph_diff\\` for refactor planning and review.\n\n## Workflow\n\n1. Call \\`kirograph_context\\` for orientation.\n2. Drill into specific symbols with \\`kirograph_node\\`.\n3. Use graph traversal tools before reading unrelated files.\n4. Fall back to normal filesystem tools only when the graph is missing, stale, or lacks the needed detail.\n\nIf \\`.kirograph/\\` does not exist, ask whether to run \\`kirograph init --index\\`.\n`;\n\n // Shell compression section\n if (enableCompression) {\n const level = shellCompressionLevel as 'normal' | 'aggressive' | 'ultra';\n content += `\n## Shell Compression (\\`kirograph_exec\\`)\n\nWhen running shell commands, prefer \\`kirograph_exec\\` over raw shell execution for:\n- **git** operations (status, log, diff, push, pull, commit, add, fetch, branch)\n- **GitHub CLI** (gh pr list/view, gh issue list, gh run list)\n- **test runners** (jest, vitest, pytest, cargo test, go test, rspec, minitest, playwright)\n- **linters/build** (eslint, tsc, ruff, clippy, cargo build, prettier, biome, golangci-lint, rubocop, next build)\n- **file listings** (ls, find, tree)\n- **search** (grep, rg/ripgrep: grouped by file)\n- **diff** (diff file1 file2: condensed context)\n- **docker/k8s** (docker ps, images, logs, compose ps, kubectl pods, logs, services)\n- **package managers** (npm/pnpm install/list, pip list/install, bundle install, prisma generate)\n- **AWS CLI** (sts, ec2, lambda, logs, cloudformation, dynamodb, iam, s3, ecs, sqs, sns)\n- **network** (curl, wget: strip progress bars and headers)\n\nThis saves 60-90% of tokens compared to raw output.\n\nCompression level: **${level}**: ${LEVEL_DESCRIPTIONS[level]}\n\n${LEVEL_EXAMPLES[level]}\n\n**Important:** Error details are always preserved. Failed commands show full diagnostic output regardless of level.\n\n**Do NOT re-run commands:** When \\`kirograph_exec\\` returns a result, treat it as the final answer. Never re-run the same command with raw shell execution to \"get more details.\" The compressed output preserves all essential information. If you genuinely need something missing from the output, explain what's missing before making a second call.\n\nUse \\`kirograph_gain\\` to check token savings statistics.\n`;\n }\n\n // Memory section\n if (enableMemory) {\n content += `\n## Memory\n\nKiroGraph has persistent memory. Use \\`kirograph_mem_search\\` to recall past decisions,\nerrors, and patterns before making changes. Use \\`kirograph_mem_store\\` to save important\nobservations (architecture decisions, bug root causes, patterns discovered).\n\nMemory is searchable via hybrid FTS + vector search. Observations are automatically\nlinked to code symbols in the graph and surface in \\`kirograph_context\\` and\n\\`kirograph_impact\\` results when relevant.\n\n**When to store:** After fixing a bug, making an architecture decision, discovering a pattern,\nencountering a non-obvious error, or learning something about the codebase that future sessions\nshould know. Keep observations concise \u2014 one fact per store call.\n`;\n }\n\n // Architecture section\n if (enableArchitecture) {\n content += `\n## Architecture\n\nKiroGraph analyzes the package structure and layer dependencies of the codebase.\n\n- \\`kirograph_architecture\\` \u2014 full package graph, detected layers (api/service/data/ui/shared), dependency edges\n- \\`kirograph_coupling\\` \u2014 Ca (afferent), Ce (efferent), instability per package; high Ca = load-bearing, high Ce = volatile\n- \\`kirograph_package\\` \u2014 drill into a single package: coupling metrics, deps, dependents, files\n\nUse \\`kirograph_architecture\\` for architectural questions instead of reading directory trees.\nHigh Ca + low instability = risky to change interface. High Ce + high instability = safe to refactor internals.\n`;\n }\n\n // Documentation section\n if (enableDocs) {\n content += `\n## Documentation\n\nKiroGraph indexes project documentation by heading structure. Use \\`kirograph_docs_search\\`\nto find relevant sections instead of reading entire files.\n\n- \\`kirograph_docs_toc\\` \u2014 table of contents for a file or the whole project\n- \\`kirograph_docs_search\\` \u2014 search sections by query\n- \\`kirograph_docs_section\\` \u2014 retrieve full section content by ID\n- \\`kirograph_docs_outline\\` \u2014 heading hierarchy for a single file\n- \\`kirograph_docs_refs\\` \u2014 code \u2194 doc cross-references\n\nBefore reading a doc file directly, try \\`kirograph_docs_search\\` or \\`kirograph_docs_outline\\` first.\n`;\n }\n\n // Data section\n if (enableData) {\n content += `\n## Data\n\nKiroGraph indexes tabular data files (CSV, TSV, JSONL, JSON, Excel, Parquet).\n\n- \\`kirograph_data_list\\` \u2014 list all indexed datasets\n- \\`kirograph_data_describe\\` \u2014 schema profile: column names, types, cardinality, samples\n- \\`kirograph_data_query\\` \u2014 filtered row retrieval (eq, gt, contains, in, between)\n- \\`kirograph_data_aggregate\\` \u2014 server-side GROUP BY: count, sum, avg, min, max\n\nUse \\`kirograph_data_describe\\` before reading a data file. Use \\`kirograph_data_query\\` with\nfilters instead of loading all rows. Use \\`kirograph_data_aggregate\\` for statistics.\nThis saves 95-99% of tokens compared to reading raw data files.\n`;\n }\n\n // Security section\n if (enableSecurity) {\n content += `\n## Security\n\nKiroGraph scans dependency manifests across 14 ecosystems for known vulnerabilities, performs\ncall-graph reachability analysis, tracks EPSS exploitation probability, checks license\ncompliance, and monitors dependency staleness.\n\n**Available tools:**\n- \\`kirograph_security\\` \u2014 overview: dep count, CVE count, verdict breakdown, stale warnings\n- \\`kirograph_vulns\\` \u2014 list CVEs with severity, EPSS score, reachability verdict, fix suggestion\n- \\`kirograph_reachability\\` \u2014 call paths, entry points, affected layers for one CVE or package\n- \\`kirograph_licenses\\` \u2014 list dependency licenses; flag policy violations\n- \\`kirograph_staleness\\` \u2014 identify outdated dependencies (staleness score 0.0\u20131.0)\n- \\`kirograph_sbom\\` / \\`kirograph_vex\\` \u2014 export CycloneDX 1.5 SBOM and VEX documents\n- \\`kirograph_vuln_add\\` \u2014 manually register a private/internal CVE\n\n**Proactive triggers:** Run \\`kirograph_security\\` when a dependency is added/updated, before a\nproduction deploy, or when the user asks about security/compliance.\n\n**Interpreting verdicts:**\n- \\`affected\\` \u2014 a call path exists from an entry point to the vulnerable code. Act on this.\n- \\`not_affected\\` \u2014 no reachable path found. Strong signal: likely safe.\n- \\`under_investigation\\` \u2014 unresolved symbols in traversal. Treat with caution.\n\n**EPSS scores:** >= 0.5 = patch immediately; 0.1\u20130.5 = elevated risk; < 0.1 = low probability.\n\n**Workflow:** \\`kirograph_security\\` \u2192 \\`kirograph_vulns --verdict affected\\` \u2192 \\`kirograph_reachability <cve>\\` \u2192 fix \u2192 \\`kirograph_vulns --refresh\\`\n`;\n }\n\n // Pattern matching section\n if (enablePatterns) {\n content += `\n## Pattern Search\n\nKiroGraph supports AST structural pattern search via \\`kirograph_live_search\\` (only available when \\`enablePatterns: true\\` and \\`@ast-grep/napi\\` is installed).\n\n- \\`kirograph_live_search\\` \u2014 find any structural code pattern across the indexed file list\n- \\`kirograph pattern --list\\` \u2014 browse 10 bundled SAST rules (SQL injection, eval, path traversal, etc.)\n- \\`kirograph pattern --library <id>\\` \u2014 run a specific library rule\n\nUse \\`kirograph_live_search\\` when you need to find patterns that can't be expressed as symbol names: anonymous functions, specific code structures, or security anti-patterns.\n`;\n }\n\n // Session hygiene for tools without hooks\n if (!opts.hasHooks) {\n content += `\n## Session Hygiene\n\nThis tool does not have automatic sync hooks. To keep the index fresh:\n- Run \\`kirograph sync\\` at the **start** of each session if files changed outside the agent.\n- Run \\`kirograph sync\\` at the **end** of each session after making changes.\n- If results from graph tools seem stale, run \\`kirograph sync\\` before retrying.\n${enableMemory ? '- Store important observations with `kirograph_mem_store` before ending your session.\\n' : ''}`;\n }\n\n // Caveman mode\n const caveman = cavemanMode && cavemanMode !== 'off' ? CAVEMAN_RULES[cavemanMode] : null;\n if (caveman) {\n content = content.trimEnd() + '\\n\\n' + caveman + '\\n';\n }\n\n return content;\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAA2C;AAc3C,MAAM,qBAA6C;AAAA,EACjD,QAAQ;AAAA,EACR,YAAY;AAAA,EACZ,OAAO;AACT;AAEA,MAAM,iBAAyC;AAAA,EAC7C,QAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMR,YAAY;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMZ,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAMT;AAEO,SAAS,uBAAuB,mBAAsE;AAE3G,QAAM,OAA2B,OAAO,sBAAsB,YAAY,sBAAsB,OAC5F,oBACA,EAAE,aAAa,qBAAqB,OAAU;AAElD,QAAM,cAAc,KAAK;AACzB,QAAM,oBAAoB,KAAK,yBAAyB,KAAK,0BAA0B;AACvF,QAAM,wBAAwB,KAAK,yBAAyB;AAC5D,QAAM,qBAAqB,KAAK,sBAAsB;AACtD,QAAM,eAAe,KAAK,gBAAgB;AAC1C,QAAM,aAAa,KAAK,cAAc;AACtC,QAAM,aAAa,KAAK,cAAc;AACtC,QAAM,iBAAiB,KAAK,kBAAkB;AAC9C,QAAM,iBAAiB,KAAK,kBAAkB;AAE9C,MAAI,UAAU;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;A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A;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EA4Bb;AAGA,MAAI,gBAAgB;AAClB,eAAW;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAWb;AAGA,MAAI,CAAC,KAAK,UAAU;AAClB,eAAW;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOb,eAAe,4FAA4F,EAAE;AAAA,EAC7G;AAGA,QAAM,UAAU,eAAe,gBAAgB,QAAQ,6BAAc,WAAW,IAAI;AACpF,MAAI,SAAS;AACX,cAAU,QAAQ,QAAQ,IAAI,SAAS,UAAU;AAAA,EACnD;AAEA,SAAO;AACT;",
6
6
  "names": []
7
7
  }
@@ -1 +1 @@
1
- {"version":3,"file":"mcp.d.ts","sourceRoot":"","sources":["../../../src/bin/installer/mcp.ts"],"names":[],"mappings":"AAAA;;GAEG;AAiBH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CA0BpD"}
1
+ {"version":3,"file":"mcp.d.ts","sourceRoot":"","sources":["../../../src/bin/installer/mcp.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CASpD"}
@@ -11,10 +11,27 @@ export declare function ask(rl: readline.Interface, question: string): Promise<s
11
11
  * Accepts: "" (use default), "y", "Y", "n", "N".
12
12
  */
13
13
  export declare function askBool(rl: readline.Interface, question: string, description: string, defaultYes?: boolean): Promise<boolean>;
14
+ /**
15
+ * Interactive enable/disable toggle using arrow keys.
16
+ * More visual alternative to askBool.
17
+ */
18
+ export declare function askToggle(rl: readline.Interface, label: string, description: string, defaultEnabled?: boolean): Promise<boolean>;
14
19
  /**
15
20
  * Prompt for a string value, returning the default on empty input.
16
21
  */
17
22
  export declare function askString(rl: readline.Interface, question: string, description: string, defaultValue: string): Promise<string>;
23
+ /**
24
+ * Print a styled section header with an icon.
25
+ */
26
+ export declare function printSection(icon: string, title: string): void;
27
+ /**
28
+ * Print a separator line.
29
+ */
30
+ export declare function printSeparator(): void;
31
+ /**
32
+ * Print a feature summary line.
33
+ */
34
+ export declare function printFeature(enabled: boolean, label: string): void;
18
35
  /**
19
36
  * Interactive arrow-key selection menu.
20
37
  * Temporarily pauses the readline interface to take over raw stdin,
@@ -1 +1 @@
1
- {"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../../../src/bin/installer/prompts.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,QAAQ,MAAM,UAAU,CAAC;AAIrC,eAAO,MAAM,MAAM,oBAAkB,CAAC;AACtC,eAAO,MAAM,KAAK,cAAa,CAAC;AAChC,eAAO,MAAM,GAAG,cAAe,CAAC;AAMhC,wBAAgB,GAAG,CAAC,EAAE,EAAE,QAAQ,CAAC,SAAS,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAE7E;AAED;;;GAGG;AACH,wBAAsB,OAAO,CAC3B,EAAE,EAAE,QAAQ,CAAC,SAAS,EACtB,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,MAAM,EACnB,UAAU,UAAO,GAChB,OAAO,CAAC,OAAO,CAAC,CAUlB;AAED;;GAEG;AACH,wBAAsB,SAAS,CAC7B,EAAE,EAAE,QAAQ,CAAC,SAAS,EACtB,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,MAAM,EACnB,YAAY,EAAE,MAAM,GACnB,OAAO,CAAC,MAAM,CAAC,CAIjB;AAED;;;;GAIG;AACH,wBAAsB,WAAW,CAAC,CAAC,EACjC,EAAE,EAAE,QAAQ,CAAC,SAAS,EACtB,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,KAAK,CAAC;IAAE,KAAK,EAAE,CAAC,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,CA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B,WAAW,CAAC,CAAC,EACjC,EAAE,EAAE,QAAQ,CAAC,SAAS,EACtB,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,KAAK,CAAC;IAAE,KAAK,EAAE,CAAC,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,CAAC,EAChE,YAAY,SAAI,GACf,OAAO,CAAC,CAAC,CAAC,CAuEZ"}
@@ -1 +1 @@
1
- {"version":3,"file":"qdrant-dashboard.d.ts","sourceRoot":"","sources":["../../../src/bin/installer/qdrant-dashboard.ts"],"names":[],"mappings":"AAsFA,iFAAiF;AACjF,wBAAsB,cAAc,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAc1E;AAED,wBAAsB,mBAAmB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAsB5E"}
1
+ {"version":3,"file":"qdrant-dashboard.d.ts","sourceRoot":"","sources":["../../../src/bin/installer/qdrant-dashboard.ts"],"names":[],"mappings":"AAwDA,iFAAiF;AACjF,wBAAsB,cAAc,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAc1E;AAED,wBAAsB,mBAAmB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAsB5E"}
@@ -1,5 +1,17 @@
1
1
  /**
2
- * KiroGraph Installer — Kiro steering file
2
+ * KiroGraph Installer: Kiro steering file
3
3
  */
4
- export declare function writeSteering(kiroDir: string): void;
4
+ import { CavemanMode } from './caveman';
5
+ export interface SteeringOptions {
6
+ cavemanMode?: CavemanMode | 'off';
7
+ enableCompression?: boolean;
8
+ shellCompressionLevel?: 'off' | 'normal' | 'aggressive' | 'ultra';
9
+ enableArchitecture?: boolean;
10
+ enableMemory?: boolean;
11
+ enableDocs?: boolean;
12
+ enableData?: boolean;
13
+ enableSecurity?: boolean;
14
+ enablePatterns?: boolean;
15
+ }
16
+ export declare function writeSteering(kiroDir: string, opts?: SteeringOptions | CavemanMode | 'off'): void;
5
17
  //# sourceMappingURL=steering.d.ts.map