@vibecodetown/mcp-server 1.3.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 (893) hide show
  1. package/CONTRIBUTING.md +294 -0
  2. package/README.md +146 -0
  3. package/bin/clinic_linux_x64/clinic +0 -0
  4. package/bin/clinic_win_x64/clinic.exe +0 -0
  5. package/bin/musu-linux-x64 +0 -0
  6. package/bin/spec-high_linux_x64/spec-high +0 -0
  7. package/bin/spec-high_win_x64/spec-high.exe +0 -0
  8. package/bin/vibecoding-helper_linux_x64/vibecoding-helper +0 -0
  9. package/bin/vibecoding-helper_win_x64/vibecoding-helper.exe +0 -0
  10. package/bin/vpm-back_linux_x64/vpm-back +0 -0
  11. package/bin/vpm-back_win_x64/vpm-back.exe +0 -0
  12. package/build/background-sync-worker.d.ts +55 -0
  13. package/build/background-sync-worker.js +172 -0
  14. package/build/bin/vibe-auth.d.ts +12 -0
  15. package/build/bin/vibe-auth.js +246 -0
  16. package/build/bin/vibe-bitnet-worker.d.ts +21 -0
  17. package/build/bin/vibe-bitnet-worker.js +123 -0
  18. package/build/bin/vibe-ci.d.ts +15 -0
  19. package/build/bin/vibe-ci.js +1558 -0
  20. package/build/bin/vibe-dashboard.d.ts +12 -0
  21. package/build/bin/vibe-dashboard.js +76 -0
  22. package/build/bin/vibe-mapper-worker.d.ts +15 -0
  23. package/build/bin/vibe-mapper-worker.js +92 -0
  24. package/build/bitnet-worker/autostart.d.ts +39 -0
  25. package/build/bitnet-worker/autostart.js +110 -0
  26. package/build/bitnet-worker/client.d.ts +177 -0
  27. package/build/bitnet-worker/client.js +393 -0
  28. package/build/bitnet-worker/cpu_brake.d.ts +106 -0
  29. package/build/bitnet-worker/cpu_brake.js +177 -0
  30. package/build/bitnet-worker/embed_client.d.ts +31 -0
  31. package/build/bitnet-worker/embed_client.js +109 -0
  32. package/build/bitnet-worker/hw_slots.d.ts +90 -0
  33. package/build/bitnet-worker/hw_slots.js +167 -0
  34. package/build/bitnet-worker/index.d.ts +24 -0
  35. package/build/bitnet-worker/index.js +27 -0
  36. package/build/bitnet-worker/metrics.d.ts +78 -0
  37. package/build/bitnet-worker/metrics.js +129 -0
  38. package/build/bitnet-worker/native_inference.d.ts +86 -0
  39. package/build/bitnet-worker/native_inference.js +256 -0
  40. package/build/bitnet-worker/pool-autostart.d.ts +41 -0
  41. package/build/bitnet-worker/pool-autostart.js +124 -0
  42. package/build/bitnet-worker/request_cache.d.ts +41 -0
  43. package/build/bitnet-worker/request_cache.js +101 -0
  44. package/build/bitnet-worker/serial_queue.d.ts +13 -0
  45. package/build/bitnet-worker/serial_queue.js +22 -0
  46. package/build/bitnet-worker/server-autostart.d.ts +48 -0
  47. package/build/bitnet-worker/server-autostart.js +129 -0
  48. package/build/bitnet-worker/server.d.ts +76 -0
  49. package/build/bitnet-worker/server.js +545 -0
  50. package/build/bitnet-worker/server_manager.d.ts +133 -0
  51. package/build/bitnet-worker/server_manager.js +359 -0
  52. package/build/bitnet-worker/tiered_queue.d.ts +126 -0
  53. package/build/bitnet-worker/tiered_queue.js +187 -0
  54. package/build/bitnet-worker/types.d.ts +196 -0
  55. package/build/bitnet-worker/types.js +146 -0
  56. package/build/config/load-config.d.ts +40 -0
  57. package/build/config/load-config.js +227 -0
  58. package/build/coordinator/client.d.ts +99 -0
  59. package/build/coordinator/client.js +158 -0
  60. package/build/coordinator/index.d.ts +27 -0
  61. package/build/coordinator/index.js +31 -0
  62. package/build/correction-messages.d.ts +66 -0
  63. package/build/correction-messages.js +245 -0
  64. package/build/dashboard/autostart.d.ts +45 -0
  65. package/build/dashboard/autostart.js +121 -0
  66. package/build/dashboard/index.d.ts +21 -0
  67. package/build/dashboard/index.js +23 -0
  68. package/build/dashboard/server.d.ts +43 -0
  69. package/build/dashboard/server.js +334 -0
  70. package/build/db_sync/config.d.ts +76 -0
  71. package/build/db_sync/config.js +153 -0
  72. package/build/db_sync/index.d.ts +86 -0
  73. package/build/db_sync/index.js +294 -0
  74. package/build/db_sync/parsers/bitnet.d.ts +20 -0
  75. package/build/db_sync/parsers/bitnet.js +61 -0
  76. package/build/db_sync/parsers/gate.d.ts +23 -0
  77. package/build/db_sync/parsers/gate.js +73 -0
  78. package/build/db_sync/parsers/index.d.ts +10 -0
  79. package/build/db_sync/parsers/index.js +10 -0
  80. package/build/db_sync/parsers/ingress.d.ts +22 -0
  81. package/build/db_sync/parsers/ingress.js +57 -0
  82. package/build/db_sync/parsers/mapping.d.ts +22 -0
  83. package/build/db_sync/parsers/mapping.js +57 -0
  84. package/build/db_sync/parsers/orchestrator.d.ts +66 -0
  85. package/build/db_sync/parsers/orchestrator.js +110 -0
  86. package/build/db_sync/pool.d.ts +120 -0
  87. package/build/db_sync/pool.js +225 -0
  88. package/build/db_sync/publish.d.ts +125 -0
  89. package/build/db_sync/publish.js +197 -0
  90. package/build/db_sync/read_model.d.ts +54 -0
  91. package/build/db_sync/read_model.js +254 -0
  92. package/build/db_sync/scanner.d.ts +97 -0
  93. package/build/db_sync/scanner.js +287 -0
  94. package/build/db_sync/types.d.ts +254 -0
  95. package/build/db_sync/types.js +76 -0
  96. package/build/db_sync/writer.d.ts +111 -0
  97. package/build/db_sync/writer.js +377 -0
  98. package/build/decision-log-reader.d.ts +38 -0
  99. package/build/decision-log-reader.js +116 -0
  100. package/build/deep-link.d.ts +97 -0
  101. package/build/deep-link.js +176 -0
  102. package/build/deps/deps-update.d.ts +36 -0
  103. package/build/deps/deps-update.js +324 -0
  104. package/build/deps/drift-check.d.ts +35 -0
  105. package/build/deps/drift-check.js +247 -0
  106. package/build/deps/env-check.d.ts +43 -0
  107. package/build/deps/env-check.js +310 -0
  108. package/build/deps/index.d.ts +16 -0
  109. package/build/deps/index.js +22 -0
  110. package/build/deps/pm-detect.d.ts +56 -0
  111. package/build/deps/pm-detect.js +213 -0
  112. package/build/deps/types.d.ts +84 -0
  113. package/build/deps/types.js +4 -0
  114. package/build/deps/ux-renderer.d.ts +102 -0
  115. package/build/deps/ux-renderer.js +410 -0
  116. package/build/evidence-report.d.ts +152 -0
  117. package/build/evidence-report.js +648 -0
  118. package/build/health/index.d.ts +30 -0
  119. package/build/health/index.js +31 -0
  120. package/build/health/liveness.d.ts +32 -0
  121. package/build/health/liveness.js +49 -0
  122. package/build/health/readiness.d.ts +60 -0
  123. package/build/health/readiness.js +136 -0
  124. package/build/health/types.d.ts +75 -0
  125. package/build/health/types.js +31 -0
  126. package/build/index.d.ts +41 -0
  127. package/build/index.js +131 -0
  128. package/build/license-manager.d.ts +85 -0
  129. package/build/license-manager.js +349 -0
  130. package/build/mapper-worker/client.d.ts +92 -0
  131. package/build/mapper-worker/client.js +360 -0
  132. package/build/mapper-worker/index.d.ts +29 -0
  133. package/build/mapper-worker/index.js +33 -0
  134. package/build/mapper-worker/pool.d.ts +24 -0
  135. package/build/mapper-worker/pool.js +301 -0
  136. package/build/mapper-worker/server.d.ts +49 -0
  137. package/build/mapper-worker/server.js +324 -0
  138. package/build/mapper-worker/types.d.ts +215 -0
  139. package/build/mapper-worker/types.js +106 -0
  140. package/build/mcp/a2a/observer/hooks.d.ts +102 -0
  141. package/build/mcp/a2a/observer/hooks.js +207 -0
  142. package/build/mcp/a2a/observer/logger.d.ts +66 -0
  143. package/build/mcp/a2a/observer/logger.js +300 -0
  144. package/build/mcp/a2a/observer/types.d.ts +92 -0
  145. package/build/mcp/a2a/observer/types.js +11 -0
  146. package/build/mcp/a2a/orchestrator/loop.d.ts +84 -0
  147. package/build/mcp/a2a/orchestrator/loop.js +151 -0
  148. package/build/mcp/a2a/orchestrator/ralph-audit.d.ts +66 -0
  149. package/build/mcp/a2a/orchestrator/ralph-audit.js +113 -0
  150. package/build/mcp/a2a/orchestrator/ralph-runner.d.ts +120 -0
  151. package/build/mcp/a2a/orchestrator/ralph-runner.js +365 -0
  152. package/build/mcp/a2a/orchestrator/rewind-actions.d.ts +38 -0
  153. package/build/mcp/a2a/orchestrator/rewind-actions.js +148 -0
  154. package/build/mcp/a2a/types.d.ts +82 -0
  155. package/build/mcp/a2a/types.js +4 -0
  156. package/build/mcp/airlock/airlock.d.ts +2 -0
  157. package/build/mcp/airlock/airlock.js +34 -0
  158. package/build/mcp/airlock/index.d.ts +5 -0
  159. package/build/mcp/airlock/index.js +5 -0
  160. package/build/mcp/airlock/policy.d.ts +14 -0
  161. package/build/mcp/airlock/policy.js +31 -0
  162. package/build/mcp/airlock/redact.d.ts +11 -0
  163. package/build/mcp/airlock/redact.js +69 -0
  164. package/build/mcp/airlock/report.d.ts +14 -0
  165. package/build/mcp/airlock/report.js +53 -0
  166. package/build/mcp/airlock/types.d.ts +66 -0
  167. package/build/mcp/airlock/types.js +1 -0
  168. package/build/mcp/auth/gate.d.ts +51 -0
  169. package/build/mcp/auth/gate.js +225 -0
  170. package/build/mcp/auth/index.d.ts +32 -0
  171. package/build/mcp/auth/index.js +55 -0
  172. package/build/mcp/auth/public_key.d.ts +31 -0
  173. package/build/mcp/auth/public_key.js +34 -0
  174. package/build/mcp/auth/token_cache.d.ts +49 -0
  175. package/build/mcp/auth/token_cache.js +122 -0
  176. package/build/mcp/auth/token_verifier.d.ts +57 -0
  177. package/build/mcp/auth/token_verifier.js +117 -0
  178. package/build/mcp/bootstrap/doctor.d.ts +75 -0
  179. package/build/mcp/bootstrap/doctor.js +223 -0
  180. package/build/mcp/bootstrap/installer.d.ts +73 -0
  181. package/build/mcp/bootstrap/installer.js +993 -0
  182. package/build/mcp/bootstrap/lock.d.ts +5 -0
  183. package/build/mcp/bootstrap/lock.js +37 -0
  184. package/build/mcp/bootstrap/platform.d.ts +9 -0
  185. package/build/mcp/bootstrap/platform.js +26 -0
  186. package/build/mcp/bootstrap/registry.d.ts +46 -0
  187. package/build/mcp/bootstrap/registry.js +49 -0
  188. package/build/mcp/bootstrap/skills-installer.d.ts +154 -0
  189. package/build/mcp/bootstrap/skills-installer.js +610 -0
  190. package/build/mcp/cache/index.d.ts +77 -0
  191. package/build/mcp/cache/index.js +147 -0
  192. package/build/mcp/chunking/artifacts.d.ts +9 -0
  193. package/build/mcp/chunking/artifacts.js +41 -0
  194. package/build/mcp/chunking/chunking.d.ts +10 -0
  195. package/build/mcp/chunking/chunking.js +193 -0
  196. package/build/mcp/chunking/index.d.ts +4 -0
  197. package/build/mcp/chunking/index.js +4 -0
  198. package/build/mcp/chunking/policy.d.ts +27 -0
  199. package/build/mcp/chunking/policy.js +71 -0
  200. package/build/mcp/chunking/types.d.ts +66 -0
  201. package/build/mcp/chunking/types.js +1 -0
  202. package/build/mcp/cli.d.ts +57 -0
  203. package/build/mcp/cli.js +182 -0
  204. package/build/mcp/cockpit-bridge/client.d.ts +84 -0
  205. package/build/mcp/cockpit-bridge/client.js +78 -0
  206. package/build/mcp/cockpit-bridge/index.d.ts +16 -0
  207. package/build/mcp/cockpit-bridge/index.js +20 -0
  208. package/build/mcp/cockpit-bridge/tools/command.d.ts +101 -0
  209. package/build/mcp/cockpit-bridge/tools/command.js +185 -0
  210. package/build/mcp/cockpit-bridge/tools/decide.d.ts +27 -0
  211. package/build/mcp/cockpit-bridge/tools/decide.js +62 -0
  212. package/build/mcp/cockpit-bridge/tools/index.d.ts +17 -0
  213. package/build/mcp/cockpit-bridge/tools/index.js +28 -0
  214. package/build/mcp/cockpit-bridge/tools/manual.d.ts +26 -0
  215. package/build/mcp/cockpit-bridge/tools/manual.js +56 -0
  216. package/build/mcp/cockpit-bridge/tools/prompt.d.ts +19 -0
  217. package/build/mcp/cockpit-bridge/tools/prompt.js +57 -0
  218. package/build/mcp/cockpit-bridge/tools/status.d.ts +19 -0
  219. package/build/mcp/cockpit-bridge/tools/status.js +50 -0
  220. package/build/mcp/contracts.d.ts +609 -0
  221. package/build/mcp/contracts.js +22 -0
  222. package/build/mcp/engine.d.ts +86 -0
  223. package/build/mcp/engine.js +273 -0
  224. package/build/mcp/errors.d.ts +118 -0
  225. package/build/mcp/errors.js +278 -0
  226. package/build/mcp/events/constants.d.ts +31 -0
  227. package/build/mcp/events/constants.js +44 -0
  228. package/build/mcp/events/dedup_cooldown.d.ts +19 -0
  229. package/build/mcp/events/dedup_cooldown.js +51 -0
  230. package/build/mcp/events/emitter.d.ts +12 -0
  231. package/build/mcp/events/emitter.js +27 -0
  232. package/build/mcp/events/event_loop.d.ts +13 -0
  233. package/build/mcp/events/event_loop.js +248 -0
  234. package/build/mcp/events/file_watcher.d.ts +8 -0
  235. package/build/mcp/events/file_watcher.js +24 -0
  236. package/build/mcp/events/index.d.ts +11 -0
  237. package/build/mcp/events/index.js +11 -0
  238. package/build/mcp/events/logger.d.ts +8 -0
  239. package/build/mcp/events/logger.js +38 -0
  240. package/build/mcp/events/mq.d.ts +10 -0
  241. package/build/mcp/events/mq.js +22 -0
  242. package/build/mcp/events/mq_nats.d.ts +5 -0
  243. package/build/mcp/events/mq_nats.js +20 -0
  244. package/build/mcp/events/mq_redis.d.ts +5 -0
  245. package/build/mcp/events/mq_redis.js +20 -0
  246. package/build/mcp/events/nav_refresh.d.ts +14 -0
  247. package/build/mcp/events/nav_refresh.js +64 -0
  248. package/build/mcp/events/processor.d.ts +19 -0
  249. package/build/mcp/events/processor.js +76 -0
  250. package/build/mcp/events/replay.d.ts +6 -0
  251. package/build/mcp/events/replay.js +27 -0
  252. package/build/mcp/events/types.d.ts +32 -0
  253. package/build/mcp/events/types.js +18 -0
  254. package/build/mcp/generated/activate_input.d.ts +15 -0
  255. package/build/mcp/generated/activate_input.js +2 -0
  256. package/build/mcp/generated/activate_output.d.ts +36 -0
  257. package/build/mcp/generated/activate_output.js +57 -0
  258. package/build/mcp/generated/advisory_review_input.d.ts +42 -0
  259. package/build/mcp/generated/advisory_review_input.js +2 -0
  260. package/build/mcp/generated/advisory_review_output.d.ts +3 -0
  261. package/build/mcp/generated/advisory_review_output.js +35 -0
  262. package/build/mcp/generated/auth_token_file.d.ts +79 -0
  263. package/build/mcp/generated/auth_token_file.js +2 -0
  264. package/build/mcp/generated/autopilot_policy.d.ts +133 -0
  265. package/build/mcp/generated/autopilot_policy.js +77 -0
  266. package/build/mcp/generated/bitnet_signal.d.ts +146 -0
  267. package/build/mcp/generated/bitnet_signal.js +71 -0
  268. package/build/mcp/generated/bridge_build_seed_input.d.ts +65 -0
  269. package/build/mcp/generated/bridge_build_seed_input.js +2 -0
  270. package/build/mcp/generated/bridge_build_seed_output.d.ts +36 -0
  271. package/build/mcp/generated/bridge_build_seed_output.js +2 -0
  272. package/build/mcp/generated/bridge_confirm_reference_input.d.ts +30 -0
  273. package/build/mcp/generated/bridge_confirm_reference_input.js +2 -0
  274. package/build/mcp/generated/bridge_confirm_reference_output.d.ts +59 -0
  275. package/build/mcp/generated/bridge_confirm_reference_output.js +2 -0
  276. package/build/mcp/generated/bridge_confirmed_reference_file.d.ts +74 -0
  277. package/build/mcp/generated/bridge_confirmed_reference_file.js +2 -0
  278. package/build/mcp/generated/bridge_generate_references_input.d.ts +66 -0
  279. package/build/mcp/generated/bridge_generate_references_input.js +2 -0
  280. package/build/mcp/generated/bridge_generate_references_output.d.ts +62 -0
  281. package/build/mcp/generated/bridge_generate_references_output.js +2 -0
  282. package/build/mcp/generated/bridge_references_file.d.ts +141 -0
  283. package/build/mcp/generated/bridge_references_file.js +2 -0
  284. package/build/mcp/generated/bridge_work_order_seed_file.d.ts +120 -0
  285. package/build/mcp/generated/bridge_work_order_seed_file.js +2 -0
  286. package/build/mcp/generated/briefing_input.d.ts +15 -0
  287. package/build/mcp/generated/briefing_input.js +2 -0
  288. package/build/mcp/generated/briefing_output.d.ts +58 -0
  289. package/build/mcp/generated/briefing_output.js +2 -0
  290. package/build/mcp/generated/clinic_bridge_file.d.ts +3 -0
  291. package/build/mcp/generated/clinic_bridge_file.js +13 -0
  292. package/build/mcp/generated/contracts_bundle_info.d.ts +3 -0
  293. package/build/mcp/generated/contracts_bundle_info.js +5 -0
  294. package/build/mcp/generated/create_work_order_input.d.ts +12 -0
  295. package/build/mcp/generated/create_work_order_input.js +2 -0
  296. package/build/mcp/generated/create_work_order_output.d.ts +214 -0
  297. package/build/mcp/generated/create_work_order_output.js +2 -0
  298. package/build/mcp/generated/current_work_order_file.d.ts +39 -0
  299. package/build/mcp/generated/current_work_order_file.js +2 -0
  300. package/build/mcp/generated/deps_drift_report.d.ts +167 -0
  301. package/build/mcp/generated/deps_drift_report.js +33 -0
  302. package/build/mcp/generated/deps_scan.d.ts +207 -0
  303. package/build/mcp/generated/deps_scan.js +38 -0
  304. package/build/mcp/generated/doctor_input.d.ts +9 -0
  305. package/build/mcp/generated/doctor_input.js +2 -0
  306. package/build/mcp/generated/doctor_output.d.ts +217 -0
  307. package/build/mcp/generated/doctor_output.js +24 -0
  308. package/build/mcp/generated/execution_result.d.ts +116 -0
  309. package/build/mcp/generated/execution_result.js +2 -0
  310. package/build/mcp/generated/execution_task.d.ts +136 -0
  311. package/build/mcp/generated/execution_task.js +2 -0
  312. package/build/mcp/generated/export_output_input.d.ts +42 -0
  313. package/build/mcp/generated/export_output_input.js +2 -0
  314. package/build/mcp/generated/export_output_output.d.ts +71 -0
  315. package/build/mcp/generated/export_output_output.js +2 -0
  316. package/build/mcp/generated/finalize_work_input.d.ts +68 -0
  317. package/build/mcp/generated/finalize_work_input.js +2 -0
  318. package/build/mcp/generated/finalize_work_output.d.ts +42 -0
  319. package/build/mcp/generated/finalize_work_output.js +2 -0
  320. package/build/mcp/generated/gate_input.d.ts +158 -0
  321. package/build/mcp/generated/gate_input.js +2 -0
  322. package/build/mcp/generated/gate_output.d.ts +131 -0
  323. package/build/mcp/generated/gate_output.js +2 -0
  324. package/build/mcp/generated/gate_result_v1.d.ts +131 -0
  325. package/build/mcp/generated/gate_result_v1.js +2 -0
  326. package/build/mcp/generated/get_decision_input.d.ts +15 -0
  327. package/build/mcp/generated/get_decision_input.js +6 -0
  328. package/build/mcp/generated/get_decision_output.d.ts +68 -0
  329. package/build/mcp/generated/get_decision_output.js +13 -0
  330. package/build/mcp/generated/get_semantic_complexity_input.d.ts +21 -0
  331. package/build/mcp/generated/get_semantic_complexity_input.js +2 -0
  332. package/build/mcp/generated/get_semantic_complexity_output.d.ts +161 -0
  333. package/build/mcp/generated/get_semantic_complexity_output.js +2 -0
  334. package/build/mcp/generated/handoff_to_clinic.d.ts +15 -0
  335. package/build/mcp/generated/handoff_to_clinic.js +2 -0
  336. package/build/mcp/generated/index.d.ts +106 -0
  337. package/build/mcp/generated/index.js +108 -0
  338. package/build/mcp/generated/ingress_input.d.ts +30 -0
  339. package/build/mcp/generated/ingress_input.js +11 -0
  340. package/build/mcp/generated/ingress_output.d.ts +136 -0
  341. package/build/mcp/generated/ingress_output.js +2 -0
  342. package/build/mcp/generated/ingress_resolution_file.d.ts +33 -0
  343. package/build/mcp/generated/ingress_resolution_file.js +2 -0
  344. package/build/mcp/generated/ingress_summary_file.d.ts +130 -0
  345. package/build/mcp/generated/ingress_summary_file.js +2 -0
  346. package/build/mcp/generated/inspect_code_input.d.ts +47 -0
  347. package/build/mcp/generated/inspect_code_input.js +2 -0
  348. package/build/mcp/generated/inspect_code_output.d.ts +164 -0
  349. package/build/mcp/generated/inspect_code_output.js +13 -0
  350. package/build/mcp/generated/memory_retrieve_input.d.ts +21 -0
  351. package/build/mcp/generated/memory_retrieve_input.js +2 -0
  352. package/build/mcp/generated/memory_retrieve_output.d.ts +18 -0
  353. package/build/mcp/generated/memory_retrieve_output.js +2 -0
  354. package/build/mcp/generated/memory_state_file.d.ts +46 -0
  355. package/build/mcp/generated/memory_state_file.js +2 -0
  356. package/build/mcp/generated/memory_status_input.d.ts +15 -0
  357. package/build/mcp/generated/memory_status_input.js +2 -0
  358. package/build/mcp/generated/memory_status_output.d.ts +79 -0
  359. package/build/mcp/generated/memory_status_output.js +13 -0
  360. package/build/mcp/generated/memory_sync_input.d.ts +18 -0
  361. package/build/mcp/generated/memory_sync_input.js +2 -0
  362. package/build/mcp/generated/memory_sync_output.d.ts +66 -0
  363. package/build/mcp/generated/memory_sync_output.js +13 -0
  364. package/build/mcp/generated/message_template_id_mapping_file.d.ts +132 -0
  365. package/build/mcp/generated/message_template_id_mapping_file.js +2 -0
  366. package/build/mcp/generated/observer_event_map.d.ts +198 -0
  367. package/build/mcp/generated/observer_event_map.js +74 -0
  368. package/build/mcp/generated/ose_expand_input.d.ts +48 -0
  369. package/build/mcp/generated/ose_expand_input.js +2 -0
  370. package/build/mcp/generated/ose_expand_output.d.ts +45 -0
  371. package/build/mcp/generated/ose_expand_output.js +2 -0
  372. package/build/mcp/generated/oss_candidates_file.d.ts +132 -0
  373. package/build/mcp/generated/oss_candidates_file.js +2 -0
  374. package/build/mcp/generated/oss_decisions_file.d.ts +125 -0
  375. package/build/mcp/generated/oss_decisions_file.js +2 -0
  376. package/build/mcp/generated/oss_snippets_file.d.ts +117 -0
  377. package/build/mcp/generated/oss_snippets_file.js +2 -0
  378. package/build/mcp/generated/plugin_result.d.ts +43 -0
  379. package/build/mcp/generated/plugin_result.js +2 -0
  380. package/build/mcp/generated/react_perf_check_patterns_input.d.ts +15 -0
  381. package/build/mcp/generated/react_perf_check_patterns_input.js +2 -0
  382. package/build/mcp/generated/react_perf_check_patterns_output.d.ts +102 -0
  383. package/build/mcp/generated/react_perf_check_patterns_output.js +2 -0
  384. package/build/mcp/generated/react_perf_generate_report_input.d.ts +18 -0
  385. package/build/mcp/generated/react_perf_generate_report_input.js +2 -0
  386. package/build/mcp/generated/react_perf_generate_report_output.d.ts +76 -0
  387. package/build/mcp/generated/react_perf_generate_report_output.js +2 -0
  388. package/build/mcp/generated/read_file_input.d.ts +21 -0
  389. package/build/mcp/generated/read_file_input.js +2 -0
  390. package/build/mcp/generated/read_file_output.d.ts +119 -0
  391. package/build/mcp/generated/read_file_output.js +2 -0
  392. package/build/mcp/generated/repair_analysis_engine_input.d.ts +21 -0
  393. package/build/mcp/generated/repair_analysis_engine_input.js +2 -0
  394. package/build/mcp/generated/repair_analysis_engine_output.d.ts +45 -0
  395. package/build/mcp/generated/repair_analysis_engine_output.js +2 -0
  396. package/build/mcp/generated/repair_plan_input.d.ts +12 -0
  397. package/build/mcp/generated/repair_plan_input.js +2 -0
  398. package/build/mcp/generated/repair_plan_output.d.ts +48 -0
  399. package/build/mcp/generated/repair_plan_output.js +2 -0
  400. package/build/mcp/generated/run_app_input.d.ts +50 -0
  401. package/build/mcp/generated/run_app_input.js +2 -0
  402. package/build/mcp/generated/run_app_output.d.ts +27 -0
  403. package/build/mcp/generated/run_app_output.js +2 -0
  404. package/build/mcp/generated/run_state_file.d.ts +3 -0
  405. package/build/mcp/generated/run_state_file.js +13 -0
  406. package/build/mcp/generated/scaffold_input.d.ts +15 -0
  407. package/build/mcp/generated/scaffold_input.js +2 -0
  408. package/build/mcp/generated/scaffold_output.d.ts +39 -0
  409. package/build/mcp/generated/scaffold_output.js +2 -0
  410. package/build/mcp/generated/search_oss_input.d.ts +59 -0
  411. package/build/mcp/generated/search_oss_input.js +2 -0
  412. package/build/mcp/generated/search_oss_output.d.ts +88 -0
  413. package/build/mcp/generated/search_oss_output.js +2 -0
  414. package/build/mcp/generated/selection_validation_result.d.ts +358 -0
  415. package/build/mcp/generated/selection_validation_result.js +2 -0
  416. package/build/mcp/generated/signal_agent_input.d.ts +101 -0
  417. package/build/mcp/generated/signal_agent_input.js +2 -0
  418. package/build/mcp/generated/skillpack_file.d.ts +825 -0
  419. package/build/mcp/generated/skillpack_file.js +102 -0
  420. package/build/mcp/generated/skills_input.d.ts +30 -0
  421. package/build/mcp/generated/skills_input.js +11 -0
  422. package/build/mcp/generated/skills_output.d.ts +349 -0
  423. package/build/mcp/generated/skills_output.js +52 -0
  424. package/build/mcp/generated/spec_expansion_file.d.ts +282 -0
  425. package/build/mcp/generated/spec_expansion_file.js +2 -0
  426. package/build/mcp/generated/spec_high_ask_queue_items_file.d.ts +247 -0
  427. package/build/mcp/generated/spec_high_ask_queue_items_file.js +2 -0
  428. package/build/mcp/generated/spec_high_clinic_bridge_output.d.ts +15 -0
  429. package/build/mcp/generated/spec_high_clinic_bridge_output.js +2 -0
  430. package/build/mcp/generated/spec_high_decision_draft_output.d.ts +40 -0
  431. package/build/mcp/generated/spec_high_decision_draft_output.js +2 -0
  432. package/build/mcp/generated/spec_high_validate_output.d.ts +24 -0
  433. package/build/mcp/generated/spec_high_validate_output.js +2 -0
  434. package/build/mcp/generated/status_input.d.ts +12 -0
  435. package/build/mcp/generated/status_input.js +5 -0
  436. package/build/mcp/generated/status_output.d.ts +919 -0
  437. package/build/mcp/generated/status_output.js +188 -0
  438. package/build/mcp/generated/submit_decision_input.d.ts +18 -0
  439. package/build/mcp/generated/submit_decision_input.js +2 -0
  440. package/build/mcp/generated/submit_decision_output.d.ts +53 -0
  441. package/build/mcp/generated/submit_decision_output.js +2 -0
  442. package/build/mcp/generated/tool_error_output.d.ts +80 -0
  443. package/build/mcp/generated/tool_error_output.js +26 -0
  444. package/build/mcp/generated/undo_last_task_input.d.ts +12 -0
  445. package/build/mcp/generated/undo_last_task_input.js +2 -0
  446. package/build/mcp/generated/undo_last_task_output.d.ts +38 -0
  447. package/build/mcp/generated/undo_last_task_output.js +2 -0
  448. package/build/mcp/generated/update_input.d.ts +18 -0
  449. package/build/mcp/generated/update_input.js +2 -0
  450. package/build/mcp/generated/update_output.d.ts +124 -0
  451. package/build/mcp/generated/update_output.js +2 -0
  452. package/build/mcp/generated/verification_steps.d.ts +249 -0
  453. package/build/mcp/generated/verification_steps.js +34 -0
  454. package/build/mcp/generated/vibe_pm_inspection_result.d.ts +68 -0
  455. package/build/mcp/generated/vibe_pm_inspection_result.js +2 -0
  456. package/build/mcp/generated/vibe_pm_report_markdown.d.ts +15 -0
  457. package/build/mcp/generated/vibe_pm_report_markdown.js +2 -0
  458. package/build/mcp/generated/vibe_pm_verdict.d.ts +15 -0
  459. package/build/mcp/generated/vibe_pm_verdict.js +2 -0
  460. package/build/mcp/generated/vibe_repo_config.d.ts +214 -0
  461. package/build/mcp/generated/vibe_repo_config.js +2 -0
  462. package/build/mcp/generated/vibecoding_helper_answer_output.d.ts +18 -0
  463. package/build/mcp/generated/vibecoding_helper_answer_output.js +2 -0
  464. package/build/mcp/generated/vibecoding_helper_one_loop_selection_output.d.ts +115 -0
  465. package/build/mcp/generated/vibecoding_helper_one_loop_selection_output.js +2 -0
  466. package/build/mcp/generated/vibecoding_helper_show_ask_queue_output.d.ts +230 -0
  467. package/build/mcp/generated/vibecoding_helper_show_ask_queue_output.js +2 -0
  468. package/build/mcp/generated/work_order_v1.d.ts +89 -0
  469. package/build/mcp/generated/work_order_v1.js +2 -0
  470. package/build/mcp/generated/zoekt_evidence_input.d.ts +27 -0
  471. package/build/mcp/generated/zoekt_evidence_input.js +2 -0
  472. package/build/mcp/generated/zoekt_evidence_output.d.ts +70 -0
  473. package/build/mcp/generated/zoekt_evidence_output.js +2 -0
  474. package/build/mcp/index.d.ts +2 -0
  475. package/build/mcp/index.js +187 -0
  476. package/build/mcp/legacy_alias.d.ts +29 -0
  477. package/build/mcp/legacy_alias.js +53 -0
  478. package/build/mcp/metrics/collector.d.ts +23 -0
  479. package/build/mcp/metrics/collector.js +270 -0
  480. package/build/mcp/metrics/index.d.ts +8 -0
  481. package/build/mcp/metrics/index.js +6 -0
  482. package/build/mcp/metrics/server.d.ts +39 -0
  483. package/build/mcp/metrics/server.js +129 -0
  484. package/build/mcp/metrics/types.d.ts +105 -0
  485. package/build/mcp/metrics/types.js +46 -0
  486. package/build/mcp/path-utils.d.ts +34 -0
  487. package/build/mcp/path-utils.js +68 -0
  488. package/build/mcp/paths.d.ts +29 -0
  489. package/build/mcp/paths.js +90 -0
  490. package/build/mcp/policy/index.d.ts +2 -0
  491. package/build/mcp/policy/index.js +2 -0
  492. package/build/mcp/policy/loader.d.ts +18 -0
  493. package/build/mcp/policy/loader.js +46 -0
  494. package/build/mcp/policy/schema.d.ts +558 -0
  495. package/build/mcp/policy/schema.js +87 -0
  496. package/build/mcp/preprocess.d.ts +16 -0
  497. package/build/mcp/preprocess.js +64 -0
  498. package/build/mcp/profile-config.d.ts +87 -0
  499. package/build/mcp/profile-config.js +211 -0
  500. package/build/mcp/router/artifacts.d.ts +15 -0
  501. package/build/mcp/router/artifacts.js +30 -0
  502. package/build/mcp/router/decide.d.ts +2 -0
  503. package/build/mcp/router/decide.js +51 -0
  504. package/build/mcp/router/index.d.ts +4 -0
  505. package/build/mcp/router/index.js +4 -0
  506. package/build/mcp/router/rules.d.ts +14 -0
  507. package/build/mcp/router/rules.js +32 -0
  508. package/build/mcp/router/types.d.ts +32 -0
  509. package/build/mcp/router/types.js +1 -0
  510. package/build/mcp/run-retention.d.ts +15 -0
  511. package/build/mcp/run-retention.js +87 -0
  512. package/build/mcp/runtime/helper_commands.d.ts +205 -0
  513. package/build/mcp/runtime/helper_commands.js +198 -0
  514. package/build/mcp/runtime/helper_invoker.d.ts +48 -0
  515. package/build/mcp/runtime/helper_invoker.js +134 -0
  516. package/build/mcp/runtime/helper_resolver.d.ts +41 -0
  517. package/build/mcp/runtime/helper_resolver.js +148 -0
  518. package/build/mcp/runtime/index.d.ts +3 -0
  519. package/build/mcp/runtime/index.js +8 -0
  520. package/build/mcp/runtime/musu_adapter.d.ts +193 -0
  521. package/build/mcp/runtime/musu_adapter.js +373 -0
  522. package/build/mcp/security/input-validator.d.ts +76 -0
  523. package/build/mcp/security/input-validator.js +119 -0
  524. package/build/mcp/security/path-policy.d.ts +102 -0
  525. package/build/mcp/security/path-policy.js +289 -0
  526. package/build/mcp/security/sandbox.d.ts +55 -0
  527. package/build/mcp/security/sandbox.js +378 -0
  528. package/build/mcp/tool-registry.d.ts +26 -0
  529. package/build/mcp/tool-registry.js +136 -0
  530. package/build/mcp/tools/bitnet/index.d.ts +494 -0
  531. package/build/mcp/tools/bitnet/index.js +748 -0
  532. package/build/mcp/tools/vibe_pm/ask-queue/index.d.ts +9 -0
  533. package/build/mcp/tools/vibe_pm/ask-queue/index.js +10 -0
  534. package/build/mcp/tools/vibe_pm/ask-queue/loader.d.ts +29 -0
  535. package/build/mcp/tools/vibe_pm/ask-queue/loader.js +137 -0
  536. package/build/mcp/tools/vibe_pm/ask-queue/transformer.d.ts +18 -0
  537. package/build/mcp/tools/vibe_pm/ask-queue/transformer.js +58 -0
  538. package/build/mcp/tools/vibe_pm/ask-queue/types.d.ts +75 -0
  539. package/build/mcp/tools/vibe_pm/ask-queue/types.js +16 -0
  540. package/build/mcp/tools/vibe_pm/auto-init.d.ts +41 -0
  541. package/build/mcp/tools/vibe_pm/auto-init.js +133 -0
  542. package/build/mcp/tools/vibe_pm/autopilot.d.ts +74 -0
  543. package/build/mcp/tools/vibe_pm/autopilot.js +334 -0
  544. package/build/mcp/tools/vibe_pm/bitnet-cache.d.ts +124 -0
  545. package/build/mcp/tools/vibe_pm/bitnet-cache.js +327 -0
  546. package/build/mcp/tools/vibe_pm/bitnet-ensure.d.ts +58 -0
  547. package/build/mcp/tools/vibe_pm/bitnet-ensure.js +204 -0
  548. package/build/mcp/tools/vibe_pm/bitnet-hook-consumer.d.ts +87 -0
  549. package/build/mcp/tools/vibe_pm/bitnet-hook-consumer.js +323 -0
  550. package/build/mcp/tools/vibe_pm/bitnet-runner.d.ts +44 -0
  551. package/build/mcp/tools/vibe_pm/bitnet-runner.js +144 -0
  552. package/build/mcp/tools/vibe_pm/briefing.d.ts +15 -0
  553. package/build/mcp/tools/vibe_pm/briefing.js +165 -0
  554. package/build/mcp/tools/vibe_pm/context.d.ts +113 -0
  555. package/build/mcp/tools/vibe_pm/context.js +579 -0
  556. package/build/mcp/tools/vibe_pm/create_work_order.d.ts +15 -0
  557. package/build/mcp/tools/vibe_pm/create_work_order.js +252 -0
  558. package/build/mcp/tools/vibe_pm/dashboard.d.ts +64 -0
  559. package/build/mcp/tools/vibe_pm/dashboard.js +175 -0
  560. package/build/mcp/tools/vibe_pm/decision-log.d.ts +24 -0
  561. package/build/mcp/tools/vibe_pm/decision-log.js +38 -0
  562. package/build/mcp/tools/vibe_pm/diagrams/animator.d.ts +27 -0
  563. package/build/mcp/tools/vibe_pm/diagrams/animator.js +122 -0
  564. package/build/mcp/tools/vibe_pm/diagrams/constants.d.ts +71 -0
  565. package/build/mcp/tools/vibe_pm/diagrams/constants.js +158 -0
  566. package/build/mcp/tools/vibe_pm/diagrams/gate_engine.d.ts +67 -0
  567. package/build/mcp/tools/vibe_pm/diagrams/gate_engine.js +695 -0
  568. package/build/mcp/tools/vibe_pm/diagrams/generator.d.ts +8 -0
  569. package/build/mcp/tools/vibe_pm/diagrams/generator.js +214 -0
  570. package/build/mcp/tools/vibe_pm/diagrams/index.d.ts +8 -0
  571. package/build/mcp/tools/vibe_pm/diagrams/index.js +9 -0
  572. package/build/mcp/tools/vibe_pm/diagrams/manifest.d.ts +37 -0
  573. package/build/mcp/tools/vibe_pm/diagrams/manifest.js +151 -0
  574. package/build/mcp/tools/vibe_pm/diagrams/mermaid_generator.d.ts +70 -0
  575. package/build/mcp/tools/vibe_pm/diagrams/mermaid_generator.js +214 -0
  576. package/build/mcp/tools/vibe_pm/diagrams/renderer.d.ts +29 -0
  577. package/build/mcp/tools/vibe_pm/diagrams/renderer.js +207 -0
  578. package/build/mcp/tools/vibe_pm/diagrams/types.d.ts +66 -0
  579. package/build/mcp/tools/vibe_pm/diagrams/types.js +16 -0
  580. package/build/mcp/tools/vibe_pm/dirty-scan.d.ts +59 -0
  581. package/build/mcp/tools/vibe_pm/dirty-scan.js +242 -0
  582. package/build/mcp/tools/vibe_pm/docs_structure.d.ts +17 -0
  583. package/build/mcp/tools/vibe_pm/docs_structure.js +148 -0
  584. package/build/mcp/tools/vibe_pm/doctor.d.ts +65 -0
  585. package/build/mcp/tools/vibe_pm/doctor.js +244 -0
  586. package/build/mcp/tools/vibe_pm/engine-errors/index.d.ts +9 -0
  587. package/build/mcp/tools/vibe_pm/engine-errors/index.js +10 -0
  588. package/build/mcp/tools/vibe_pm/engine-errors/normalizer.d.ts +35 -0
  589. package/build/mcp/tools/vibe_pm/engine-errors/normalizer.js +122 -0
  590. package/build/mcp/tools/vibe_pm/engine-errors/patterns.d.ts +26 -0
  591. package/build/mcp/tools/vibe_pm/engine-errors/patterns.js +111 -0
  592. package/build/mcp/tools/vibe_pm/engine-errors/types.d.ts +51 -0
  593. package/build/mcp/tools/vibe_pm/engine-errors/types.js +47 -0
  594. package/build/mcp/tools/vibe_pm/facts/collector.d.ts +35 -0
  595. package/build/mcp/tools/vibe_pm/facts/collector.js +285 -0
  596. package/build/mcp/tools/vibe_pm/facts/index.d.ts +8 -0
  597. package/build/mcp/tools/vibe_pm/facts/index.js +8 -0
  598. package/build/mcp/tools/vibe_pm/facts/types.d.ts +94 -0
  599. package/build/mcp/tools/vibe_pm/facts/types.js +44 -0
  600. package/build/mcp/tools/vibe_pm/failure/classifier.d.ts +37 -0
  601. package/build/mcp/tools/vibe_pm/failure/classifier.js +134 -0
  602. package/build/mcp/tools/vibe_pm/failure/index.d.ts +11 -0
  603. package/build/mcp/tools/vibe_pm/failure/index.js +11 -0
  604. package/build/mcp/tools/vibe_pm/failure/loop_diagnose.d.ts +33 -0
  605. package/build/mcp/tools/vibe_pm/failure/loop_diagnose.js +232 -0
  606. package/build/mcp/tools/vibe_pm/failure/tracker.d.ts +66 -0
  607. package/build/mcp/tools/vibe_pm/failure/tracker.js +113 -0
  608. package/build/mcp/tools/vibe_pm/failure/types.d.ts +98 -0
  609. package/build/mcp/tools/vibe_pm/failure/types.js +17 -0
  610. package/build/mcp/tools/vibe_pm/feature-flags.d.ts +105 -0
  611. package/build/mcp/tools/vibe_pm/feature-flags.js +156 -0
  612. package/build/mcp/tools/vibe_pm/flow_policy.d.ts +66 -0
  613. package/build/mcp/tools/vibe_pm/flow_policy.js +253 -0
  614. package/build/mcp/tools/vibe_pm/get_decision.d.ts +9 -0
  615. package/build/mcp/tools/vibe_pm/get_decision.js +122 -0
  616. package/build/mcp/tools/vibe_pm/get_result.d.ts +43 -0
  617. package/build/mcp/tools/vibe_pm/get_result.js +82 -0
  618. package/build/mcp/tools/vibe_pm/index.d.ts +499 -0
  619. package/build/mcp/tools/vibe_pm/index.js +837 -0
  620. package/build/mcp/tools/vibe_pm/ingress.d.ts +29 -0
  621. package/build/mcp/tools/vibe_pm/ingress.js +435 -0
  622. package/build/mcp/tools/vibe_pm/init_docs.d.ts +21 -0
  623. package/build/mcp/tools/vibe_pm/init_docs.js +38 -0
  624. package/build/mcp/tools/vibe_pm/inspect_code.d.ts +10 -0
  625. package/build/mcp/tools/vibe_pm/inspect_code.js +729 -0
  626. package/build/mcp/tools/vibe_pm/mapping/change_map.d.ts +12 -0
  627. package/build/mcp/tools/vibe_pm/mapping/change_map.js +154 -0
  628. package/build/mcp/tools/vibe_pm/mapping/diff_scan.d.ts +31 -0
  629. package/build/mcp/tools/vibe_pm/mapping/diff_scan.js +156 -0
  630. package/build/mcp/tools/vibe_pm/mapping/gate_judge.d.ts +18 -0
  631. package/build/mcp/tools/vibe_pm/mapping/gate_judge.js +101 -0
  632. package/build/mcp/tools/vibe_pm/mapping/import_scan.d.ts +9 -0
  633. package/build/mcp/tools/vibe_pm/mapping/import_scan.js +56 -0
  634. package/build/mcp/tools/vibe_pm/mapping/index.d.ts +8 -0
  635. package/build/mcp/tools/vibe_pm/mapping/index.js +10 -0
  636. package/build/mcp/tools/vibe_pm/mapping/orchestrator.d.ts +41 -0
  637. package/build/mcp/tools/vibe_pm/mapping/orchestrator.js +200 -0
  638. package/build/mcp/tools/vibe_pm/mapping/skeleton_patch.d.ts +15 -0
  639. package/build/mcp/tools/vibe_pm/mapping/skeleton_patch.js +59 -0
  640. package/build/mcp/tools/vibe_pm/mapping/spec_map.d.ts +19 -0
  641. package/build/mcp/tools/vibe_pm/mapping/spec_map.js +43 -0
  642. package/build/mcp/tools/vibe_pm/mapping/types.d.ts +126 -0
  643. package/build/mcp/tools/vibe_pm/mapping/types.js +2 -0
  644. package/build/mcp/tools/vibe_pm/memory.d.ts +53 -0
  645. package/build/mcp/tools/vibe_pm/memory.js +92 -0
  646. package/build/mcp/tools/vibe_pm/memory_backend.d.ts +50 -0
  647. package/build/mcp/tools/vibe_pm/memory_backend.js +187 -0
  648. package/build/mcp/tools/vibe_pm/memory_docs_root.d.ts +15 -0
  649. package/build/mcp/tools/vibe_pm/memory_docs_root.js +39 -0
  650. package/build/mcp/tools/vibe_pm/memory_index.d.ts +36 -0
  651. package/build/mcp/tools/vibe_pm/memory_index.js +302 -0
  652. package/build/mcp/tools/vibe_pm/memory_index_embeddings.d.ts +138 -0
  653. package/build/mcp/tools/vibe_pm/memory_index_embeddings.js +481 -0
  654. package/build/mcp/tools/vibe_pm/memory_index_hashvec.d.ts +53 -0
  655. package/build/mcp/tools/vibe_pm/memory_index_hashvec.js +251 -0
  656. package/build/mcp/tools/vibe_pm/memory_rerank.d.ts +92 -0
  657. package/build/mcp/tools/vibe_pm/memory_rerank.js +164 -0
  658. package/build/mcp/tools/vibe_pm/memory_retrieve.d.ts +22 -0
  659. package/build/mcp/tools/vibe_pm/memory_retrieve.js +247 -0
  660. package/build/mcp/tools/vibe_pm/memory_status.d.ts +6 -0
  661. package/build/mcp/tools/vibe_pm/memory_status.js +101 -0
  662. package/build/mcp/tools/vibe_pm/memory_sync.d.ts +6 -0
  663. package/build/mcp/tools/vibe_pm/memory_sync.js +226 -0
  664. package/build/mcp/tools/vibe_pm/modules/fix_dependencies.d.ts +18 -0
  665. package/build/mcp/tools/vibe_pm/modules/fix_dependencies.js +223 -0
  666. package/build/mcp/tools/vibe_pm/modules/fix_imports.d.ts +43 -0
  667. package/build/mcp/tools/vibe_pm/modules/fix_imports.js +317 -0
  668. package/build/mcp/tools/vibe_pm/modules/fix_lint.d.ts +34 -0
  669. package/build/mcp/tools/vibe_pm/modules/fix_lint.js +267 -0
  670. package/build/mcp/tools/vibe_pm/modules/one_loop.d.ts +40 -0
  671. package/build/mcp/tools/vibe_pm/modules/one_loop.js +181 -0
  672. package/build/mcp/tools/vibe_pm/navigation/index.d.ts +10 -0
  673. package/build/mcp/tools/vibe_pm/navigation/index.js +9 -0
  674. package/build/mcp/tools/vibe_pm/navigation/resolver.d.ts +61 -0
  675. package/build/mcp/tools/vibe_pm/navigation/resolver.js +148 -0
  676. package/build/mcp/tools/vibe_pm/navigation/rules.d.ts +27 -0
  677. package/build/mcp/tools/vibe_pm/navigation/rules.js +258 -0
  678. package/build/mcp/tools/vibe_pm/navigation/types.d.ts +92 -0
  679. package/build/mcp/tools/vibe_pm/navigation/types.js +29 -0
  680. package/build/mcp/tools/vibe_pm/observer.d.ts +153 -0
  681. package/build/mcp/tools/vibe_pm/observer.js +402 -0
  682. package/build/mcp/tools/vibe_pm/phase.d.ts +69 -0
  683. package/build/mcp/tools/vibe_pm/phase.js +252 -0
  684. package/build/mcp/tools/vibe_pm/pm_language.d.ts +97 -0
  685. package/build/mcp/tools/vibe_pm/pm_language.js +355 -0
  686. package/build/mcp/tools/vibe_pm/policy/config.d.ts +30 -0
  687. package/build/mcp/tools/vibe_pm/policy/config.js +50 -0
  688. package/build/mcp/tools/vibe_pm/policy/index.d.ts +13 -0
  689. package/build/mcp/tools/vibe_pm/policy/index.js +12 -0
  690. package/build/mcp/tools/vibe_pm/policy/recommender.d.ts +49 -0
  691. package/build/mcp/tools/vibe_pm/policy/recommender.js +119 -0
  692. package/build/mcp/tools/vibe_pm/policy/types.d.ts +75 -0
  693. package/build/mcp/tools/vibe_pm/policy/types.js +32 -0
  694. package/build/mcp/tools/vibe_pm/ralph-loop-tools.d.ts +66 -0
  695. package/build/mcp/tools/vibe_pm/ralph-loop-tools.js +101 -0
  696. package/build/mcp/tools/vibe_pm/scaffold.d.ts +57 -0
  697. package/build/mcp/tools/vibe_pm/scaffold.js +403 -0
  698. package/build/mcp/tools/vibe_pm/schema-adapter.d.ts +44 -0
  699. package/build/mcp/tools/vibe_pm/schema-adapter.js +165 -0
  700. package/build/mcp/tools/vibe_pm/scorecard/index.d.ts +3 -0
  701. package/build/mcp/tools/vibe_pm/scorecard/index.js +3 -0
  702. package/build/mcp/tools/vibe_pm/scorecard/types.d.ts +66 -0
  703. package/build/mcp/tools/vibe_pm/scorecard/types.js +27 -0
  704. package/build/mcp/tools/vibe_pm/scorecard/writer.d.ts +33 -0
  705. package/build/mcp/tools/vibe_pm/scorecard/writer.js +134 -0
  706. package/build/mcp/tools/vibe_pm/setup.d.ts +52 -0
  707. package/build/mcp/tools/vibe_pm/setup.js +411 -0
  708. package/build/mcp/tools/vibe_pm/signals/index.d.ts +4 -0
  709. package/build/mcp/tools/vibe_pm/signals/index.js +4 -0
  710. package/build/mcp/tools/vibe_pm/signals/logger.d.ts +36 -0
  711. package/build/mcp/tools/vibe_pm/signals/logger.js +115 -0
  712. package/build/mcp/tools/vibe_pm/signals/rotation.d.ts +43 -0
  713. package/build/mcp/tools/vibe_pm/signals/rotation.js +128 -0
  714. package/build/mcp/tools/vibe_pm/signals/types.d.ts +46 -0
  715. package/build/mcp/tools/vibe_pm/signals/types.js +39 -0
  716. package/build/mcp/tools/vibe_pm/state-guesser.d.ts +50 -0
  717. package/build/mcp/tools/vibe_pm/state-guesser.js +322 -0
  718. package/build/mcp/tools/vibe_pm/state-schema.d.ts +133 -0
  719. package/build/mcp/tools/vibe_pm/state-schema.js +57 -0
  720. package/build/mcp/tools/vibe_pm/state-store.d.ts +8 -0
  721. package/build/mcp/tools/vibe_pm/state-store.js +97 -0
  722. package/build/mcp/tools/vibe_pm/status.d.ts +9 -0
  723. package/build/mcp/tools/vibe_pm/status.js +704 -0
  724. package/build/mcp/tools/vibe_pm/submit_decision.d.ts +9 -0
  725. package/build/mcp/tools/vibe_pm/submit_decision.js +154 -0
  726. package/build/mcp/tools/vibe_pm/submit_task.d.ts +107 -0
  727. package/build/mcp/tools/vibe_pm/submit_task.js +85 -0
  728. package/build/mcp/tools/vibe_pm/types.d.ts +4649 -0
  729. package/build/mcp/tools/vibe_pm/types.js +377 -0
  730. package/build/mcp/tools/vibe_pm/ui/index.d.ts +29 -0
  731. package/build/mcp/tools/vibe_pm/ui/index.js +17 -0
  732. package/build/mcp/tools/vibe_pm/ui/manifest.d.ts +14 -0
  733. package/build/mcp/tools/vibe_pm/ui/manifest.js +94 -0
  734. package/build/mcp/tools/vibe_pm/ui/types.d.ts +61 -0
  735. package/build/mcp/tools/vibe_pm/ui/types.js +3 -0
  736. package/build/mcp/tools/vibe_pm/ui/viewer_bundle.d.ts +6 -0
  737. package/build/mcp/tools/vibe_pm/ui/viewer_bundle.js +351 -0
  738. package/build/mcp/tools/vibe_pm/ux_fsm.d.ts +48 -0
  739. package/build/mcp/tools/vibe_pm/ux_fsm.js +127 -0
  740. package/build/mcp/tools/vibe_pm/verdict/index.d.ts +8 -0
  741. package/build/mcp/tools/vibe_pm/verdict/index.js +8 -0
  742. package/build/mcp/tools/vibe_pm/verdict/types.d.ts +69 -0
  743. package/build/mcp/tools/vibe_pm/verdict/types.js +50 -0
  744. package/build/mcp/tools/vibe_pm/verdict/writer.d.ts +42 -0
  745. package/build/mcp/tools/vibe_pm/verdict/writer.js +136 -0
  746. package/build/mcp/tools/vibe_pm/watcher.d.ts +91 -0
  747. package/build/mcp/tools/vibe_pm/watcher.js +235 -0
  748. package/build/mcp/tools/vibe_pm/worker_status.d.ts +43 -0
  749. package/build/mcp/tools/vibe_pm/worker_status.js +89 -0
  750. package/build/mcp/tools.d.ts +1 -0
  751. package/build/mcp/tools.js +11 -0
  752. package/build/mcp/transport/cli.d.ts +27 -0
  753. package/build/mcp/transport/cli.js +71 -0
  754. package/build/mcp/transport/handlers.d.ts +24 -0
  755. package/build/mcp/transport/handlers.js +118 -0
  756. package/build/mcp/transport/http.d.ts +28 -0
  757. package/build/mcp/transport/http.js +115 -0
  758. package/build/mcp/transport/index.d.ts +17 -0
  759. package/build/mcp/transport/index.js +18 -0
  760. package/build/mcp/transport/types.d.ts +81 -0
  761. package/build/mcp/transport/types.js +8 -0
  762. package/build/mcp/workspace-root.d.ts +49 -0
  763. package/build/mcp/workspace-root.js +165 -0
  764. package/build/offline-queue.d.ts +67 -0
  765. package/build/offline-queue.js +233 -0
  766. package/build/pool-manager/adapter.d.ts +118 -0
  767. package/build/pool-manager/adapter.js +99 -0
  768. package/build/pool-manager/bitnet-adapter.d.ts +74 -0
  769. package/build/pool-manager/bitnet-adapter.js +208 -0
  770. package/build/pool-manager/index.d.ts +16 -0
  771. package/build/pool-manager/index.js +14 -0
  772. package/build/pool-manager/mapper-adapter.d.ts +74 -0
  773. package/build/pool-manager/mapper-adapter.js +194 -0
  774. package/build/pool-manager/resource-monitor.d.ts +112 -0
  775. package/build/pool-manager/resource-monitor.js +213 -0
  776. package/build/pool-manager/types.d.ts +286 -0
  777. package/build/pool-manager/types.js +137 -0
  778. package/build/pool-manager/unified-pool.d.ts +168 -0
  779. package/build/pool-manager/unified-pool.js +561 -0
  780. package/build/profile-config.d.ts +115 -0
  781. package/build/profile-config.js +202 -0
  782. package/build/report-generator.d.ts +201 -0
  783. package/build/report-generator.js +763 -0
  784. package/build/review-history.d.ts +61 -0
  785. package/build/review-history.js +228 -0
  786. package/build/reviewer-ux-types.d.ts +85 -0
  787. package/build/reviewer-ux-types.js +21 -0
  788. package/build/skeleton-types.d.ts +89 -0
  789. package/build/skeleton-types.js +9 -0
  790. package/build/skill-loader.d.ts +177 -0
  791. package/build/skill-loader.js +407 -0
  792. package/build/spec-map.d.ts +32 -0
  793. package/build/spec-map.js +100 -0
  794. package/build/startup/index.d.ts +26 -0
  795. package/build/startup/index.js +26 -0
  796. package/build/startup/manager.d.ts +67 -0
  797. package/build/startup/manager.js +219 -0
  798. package/build/sync-manager.d.ts +58 -0
  799. package/build/sync-manager.js +113 -0
  800. package/build/sync-packet-builder.d.ts +215 -0
  801. package/build/sync-packet-builder.js +303 -0
  802. package/build/tier/ant_lane.d.ts +99 -0
  803. package/build/tier/ant_lane.js +308 -0
  804. package/build/tier/checkpoint.d.ts +61 -0
  805. package/build/tier/checkpoint.js +255 -0
  806. package/build/tier/checkpoint_types.d.ts +95 -0
  807. package/build/tier/checkpoint_types.js +8 -0
  808. package/build/tier/cooldown_store.d.ts +46 -0
  809. package/build/tier/cooldown_store.js +137 -0
  810. package/build/tier/feature_gate.d.ts +192 -0
  811. package/build/tier/feature_gate.js +416 -0
  812. package/build/tier/index.d.ts +45 -0
  813. package/build/tier/index.js +63 -0
  814. package/build/tier/policy_analysis.d.ts +130 -0
  815. package/build/tier/policy_analysis.js +465 -0
  816. package/build/tier/scorecard.d.ts +142 -0
  817. package/build/tier/scorecard.js +496 -0
  818. package/build/tier/scout_runner.d.ts +28 -0
  819. package/build/tier/scout_runner.js +203 -0
  820. package/build/tier/trigger_evaluator.d.ts +42 -0
  821. package/build/tier/trigger_evaluator.js +229 -0
  822. package/build/tier/trigger_facts_collector.d.ts +20 -0
  823. package/build/tier/trigger_facts_collector.js +294 -0
  824. package/build/tier/trigger_types.d.ts +87 -0
  825. package/build/tier/trigger_types.js +21 -0
  826. package/build/workers/base/autoscaler.d.ts +96 -0
  827. package/build/workers/base/autoscaler.js +165 -0
  828. package/build/workers/base/dashboard.d.ts +131 -0
  829. package/build/workers/base/dashboard.js +311 -0
  830. package/build/workers/base/health.d.ts +79 -0
  831. package/build/workers/base/health.js +240 -0
  832. package/build/workers/base/index.d.ts +13 -0
  833. package/build/workers/base/index.js +13 -0
  834. package/build/workers/base/metrics.d.ts +88 -0
  835. package/build/workers/base/metrics.js +183 -0
  836. package/build/workers/base/pool.d.ts +100 -0
  837. package/build/workers/base/pool.js +279 -0
  838. package/build/workers/base/queue.d.ts +48 -0
  839. package/build/workers/base/queue.js +163 -0
  840. package/build/workers/base/types.d.ts +131 -0
  841. package/build/workers/base/types.js +6 -0
  842. package/build/workers/base/worker.d.ts +64 -0
  843. package/build/workers/base/worker.js +198 -0
  844. package/build/workers/browser/index.d.ts +102 -0
  845. package/build/workers/browser/index.js +222 -0
  846. package/build/workers/build/index.d.ts +77 -0
  847. package/build/workers/build/index.js +167 -0
  848. package/build/workers/fs/index.d.ts +84 -0
  849. package/build/workers/fs/index.js +290 -0
  850. package/build/workers/index.d.ts +31 -0
  851. package/build/workers/index.js +60 -0
  852. package/build/workers/manager.d.ts +228 -0
  853. package/build/workers/manager.js +562 -0
  854. package/build/workers/model/index.d.ts +119 -0
  855. package/build/workers/model/index.js +239 -0
  856. package/build/workers/search/index.d.ts +93 -0
  857. package/build/workers/search/index.js +260 -0
  858. package/package.json +129 -0
  859. package/schemas/autopilot_policy.v1.schema.json +90 -0
  860. package/schemas/banned_question_rules.v1.schema.json +186 -0
  861. package/schemas/bitnet_signal.v1.schema.json +112 -0
  862. package/schemas/catalog_tree.v1.schema.json +172 -0
  863. package/schemas/choice_card.v1.schema.json +104 -0
  864. package/schemas/ci_summary.v1.schema.json +275 -0
  865. package/schemas/clinic_result.v1.2.schema.json +202 -0
  866. package/schemas/encrypted_packet.v1.schema.json +18 -0
  867. package/schemas/handoff_packet.v1.schema.json +192 -0
  868. package/schemas/observer_event_map.v1.schema.json +89 -0
  869. package/schemas/result.v1.schema.json +130 -0
  870. package/schemas/skeleton_map_summary.v1.schema.json +128 -0
  871. package/schemas/spec_gate_result.v1.schema.json +41 -0
  872. package/schemas/spec_map.v1.schema.json +40 -0
  873. package/schemas/sync_packet.v1.schema.json +103 -0
  874. package/schemas/task.v1.schema.json +227 -0
  875. package/schemas/vibe_tool_status.schema.json +182 -0
  876. package/scripts/build-artifacts.mjs +124 -0
  877. package/scripts/build-musu.sh +132 -0
  878. package/scripts/check-musu.mjs +78 -0
  879. package/scripts/check-pr-scope.mjs +121 -0
  880. package/scripts/clean-build.mjs +20 -0
  881. package/scripts/e2e-k8s-test.sh +202 -0
  882. package/scripts/ensure-exec.mjs +80 -0
  883. package/scripts/validate-doc-links.mjs +321 -0
  884. package/skills/skillpack.json +383 -0
  885. package/skills/skillpack.schema.json +212 -0
  886. package/templates/docs-structure/README.md +41 -0
  887. package/templates/docs-structure/active/.gitkeep +0 -0
  888. package/templates/docs-structure/archived/legacy/.gitkeep +0 -0
  889. package/templates/docs-structure/archived/topics/.gitkeep +0 -0
  890. package/templates/docs-structure/reference/contracts/.gitkeep +0 -0
  891. package/templates/docs-structure/reference/product-spec/.gitkeep +0 -0
  892. package/templates/docs-structure/reference/ssot/.gitkeep +0 -0
  893. package/templates/github-actions/vibe-ci.yml +27 -0
