@apralabs/apra-fleet 0.4.0 → 0.4.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 (427) hide show
  1. package/README.md +145 -7
  2. package/dist/agents/backlog-groomer.md +17 -1
  3. package/dist/agents/ci-watcher.md +13 -1
  4. package/dist/agents/deployer.md +15 -3
  5. package/dist/agents/doer.md +35 -1
  6. package/dist/agents/harvester.md +22 -3
  7. package/dist/agents/integ-test-runner.md +18 -2
  8. package/dist/agents/kb-reconciler.md +216 -0
  9. package/dist/agents/plan-reviewer.md +14 -1
  10. package/dist/agents/planner.md +88 -5
  11. package/dist/agents/regression-test-runner.md +19 -1
  12. package/dist/agents/reviewer.md +104 -3
  13. package/dist/agents/schemas/doer-output.json +63 -3
  14. package/dist/agents/schemas/harvester-output.json +59 -2
  15. package/dist/agents/schemas/integ-test-runner-output.json +2 -2
  16. package/dist/agents/schemas/kb-reconciler-output.json +87 -0
  17. package/dist/agents/schemas/planner-output.json +65 -0
  18. package/dist/agents/schemas/reviewer-output.json +105 -8
  19. package/dist/cli/install.d.ts +1 -0
  20. package/dist/cli/install.d.ts.map +1 -1
  21. package/dist/cli/install.js +136 -5
  22. package/dist/cli/install.js.map +1 -1
  23. package/dist/cli/join.js +1 -1
  24. package/dist/cli/join.js.map +1 -1
  25. package/dist/cli/kb-commit.d.ts +12 -0
  26. package/dist/cli/kb-commit.d.ts.map +1 -0
  27. package/dist/cli/kb-commit.js +53 -0
  28. package/dist/cli/kb-commit.js.map +1 -0
  29. package/dist/cli/kb-directives.d.ts +17 -0
  30. package/dist/cli/kb-directives.d.ts.map +1 -0
  31. package/dist/cli/kb-directives.js +146 -0
  32. package/dist/cli/kb-directives.js.map +1 -0
  33. package/dist/cli/kb-import.d.ts +13 -0
  34. package/dist/cli/kb-import.d.ts.map +1 -0
  35. package/dist/cli/kb-import.js +56 -0
  36. package/dist/cli/kb-import.js.map +1 -0
  37. package/dist/cli/uninstall.d.ts.map +1 -1
  38. package/dist/cli/uninstall.js +11 -0
  39. package/dist/cli/uninstall.js.map +1 -1
  40. package/dist/cli/watch.d.ts +53 -4
  41. package/dist/cli/watch.d.ts.map +1 -1
  42. package/dist/cli/watch.js +118 -17
  43. package/dist/cli/watch.js.map +1 -1
  44. package/dist/commands/kb-server.d.ts +8 -0
  45. package/dist/commands/kb-server.d.ts.map +1 -0
  46. package/dist/commands/kb-server.js +221 -0
  47. package/dist/commands/kb-server.js.map +1 -0
  48. package/dist/index.js +77 -2
  49. package/dist/index.js.map +1 -1
  50. package/dist/os/linux.d.ts +1 -0
  51. package/dist/os/linux.d.ts.map +1 -1
  52. package/dist/os/linux.js +18 -1
  53. package/dist/os/linux.js.map +1 -1
  54. package/dist/os/os-commands.d.ts +5 -0
  55. package/dist/os/os-commands.d.ts.map +1 -1
  56. package/dist/os/windows.d.ts +35 -0
  57. package/dist/os/windows.d.ts.map +1 -1
  58. package/dist/os/windows.js +67 -31
  59. package/dist/os/windows.js.map +1 -1
  60. package/dist/providers/agy.d.ts +12 -1
  61. package/dist/providers/agy.d.ts.map +1 -1
  62. package/dist/providers/agy.js +134 -9
  63. package/dist/providers/agy.js.map +1 -1
  64. package/dist/providers/claude.d.ts +11 -1
  65. package/dist/providers/claude.d.ts.map +1 -1
  66. package/dist/providers/claude.js +47 -19
  67. package/dist/providers/claude.js.map +1 -1
  68. package/dist/providers/codex.d.ts +11 -1
  69. package/dist/providers/codex.d.ts.map +1 -1
  70. package/dist/providers/codex.js +29 -6
  71. package/dist/providers/codex.js.map +1 -1
  72. package/dist/providers/copilot.d.ts +11 -1
  73. package/dist/providers/copilot.d.ts.map +1 -1
  74. package/dist/providers/copilot.js +26 -6
  75. package/dist/providers/copilot.js.map +1 -1
  76. package/dist/providers/email/headers.d.ts +15 -0
  77. package/dist/providers/email/headers.d.ts.map +1 -0
  78. package/dist/providers/email/headers.js +42 -0
  79. package/dist/providers/email/headers.js.map +1 -0
  80. package/dist/providers/email/index.d.ts +18 -0
  81. package/dist/providers/email/index.d.ts.map +1 -0
  82. package/dist/providers/email/index.js +60 -0
  83. package/dist/providers/email/index.js.map +1 -0
  84. package/dist/providers/email/provider.d.ts +49 -0
  85. package/dist/providers/email/provider.d.ts.map +1 -0
  86. package/dist/providers/email/provider.js +2 -0
  87. package/dist/providers/email/provider.js.map +1 -0
  88. package/dist/providers/email/sendgrid.d.ts +12 -0
  89. package/dist/providers/email/sendgrid.d.ts.map +1 -0
  90. package/dist/providers/email/sendgrid.js +67 -0
  91. package/dist/providers/email/sendgrid.js.map +1 -0
  92. package/dist/providers/email/smtp.d.ts +65 -0
  93. package/dist/providers/email/smtp.d.ts.map +1 -0
  94. package/dist/providers/email/smtp.js +373 -0
  95. package/dist/providers/email/smtp.js.map +1 -0
  96. package/dist/providers/gemini.d.ts +11 -1
  97. package/dist/providers/gemini.d.ts.map +1 -1
  98. package/dist/providers/gemini.js +38 -4
  99. package/dist/providers/gemini.js.map +1 -1
  100. package/dist/providers/none.d.ts +11 -1
  101. package/dist/providers/none.d.ts.map +1 -1
  102. package/dist/providers/none.js +21 -0
  103. package/dist/providers/none.js.map +1 -1
  104. package/dist/providers/opencode.d.ts +11 -1
  105. package/dist/providers/opencode.d.ts.map +1 -1
  106. package/dist/providers/opencode.js +55 -4
  107. package/dist/providers/opencode.js.map +1 -1
  108. package/dist/providers/provider.d.ts +77 -0
  109. package/dist/providers/provider.d.ts.map +1 -1
  110. package/dist/providers/provider.js +44 -0
  111. package/dist/providers/provider.js.map +1 -1
  112. package/dist/services/agent-provisioner.d.ts.map +1 -1
  113. package/dist/services/agent-provisioner.js +3 -6
  114. package/dist/services/agent-provisioner.js.map +1 -1
  115. package/dist/services/cloud/lifecycle.d.ts.map +1 -1
  116. package/dist/services/cloud/lifecycle.js +3 -0
  117. package/dist/services/cloud/lifecycle.js.map +1 -1
  118. package/dist/services/cloud/task-wrapper.d.ts +18 -0
  119. package/dist/services/cloud/task-wrapper.d.ts.map +1 -1
  120. package/dist/services/cloud/task-wrapper.js +157 -0
  121. package/dist/services/cloud/task-wrapper.js.map +1 -1
  122. package/dist/services/github-app.d.ts.map +1 -1
  123. package/dist/services/github-app.js +11 -2
  124. package/dist/services/github-app.js.map +1 -1
  125. package/dist/services/knowledge/audn.d.ts +37 -0
  126. package/dist/services/knowledge/audn.d.ts.map +1 -0
  127. package/dist/services/knowledge/audn.js +219 -0
  128. package/dist/services/knowledge/audn.js.map +1 -0
  129. package/dist/services/knowledge/file-hash.d.ts +11 -0
  130. package/dist/services/knowledge/file-hash.d.ts.map +1 -0
  131. package/dist/services/knowledge/file-hash.js +123 -0
  132. package/dist/services/knowledge/file-hash.js.map +1 -0
  133. package/dist/services/knowledge/http-provider.d.ts +46 -0
  134. package/dist/services/knowledge/http-provider.d.ts.map +1 -0
  135. package/dist/services/knowledge/http-provider.js +254 -0
  136. package/dist/services/knowledge/http-provider.js.map +1 -0
  137. package/dist/services/knowledge/kb-providers.d.ts +15 -0
  138. package/dist/services/knowledge/kb-providers.d.ts.map +1 -0
  139. package/dist/services/knowledge/kb-providers.js +92 -0
  140. package/dist/services/knowledge/kb-providers.js.map +1 -0
  141. package/dist/services/knowledge/kb-scope-input.d.ts +5 -0
  142. package/dist/services/knowledge/kb-scope-input.d.ts.map +1 -0
  143. package/dist/services/knowledge/kb-scope-input.js +11 -0
  144. package/dist/services/knowledge/kb-scope-input.js.map +1 -0
  145. package/dist/services/knowledge/kb-service.d.ts +3 -0
  146. package/dist/services/knowledge/kb-service.d.ts.map +1 -0
  147. package/dist/services/knowledge/kb-service.js +2 -0
  148. package/dist/services/knowledge/kb-service.js.map +1 -0
  149. package/dist/services/knowledge/path-validation.d.ts +2 -0
  150. package/dist/services/knowledge/path-validation.d.ts.map +1 -0
  151. package/dist/services/knowledge/path-validation.js +13 -0
  152. package/dist/services/knowledge/path-validation.js.map +1 -0
  153. package/dist/services/knowledge/pre-init.d.ts +14 -0
  154. package/dist/services/knowledge/pre-init.d.ts.map +1 -0
  155. package/dist/services/knowledge/pre-init.js +147 -0
  156. package/dist/services/knowledge/pre-init.js.map +1 -0
  157. package/dist/services/knowledge/project-slug.d.ts +2 -0
  158. package/dist/services/knowledge/project-slug.d.ts.map +1 -0
  159. package/dist/services/knowledge/project-slug.js +49 -0
  160. package/dist/services/knowledge/project-slug.js.map +1 -0
  161. package/dist/services/knowledge/sqlite-provider.d.ts +147 -0
  162. package/dist/services/knowledge/sqlite-provider.d.ts.map +1 -0
  163. package/dist/services/knowledge/sqlite-provider.js +1646 -0
  164. package/dist/services/knowledge/sqlite-provider.js.map +1 -0
  165. package/dist/services/knowledge/types.d.ts +163 -0
  166. package/dist/services/knowledge/types.d.ts.map +1 -0
  167. package/dist/services/knowledge/types.js +9 -0
  168. package/dist/services/knowledge/types.js.map +1 -0
  169. package/dist/services/member-home.d.ts +89 -0
  170. package/dist/services/member-home.d.ts.map +1 -0
  171. package/dist/services/member-home.js +256 -0
  172. package/dist/services/member-home.js.map +1 -0
  173. package/dist/services/member-remote-url.d.ts +34 -0
  174. package/dist/services/member-remote-url.d.ts.map +1 -0
  175. package/dist/services/member-remote-url.js +39 -0
  176. package/dist/services/member-remote-url.js.map +1 -0
  177. package/dist/services/orphan-recovery.d.ts +5 -2
  178. package/dist/services/orphan-recovery.d.ts.map +1 -1
  179. package/dist/services/orphan-recovery.js +19 -8
  180. package/dist/services/orphan-recovery.js.map +1 -1
  181. package/dist/services/preflight-check.d.ts +56 -0
  182. package/dist/services/preflight-check.d.ts.map +1 -0
  183. package/dist/services/preflight-check.js +277 -0
  184. package/dist/services/preflight-check.js.map +1 -0
  185. package/dist/services/stall/log-path-resolver.d.ts +11 -8
  186. package/dist/services/stall/log-path-resolver.d.ts.map +1 -1
  187. package/dist/services/stall/log-path-resolver.js +17 -40
  188. package/dist/services/stall/log-path-resolver.js.map +1 -1
  189. package/dist/services/stall/stall-detector.d.ts +32 -0
  190. package/dist/services/stall/stall-detector.d.ts.map +1 -1
  191. package/dist/services/stall/stall-detector.js +149 -6
  192. package/dist/services/stall/stall-detector.js.map +1 -1
  193. package/dist/services/stall/stall-poller.d.ts +34 -0
  194. package/dist/services/stall/stall-poller.d.ts.map +1 -1
  195. package/dist/services/stall/stall-poller.js +134 -2
  196. package/dist/services/stall/stall-poller.js.map +1 -1
  197. package/dist/services/strategy.d.ts.map +1 -1
  198. package/dist/services/strategy.js +2 -2
  199. package/dist/services/strategy.js.map +1 -1
  200. package/dist/services/tool-registry.d.ts.map +1 -1
  201. package/dist/services/tool-registry.js +87 -1
  202. package/dist/services/tool-registry.js.map +1 -1
  203. package/dist/services/vcs/github.d.ts.map +1 -1
  204. package/dist/services/vcs/github.js +32 -1
  205. package/dist/services/vcs/github.js.map +1 -1
  206. package/dist/services/version-check.d.ts +22 -0
  207. package/dist/services/version-check.d.ts.map +1 -0
  208. package/dist/services/version-check.js +103 -0
  209. package/dist/services/version-check.js.map +1 -0
  210. package/dist/skills/fleet-sprint-cli/SKILL.md +13 -2
  211. package/dist/skills/pm/beads.md +6 -0
  212. package/dist/skills/pm/fleet-addendum.md +6 -0
  213. package/dist/skills/pm/index.md +56 -0
  214. package/dist/skills/pm/kb-reconcile.md +132 -0
  215. package/dist/skills/pm/kb-review.md +109 -0
  216. package/dist/tools/check-status.d.ts +47 -0
  217. package/dist/tools/check-status.d.ts.map +1 -1
  218. package/dist/tools/check-status.js +242 -0
  219. package/dist/tools/check-status.js.map +1 -1
  220. package/dist/tools/child-id-allocator.d.ts +2 -2
  221. package/dist/tools/code-intelligence-codebase-memory.d.ts +11 -0
  222. package/dist/tools/code-intelligence-codebase-memory.d.ts.map +1 -0
  223. package/dist/tools/code-intelligence-codebase-memory.js +270 -0
  224. package/dist/tools/code-intelligence-codebase-memory.js.map +1 -0
  225. package/dist/tools/code-intelligence-freshness.d.ts +2 -0
  226. package/dist/tools/code-intelligence-freshness.d.ts.map +1 -0
  227. package/dist/tools/code-intelligence-freshness.js +26 -0
  228. package/dist/tools/code-intelligence-freshness.js.map +1 -0
  229. package/dist/tools/code-intelligence-gitnexus.d.ts +14 -0
  230. package/dist/tools/code-intelligence-gitnexus.d.ts.map +1 -0
  231. package/dist/tools/code-intelligence-gitnexus.js +475 -0
  232. package/dist/tools/code-intelligence-gitnexus.js.map +1 -0
  233. package/dist/tools/code-intelligence-kb-enrich.d.ts +2 -0
  234. package/dist/tools/code-intelligence-kb-enrich.d.ts.map +1 -0
  235. package/dist/tools/code-intelligence-kb-enrich.js +65 -0
  236. package/dist/tools/code-intelligence-kb-enrich.js.map +1 -0
  237. package/dist/tools/code-intelligence-reindex.d.ts +7 -0
  238. package/dist/tools/code-intelligence-reindex.d.ts.map +1 -0
  239. package/dist/tools/code-intelligence-reindex.js +106 -0
  240. package/dist/tools/code-intelligence-reindex.js.map +1 -0
  241. package/dist/tools/code-intelligence-telemetry.d.ts +5 -0
  242. package/dist/tools/code-intelligence-telemetry.d.ts.map +1 -0
  243. package/dist/tools/code-intelligence-telemetry.js +52 -0
  244. package/dist/tools/code-intelligence-telemetry.js.map +1 -0
  245. package/dist/tools/code-intelligence-tests.d.ts +2 -0
  246. package/dist/tools/code-intelligence-tests.d.ts.map +1 -0
  247. package/dist/tools/code-intelligence-tests.js +24 -0
  248. package/dist/tools/code-intelligence-tests.js.map +1 -0
  249. package/dist/tools/code-intelligence.d.ts +114 -0
  250. package/dist/tools/code-intelligence.d.ts.map +1 -0
  251. package/dist/tools/code-intelligence.js +124 -0
  252. package/dist/tools/code-intelligence.js.map +1 -0
  253. package/dist/tools/compose-permissions.d.ts +26 -0
  254. package/dist/tools/compose-permissions.d.ts.map +1 -1
  255. package/dist/tools/compose-permissions.js +244 -33
  256. package/dist/tools/compose-permissions.js.map +1 -1
  257. package/dist/tools/execute-command.d.ts +2 -0
  258. package/dist/tools/execute-command.d.ts.map +1 -1
  259. package/dist/tools/execute-command.js +86 -16
  260. package/dist/tools/execute-command.js.map +1 -1
  261. package/dist/tools/execute-prompt.d.ts +13 -1
  262. package/dist/tools/execute-prompt.d.ts.map +1 -1
  263. package/dist/tools/execute-prompt.js +257 -45
  264. package/dist/tools/execute-prompt.js.map +1 -1
  265. package/dist/tools/kb-capture.d.ts +53 -0
  266. package/dist/tools/kb-capture.d.ts.map +1 -0
  267. package/dist/tools/kb-capture.js +130 -0
  268. package/dist/tools/kb-capture.js.map +1 -0
  269. package/dist/tools/kb-context.d.ts +17 -0
  270. package/dist/tools/kb-context.d.ts.map +1 -0
  271. package/dist/tools/kb-context.js +29 -0
  272. package/dist/tools/kb-context.js.map +1 -0
  273. package/dist/tools/kb-export.d.ts +19 -0
  274. package/dist/tools/kb-export.d.ts.map +1 -0
  275. package/dist/tools/kb-export.js +344 -0
  276. package/dist/tools/kb-export.js.map +1 -0
  277. package/dist/tools/kb-feedback.d.ts +23 -0
  278. package/dist/tools/kb-feedback.d.ts.map +1 -0
  279. package/dist/tools/kb-feedback.js +43 -0
  280. package/dist/tools/kb-feedback.js.map +1 -0
  281. package/dist/tools/kb-freshness-sweep.d.ts +14 -0
  282. package/dist/tools/kb-freshness-sweep.d.ts.map +1 -0
  283. package/dist/tools/kb-freshness-sweep.js +29 -0
  284. package/dist/tools/kb-freshness-sweep.js.map +1 -0
  285. package/dist/tools/kb-harvest.d.ts +20 -0
  286. package/dist/tools/kb-harvest.d.ts.map +1 -0
  287. package/dist/tools/kb-harvest.js +143 -0
  288. package/dist/tools/kb-harvest.js.map +1 -0
  289. package/dist/tools/kb-import.d.ts +44 -0
  290. package/dist/tools/kb-import.d.ts.map +1 -0
  291. package/dist/tools/kb-import.js +239 -0
  292. package/dist/tools/kb-import.js.map +1 -0
  293. package/dist/tools/kb-invalidate.d.ts +19 -0
  294. package/dist/tools/kb-invalidate.d.ts.map +1 -0
  295. package/dist/tools/kb-invalidate.js +34 -0
  296. package/dist/tools/kb-invalidate.js.map +1 -0
  297. package/dist/tools/kb-list.d.ts +32 -0
  298. package/dist/tools/kb-list.d.ts.map +1 -0
  299. package/dist/tools/kb-list.js +43 -0
  300. package/dist/tools/kb-list.js.map +1 -0
  301. package/dist/tools/kb-promote.d.ts +20 -0
  302. package/dist/tools/kb-promote.d.ts.map +1 -0
  303. package/dist/tools/kb-promote.js +20 -0
  304. package/dist/tools/kb-promote.js.map +1 -0
  305. package/dist/tools/kb-query.d.ts +35 -0
  306. package/dist/tools/kb-query.d.ts.map +1 -0
  307. package/dist/tools/kb-query.js +111 -0
  308. package/dist/tools/kb-query.js.map +1 -0
  309. package/dist/tools/kb-reconcile-prefilter.d.ts +14 -0
  310. package/dist/tools/kb-reconcile-prefilter.d.ts.map +1 -0
  311. package/dist/tools/kb-reconcile-prefilter.js +26 -0
  312. package/dist/tools/kb-reconcile-prefilter.js.map +1 -0
  313. package/dist/tools/kb-resolve-contradiction.d.ts +23 -0
  314. package/dist/tools/kb-resolve-contradiction.d.ts.map +1 -0
  315. package/dist/tools/kb-resolve-contradiction.js +37 -0
  316. package/dist/tools/kb-resolve-contradiction.js.map +1 -0
  317. package/dist/tools/kb-session-prime.d.ts +26 -0
  318. package/dist/tools/kb-session-prime.d.ts.map +1 -0
  319. package/dist/tools/kb-session-prime.js +392 -0
  320. package/dist/tools/kb-session-prime.js.map +1 -0
  321. package/dist/tools/kb-setup.d.ts +20 -0
  322. package/dist/tools/kb-setup.d.ts.map +1 -0
  323. package/dist/tools/kb-setup.js +49 -0
  324. package/dist/tools/kb-setup.js.map +1 -0
  325. package/dist/tools/kb-stats.d.ts +20 -0
  326. package/dist/tools/kb-stats.d.ts.map +1 -0
  327. package/dist/tools/kb-stats.js +115 -0
  328. package/dist/tools/kb-stats.js.map +1 -0
  329. package/dist/tools/member-detail.d.ts.map +1 -1
  330. package/dist/tools/member-detail.js +8 -0
  331. package/dist/tools/member-detail.js.map +1 -1
  332. package/dist/tools/monitor-task.d.ts.map +1 -1
  333. package/dist/tools/monitor-task.js +21 -3
  334. package/dist/tools/monitor-task.js.map +1 -1
  335. package/dist/tools/provision-auth.d.ts.map +1 -1
  336. package/dist/tools/provision-auth.js +10 -3
  337. package/dist/tools/provision-auth.js.map +1 -1
  338. package/dist/tools/register-member.d.ts +3 -0
  339. package/dist/tools/register-member.d.ts.map +1 -1
  340. package/dist/tools/register-member.js +30 -1
  341. package/dist/tools/register-member.js.map +1 -1
  342. package/dist/tools/remove-member.d.ts.map +1 -1
  343. package/dist/tools/remove-member.js +17 -3
  344. package/dist/tools/remove-member.js.map +1 -1
  345. package/dist/tools/report-status.d.ts.map +1 -1
  346. package/dist/tools/report-status.js +2 -1
  347. package/dist/tools/report-status.js.map +1 -1
  348. package/dist/tools/send-email.d.ts +69 -0
  349. package/dist/tools/send-email.d.ts.map +1 -0
  350. package/dist/tools/send-email.js +177 -0
  351. package/dist/tools/send-email.js.map +1 -0
  352. package/dist/tools/setup-ssh-key.d.ts.map +1 -1
  353. package/dist/tools/setup-ssh-key.js +2 -0
  354. package/dist/tools/setup-ssh-key.js.map +1 -1
  355. package/dist/tools/update-member.d.ts +3 -0
  356. package/dist/tools/update-member.d.ts.map +1 -1
  357. package/dist/tools/update-member.js +25 -1
  358. package/dist/tools/update-member.js.map +1 -1
  359. package/dist/types.d.ts +1 -0
  360. package/dist/types.d.ts.map +1 -1
  361. package/dist/utils/prompt-errors.js +1 -1
  362. package/dist/utils/prompt-errors.js.map +1 -1
  363. package/dist/utils/session-caller.d.ts +28 -0
  364. package/dist/utils/session-caller.d.ts.map +1 -0
  365. package/dist/utils/session-caller.js +24 -0
  366. package/dist/utils/session-caller.js.map +1 -0
  367. package/dist/utils/work-folder-validation.d.ts +39 -0
  368. package/dist/utils/work-folder-validation.d.ts.map +1 -0
  369. package/dist/utils/work-folder-validation.js +60 -0
  370. package/dist/utils/work-folder-validation.js.map +1 -0
  371. package/dist/workflows/auto-sprint.js +546 -6
  372. package/package.json +7 -4
  373. package/packages/apra-fleet-client/src/client/api.mjs +118 -4
  374. package/packages/apra-fleet-se/apra-pm/agents/backlog-groomer.md +17 -1
  375. package/packages/apra-fleet-se/apra-pm/agents/ci-watcher.md +13 -1
  376. package/packages/apra-fleet-se/apra-pm/agents/deployer.md +15 -3
  377. package/packages/apra-fleet-se/apra-pm/agents/doer.md +35 -1
  378. package/packages/apra-fleet-se/apra-pm/agents/harvester.md +22 -3
  379. package/packages/apra-fleet-se/apra-pm/agents/integ-test-runner.md +18 -2
  380. package/packages/apra-fleet-se/apra-pm/agents/kb-reconciler.md +216 -0
  381. package/packages/apra-fleet-se/apra-pm/agents/plan-reviewer.md +14 -1
  382. package/packages/apra-fleet-se/apra-pm/agents/planner.md +88 -5
  383. package/packages/apra-fleet-se/apra-pm/agents/regression-test-runner.md +19 -1
  384. package/packages/apra-fleet-se/apra-pm/agents/reviewer.md +104 -3
  385. package/packages/apra-fleet-se/apra-pm/agents/schemas/doer-output.json +63 -3
  386. package/packages/apra-fleet-se/apra-pm/agents/schemas/harvester-output.json +59 -2
  387. package/packages/apra-fleet-se/apra-pm/agents/schemas/integ-test-runner-output.json +2 -2
  388. package/packages/apra-fleet-se/apra-pm/agents/schemas/kb-reconciler-output.json +87 -0
  389. package/packages/apra-fleet-se/apra-pm/agents/schemas/planner-output.json +65 -0
  390. package/packages/apra-fleet-se/apra-pm/agents/schemas/reviewer-output.json +105 -8
  391. package/packages/apra-fleet-se/apra-pm/skills/pm/beads.md +6 -0
  392. package/packages/apra-fleet-se/apra-pm/skills/pm/fleet-addendum.md +6 -0
  393. package/packages/apra-fleet-se/apra-pm/skills/pm/index.md +56 -0
  394. package/packages/apra-fleet-se/apra-pm/skills/pm/kb-reconcile.md +132 -0
  395. package/packages/apra-fleet-se/apra-pm/skills/pm/kb-review.md +109 -0
  396. package/packages/apra-fleet-se/bin/cli.mjs +7 -0
  397. package/packages/apra-fleet-se/bin/serve.mjs +14 -2
  398. package/packages/apra-fleet-se/fleet-sprint/contracts.mjs +31 -5
  399. package/packages/apra-fleet-se/fleet-sprint/docs/README.md +1 -1
  400. package/packages/apra-fleet-se/fleet-sprint/docs/coach-role-design.md +23 -151
  401. package/packages/apra-fleet-se/fleet-sprint/docs/dolt-manual-recovery-verified.md +256 -0
  402. package/packages/apra-fleet-se/fleet-sprint/docs/dolt-sync-redesign.md +1482 -0
  403. package/packages/apra-fleet-se/fleet-sprint/docs/escalate-to-llm-design.md +908 -0
  404. package/packages/apra-fleet-se/fleet-sprint/docs/shared-orchestrator-reservation-design.md +399 -0
  405. package/packages/apra-fleet-se/fleet-sprint/dolt-settle.mjs +972 -0
  406. package/packages/apra-fleet-se/fleet-sprint/dolt-sync.mjs +167 -101
  407. package/packages/apra-fleet-se/fleet-sprint/errors.mjs +50 -6
  408. package/packages/apra-fleet-se/fleet-sprint/runner.js +1416 -116
  409. package/packages/apra-fleet-se/fleet-sprint/skills/fleet-sprint-cli/SKILL.md +13 -2
  410. package/packages/apra-fleet-se/fleet-sprint/skills/fleet-supervisor/SKILL.md +350 -0
  411. package/packages/apra-fleet-se/fleet-sprint/sprint-progress.mjs +101 -0
  412. package/packages/apra-fleet-se/fleet-sprint/vcs-providers/github.mjs +30 -17
  413. package/packages/apra-fleet-se/fleet-sprint/viewer-extensions.mjs +62 -2
  414. package/packages/apra-fleet-se/package.json +1 -0
  415. package/packages/apra-fleet-workflow/src/viewer/index.mjs +127 -13
  416. package/packages/apra-fleet-workflow/src/viewer/run-title.mjs +60 -0
  417. package/packages/apra-fleet-workflow/src/workflow/index.mjs +8 -4
  418. package/skills/fleet/knowledge-agent.md +66 -0
  419. package/skills/fleet/permissions.md +28 -4
  420. package/skills/fleet/profiles/base-dev.json +10 -1
  421. package/skills/fleet/profiles/base-reviewer.json +8 -1
  422. package/skills/fleet/profiles/tag-kb-reconciler.json +20 -0
  423. package/version.json +1 -1
  424. package/packages/apra-fleet-se/fleet-sprint/docs/dolt-tier2-runbook.md +0 -127
  425. package/packages/apra-fleet-se/fleet-sprint/dolt-recovery-path-b.mjs +0 -339
  426. package/packages/apra-fleet-se/fleet-sprint/dolt-recovery-tier2.mjs +0 -360
  427. package/packages/apra-fleet-se/fleet-sprint/dolt-recovery.mjs +0 -363