@@ -0,0 +1,248 @@
1
+ import * as path from "node:path";
2
+ import crypto from "node:crypto";
3
+ import { startFileWatcher } from "./file_watcher.js";
4
+ import { processEvent } from "./processor.js";
5
+ import { DEFAULT_EVENT_COOLDOWN_MS, DEFAULT_EVENT_DEDUP_BUCKET_MS, DEFAULT_EVENT_MAX_RETRY, DEFAULT_EVENT_RETRY_BACKOFF_MS, DEFAULT_MQ_RETRY_MS, ENV_FLAGS, envFlag, envInt, envStr, } from "./constants.js";
6
+ import { toPosixPath, resolveRelativePosix } from "../path-utils.js";
7
+ import { getVibeDir, getPmRunsDir, getEngineRunsDir, getLegacyRunsDir } from "../paths.js";
8
+ import { appendEventLog } from "./logger.js";
9
+ import { DedupCooldown } from "./dedup_cooldown.js";
10
+ import { refreshNavAndState } from "./nav_refresh.js";
11
+ import { createMQ } from "./mq.js";
12
+ import { createNatsClient } from "./mq_nats.js";
13
+ import { createRedisClient } from "./mq_redis.js";
14
+ const SELF_COMPONENT = "kernel";
15
+ function randomId() {
16
+ return crypto.randomUUID();
17
+ }
18
+ export function classifyEventType(filePath) {
19
+ const p = toPosixPath(filePath.toLowerCase());
20
+ const segments = p.split("/").filter(Boolean);
21
+ const filename = segments[segments.length - 1] ?? "";
22
+ const has = (seg) => segments.includes(seg);
23
+ if (has("results"))
24
+ return { type: "artifact.result_written", reason: "file_change" };
25
+ if (has("mapping"))
26
+ return { type: "artifact.mapping_written", reason: "file_change" };
27
+ if (has("airlock") && filename === "redaction_report.json") {
28
+ return { type: "artifact.airlock_report_written", reason: "file_change" };
29
+ }
30
+ if (has("airlock") && filename === "safe_context.txt") {
31
+ return { type: "artifact.airlock_safe_context_written", reason: "file_change" };
32
+ }
33
+ if (has("airlock") && filename === "input_fingerprint.json") {
34
+ return { type: "artifact.airlock_fingerprint_written", reason: "file_change" };
35
+ }
36
+ if (has("chunks") && filename === "chunk_manifest.v1.json") {
37
+ return { type: "artifact.chunk_manifest_written", reason: "file_change" };
38
+ }
39
+ if (has("chunks") && filename === "chunk_summary.md") {
40
+ return { type: "artifact.chunk_summary_written", reason: "file_change" };
41
+ }
42
+ if (has("chunks") && filename.startsWith("chk_") && filename.endsWith(".json")) {
43
+ return { type: "artifact.chunk_written", reason: "file_change" };
44
+ }
45
+ if (has("handoff") && (filename.includes("work_order") || filename.includes("clinic_bridge"))) {
46
+ return { type: "artifact.work_order_updated", reason: "file_change" };
47
+ }
48
+ if (has("intent"))
49
+ return { type: "artifact.intent_generated", reason: "file_change" };
50
+ if (has("spec") || has("05_spec") || filename === "atomic_specs.json") {
51
+ return { type: "artifact.spec_generated", reason: "file_change" };
52
+ }
53
+ if (has("plan") || has("10_plan") || filename === "plan.json") {
54
+ return { type: "artifact.plan_updated", reason: "file_change" };
55
+ }
56
+ if (filename.includes("work_order"))
57
+ return { type: "artifact.work_order_updated", reason: "file_change" };
58
+ return { type: "artifact.file_changed", reason: "file_change" };
59
+ }
60
+ export function detectRunId(workspaceRoot, filePath) {
61
+ const segments = toPosixPath(path.resolve(filePath)).split("/");
62
+ const root = toPosixPath(path.resolve(workspaceRoot));
63
+ const rel = toPosixPath(path.relative(root, path.resolve(filePath)));
64
+ // .vibe/runs/<run_id>
65
+ const vibeIdx = rel.split("/").indexOf(".vibe");
66
+ if (vibeIdx >= 0) {
67
+ const parts = rel.split("/");
68
+ const runIdx = parts.indexOf("runs");
69
+ if (runIdx >= 0 && parts[runIdx + 1])
70
+ return parts[runIdx + 1];
71
+ }
72
+ // engines/spec_high/runs/<run_id>
73
+ if (rel.includes("engines/spec_high/runs")) {
74
+ const parts = rel.split("/");
75
+ const runIdx = parts.indexOf("runs");
76
+ if (runIdx >= 0 && parts[runIdx + 1])
77
+ return parts[runIdx + 1];
78
+ }
79
+ // legacy runs/<run_id>
80
+ const parts = rel.split("/");
81
+ const runIdx = parts.indexOf("runs");
82
+ if (runIdx >= 0 && parts[runIdx + 1])
83
+ return parts[runIdx + 1];
84
+ return "unknown";
85
+ }
86
+ function buildEventRecord(workspaceRoot, filePath) {
87
+ const { type, reason } = classifyEventType(filePath);
88
+ const runId = detectRunId(workspaceRoot, filePath);
89
+ const rel = resolveRelativePosix(workspaceRoot, path.resolve(filePath));
90
+ return {
91
+ schema_version: "event.v1",
92
+ event_id: randomId(),
93
+ ts: new Date().toISOString(),
94
+ run_id: runId,
95
+ type,
96
+ reason,
97
+ source: { actor: "system", component: SELF_COMPONENT, host: path.basename(workspaceRoot) },
98
+ refs: { paths: [rel] },
99
+ dedup: { bucket_ms: envInt(ENV_FLAGS.EVENT_DEDUP_BUCKET_MS, DEFAULT_EVENT_DEDUP_BUCKET_MS) },
100
+ note: `file=${rel}`,
101
+ };
102
+ }
103
+ function getLogPath(workspaceRoot, runId) {
104
+ if (runId && runId !== "unknown") {
105
+ return path.join(getVibeDir(workspaceRoot), "runs", runId, "events.jsonl");
106
+ }
107
+ return path.join(getVibeDir(workspaceRoot), "logs", "events.global.jsonl");
108
+ }
109
+ export function startEventLoop(workspaceRoot) {
110
+ const enableWatcher = envFlag(ENV_FLAGS.ENABLE_FILE_WATCHER) ||
111
+ process.env[ENV_FLAGS.ENABLE_FILE_WATCHER] === undefined; // default ON
112
+ const enableEventBus = envFlag(ENV_FLAGS.ENABLE_EVENT_BUS);
113
+ const enableGlobalEvents = envFlag(ENV_FLAGS.ENABLE_GLOBAL_EVENTS);
114
+ const mqProvider = (process.env[ENV_FLAGS.MQ_PROVIDER] ?? "none").toLowerCase();
115
+ const mqUrl = envStr(ENV_FLAGS.MQ_URL, "");
116
+ let mqClient = null;
117
+ let mqRetryTimer = null;
118
+ // Initialize optional MQ
119
+ if (enableEventBus && mqProvider !== "none") {
120
+ const retryMs = envInt(ENV_FLAGS.MQ_RETRY_MS, DEFAULT_MQ_RETRY_MS);
121
+ const initMq = async () => {
122
+ try {
123
+ if (mqProvider === "nats") {
124
+ mqClient = await createNatsClient({ servers: mqUrl || "nats://127.0.0.1:4222" });
125
+ }
126
+ else if (mqProvider === "redis") {
127
+ mqClient = await createRedisClient(mqUrl || "redis://127.0.0.1:6379");
128
+ }
129
+ else {
130
+ mqClient = createMQ("none");
131
+ }
132
+ if (!mqClient) {
133
+ throw new Error("MQ client unavailable");
134
+ }
135
+ }
136
+ catch (e) {
137
+ console.error(`[event_loop] MQ init failed: ${e instanceof Error ? e.message : String(e)}`);
138
+ if (!mqRetryTimer) {
139
+ mqRetryTimer = setTimeout(() => {
140
+ mqRetryTimer = null;
141
+ void initMq();
142
+ }, retryMs);
143
+ }
144
+ }
145
+ };
146
+ void initMq();
147
+ }
148
+ if (!enableWatcher) {
149
+ return {
150
+ async stop() { },
151
+ status() {
152
+ return { watching: false, paths: [] };
153
+ },
154
+ };
155
+ }
156
+ const paths = [getPmRunsDir(workspaceRoot), getEngineRunsDir(workspaceRoot), getLegacyRunsDir(workspaceRoot)];
157
+ const dedup = new DedupCooldown(envInt(ENV_FLAGS.EVENT_DEDUP_BUCKET_MS, DEFAULT_EVENT_DEDUP_BUCKET_MS), envInt(ENV_FLAGS.EVENT_COOLDOWN_MS, DEFAULT_EVENT_COOLDOWN_MS));
158
+ const watcher = startFileWatcher(paths, {
159
+ cwd: workspaceRoot,
160
+ ignore: (fullPath) => {
161
+ const p = toPosixPath(fullPath);
162
+ // ignore self-written/control files
163
+ if (p.includes("/run_state.v1.json"))
164
+ return true;
165
+ if (p.endsWith("/events.jsonl"))
166
+ return true;
167
+ if (p.includes("/observer/heartbeat.json"))
168
+ return true;
169
+ if (p.endsWith("/nav.json"))
170
+ return true;
171
+ return false;
172
+ },
173
+ onEvent: (type, changedPath) => {
174
+ if (type === "unlink")
175
+ return; // ignore deletes for now
176
+ const ev = buildEventRecord(workspaceRoot, changedPath);
177
+ if (ev.run_id === "unknown" && !enableGlobalEvents) {
178
+ return;
179
+ }
180
+ const logPath = getLogPath(workspaceRoot, ev.run_id);
181
+ // Self paths: run_state/nav writes by kernel should not re-trigger
182
+ const selfPaths = new Set([
183
+ resolveRelativePosix(workspaceRoot, path.join(getVibeDir(workspaceRoot), "runs", ev.run_id, "run_state.v1.json")),
184
+ resolveRelativePosix(workspaceRoot, path.join(getVibeDir(workspaceRoot), "runs", ev.run_id, "nav.json")),
185
+ ]);
186
+ processEvent(ev, {
187
+ logPath,
188
+ dedup,
189
+ selfComponent: SELF_COMPONENT,
190
+ selfPaths,
191
+ workspaceRoot,
192
+ allowUnknownRun: ev.run_id === "unknown" && enableGlobalEvents,
193
+ maxRetry: envInt(ENV_FLAGS.EVENT_MAX_RETRY, DEFAULT_EVENT_MAX_RETRY),
194
+ retryBackoffMs: envInt(ENV_FLAGS.EVENT_RETRY_BACKOFF_MS, DEFAULT_EVENT_RETRY_BACKOFF_MS),
195
+ onHandle: async () => {
196
+ if (ev.run_id === "unknown")
197
+ return;
198
+ const res = await refreshNavAndState(workspaceRoot, ev.run_id);
199
+ const navSignal = {
200
+ schema_version: "event.v1",
201
+ event_id: randomId(),
202
+ ts: new Date().toISOString(),
203
+ run_id: ev.run_id,
204
+ type: "signal.nav_updated",
205
+ reason: "nav_refreshed",
206
+ source: { actor: "system", component: SELF_COMPONENT },
207
+ refs: { paths: [res.run_state_path, res.nav_path] },
208
+ note: `actions=${res.actions_count}`,
209
+ };
210
+ appendEventLog(getLogPath(workspaceRoot, ev.run_id), {
211
+ status: "handled",
212
+ event: navSignal,
213
+ ts: new Date().toISOString(),
214
+ message: "nav refreshed",
215
+ });
216
+ if (mqClient) {
217
+ await mqClient.publish(navSignal);
218
+ }
219
+ },
220
+ }).catch((err) => {
221
+ appendEventLog(logPath, {
222
+ status: "failed_parse",
223
+ event: ev,
224
+ ts: new Date().toISOString(),
225
+ message: err instanceof Error ? err.message : String(err),
226
+ });
227
+ });
228
+ // Publish original event to MQ (bell-only, optional)
229
+ if (mqClient) {
230
+ mqClient.publish(ev).catch(() => { });
231
+ }
232
+ },
233
+ });
234
+ return {
235
+ async stop() {
236
+ await watcher.close();
237
+ if (mqRetryTimer) {
238
+ clearTimeout(mqRetryTimer);
239
+ mqRetryTimer = null;
240
+ }
241
+ if (mqClient)
242
+ await mqClient.close();
243
+ },
244
+ status() {
245
+ return { watching: true, paths: paths.map((p) => path.resolve(p)) };
246
+ },
247
+ };
248
+ }
@@ -0,0 +1,8 @@
1
+ export type FileEventType = "add" | "change" | "unlink";
2
+ export interface FileWatcherOptions {
3
+ cwd?: string;
4
+ ignore?: (path: string) => boolean;
5
+ onEvent: (type: FileEventType, path: string) => void;
6
+ persistent?: boolean;
7
+ }
8
+ export declare function startFileWatcher(paths: string[], opts: FileWatcherOptions): import("chokidar").FSWatcher;
@@ -0,0 +1,24 @@
1
+ import chokidar from "chokidar";
2
+ import { resolve } from "node:path";
3
+ export function startFileWatcher(paths, opts) {
4
+ const watcher = chokidar.watch(paths, {
5
+ cwd: opts.cwd ?? process.cwd(),
6
+ persistent: opts.persistent ?? true,
7
+ ignoreInitial: true,
8
+ awaitWriteFinish: {
9
+ stabilityThreshold: 150,
10
+ pollInterval: 50,
11
+ },
12
+ });
13
+ watcher
14
+ .on("add", (p) => emit("add", p))
15
+ .on("change", (p) => emit("change", p))
16
+ .on("unlink", (p) => emit("unlink", p));
17
+ function emit(type, p) {
18
+ const full = resolve(opts.cwd ?? process.cwd(), p);
19
+ if (opts.ignore?.(full))
20
+ return;
21
+ opts.onEvent(type, full);
22
+ }
23
+ return watcher;
24
+ }
@@ -0,0 +1,11 @@
1
+ export * from "./constants.js";
2
+ export * from "./types.js";
3
+ export * from "./dedup_cooldown.js";
4
+ export * from "./logger.js";
5
+ export * from "./processor.js";
6
+ export * from "./file_watcher.js";
7
+ export * from "./event_loop.js";
8
+ export * from "./nav_refresh.js";
9
+ export * from "./mq.js";
10
+ export * from "./emitter.js";
11
+ export * from "./replay.js";
@@ -0,0 +1,11 @@
1
+ export * from "./constants.js";
2
+ export * from "./types.js";
3
+ export * from "./dedup_cooldown.js";
4
+ export * from "./logger.js";
5
+ export * from "./processor.js";
6
+ export * from "./file_watcher.js";
7
+ export * from "./event_loop.js";
8
+ export * from "./nav_refresh.js";
9
+ export * from "./mq.js";
10
+ export * from "./emitter.js";
11
+ export * from "./replay.js";
@@ -0,0 +1,8 @@
1
+ import type { EventRecord, EventStatus } from "./types.js";
2
+ export interface EventLogEntry {
3
+ status: EventStatus;
4
+ event: EventRecord;
5
+ message?: string;
6
+ ts: string;
7
+ }
8
+ export declare function appendEventLog(logPath: string, entry: EventLogEntry): void;
@@ -0,0 +1,38 @@
1
+ import { appendFileSync, mkdirSync, renameSync, readdirSync, statSync, unlinkSync, existsSync } from "node:fs";
2
+ import { dirname, basename, join } from "node:path";
3
+ import { DEFAULT_EVENTS_GLOBAL_MAX_BYTES, DEFAULT_EVENTS_GLOBAL_MAX_FILES, ENV_FLAGS, envInt, } from "./constants.js";
4
+ function rotateGlobalLogIfNeeded(logPath) {
5
+ if (basename(logPath) !== "events.global.jsonl")
6
+ return;
7
+ if (!existsSync(logPath))
8
+ return;
9
+ const maxBytes = envInt(ENV_FLAGS.EVENTS_GLOBAL_MAX_BYTES, DEFAULT_EVENTS_GLOBAL_MAX_BYTES);
10
+ const maxFiles = envInt(ENV_FLAGS.EVENTS_GLOBAL_MAX_FILES, DEFAULT_EVENTS_GLOBAL_MAX_FILES);
11
+ try {
12
+ const { size } = statSync(logPath);
13
+ if (size < maxBytes)
14
+ return;
15
+ const dir = dirname(logPath);
16
+ const stamp = new Date().toISOString().replace(/[:.]/g, "");
17
+ const rotated = join(dir, `events.global.${stamp}.jsonl`);
18
+ renameSync(logPath, rotated);
19
+ if (maxFiles <= 0)
20
+ return;
21
+ const files = readdirSync(dir)
22
+ .filter((f) => f.startsWith("events.global.") && f.endsWith(".jsonl"))
23
+ .map((f) => ({ name: f, mtime: statSync(join(dir, f)).mtimeMs }))
24
+ .sort((a, b) => b.mtime - a.mtime);
25
+ for (let i = maxFiles; i < files.length; i++) {
26
+ unlinkSync(join(dir, files[i].name));
27
+ }
28
+ }
29
+ catch {
30
+ // best-effort rotation
31
+ }
32
+ }
33
+ export function appendEventLog(logPath, entry) {
34
+ mkdirSync(dirname(logPath), { recursive: true });
35
+ rotateGlobalLogIfNeeded(logPath);
36
+ const line = JSON.stringify(entry);
37
+ appendFileSync(logPath, `${line}\n`, { encoding: "utf-8" });
38
+ }
@@ -0,0 +1,10 @@
1
+ import type { EventRecord } from "./types.js";
2
+ export type MQProvider = "none" | "nats" | "redis";
3
+ export interface MQClient {
4
+ publish(event: EventRecord): Promise<void>;
5
+ close(): Promise<void>;
6
+ }
7
+ /**
8
+ * Stub factory for MQ client (optional). Real MQ to be wired later.
9
+ */
10
+ export declare function createMQ(provider: MQProvider): MQClient;
@@ -0,0 +1,22 @@
1
+ class NoopMQ {
2
+ async publish(_event) {
3
+ return;
4
+ }
5
+ async close() {
6
+ return;
7
+ }
8
+ }
9
+ /**
10
+ * Stub factory for MQ client (optional). Real MQ to be wired later.
11
+ */
12
+ export function createMQ(provider) {
13
+ switch (provider) {
14
+ case "nats":
15
+ case "redis":
16
+ // TODO: implement real providers
17
+ return new NoopMQ();
18
+ case "none":
19
+ default:
20
+ return new NoopMQ();
21
+ }
22
+ }
@@ -0,0 +1,5 @@
1
+ import type { EventRecord } from "./types.js";
2
+ export declare function createNatsClient(_opts: Record<string, unknown>): Promise<{
3
+ publish: (ev: EventRecord) => Promise<void>;
4
+ close: () => Promise<void>;
5
+ } | null>;
@@ -0,0 +1,20 @@
1
+ export async function createNatsClient(_opts) {
2
+ try {
3
+ const nats = await import("nats");
4
+ const sc = nats.StringCodec();
5
+ const conn = await nats.connect(_opts);
6
+ const subject = _opts.name ?? "vibe.events";
7
+ return {
8
+ async publish(ev) {
9
+ conn.publish(subject, sc.encode(JSON.stringify(ev)));
10
+ },
11
+ async close() {
12
+ await conn.close();
13
+ },
14
+ };
15
+ }
16
+ catch (e) {
17
+ console.error(`[mq_nats] NATS client unavailable: ${e instanceof Error ? e.message : String(e)}`);
18
+ return null;
19
+ }
20
+ }
@@ -0,0 +1,5 @@
1
+ import type { EventRecord } from "./types.js";
2
+ export declare function createRedisClient(url?: string): Promise<{
3
+ publish: (ev: EventRecord) => Promise<void>;
4
+ close: () => Promise<void>;
5
+ } | null>;
@@ -0,0 +1,20 @@
1
+ export async function createRedisClient(url) {
2
+ try {
3
+ const { createClient } = await import("redis");
4
+ const client = createClient({ url });
5
+ await client.connect();
6
+ const channel = "vibe.events";
7
+ return {
8
+ async publish(ev) {
9
+ await client.publish(channel, JSON.stringify(ev));
10
+ },
11
+ async close() {
12
+ await client.disconnect();
13
+ }
14
+ };
15
+ }
16
+ catch (e) {
17
+ console.error(`[mq_redis] Redis client unavailable: ${e instanceof Error ? e.message : String(e)}`);
18
+ return null;
19
+ }
20
+ }
@@ -0,0 +1,14 @@
1
+ export interface NavRefreshResult {
2
+ nav_path: string;
3
+ run_state_path: string;
4
+ actions_count: number;
5
+ phase: string;
6
+ }
7
+ /**
8
+ * Minimal nav/run_state refresh for event loop.
9
+ * - Reads facts + scorecard (best-effort)
10
+ * - Derives phase from run_state if present else falls back to "INTAKE"
11
+ * - Writes nav.json with next_actions and summary
12
+ * - Ensures run_state.v1.json exists (creates minimal shell if missing)
13
+ */
14
+ export declare function refreshNavAndState(workspaceRoot: string, runId: string): Promise<NavRefreshResult>;
@@ -0,0 +1,64 @@
1
+ import * as fs from "node:fs";
2
+ import * as path from "node:path";
3
+ import { collectFacts } from "../tools/vibe_pm/facts/index.js";
4
+ import { readScorecard } from "../tools/vibe_pm/scorecard/index.js";
5
+ import { resolveNextActions } from "../tools/vibe_pm/navigation/index.js";
6
+ import { getPmRunDir, getVibeDir } from "../paths.js";
7
+ import { resolveRelativePosix } from "../path-utils.js";
8
+ /**
9
+ * Minimal nav/run_state refresh for event loop.
10
+ * - Reads facts + scorecard (best-effort)
11
+ * - Derives phase from run_state if present else falls back to "INTAKE"
12
+ * - Writes nav.json with next_actions and summary
13
+ * - Ensures run_state.v1.json exists (creates minimal shell if missing)
14
+ */
15
+ export async function refreshNavAndState(workspaceRoot, runId) {
16
+ const runDir = getPmRunDir(workspaceRoot, runId);
17
+ fs.mkdirSync(runDir, { recursive: true });
18
+ const runStatePath = path.join(getVibeDir(workspaceRoot), "runs", runId, "run_state.v1.json");
19
+ const navPath = path.join(getVibeDir(workspaceRoot), "runs", runId, "nav.json");
20
+ fs.mkdirSync(path.dirname(runStatePath), { recursive: true });
21
+ // Load existing run_state to derive phase if available
22
+ let phase = "INTAKE";
23
+ try {
24
+ if (fs.existsSync(runStatePath)) {
25
+ const raw = JSON.parse(fs.readFileSync(runStatePath, "utf-8"));
26
+ if (typeof raw?.phase === "string")
27
+ phase = raw.phase;
28
+ }
29
+ }
30
+ catch {
31
+ // ignore
32
+ }
33
+ const facts = await collectFacts(workspaceRoot, runId, { skipScout: true });
34
+ const scorecard = await readScorecard(workspaceRoot, runId);
35
+ const actions = resolveNextActions(facts, scorecard, phase, false);
36
+ const navData = {
37
+ schema_version: "nav.v1",
38
+ run_id: runId,
39
+ phase,
40
+ generated_at: new Date().toISOString(),
41
+ actions,
42
+ facts_summary: facts.sources,
43
+ };
44
+ fs.writeFileSync(navPath, JSON.stringify(navData, null, 2));
45
+ // Ensure run_state exists minimally
46
+ if (!fs.existsSync(runStatePath)) {
47
+ const runState = {
48
+ schema_version: "run_state.v1",
49
+ run_id: runId,
50
+ phase,
51
+ mode: "balanced",
52
+ created_at: new Date().toISOString(),
53
+ decisions_made: facts.ask_queue_count ? 0 : 0,
54
+ decisions_pending: facts.ask_queue_count ?? 0,
55
+ };
56
+ fs.writeFileSync(runStatePath, JSON.stringify(runState, null, 2));
57
+ }
58
+ return {
59
+ nav_path: resolveRelativePosix(workspaceRoot, navPath),
60
+ run_state_path: resolveRelativePosix(workspaceRoot, runStatePath),
61
+ actions_count: actions.length,
62
+ phase,
63
+ };
64
+ }
@@ -0,0 +1,19 @@
1
+ import { DedupCooldown } from "./dedup_cooldown.js";
2
+ import type { EventRecord, EventStatus } from "./types.js";
3
+ export interface ProcessEventOpts {
4
+ logPath: string;
5
+ dedup?: DedupCooldown;
6
+ cooldownMs?: number;
7
+ dedupBucketMs?: number;
8
+ maxRetry?: number;
9
+ retryBackoffMs?: number;
10
+ selfComponent?: string;
11
+ selfPaths?: Set<string>;
12
+ onHandle?: (ev: EventRecord) => Promise<void> | void;
13
+ workspaceRoot?: string;
14
+ allowUnknownRun?: boolean;
15
+ }
16
+ /**
17
+ * Process a single event with dedup, cooldown, self-trigger guard, read-after-write.
18
+ */
19
+ export declare function processEvent(ev: EventRecord, opts: ProcessEventOpts): Promise<EventStatus>;
@@ -0,0 +1,76 @@
1
+ import { stat } from "node:fs/promises";
2
+ import path from "node:path";
3
+ import { setTimeout as delay } from "node:timers/promises";
4
+ import { DedupCooldown } from "./dedup_cooldown.js";
5
+ import { DEFAULT_EVENT_COOLDOWN_MS, DEFAULT_EVENT_DEDUP_BUCKET_MS, DEFAULT_EVENT_MAX_RETRY, DEFAULT_EVENT_RETRY_BACKOFF_MS, } from "./constants.js";
6
+ import { appendEventLog } from "./logger.js";
7
+ /**
8
+ * Process a single event with dedup, cooldown, self-trigger guard, read-after-write.
9
+ */
10
+ export async function processEvent(ev, opts) {
11
+ const now = Date.now();
12
+ const dedup = opts.dedup ?? new DedupCooldown(opts.dedupBucketMs ?? DEFAULT_EVENT_DEDUP_BUCKET_MS, opts.cooldownMs ?? DEFAULT_EVENT_COOLDOWN_MS);
13
+ const logPath = opts.logPath;
14
+ // basic schema checks
15
+ const firstPath = ev.refs?.paths?.[0];
16
+ if (!firstPath) {
17
+ appendEventLog(logPath, { status: "failed_schema", event: ev, ts: new Date().toISOString(), message: "refs.paths empty" });
18
+ return "failed_schema";
19
+ }
20
+ if (!ev.run_id || ev.run_id === "unknown") {
21
+ if (!opts.allowUnknownRun) {
22
+ appendEventLog(logPath, { status: "failed_schema", event: ev, ts: new Date().toISOString(), message: "run_id unknown" });
23
+ return "failed_schema";
24
+ }
25
+ }
26
+ // dedup / cooldown
27
+ const skip = dedup.shouldSkip(ev, now);
28
+ if (skip === "dedup") {
29
+ appendEventLog(logPath, { status: "skipped_dedup", event: ev, ts: new Date().toISOString(), message: "duplicate" });
30
+ return "skipped_dedup";
31
+ }
32
+ if (skip === "cooldown") {
33
+ appendEventLog(logPath, { status: "skipped_cooldown", event: ev, ts: new Date().toISOString(), message: "cooldown" });
34
+ return "skipped_cooldown";
35
+ }
36
+ // self-trigger guard
37
+ if (opts.selfComponent && ev.source.component === opts.selfComponent) {
38
+ if (opts.selfPaths?.has(firstPath)) {
39
+ appendEventLog(logPath, { status: "skipped_self_trigger", event: ev, ts: new Date().toISOString(), message: "self-trigger" });
40
+ return "skipped_self_trigger";
41
+ }
42
+ }
43
+ // read-after-write
44
+ const statPath = path.isAbsolute(firstPath)
45
+ ? firstPath
46
+ : opts.workspaceRoot
47
+ ? path.resolve(opts.workspaceRoot, firstPath)
48
+ : path.resolve(firstPath);
49
+ const maxRetry = opts.maxRetry ?? DEFAULT_EVENT_MAX_RETRY;
50
+ const backoffMs = opts.retryBackoffMs ?? DEFAULT_EVENT_RETRY_BACKOFF_MS;
51
+ let ok = true;
52
+ for (let i = 0; i <= maxRetry; i++) {
53
+ try {
54
+ await stat(statPath);
55
+ ok = true;
56
+ break;
57
+ }
58
+ catch (err) {
59
+ ok = false;
60
+ if (i === maxRetry)
61
+ break;
62
+ await delay(backoffMs * Math.pow(2, i));
63
+ }
64
+ }
65
+ if (!ok) {
66
+ appendEventLog(logPath, { status: "failed_read_after_write", event: ev, ts: new Date().toISOString(), message: "refs.paths missing after retries" });
67
+ return "failed_read_after_write";
68
+ }
69
+ // handle
70
+ if (opts.onHandle) {
71
+ await opts.onHandle(ev);
72
+ }
73
+ dedup.markProcessed(ev, now);
74
+ appendEventLog(logPath, { status: "handled", event: ev, ts: new Date().toISOString() });
75
+ return "handled";
76
+ }
@@ -0,0 +1,6 @@
1
+ import type { EventRecord } from "./types.js";
2
+ /**
3
+ * Read events from events.jsonl (best-effort).
4
+ * Skips malformed/partial lines.
5
+ */
6
+ export declare function readEventLogEvents(logPath: string): EventRecord[];
@@ -0,0 +1,27 @@
1
+ import fs from "node:fs";
2
+ /**
3
+ * Read events from events.jsonl (best-effort).
4
+ * Skips malformed/partial lines.
5
+ */
6
+ export function readEventLogEvents(logPath) {
7
+ if (!fs.existsSync(logPath))
8
+ return [];
9
+ const raw = fs.readFileSync(logPath, "utf-8");
10
+ const lines = raw.split(/\n+/);
11
+ const events = [];
12
+ for (const line of lines) {
13
+ if (!line.trim())
14
+ continue;
15
+ try {
16
+ const parsed = JSON.parse(line);
17
+ const ev = parsed?.event ?? parsed;
18
+ if (ev?.schema_version === "event.v1" && Array.isArray(ev?.refs?.paths)) {
19
+ events.push(ev);
20
+ }
21
+ }
22
+ catch {
23
+ // ignore malformed line
24
+ }
25
+ }
26
+ return events;
27
+ }