@@ -0,0 +1,475 @@
1
+ import { existsSync, readFileSync } from 'fs';
2
+ import { execFileSync } from 'child_process';
3
+ import { join } from 'path';
4
+ import { Client } from '@modelcontextprotocol/sdk/client/index.js';
5
+ import { StdioClientTransport } from '@modelcontextprotocol/sdk/client/stdio.js';
6
+ import { freshnessNote } from './code-intelligence-freshness.js';
7
+ import { maybeScheduleReindex } from './code-intelligence-reindex.js';
8
+ import { isTestPath } from './code-intelligence-tests.js';
9
+ import { logError } from '../utils/log-helpers.js';
10
+ let sharedClient = null;
11
+ let connectionPromise = null;
12
+ // Structured, actionable "offline" result. Same shape as a normal MCP tool
13
+ // result (content array of text plus isError) so callers never receive an
14
+ // unhandled throw or a silent empty result -- mirrors the F3.1 error shape.
15
+ const OFFLINE_MESSAGE = "Code intelligence is offline: the gitnexus service could not be reached. " +
16
+ "Start or reinstall it by running 'npx gitnexus analyze' in the repo " +
17
+ "(or /pm index), then retry.";
18
+ function offlineResult(detail) {
19
+ const text = detail ? `${OFFLINE_MESSAGE} (${detail})` : OFFLINE_MESSAGE;
20
+ return { content: [{ type: 'text', text }], isError: true };
21
+ }
22
+ // Structured, actionable "missing index" result (F3.1). Returned without ever
23
+ // spawning or contacting the child gitnexus process when a repo has not been
24
+ // indexed yet.
25
+ function missingIndexResult(repo) {
26
+ const text = `No code intelligence index found for ${repo}. Run 'npx gitnexus analyze' in the repo (or /pm index) and retry.`;
27
+ return { content: [{ type: 'text', text }], isError: true };
28
+ }
29
+ // Reset the shared connection state so the next call reconnects from scratch.
30
+ function resetConnection() {
31
+ sharedClient = null;
32
+ connectionPromise = null;
33
+ }
34
+ async function getGitNexusClient() {
35
+ if (sharedClient)
36
+ return sharedClient;
37
+ if (connectionPromise)
38
+ return connectionPromise;
39
+ connectionPromise = (async () => {
40
+ const transport = new StdioClientTransport({
41
+ command: 'npx',
42
+ args: ['-y', 'gitnexus', 'mcp'],
43
+ stderr: 'pipe',
44
+ });
45
+ const client = new Client({ name: 'apra-fleet', version: '1.0.0' }, { capabilities: {} });
46
+ // Transport death reset: if the child process dies (close) or the
47
+ // transport/client errors after a successful connect, drop the cached
48
+ // client and promise so the next call reconnects. Guard on identity so a
49
+ // late handler for a client that was already replaced does not clobber a
50
+ // newer connection.
51
+ const onDeath = () => {
52
+ if (sharedClient === client) {
53
+ resetConnection();
54
+ }
55
+ };
56
+ transport.onclose = onDeath;
57
+ transport.onerror = onDeath;
58
+ client.onclose = onDeath;
59
+ client.onerror = onDeath;
60
+ try {
61
+ await client.connect(transport);
62
+ }
63
+ catch (err) {
64
+ // Failure reset: clear the poisoned promise (sharedClient stays null) so
65
+ // the NEXT call attempts a brand-new connection instead of awaiting a
66
+ // rejected promise forever. Rethrow so the current caller sees failure.
67
+ connectionPromise = null;
68
+ throw err;
69
+ }
70
+ sharedClient = client;
71
+ return client;
72
+ })();
73
+ return connectionPromise;
74
+ }
75
+ // Freshness metadata (F2.2): when a call carries a `repo` param and the index
76
+ // exists, compare meta.json's lastCommit against the repo's current
77
+ // `git rev-parse HEAD`. Never throws -- any failure reading meta.json or
78
+ // running git degrades to "no note" so a stale/missing index or unavailable
79
+ // git never blocks or fails the call.
80
+ //
81
+ // P3 (design D3): when divergence is detected, this is also the trigger point
82
+ // for a background reindex -- "already per-call, already knows repo +
83
+ // divergence; no new watchers, no cron". maybeScheduleReindex() is
84
+ // synchronous and non-blocking (it spawns the child detached/unref'd and
85
+ // returns immediately), so calling it here adds no tool-call latency. Any
86
+ // error from it is swallowed and logged -- it must never affect the note or
87
+ // the tool result.
88
+ function computeFreshnessNote(repo) {
89
+ try {
90
+ const metaPath = join(repo, '.gitnexus', 'meta.json');
91
+ const meta = JSON.parse(readFileSync(metaPath, 'utf-8'));
92
+ const head = execFileSync('git', ['rev-parse', 'HEAD'], {
93
+ cwd: repo, encoding: 'utf-8', timeout: 3000, stdio: ['ignore', 'pipe', 'ignore'],
94
+ }).trim();
95
+ const diverged = freshnessNote(meta.lastCommit, head) !== null;
96
+ let reindexScheduled = false;
97
+ if (diverged) {
98
+ try {
99
+ reindexScheduled = maybeScheduleReindex(repo);
100
+ }
101
+ catch (err) {
102
+ const detail = err instanceof Error ? err.message : String(err);
103
+ logError('code-intelligence-gitnexus', `maybeScheduleReindex threw for ${repo}: ${detail}`);
104
+ reindexScheduled = false;
105
+ }
106
+ }
107
+ return freshnessNote(meta.lastCommit, head, reindexScheduled);
108
+ }
109
+ catch {
110
+ return null;
111
+ }
112
+ }
113
+ // Append the freshness note to an MCP tool response as an additional text
114
+ // content block, preserving the existing content array shape. If the result
115
+ // does not look like a content-array response, return it unchanged rather
116
+ // than risk corrupting an unexpected shape.
117
+ function appendFreshnessNote(result, note) {
118
+ if (result &&
119
+ typeof result === 'object' &&
120
+ 'content' in result &&
121
+ Array.isArray(result.content)) {
122
+ const { content, ...rest } = result;
123
+ return { ...rest, content: [...content, { type: 'text', text: note }] };
124
+ }
125
+ return result;
126
+ }
127
+ // Single guarded entry point for every provider method. A thrown
128
+ // connection/dead-client error is converted into a structured actionable
129
+ // result and the shared state is reset so the next call reconnects.
130
+ //
131
+ // Pre-flight (F3.1): when the call carries a non-empty `repo` param, verify
132
+ // the repo has been indexed (`<repo>/.gitnexus/meta.json` exists) BEFORE ever
133
+ // touching the child process. Calls without a `repo` param are forwarded
134
+ // untouched -- the check only applies when a repo is named.
135
+ async function callGitNexus(name, params) {
136
+ const repo = params.repo;
137
+ const hasRepo = typeof repo === 'string' && repo.length > 0;
138
+ if (hasRepo) {
139
+ const metaPath = join(repo, '.gitnexus', 'meta.json');
140
+ if (!existsSync(metaPath)) {
141
+ return missingIndexResult(repo);
142
+ }
143
+ }
144
+ try {
145
+ const client = await getGitNexusClient();
146
+ const result = await client.callTool({ name, arguments: params });
147
+ if (hasRepo) {
148
+ const note = computeFreshnessNote(repo);
149
+ if (note)
150
+ return appendFreshnessNote(result, note);
151
+ }
152
+ return result;
153
+ }
154
+ catch (err) {
155
+ resetConnection();
156
+ const detail = err instanceof Error ? err.message : String(err);
157
+ return offlineResult(detail);
158
+ }
159
+ }
160
+ // Small, pure, exported so both T2.1 (code_map) and T2.2 (code_flow) can reuse
161
+ // it and it can be unit tested directly without mocking the MCP client.
162
+ export function parseMarkdownTable(markdown) {
163
+ if (typeof markdown !== 'string' || markdown.length === 0)
164
+ return [];
165
+ const lines = markdown
166
+ .split('\n')
167
+ .map((line) => line.trim())
168
+ .filter((line) => line.length > 0);
169
+ if (lines.length < 2)
170
+ return [];
171
+ const splitRow = (line) => line
172
+ .replace(/^\|/, '')
173
+ .replace(/\|$/, '')
174
+ .split('|')
175
+ .map((cell) => cell.trim());
176
+ const headers = splitRow(lines[0]);
177
+ // lines[1] is the "| --- | --- |" separator row -- data starts at index 2.
178
+ const rows = [];
179
+ for (let i = 2; i < lines.length; i++) {
180
+ const cells = splitRow(lines[i]);
181
+ const row = {};
182
+ headers.forEach((header, idx) => {
183
+ row[header] = cells[idx] ?? '';
184
+ });
185
+ rows.push(row);
186
+ }
187
+ return rows;
188
+ }
189
+ // gitnexus heuristicLabels for processes encode "Entry -> Terminal" using a
190
+ // Unicode arrow (confirmed in the T1.1 spike sample: "RemoveMember -> MaskSecrets").
191
+ // Community keywords can also carry non-ASCII punctuation. Sanitize before this
192
+ // text is written anywhere in an ASCII-only project (repo convention).
193
+ const UNICODE_ARROW_PATTERN = /[→⇒⟶⟹➔➜↦]/g;
194
+ export function asciiSanitizeLabel(label) {
195
+ if (typeof label !== 'string')
196
+ return label;
197
+ return label
198
+ .replace(UNICODE_ARROW_PATTERN, '->')
199
+ .replace(/[^\x00-\x7F]/g, '?');
200
+ }
201
+ function isErrorResult(result) {
202
+ return !!(result && typeof result === 'object' && result.isError === true);
203
+ }
204
+ // The child's `cypher` tool result is an MCP content array whose text is
205
+ // `JSON.stringify({ markdown, row_count }, null, 2)` followed by a
206
+ // "\n\n---\n**Next:**..." hint suffix (see gitnexus dist/mcp/server.js). Strip
207
+ // the hint before parsing so `JSON.parse` sees only the payload.
208
+ function extractCypherPayload(result) {
209
+ if (!result || typeof result !== 'object' || !('content' in result))
210
+ return null;
211
+ const content = result.content;
212
+ if (!Array.isArray(content) || content.length === 0)
213
+ return null;
214
+ const first = content[0];
215
+ if (!first || typeof first.text !== 'string')
216
+ return null;
217
+ const jsonPart = first.text.split('\n\n---\n')[0];
218
+ try {
219
+ const parsed = JSON.parse(jsonPart);
220
+ if (typeof parsed.markdown === 'string') {
221
+ return {
222
+ markdown: parsed.markdown,
223
+ row_count: typeof parsed.row_count === 'number' ? parsed.row_count : 0,
224
+ };
225
+ }
226
+ }
227
+ catch {
228
+ // Not the expected shape -- caller falls back to the raw result.
229
+ }
230
+ return null;
231
+ }
232
+ function textResult(payload) {
233
+ return { content: [{ type: 'text', text: JSON.stringify(payload) }] };
234
+ }
235
+ function mapCommunitiesResult(result) {
236
+ if (isErrorResult(result))
237
+ return result;
238
+ const payload = extractCypherPayload(result);
239
+ if (!payload)
240
+ return result;
241
+ const communities = parseMarkdownTable(payload.markdown).map((row) => ({
242
+ label: asciiSanitizeLabel(row.label ?? ''),
243
+ symbols: Number(row.symbols) || 0,
244
+ cohesion: row.cohesion !== undefined && row.cohesion !== '' ? Number(row.cohesion) : undefined,
245
+ keywords: row.keywords !== undefined ? asciiSanitizeLabel(row.keywords) : undefined,
246
+ }));
247
+ return textResult({ communities, row_count: payload.row_count });
248
+ }
249
+ // Bounds the number of matched processes for which a second (steps) query is
250
+ // issued, so a broad/unfiltered flow() call cannot fan out unbounded cypher
251
+ // calls against the child.
252
+ const MAX_FLOW_STEP_LOOKUPS = 5;
253
+ const FLOW_STEP_QUERY = 'MATCH (s)-[r:CodeRelation {type: "STEP_IN_PROCESS"}]->(p:Process) WHERE p.heuristicLabel = $label ' +
254
+ 'RETURN s.name AS step, s.filePath AS filePath, r.step AS stepOrder ORDER BY r.step';
255
+ async function mapFlowResult(listResult, repo) {
256
+ if (isErrorResult(listResult))
257
+ return listResult;
258
+ const payload = extractCypherPayload(listResult);
259
+ if (!payload)
260
+ return listResult;
261
+ const rows = parseMarkdownTable(payload.markdown);
262
+ const processes = [];
263
+ for (const row of rows.slice(0, MAX_FLOW_STEP_LOOKUPS)) {
264
+ const rawLabel = row.label ?? '';
265
+ const stepsResult = await callGitNexus('cypher', {
266
+ query: FLOW_STEP_QUERY,
267
+ params: { label: rawLabel },
268
+ ...(repo ? { repo } : {}),
269
+ });
270
+ const stepsPayload = extractCypherPayload(stepsResult);
271
+ const steps = stepsPayload
272
+ ? parseMarkdownTable(stepsPayload.markdown).map((s) => ({
273
+ step: asciiSanitizeLabel(s.step ?? ''),
274
+ filePath: s.filePath ?? '',
275
+ order: Number(s.stepOrder) || 0,
276
+ }))
277
+ : [];
278
+ processes.push({
279
+ label: asciiSanitizeLabel(rawLabel),
280
+ processType: row.processType ?? '',
281
+ stepCount: Number(row.stepCount) || 0,
282
+ steps,
283
+ });
284
+ }
285
+ return textResult({ processes, row_count: payload.row_count });
286
+ }
287
+ // The child's `impact` tool result is an MCP content array whose text is
288
+ // JSON (per the confirmed shape in docs/code-intelligence-child-surface.md).
289
+ // Some child tools (cypher) append a "\n\n---\n**Next:**..." hint suffix
290
+ // after the JSON payload; strip it defensively here too in case impact does
291
+ // the same, mirroring extractCypherPayload's approach.
292
+ function extractImpactPayload(result) {
293
+ if (!result || typeof result !== 'object' || !('content' in result))
294
+ return null;
295
+ const content = result.content;
296
+ if (!Array.isArray(content) || content.length === 0)
297
+ return null;
298
+ const first = content[0];
299
+ if (!first || typeof first.text !== 'string')
300
+ return null;
301
+ const jsonPart = first.text.split('\n\n---\n')[0];
302
+ try {
303
+ const parsed = JSON.parse(jsonPart);
304
+ if (parsed && typeof parsed === 'object')
305
+ return parsed;
306
+ }
307
+ catch {
308
+ // Not the expected shape -- caller falls back to the raw result.
309
+ }
310
+ return null;
311
+ }
312
+ function mapTestsResult(result) {
313
+ if (isErrorResult(result))
314
+ return result;
315
+ const payload = extractImpactPayload(result);
316
+ if (!payload)
317
+ return result;
318
+ const byDepth = payload.byDepth ?? {};
319
+ const candidates = [...(byDepth['1'] ?? []), ...(byDepth['2'] ?? [])];
320
+ const tests = candidates
321
+ .filter((item) => typeof item.filePath === 'string' && isTestPath(item.filePath))
322
+ .map((item) => ({ name: item.name ?? '', filePath: item.filePath ?? '' }));
323
+ return textResult({ tests, count: tests.length });
324
+ }
325
+ // ---------------------------------------------------------------------------
326
+ // graph() retarget (yashr-5t9): gitnexus 1.6.7 has NO child tool named
327
+ // `call_graph` -- the previous mapping callGitNexus('call_graph', ...) always
328
+ // returned the child's "Unknown tool: call_graph" isError result, so code_graph
329
+ // was silently broken. Live-verified 2026-07 exactly as the fleet spawns the
330
+ // child (npx -y gitnexus mcp over stdio): listTools() returns 13 tools and
331
+ // `call_graph` is absent; a variable-length CALLS traversal via `cypher`
332
+ // returns the { markdown, row_count } shape (confirmed against this repo's
333
+ // .gitnexus index). See docs/code-intelligence-child-surface.md.
334
+ //
335
+ // Chosen approach: compose two depth-bounded `cypher` traversals over CALLS
336
+ // edges (callers + callees), rung 2 -- same pattern as map()/flow(). This
337
+ // returns a GENUINE multi-hop call graph, which keeps code_graph meaningfully
338
+ // distinct from code_context: `context` (mapped to child 'context') is the
339
+ // depth-1 360-degree view of a single symbol (direct in/out calls, accesses,
340
+ // KB enrichment), whereas code_graph is the transitive caller/callee graph out
341
+ // to GRAPH_MAX_DEPTH hops -- something context does not provide. The `symbol`
342
+ // arg of codeGraphSchema maps to the Cypher `$symbol` param. Routed through
343
+ // callGitNexus so it inherits the pre-flight index check, resilience, and
344
+ // freshness wiring. Reuses parseMarkdownTable/asciiSanitizeLabel/
345
+ // extractCypherPayload. Do NOT parse ladybugdb directly.
346
+ //
347
+ // NOTE on freshness: like map()/flow(), graph() reshapes the child's cypher
348
+ // output into its own envelope, so the per-call freshness note that
349
+ // callGitNexus appends to a passthrough result is not carried through here --
350
+ // this is the same accepted trade-off the other composed tools make.
351
+ // Depth 2 gives direct callers/callees plus one transitive hop. Inlined into
352
+ // the query string because Cypher variable-length bounds cannot be
353
+ // parameterized.
354
+ const GRAPH_MAX_DEPTH = 2;
355
+ const GRAPH_ROW_LIMIT = 100;
356
+ // Callers: symbols that transitively CALL the target (incoming CALLS edges).
357
+ const GRAPH_CALLERS_QUERY = 'MATCH p = (caller)-[:CodeRelation*1..' + GRAPH_MAX_DEPTH + ' {type: "CALLS"}]->(target) ' +
358
+ 'WHERE target.name = $symbol ' +
359
+ 'RETURN DISTINCT caller.name AS name, caller.filePath AS filePath, length(p) AS depth ' +
360
+ 'ORDER BY depth, name LIMIT ' + GRAPH_ROW_LIMIT;
361
+ // Callees: symbols the target transitively CALLS (outgoing CALLS edges).
362
+ const GRAPH_CALLEES_QUERY = 'MATCH p = (source)-[:CodeRelation*1..' + GRAPH_MAX_DEPTH + ' {type: "CALLS"}]->(callee) ' +
363
+ 'WHERE source.name = $symbol ' +
364
+ 'RETURN DISTINCT callee.name AS name, callee.filePath AS filePath, length(p) AS depth ' +
365
+ 'ORDER BY depth, name LIMIT ' + GRAPH_ROW_LIMIT;
366
+ function mapGraphRows(result) {
367
+ const payload = extractCypherPayload(result);
368
+ if (!payload)
369
+ return [];
370
+ return parseMarkdownTable(payload.markdown).map((row) => ({
371
+ name: asciiSanitizeLabel(row.name ?? ''),
372
+ filePath: row.filePath ?? '',
373
+ depth: Number(row.depth) || 0,
374
+ }));
375
+ }
376
+ export class GitNexusProvider {
377
+ async graph(params) {
378
+ const symbol = params.symbol;
379
+ const repoArg = typeof params.repo === 'string' ? { repo: params.repo } : {};
380
+ const callersResult = await callGitNexus('cypher', {
381
+ query: GRAPH_CALLERS_QUERY,
382
+ params: { symbol },
383
+ ...repoArg,
384
+ });
385
+ // Surface offline / missing-index / unknown-error results unchanged, and
386
+ // short-circuit the second call so a broken index does not fan out twice.
387
+ if (isErrorResult(callersResult))
388
+ return callersResult;
389
+ const calleesResult = await callGitNexus('cypher', {
390
+ query: GRAPH_CALLEES_QUERY,
391
+ params: { symbol },
392
+ ...repoArg,
393
+ });
394
+ if (isErrorResult(calleesResult))
395
+ return calleesResult;
396
+ return textResult({
397
+ symbol: asciiSanitizeLabel(typeof symbol === 'string' ? symbol : String(symbol ?? '')),
398
+ maxDepth: GRAPH_MAX_DEPTH,
399
+ callers: mapGraphRows(callersResult),
400
+ callees: mapGraphRows(calleesResult),
401
+ });
402
+ }
403
+ async impact(params) {
404
+ return callGitNexus('impact', params);
405
+ }
406
+ async query(params) {
407
+ return callGitNexus('query', params);
408
+ }
409
+ async context(params) {
410
+ return callGitNexus('context', params);
411
+ }
412
+ // T2.1: architectural map via Community nodes (rung 2 -- compose over cypher;
413
+ // no direct communities/map tool exists on gitnexus 1.6.7). See Decisions
414
+ // table in docs/code-intelligence-child-surface.md.
415
+ async map(params) {
416
+ const top = typeof params.top === 'number' && params.top > 0 ? params.top : 20;
417
+ const repo = params.repo;
418
+ const result = await callGitNexus('cypher', {
419
+ query: 'MATCH (c:Community) RETURN c.heuristicLabel AS label, c.symbolCount AS symbols, ' +
420
+ 'c.cohesion AS cohesion, c.keywords AS keywords ORDER BY symbols DESC LIMIT $top',
421
+ params: { top },
422
+ ...(typeof repo === 'string' ? { repo } : {}),
423
+ });
424
+ return mapCommunitiesResult(result);
425
+ }
426
+ // T2.2: process flows via Process/STEP_IN_PROCESS nodes (rung 2 -- compose
427
+ // over cypher; no direct flows/processes tool, and code_query's `processes`
428
+ // array is free-text only, not from/to/name filterable). See Decisions table
429
+ // in docs/code-intelligence-child-surface.md. from/to are matched against the
430
+ // "Entry -> Terminal" heuristicLabel text (CONTAINS) since there is no
431
+ // structured endpoint field to filter on directly.
432
+ async flow(params) {
433
+ const repo = typeof params.repo === 'string' ? params.repo : undefined;
434
+ const conditions = [];
435
+ const cypherParams = {};
436
+ if (typeof params.name === 'string' && params.name.length > 0) {
437
+ conditions.push('p.heuristicLabel CONTAINS $name');
438
+ cypherParams.name = params.name;
439
+ }
440
+ if (typeof params.from === 'string' && params.from.length > 0) {
441
+ conditions.push('p.heuristicLabel CONTAINS $from');
442
+ cypherParams.from = params.from;
443
+ }
444
+ if (typeof params.to === 'string' && params.to.length > 0) {
445
+ conditions.push('p.heuristicLabel CONTAINS $to');
446
+ cypherParams.to = params.to;
447
+ }
448
+ const whereClause = conditions.length > 0 ? `WHERE ${conditions.join(' AND ')} ` : '';
449
+ const listResult = await callGitNexus('cypher', {
450
+ query: `MATCH (p:Process) ${whereClause}RETURN p.heuristicLabel AS label, ` +
451
+ 'p.processType AS processType, p.stepCount AS stepCount ORDER BY stepCount DESC LIMIT 20',
452
+ params: cypherParams,
453
+ ...(repo ? { repo } : {}),
454
+ });
455
+ return mapFlowResult(listResult, repo);
456
+ }
457
+ // T4.4: test-to-symbol mapping via the `impact` upstream traversal (rung
458
+ // 1/2 -- direct tool, composed filter; see Decisions table in
459
+ // docs/code-intelligence-child-surface.md, "Upstream traversal depth 2"
460
+ // row). Depth is fixed at 2 per design D9. includeTests: true so test
461
+ // files are not filtered out by the child before isTestPath ever sees
462
+ // them.
463
+ async tests(params) {
464
+ const repo = params.repo;
465
+ const result = await callGitNexus('impact', {
466
+ target: params.symbol,
467
+ direction: 'upstream',
468
+ maxDepth: 2,
469
+ includeTests: true,
470
+ ...(typeof repo === 'string' ? { repo } : {}),
471
+ });
472
+ return mapTestsResult(result);
473
+ }
474
+ }
475
+ //# sourceMappingURL=code-intelligence-gitnexus.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"code-intelligence-gitnexus.js","sourceRoot":"","sources":["../../src/tools/code-intelligence-gitnexus.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AAEjF,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAA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K,CAAC,KAAK,CAAC,MAA+B;QACzC,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;QACzB,MAAM,MAAM,GAAG,MAAM,YAAY,CAAC,QAAQ,EAAE;YAC1C,MAAM,EAAE,MAAM,CAAC,MAAM;YACrB,SAAS,EAAE,UAAU;YACrB,QAAQ,EAAE,CAAC;YACX,YAAY,EAAE,IAAI;YAClB,GAAG,CAAC,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SAC9C,CAAC,CAAC;QACH,OAAO,cAAc,CAAC,MAAM,CAAC,CAAC;IAChC,CAAC;CACF"}
@@ -0,0 +1,2 @@
1
+ export declare function enrichContextWithKb(name: string, result: unknown, repoPath?: string, remoteUrl?: string): Promise<unknown>;
2
+ //# sourceMappingURL=code-intelligence-kb-enrich.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"code-intelligence-kb-enrich.d.ts","sourceRoot":"","sources":["../../src/tools/code-intelligence-kb-enrich.ts"],"names":[],"mappings":"AAqCA,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,OAAO,EACf,QAAQ,CAAC,EAAE,MAAM,EACjB,SAAS,CAAC,EAAE,MAAM,GACjB,OAAO,CAAC,OAAO,CAAC,CAsClB"}
@@ -0,0 +1,65 @@
1
+ // P4a KB enrichment for code_context (T3.3, design D4). The gitnexus
2
+ // provider file (code-intelligence-gitnexus.ts) must NOT import the KB
3
+ // service -- that would create a src/tools <-> src/services cycle. This
4
+ // helper is imported ONLY by the code_context handler in src/index.ts: the
5
+ // handler calls the provider, then this helper, then merges the two results.
6
+ import { getKbProviders } from '../services/knowledge/kb-providers.js';
7
+ const SUMMARY_TRUNCATE_LEN = 120;
8
+ function isErrorResult(result) {
9
+ return !!(result && typeof result === 'object' && result.isError === true);
10
+ }
11
+ // Append a plain text content block to an MCP tool response, preserving the
12
+ // existing content array shape -- mirrors appendFreshnessNote() in
13
+ // code-intelligence-gitnexus.ts. If the result does not look like a
14
+ // content-array response, return it unchanged rather than risk corrupting an
15
+ // unexpected shape.
16
+ function appendTextBlock(result, text) {
17
+ if (result &&
18
+ typeof result === 'object' &&
19
+ 'content' in result &&
20
+ Array.isArray(result.content)) {
21
+ const { content, ...rest } = result;
22
+ return { ...rest, content: [...content, { type: 'text', text }] };
23
+ }
24
+ return result;
25
+ }
26
+ // After a successful (non-error) code_context call for `name`, query the
27
+ // project KB for CONFIRMED entries whose `symbols` array contains `name`
28
+ // (exact match) and append a compact block listing them. Zero matches -> the
29
+ // result is returned unchanged (no block at all). Any KB read error is
30
+ // swallowed -- this never fails the call, and error results from the
31
+ // provider are passed through untouched (do not enrich error results).
32
+ export async function enrichContextWithKb(name, result, repoPath, remoteUrl) {
33
+ if (isErrorResult(result))
34
+ return result;
35
+ try {
36
+ // Enrich from the KB of the repo the code_context call is about; without
37
+ // this the server's cwd decides, and one repo's knowledge annotates
38
+ // another's symbols. remoteUrl (repo_remote_url on the code_context
39
+ // input) lets a remote member's call resolve the correct project KB even
40
+ // when repoPath is a path on another host that this process cannot stat.
41
+ const providers = await getKbProviders(repoPath, remoteUrl);
42
+ const kbResult = await providers.project.query({
43
+ query: name,
44
+ l1_only: true,
45
+ include_stale: false,
46
+ });
47
+ const matches = kbResult.results.filter((entry) => entry.confidence === 'CONFIRMED' &&
48
+ Array.isArray(entry.symbols) &&
49
+ entry.symbols.includes(name));
50
+ if (matches.length === 0)
51
+ return result;
52
+ const lines = matches.map((entry) => {
53
+ const summary = entry.summary.length > SUMMARY_TRUNCATE_LEN
54
+ ? entry.summary.slice(0, SUMMARY_TRUNCATE_LEN)
55
+ : entry.summary;
56
+ return `- ${entry.title} -- ${summary}`;
57
+ });
58
+ const block = `[knowledge-bank] ${matches.length} confirmed entries for ${name}:\n${lines.join('\n')}`;
59
+ return appendTextBlock(result, block);
60
+ }
61
+ catch {
62
+ return result;
63
+ }
64
+ }
65
+ //# sourceMappingURL=code-intelligence-kb-enrich.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"code-intelligence-kb-enrich.js","sourceRoot":"","sources":["../../src/tools/code-intelligence-kb-enrich.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,uEAAuE;AACvE,wEAAwE;AACxE,2EAA2E;AAC3E,6EAA6E;AAC7E,OAAO,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AAEvE,MAAM,oBAAoB,GAAG,GAAG,CAAC;AAEjC,SAAS,aAAa,CAAC,MAAe;IACpC,OAAO,CAAC,CAAC,CAAC,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAK,MAAgC,CAAC,OAAO,KAAK,IAAI,CAAC,CAAC;AACxG,CAAC;AAED,4EAA4E;AAC5E,mEAAmE;AACnE,oEAAoE;AACpE,6EAA6E;AAC7E,oBAAoB;AACpB,SAAS,eAAe,CAAC,MAAe,EAAE,IAAY;IACpD,IACE,MAAM;QACN,OAAO,MAAM,KAAK,QAAQ;QAC1B,SAAS,IAAI,MAAM;QACnB,KAAK,CAAC,OAAO,CAAE,MAA+B,CAAC,OAAO,CAAC,EACvD,CAAC;QACD,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,GAAG,MAA0D,CAAC;QACxF,OAAO,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,CAAC,GAAG,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC;IACpE,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,yEAAyE;AACzE,yEAAyE;AACzE,6EAA6E;AAC7E,uEAAuE;AACvE,qEAAqE;AACrE,uEAAuE;AACvE,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACvC,IAAY,EACZ,MAAe,EACf,QAAiB,EACjB,SAAkB;IAElB,IAAI,aAAa,CAAC,MAAM,CAAC;QAAE,OAAO,MAAM,CAAC;IAEzC,IAAI,CAAC;QACH,y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 export declare const DEFAULT_COOLDOWN_MS = 120000;
2
+ export declare function shouldStartReindex(entry: {
3
+ running: boolean;
4
+ lastFinishedAt?: number;
5
+ } | undefined, now: number, cooldownMs?: number): boolean;
6
+ export declare function maybeScheduleReindex(repoPath: string): boolean;
7
+ //# sourceMappingURL=code-intelligence-reindex.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"code-intelligence-reindex.d.ts","sourceRoot":"","sources":["../../src/tools/code-intelligence-reindex.ts"],"names":[],"mappings":"AAuBA,eAAO,MAAM,mBAAmB,SAAS,CAAC;AAS1C,wBAAgB,kBAAkB,CAChC,KAAK,EAAE;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,cAAc,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,EAChE,GAAG,EAAE,MAAM,EACX,UAAU,GAAE,MAA4B,GACvC,OAAO,CAIT;AA4BD,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAwD9D"}