@su-record/vibe 3.0.0 → 3.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (455) hide show
  1. package/CLAUDE.md +2 -2
  2. package/README.en.md +6 -4
  3. package/README.md +5 -3
  4. package/dist/__tests__/wiring-integrity.test.d.ts +2 -0
  5. package/dist/__tests__/wiring-integrity.test.d.ts.map +1 -0
  6. package/dist/__tests__/wiring-integrity.test.js +160 -0
  7. package/dist/__tests__/wiring-integrity.test.js.map +1 -0
  8. package/dist/cli/commands/info.d.ts.map +1 -1
  9. package/dist/cli/commands/info.js +2 -1
  10. package/dist/cli/commands/info.js.map +1 -1
  11. package/dist/cli/commands/init.d.ts.map +1 -1
  12. package/dist/cli/commands/init.js +4 -2
  13. package/dist/cli/commands/init.js.map +1 -1
  14. package/dist/cli/index.js +102 -128
  15. package/dist/cli/index.js.map +1 -1
  16. package/dist/cli/postinstall/claude-agents.d.ts.map +1 -1
  17. package/dist/cli/postinstall/claude-agents.js +0 -5
  18. package/dist/cli/postinstall/claude-agents.js.map +1 -1
  19. package/dist/cli/postinstall/constants.d.ts +6 -0
  20. package/dist/cli/postinstall/constants.d.ts.map +1 -1
  21. package/dist/cli/postinstall/constants.js +42 -60
  22. package/dist/cli/postinstall/constants.js.map +1 -1
  23. package/dist/cli/postinstall/inline-skills.js +2 -2
  24. package/dist/cli/postinstall/inline-skills.js.map +1 -1
  25. package/dist/cli/postinstall/main.d.ts.map +1 -1
  26. package/dist/cli/postinstall/main.js +2 -0
  27. package/dist/cli/postinstall/main.js.map +1 -1
  28. package/dist/cli/postinstall.d.ts +6 -1
  29. package/dist/cli/postinstall.d.ts.map +1 -1
  30. package/dist/cli/postinstall.js +6 -1
  31. package/dist/cli/postinstall.js.map +1 -1
  32. package/dist/cli/setup/GlobalInstaller.d.ts +1 -15
  33. package/dist/cli/setup/GlobalInstaller.d.ts.map +1 -1
  34. package/dist/cli/setup/GlobalInstaller.js +16 -115
  35. package/dist/cli/setup/GlobalInstaller.js.map +1 -1
  36. package/dist/cli/setup/GlobalInstaller.test.d.ts +2 -0
  37. package/dist/cli/setup/GlobalInstaller.test.d.ts.map +1 -0
  38. package/dist/cli/setup/GlobalInstaller.test.js +16 -0
  39. package/dist/cli/setup/GlobalInstaller.test.js.map +1 -0
  40. package/dist/cli/setup/ProjectSetup.js +2 -2
  41. package/dist/cli/setup/ProjectSetup.js.map +1 -1
  42. package/dist/cli/setup.d.ts +1 -1
  43. package/dist/cli/setup.d.ts.map +1 -1
  44. package/dist/cli/setup.js +1 -1
  45. package/dist/cli/setup.js.map +1 -1
  46. package/dist/infra/lib/SkillRepository.js +1 -1
  47. package/dist/infra/lib/evolution/__tests__/integration.test.js +0 -42
  48. package/dist/infra/lib/evolution/__tests__/integration.test.js.map +1 -1
  49. package/hooks/scripts/__tests__/.vibe/command-log.txt +3 -78
  50. package/hooks/scripts/__tests__/clone-behaviors.test.js +97 -1
  51. package/hooks/scripts/__tests__/clone-merge-responsive.test.js +106 -0
  52. package/hooks/scripts/__tests__/code-check-memory-write.test.js +81 -0
  53. package/hooks/scripts/__tests__/step-counter.test.js +21 -0
  54. package/hooks/scripts/auto-format.js +2 -11
  55. package/hooks/scripts/auto-test.js +2 -11
  56. package/hooks/scripts/clone-extract.js +388 -38
  57. package/hooks/scripts/clone-merge-responsive.js +184 -0
  58. package/hooks/scripts/clone-spec.js +33 -8
  59. package/hooks/scripts/clone-validate.js +15 -9
  60. package/hooks/scripts/code-check.js +27 -55
  61. package/hooks/scripts/lib/glob.js +32 -0
  62. package/hooks/scripts/lib/hook-context.js +19 -2
  63. package/hooks/scripts/post-edit.js +2 -3
  64. package/hooks/scripts/prompt-dispatcher.js +1 -1
  65. package/hooks/scripts/scope-guard.js +3 -42
  66. package/hooks/scripts/sentinel-guard.js +5 -20
  67. package/hooks/scripts/session-start.js +2 -2
  68. package/hooks/scripts/step-counter.js +35 -57
  69. package/package.json +6 -4
  70. package/skills/clone/SKILL.md +74 -203
  71. package/skills/clone/references/capture-rules.md +48 -0
  72. package/skills/clone/references/legal-and-error-recovery.md +40 -0
  73. package/skills/clone/references/refine-rules.md +61 -0
  74. package/skills/clone/references/scaffold-phases.md +59 -0
  75. package/skills/clone/references/setup-and-layout.md +30 -0
  76. package/skills/docs/SKILL.md +39 -4
  77. package/skills/docs/references/api-docs-changelog.md +34 -0
  78. package/skills/docs/references/codemaps-output.md +23 -0
  79. package/{agents/diagrammer.md → skills/docs/references/diagram-spec.md} +2 -15
  80. package/skills/exec-plan/SKILL.md +1 -1
  81. package/skills/exec-plan/templates/plan.md +1 -1
  82. package/skills/handoff/SKILL.md +3 -3
  83. package/skills/handoff/templates/handoff.md +1 -1
  84. package/skills/vibe/SKILL.md +3 -2
  85. package/skills/vibe.analyze/SKILL.md +12 -249
  86. package/skills/vibe.analyze/references/output-templates.md +188 -0
  87. package/skills/vibe.analyze/references/quality-gate.md +93 -0
  88. package/skills/vibe.clone/SKILL.md +52 -19
  89. package/skills/vibe.continue/SKILL.md +32 -0
  90. package/skills/vibe.design/SKILL.md +23 -1
  91. package/skills/vibe.design/references/ui-preview.md +20 -0
  92. package/skills/vibe.docs/SKILL.md +4 -2
  93. package/skills/vibe.figma/SKILL.md +33 -260
  94. package/skills/vibe.figma/references/branch-phases.md +113 -0
  95. package/skills/vibe.figma/references/state-schema.md +42 -0
  96. package/skills/vibe.figma/references/step-algorithms.md +204 -0
  97. package/skills/vibe.image/SKILL.md +62 -0
  98. package/skills/vibe.image/references/image-generation-examples.md +39 -0
  99. package/skills/vibe.reason/SKILL.md +3 -183
  100. package/skills/vibe.reason/references/output-format-template.md +57 -0
  101. package/skills/vibe.reason/references/quality-rubrics.md +94 -0
  102. package/skills/vibe.reason/references/worked-example.md +45 -0
  103. package/skills/vibe.review/SKILL.md +13 -348
  104. package/skills/vibe.review/references/boundary-check.md +25 -0
  105. package/skills/vibe.review/references/output-template.md +74 -0
  106. package/skills/vibe.review/references/quality-gate.md +84 -0
  107. package/skills/vibe.review/references/race-mode.md +117 -0
  108. package/skills/vibe.review/references/worked-examples.md +94 -0
  109. package/vibe/templates/claudemd-template.md +1 -1
  110. package/agents/acceptance-tester.md +0 -56
  111. package/agents/documenter.md +0 -43
  112. package/agents/figma/figma-engineer.md +0 -76
  113. package/dist/cli/llm/gemini-commands.d.ts +0 -25
  114. package/dist/cli/llm/gemini-commands.d.ts.map +0 -1
  115. package/dist/cli/llm/gemini-commands.js +0 -143
  116. package/dist/cli/llm/gemini-commands.js.map +0 -1
  117. package/dist/cli/postinstall/codex-agents.d.ts +0 -24
  118. package/dist/cli/postinstall/codex-agents.d.ts.map +0 -1
  119. package/dist/cli/postinstall/codex-agents.js +0 -114
  120. package/dist/cli/postinstall/codex-agents.js.map +0 -1
  121. package/dist/cli/postinstall/codex-instruction.d.ts +0 -10
  122. package/dist/cli/postinstall/codex-instruction.d.ts.map +0 -1
  123. package/dist/cli/postinstall/codex-instruction.js +0 -56
  124. package/dist/cli/postinstall/codex-instruction.js.map +0 -1
  125. package/dist/cli/postinstall/gemini-agents.d.ts +0 -12
  126. package/dist/cli/postinstall/gemini-agents.d.ts.map +0 -1
  127. package/dist/cli/postinstall/gemini-agents.js +0 -80
  128. package/dist/cli/postinstall/gemini-agents.js.map +0 -1
  129. package/dist/cli/postinstall/gemini-instruction.d.ts +0 -10
  130. package/dist/cli/postinstall/gemini-instruction.d.ts.map +0 -1
  131. package/dist/cli/postinstall/gemini-instruction.js +0 -59
  132. package/dist/cli/postinstall/gemini-instruction.js.map +0 -1
  133. package/dist/cli/postinstall/index.d.ts +0 -23
  134. package/dist/cli/postinstall/index.d.ts.map +0 -1
  135. package/dist/cli/postinstall/index.js +0 -23
  136. package/dist/cli/postinstall/index.js.map +0 -1
  137. package/dist/cli/setup/index.d.ts +0 -9
  138. package/dist/cli/setup/index.d.ts.map +0 -1
  139. package/dist/cli/setup/index.js +0 -12
  140. package/dist/cli/setup/index.js.map +0 -1
  141. package/dist/infra/lib/ContextCompressor.d.ts +0 -104
  142. package/dist/infra/lib/ContextCompressor.d.ts.map +0 -1
  143. package/dist/infra/lib/ContextCompressor.js +0 -297
  144. package/dist/infra/lib/ContextCompressor.js.map +0 -1
  145. package/dist/infra/lib/ContextCompressor.test.d.ts +0 -2
  146. package/dist/infra/lib/ContextCompressor.test.d.ts.map +0 -1
  147. package/dist/infra/lib/ContextCompressor.test.js +0 -25
  148. package/dist/infra/lib/ContextCompressor.test.js.map +0 -1
  149. package/dist/infra/lib/ProgressTracker.d.ts +0 -73
  150. package/dist/infra/lib/ProgressTracker.d.ts.map +0 -1
  151. package/dist/infra/lib/ProgressTracker.js +0 -267
  152. package/dist/infra/lib/ProgressTracker.js.map +0 -1
  153. package/dist/infra/lib/TokenBudgetTracker.d.ts +0 -68
  154. package/dist/infra/lib/TokenBudgetTracker.d.ts.map +0 -1
  155. package/dist/infra/lib/TokenBudgetTracker.js +0 -191
  156. package/dist/infra/lib/TokenBudgetTracker.js.map +0 -1
  157. package/dist/infra/lib/autonomy/AuditStore.d.ts +0 -63
  158. package/dist/infra/lib/autonomy/AuditStore.d.ts.map +0 -1
  159. package/dist/infra/lib/autonomy/AuditStore.js +0 -185
  160. package/dist/infra/lib/autonomy/AuditStore.js.map +0 -1
  161. package/dist/infra/lib/autonomy/AutonomyConfig.d.ts +0 -84
  162. package/dist/infra/lib/autonomy/AutonomyConfig.d.ts.map +0 -1
  163. package/dist/infra/lib/autonomy/AutonomyConfig.js +0 -49
  164. package/dist/infra/lib/autonomy/AutonomyConfig.js.map +0 -1
  165. package/dist/infra/lib/autonomy/AutonomyOrchestrator.d.ts +0 -78
  166. package/dist/infra/lib/autonomy/AutonomyOrchestrator.d.ts.map +0 -1
  167. package/dist/infra/lib/autonomy/AutonomyOrchestrator.js +0 -246
  168. package/dist/infra/lib/autonomy/AutonomyOrchestrator.js.map +0 -1
  169. package/dist/infra/lib/autonomy/BackgroundMonitor.d.ts +0 -36
  170. package/dist/infra/lib/autonomy/BackgroundMonitor.d.ts.map +0 -1
  171. package/dist/infra/lib/autonomy/BackgroundMonitor.js +0 -138
  172. package/dist/infra/lib/autonomy/BackgroundMonitor.js.map +0 -1
  173. package/dist/infra/lib/autonomy/CollaborationProtocol.d.ts +0 -56
  174. package/dist/infra/lib/autonomy/CollaborationProtocol.d.ts.map +0 -1
  175. package/dist/infra/lib/autonomy/CollaborationProtocol.js +0 -122
  176. package/dist/infra/lib/autonomy/CollaborationProtocol.js.map +0 -1
  177. package/dist/infra/lib/autonomy/ConfirmationManager.d.ts +0 -42
  178. package/dist/infra/lib/autonomy/ConfirmationManager.d.ts.map +0 -1
  179. package/dist/infra/lib/autonomy/ConfirmationManager.js +0 -200
  180. package/dist/infra/lib/autonomy/ConfirmationManager.js.map +0 -1
  181. package/dist/infra/lib/autonomy/ConfirmationStore.d.ts +0 -55
  182. package/dist/infra/lib/autonomy/ConfirmationStore.d.ts.map +0 -1
  183. package/dist/infra/lib/autonomy/ConfirmationStore.js +0 -130
  184. package/dist/infra/lib/autonomy/ConfirmationStore.js.map +0 -1
  185. package/dist/infra/lib/autonomy/EventBus.d.ts +0 -20
  186. package/dist/infra/lib/autonomy/EventBus.d.ts.map +0 -1
  187. package/dist/infra/lib/autonomy/EventBus.js +0 -119
  188. package/dist/infra/lib/autonomy/EventBus.js.map +0 -1
  189. package/dist/infra/lib/autonomy/EventOutbox.d.ts +0 -32
  190. package/dist/infra/lib/autonomy/EventOutbox.d.ts.map +0 -1
  191. package/dist/infra/lib/autonomy/EventOutbox.js +0 -152
  192. package/dist/infra/lib/autonomy/EventOutbox.js.map +0 -1
  193. package/dist/infra/lib/autonomy/NotificationDispatcher.d.ts +0 -24
  194. package/dist/infra/lib/autonomy/NotificationDispatcher.d.ts.map +0 -1
  195. package/dist/infra/lib/autonomy/NotificationDispatcher.js +0 -112
  196. package/dist/infra/lib/autonomy/NotificationDispatcher.js.map +0 -1
  197. package/dist/infra/lib/autonomy/PolicyEngine.d.ts +0 -76
  198. package/dist/infra/lib/autonomy/PolicyEngine.d.ts.map +0 -1
  199. package/dist/infra/lib/autonomy/PolicyEngine.js +0 -208
  200. package/dist/infra/lib/autonomy/PolicyEngine.js.map +0 -1
  201. package/dist/infra/lib/autonomy/ProactiveAnalyzer.d.ts +0 -61
  202. package/dist/infra/lib/autonomy/ProactiveAnalyzer.d.ts.map +0 -1
  203. package/dist/infra/lib/autonomy/ProactiveAnalyzer.js +0 -236
  204. package/dist/infra/lib/autonomy/ProactiveAnalyzer.js.map +0 -1
  205. package/dist/infra/lib/autonomy/RiskClassifier.d.ts +0 -35
  206. package/dist/infra/lib/autonomy/RiskClassifier.d.ts.map +0 -1
  207. package/dist/infra/lib/autonomy/RiskClassifier.js +0 -147
  208. package/dist/infra/lib/autonomy/RiskClassifier.js.map +0 -1
  209. package/dist/infra/lib/autonomy/SecuritySentinel.d.ts +0 -51
  210. package/dist/infra/lib/autonomy/SecuritySentinel.d.ts.map +0 -1
  211. package/dist/infra/lib/autonomy/SecuritySentinel.js +0 -162
  212. package/dist/infra/lib/autonomy/SecuritySentinel.js.map +0 -1
  213. package/dist/infra/lib/autonomy/SuggestionStore.d.ts +0 -54
  214. package/dist/infra/lib/autonomy/SuggestionStore.d.ts.map +0 -1
  215. package/dist/infra/lib/autonomy/SuggestionStore.js +0 -144
  216. package/dist/infra/lib/autonomy/SuggestionStore.js.map +0 -1
  217. package/dist/infra/lib/autonomy/TaskDecomposer.d.ts +0 -38
  218. package/dist/infra/lib/autonomy/TaskDecomposer.d.ts.map +0 -1
  219. package/dist/infra/lib/autonomy/TaskDecomposer.js +0 -175
  220. package/dist/infra/lib/autonomy/TaskDecomposer.js.map +0 -1
  221. package/dist/infra/lib/autonomy/__tests__/audit-store.test.d.ts +0 -2
  222. package/dist/infra/lib/autonomy/__tests__/audit-store.test.d.ts.map +0 -1
  223. package/dist/infra/lib/autonomy/__tests__/audit-store.test.js +0 -198
  224. package/dist/infra/lib/autonomy/__tests__/audit-store.test.js.map +0 -1
  225. package/dist/infra/lib/autonomy/__tests__/event-bus.test.d.ts +0 -2
  226. package/dist/infra/lib/autonomy/__tests__/event-bus.test.d.ts.map +0 -1
  227. package/dist/infra/lib/autonomy/__tests__/event-bus.test.js +0 -225
  228. package/dist/infra/lib/autonomy/__tests__/event-bus.test.js.map +0 -1
  229. package/dist/infra/lib/autonomy/__tests__/event-core.test.d.ts +0 -2
  230. package/dist/infra/lib/autonomy/__tests__/event-core.test.d.ts.map +0 -1
  231. package/dist/infra/lib/autonomy/__tests__/event-core.test.js +0 -194
  232. package/dist/infra/lib/autonomy/__tests__/event-core.test.js.map +0 -1
  233. package/dist/infra/lib/autonomy/__tests__/governance.test.d.ts +0 -2
  234. package/dist/infra/lib/autonomy/__tests__/governance.test.d.ts.map +0 -1
  235. package/dist/infra/lib/autonomy/__tests__/governance.test.js +0 -540
  236. package/dist/infra/lib/autonomy/__tests__/governance.test.js.map +0 -1
  237. package/dist/infra/lib/autonomy/__tests__/integration.test.d.ts +0 -2
  238. package/dist/infra/lib/autonomy/__tests__/integration.test.d.ts.map +0 -1
  239. package/dist/infra/lib/autonomy/__tests__/integration.test.js +0 -480
  240. package/dist/infra/lib/autonomy/__tests__/integration.test.js.map +0 -1
  241. package/dist/infra/lib/autonomy/__tests__/proactive.test.d.ts +0 -2
  242. package/dist/infra/lib/autonomy/__tests__/proactive.test.d.ts.map +0 -1
  243. package/dist/infra/lib/autonomy/__tests__/proactive.test.js +0 -410
  244. package/dist/infra/lib/autonomy/__tests__/proactive.test.js.map +0 -1
  245. package/dist/infra/lib/autonomy/__tests__/sentinel.test.d.ts +0 -2
  246. package/dist/infra/lib/autonomy/__tests__/sentinel.test.d.ts.map +0 -1
  247. package/dist/infra/lib/autonomy/__tests__/sentinel.test.js +0 -486
  248. package/dist/infra/lib/autonomy/__tests__/sentinel.test.js.map +0 -1
  249. package/dist/infra/lib/autonomy/index.d.ts +0 -18
  250. package/dist/infra/lib/autonomy/index.d.ts.map +0 -1
  251. package/dist/infra/lib/autonomy/index.js +0 -22
  252. package/dist/infra/lib/autonomy/index.js.map +0 -1
  253. package/dist/infra/lib/autonomy/schemas.d.ts +0 -317
  254. package/dist/infra/lib/autonomy/schemas.d.ts.map +0 -1
  255. package/dist/infra/lib/autonomy/schemas.js +0 -90
  256. package/dist/infra/lib/autonomy/schemas.js.map +0 -1
  257. package/dist/infra/lib/claude/index.d.ts +0 -5
  258. package/dist/infra/lib/claude/index.d.ts.map +0 -1
  259. package/dist/infra/lib/claude/index.js +0 -5
  260. package/dist/infra/lib/claude/index.js.map +0 -1
  261. package/dist/infra/lib/claude/storage.d.ts +0 -12
  262. package/dist/infra/lib/claude/storage.d.ts.map +0 -1
  263. package/dist/infra/lib/claude/storage.js +0 -54
  264. package/dist/infra/lib/claude/storage.js.map +0 -1
  265. package/dist/infra/lib/gemini/auth.d.ts +0 -18
  266. package/dist/infra/lib/gemini/auth.d.ts.map +0 -1
  267. package/dist/infra/lib/gemini/auth.js +0 -32
  268. package/dist/infra/lib/gemini/auth.js.map +0 -1
  269. package/dist/infra/lib/gemini/capabilities.d.ts +0 -28
  270. package/dist/infra/lib/gemini/capabilities.d.ts.map +0 -1
  271. package/dist/infra/lib/gemini/capabilities.js +0 -178
  272. package/dist/infra/lib/gemini/capabilities.js.map +0 -1
  273. package/dist/infra/lib/gemini/chat.d.ts +0 -35
  274. package/dist/infra/lib/gemini/chat.d.ts.map +0 -1
  275. package/dist/infra/lib/gemini/chat.js +0 -161
  276. package/dist/infra/lib/gemini/chat.js.map +0 -1
  277. package/dist/infra/lib/gemini/completion.d.ts +0 -12
  278. package/dist/infra/lib/gemini/completion.d.ts.map +0 -1
  279. package/dist/infra/lib/gemini/completion.js +0 -13
  280. package/dist/infra/lib/gemini/completion.js.map +0 -1
  281. package/dist/infra/lib/gemini/constants.d.ts +0 -8
  282. package/dist/infra/lib/gemini/constants.d.ts.map +0 -1
  283. package/dist/infra/lib/gemini/constants.js +0 -11
  284. package/dist/infra/lib/gemini/constants.js.map +0 -1
  285. package/dist/infra/lib/gemini/index.d.ts +0 -13
  286. package/dist/infra/lib/gemini/index.d.ts.map +0 -1
  287. package/dist/infra/lib/gemini/index.js +0 -12
  288. package/dist/infra/lib/gemini/index.js.map +0 -1
  289. package/dist/infra/lib/gemini/models.d.ts +0 -11
  290. package/dist/infra/lib/gemini/models.d.ts.map +0 -1
  291. package/dist/infra/lib/gemini/models.js +0 -38
  292. package/dist/infra/lib/gemini/models.js.map +0 -1
  293. package/dist/infra/lib/gemini/orchestration.d.ts +0 -33
  294. package/dist/infra/lib/gemini/orchestration.d.ts.map +0 -1
  295. package/dist/infra/lib/gemini/orchestration.js +0 -62
  296. package/dist/infra/lib/gemini/orchestration.js.map +0 -1
  297. package/dist/infra/lib/gemini/types.d.ts +0 -115
  298. package/dist/infra/lib/gemini/types.d.ts.map +0 -1
  299. package/dist/infra/lib/gemini/types.js +0 -5
  300. package/dist/infra/lib/gemini/types.js.map +0 -1
  301. package/dist/infra/orchestrator/AgentAnnouncer.d.ts +0 -64
  302. package/dist/infra/orchestrator/AgentAnnouncer.d.ts.map +0 -1
  303. package/dist/infra/orchestrator/AgentAnnouncer.js +0 -127
  304. package/dist/infra/orchestrator/AgentAnnouncer.js.map +0 -1
  305. package/dist/infra/orchestrator/AgentAnnouncer.test.d.ts +0 -5
  306. package/dist/infra/orchestrator/AgentAnnouncer.test.d.ts.map +0 -1
  307. package/dist/infra/orchestrator/AgentAnnouncer.test.js +0 -119
  308. package/dist/infra/orchestrator/AgentAnnouncer.test.js.map +0 -1
  309. package/dist/infra/orchestrator/AgentExecutor.d.ts +0 -22
  310. package/dist/infra/orchestrator/AgentExecutor.d.ts.map +0 -1
  311. package/dist/infra/orchestrator/AgentExecutor.js +0 -272
  312. package/dist/infra/orchestrator/AgentExecutor.js.map +0 -1
  313. package/dist/infra/orchestrator/AgentManager.d.ts +0 -72
  314. package/dist/infra/orchestrator/AgentManager.d.ts.map +0 -1
  315. package/dist/infra/orchestrator/AgentManager.js +0 -183
  316. package/dist/infra/orchestrator/AgentManager.js.map +0 -1
  317. package/dist/infra/orchestrator/AgentManifestCache.d.ts +0 -54
  318. package/dist/infra/orchestrator/AgentManifestCache.d.ts.map +0 -1
  319. package/dist/infra/orchestrator/AgentManifestCache.js +0 -191
  320. package/dist/infra/orchestrator/AgentManifestCache.js.map +0 -1
  321. package/dist/infra/orchestrator/AgentRegistry.d.ts +0 -76
  322. package/dist/infra/orchestrator/AgentRegistry.d.ts.map +0 -1
  323. package/dist/infra/orchestrator/AgentRegistry.js +0 -217
  324. package/dist/infra/orchestrator/AgentRegistry.js.map +0 -1
  325. package/dist/infra/orchestrator/AgentRegistry.test.d.ts +0 -5
  326. package/dist/infra/orchestrator/AgentRegistry.test.d.ts.map +0 -1
  327. package/dist/infra/orchestrator/AgentRegistry.test.js +0 -122
  328. package/dist/infra/orchestrator/AgentRegistry.test.js.map +0 -1
  329. package/dist/infra/orchestrator/BackgroundManager.d.ts +0 -128
  330. package/dist/infra/orchestrator/BackgroundManager.d.ts.map +0 -1
  331. package/dist/infra/orchestrator/BackgroundManager.js +0 -620
  332. package/dist/infra/orchestrator/BackgroundManager.js.map +0 -1
  333. package/dist/infra/orchestrator/BackgroundManager.test.d.ts +0 -6
  334. package/dist/infra/orchestrator/BackgroundManager.test.d.ts.map +0 -1
  335. package/dist/infra/orchestrator/BackgroundManager.test.js +0 -162
  336. package/dist/infra/orchestrator/BackgroundManager.test.js.map +0 -1
  337. package/dist/infra/orchestrator/CheckpointManager.d.ts +0 -54
  338. package/dist/infra/orchestrator/CheckpointManager.d.ts.map +0 -1
  339. package/dist/infra/orchestrator/CheckpointManager.js +0 -121
  340. package/dist/infra/orchestrator/CheckpointManager.js.map +0 -1
  341. package/dist/infra/orchestrator/CodexAgentRuntime.d.ts +0 -12
  342. package/dist/infra/orchestrator/CodexAgentRuntime.d.ts.map +0 -1
  343. package/dist/infra/orchestrator/CodexAgentRuntime.js +0 -94
  344. package/dist/infra/orchestrator/CodexAgentRuntime.js.map +0 -1
  345. package/dist/infra/orchestrator/CodexAgentRuntime.test.d.ts +0 -2
  346. package/dist/infra/orchestrator/CodexAgentRuntime.test.d.ts.map +0 -1
  347. package/dist/infra/orchestrator/CodexAgentRuntime.test.js +0 -37
  348. package/dist/infra/orchestrator/CodexAgentRuntime.test.js.map +0 -1
  349. package/dist/infra/orchestrator/LLMCluster.d.ts +0 -82
  350. package/dist/infra/orchestrator/LLMCluster.d.ts.map +0 -1
  351. package/dist/infra/orchestrator/LLMCluster.js +0 -146
  352. package/dist/infra/orchestrator/LLMCluster.js.map +0 -1
  353. package/dist/infra/orchestrator/MultiLlmResearch.d.ts +0 -31
  354. package/dist/infra/orchestrator/MultiLlmResearch.d.ts.map +0 -1
  355. package/dist/infra/orchestrator/MultiLlmResearch.js +0 -160
  356. package/dist/infra/orchestrator/MultiLlmResearch.js.map +0 -1
  357. package/dist/infra/orchestrator/PhasePipeline.d.ts +0 -122
  358. package/dist/infra/orchestrator/PhasePipeline.d.ts.map +0 -1
  359. package/dist/infra/orchestrator/PhasePipeline.js +0 -385
  360. package/dist/infra/orchestrator/PhasePipeline.js.map +0 -1
  361. package/dist/infra/orchestrator/PhaseResultStore.d.ts +0 -39
  362. package/dist/infra/orchestrator/PhaseResultStore.d.ts.map +0 -1
  363. package/dist/infra/orchestrator/PhaseResultStore.js +0 -151
  364. package/dist/infra/orchestrator/PhaseResultStore.js.map +0 -1
  365. package/dist/infra/orchestrator/SessionStore.d.ts +0 -40
  366. package/dist/infra/orchestrator/SessionStore.d.ts.map +0 -1
  367. package/dist/infra/orchestrator/SessionStore.js +0 -116
  368. package/dist/infra/orchestrator/SessionStore.js.map +0 -1
  369. package/dist/infra/orchestrator/SmartRouter.d.ts +0 -90
  370. package/dist/infra/orchestrator/SmartRouter.d.ts.map +0 -1
  371. package/dist/infra/orchestrator/SmartRouter.js +0 -277
  372. package/dist/infra/orchestrator/SmartRouter.js.map +0 -1
  373. package/dist/infra/orchestrator/SmartRouter.test.d.ts +0 -5
  374. package/dist/infra/orchestrator/SmartRouter.test.d.ts.map +0 -1
  375. package/dist/infra/orchestrator/SmartRouter.test.js +0 -484
  376. package/dist/infra/orchestrator/SmartRouter.test.js.map +0 -1
  377. package/dist/infra/orchestrator/SwarmOrchestrator.d.ts +0 -143
  378. package/dist/infra/orchestrator/SwarmOrchestrator.d.ts.map +0 -1
  379. package/dist/infra/orchestrator/SwarmOrchestrator.js +0 -378
  380. package/dist/infra/orchestrator/SwarmOrchestrator.js.map +0 -1
  381. package/dist/infra/orchestrator/SwarmOrchestrator.test.d.ts +0 -5
  382. package/dist/infra/orchestrator/SwarmOrchestrator.test.d.ts.map +0 -1
  383. package/dist/infra/orchestrator/SwarmOrchestrator.test.js +0 -95
  384. package/dist/infra/orchestrator/SwarmOrchestrator.test.js.map +0 -1
  385. package/dist/infra/orchestrator/agentDiscovery.d.ts +0 -26
  386. package/dist/infra/orchestrator/agentDiscovery.d.ts.map +0 -1
  387. package/dist/infra/orchestrator/agentDiscovery.js +0 -175
  388. package/dist/infra/orchestrator/agentDiscovery.js.map +0 -1
  389. package/dist/infra/orchestrator/backgroundAgent.d.ts +0 -9
  390. package/dist/infra/orchestrator/backgroundAgent.d.ts.map +0 -1
  391. package/dist/infra/orchestrator/backgroundAgent.js +0 -10
  392. package/dist/infra/orchestrator/backgroundAgent.js.map +0 -1
  393. package/dist/infra/orchestrator/index.d.ts +0 -207
  394. package/dist/infra/orchestrator/index.d.ts.map +0 -1
  395. package/dist/infra/orchestrator/index.js +0 -362
  396. package/dist/infra/orchestrator/index.js.map +0 -1
  397. package/dist/infra/orchestrator/orchestrator.d.ts +0 -60
  398. package/dist/infra/orchestrator/orchestrator.d.ts.map +0 -1
  399. package/dist/infra/orchestrator/orchestrator.js +0 -214
  400. package/dist/infra/orchestrator/orchestrator.js.map +0 -1
  401. package/dist/infra/orchestrator/parallelResearch.d.ts +0 -27
  402. package/dist/infra/orchestrator/parallelResearch.d.ts.map +0 -1
  403. package/dist/infra/orchestrator/parallelResearch.js +0 -285
  404. package/dist/infra/orchestrator/parallelResearch.js.map +0 -1
  405. package/dist/infra/orchestrator/types.d.ts +0 -205
  406. package/dist/infra/orchestrator/types.d.ts.map +0 -1
  407. package/dist/infra/orchestrator/types.js +0 -87
  408. package/dist/infra/orchestrator/types.js.map +0 -1
  409. package/dist/infra/orchestrator/types.test.d.ts +0 -2
  410. package/dist/infra/orchestrator/types.test.d.ts.map +0 -1
  411. package/dist/infra/orchestrator/types.test.js +0 -57
  412. package/dist/infra/orchestrator/types.test.js.map +0 -1
  413. package/dist/tools/semantic/analyzeDependencyGraph.d.ts +0 -12
  414. package/dist/tools/semantic/analyzeDependencyGraph.d.ts.map +0 -1
  415. package/dist/tools/semantic/analyzeDependencyGraph.js +0 -359
  416. package/dist/tools/semantic/analyzeDependencyGraph.js.map +0 -1
  417. package/dist/tools/semantic/astGrep.d.ts +0 -25
  418. package/dist/tools/semantic/astGrep.d.ts.map +0 -1
  419. package/dist/tools/semantic/astGrep.js +0 -324
  420. package/dist/tools/semantic/astGrep.js.map +0 -1
  421. package/dist/tools/semantic/astGrep.test.d.ts +0 -2
  422. package/dist/tools/semantic/astGrep.test.d.ts.map +0 -1
  423. package/dist/tools/semantic/astGrep.test.js +0 -74
  424. package/dist/tools/semantic/astGrep.test.js.map +0 -1
  425. package/dist/tools/semantic/findReferences.d.ts +0 -9
  426. package/dist/tools/semantic/findReferences.d.ts.map +0 -1
  427. package/dist/tools/semantic/findReferences.js +0 -200
  428. package/dist/tools/semantic/findReferences.js.map +0 -1
  429. package/dist/tools/semantic/findSymbol.d.ts +0 -8
  430. package/dist/tools/semantic/findSymbol.d.ts.map +0 -1
  431. package/dist/tools/semantic/findSymbol.js +0 -204
  432. package/dist/tools/semantic/findSymbol.js.map +0 -1
  433. package/dist/tools/semantic/index.d.ts +0 -9
  434. package/dist/tools/semantic/index.d.ts.map +0 -1
  435. package/dist/tools/semantic/index.js +0 -11
  436. package/dist/tools/semantic/index.js.map +0 -1
  437. package/dist/tools/semantic/lsp.d.ts +0 -68
  438. package/dist/tools/semantic/lsp.d.ts.map +0 -1
  439. package/dist/tools/semantic/lsp.js +0 -561
  440. package/dist/tools/semantic/lsp.js.map +0 -1
  441. package/dist/tools/spec/e2eTestGenerator.d.ts +0 -61
  442. package/dist/tools/spec/e2eTestGenerator.d.ts.map +0 -1
  443. package/dist/tools/spec/e2eTestGenerator.js +0 -255
  444. package/dist/tools/spec/e2eTestGenerator.js.map +0 -1
  445. package/dist/tools/spec/specVersioning.d.ts +0 -76
  446. package/dist/tools/spec/specVersioning.d.ts.map +0 -1
  447. package/dist/tools/spec/specVersioning.js +0 -236
  448. package/dist/tools/spec/specVersioning.js.map +0 -1
  449. package/hooks/scripts/__tests__/.vibe/memories/memories.db +0 -0
  450. package/hooks/scripts/__tests__/.vibe/memories/memories.db-shm +0 -0
  451. package/hooks/scripts/__tests__/.vibe/memories/memories.db-wal +0 -0
  452. package/hooks/scripts/evolution-engine.js +0 -91
  453. package/hooks/scripts/hud-status.js +0 -321
  454. package/hooks/scripts/skill-injector.js +0 -83
  455. package/skills/vibe.utils/SKILL.md +0 -415
@@ -1,185 +0,0 @@
1
- import { uuidv7 } from 'uuidv7';
2
- const DEFAULT_PAGE_SIZE = 50;
3
- const MAX_PAGE_SIZE = 200;
4
- const SENSITIVE_PATTERNS = [
5
- [/\b(sk-[a-zA-Z0-9]{20,})\b/g, '[REDACTED:API_KEY]'],
6
- [/\b(key-[a-zA-Z0-9]{20,})\b/g, '[REDACTED:API_KEY]'],
7
- [/Bearer\s+[a-zA-Z0-9._\-]+/gi, 'Bearer [REDACTED]'],
8
- [/("?password"?\s*[:=]\s*)"[^"]*"/gi, '$1"[REDACTED]"'],
9
- [/("?secret"?\s*[:=]\s*)"[^"]*"/gi, '$1"[REDACTED]"'],
10
- [/("?token"?\s*[:=]\s*)"[^"]*"/gi, '$1"[REDACTED]"'],
11
- ];
12
- export class AuditStore {
13
- db;
14
- insertStmt;
15
- fts5Available = false;
16
- constructor(storage) {
17
- this.db = storage.getDatabase();
18
- this.initTables();
19
- this.insertStmt = this.db.prepare(`
20
- INSERT INTO audit_events
21
- (id, correlationId, causationId, eventType, agentId, actionType, riskLevel, payload, outcome, createdAt)
22
- VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
23
- `);
24
- }
25
- initTables() {
26
- this.db.exec(`
27
- CREATE TABLE IF NOT EXISTS audit_events (
28
- id TEXT PRIMARY KEY,
29
- correlationId TEXT NOT NULL,
30
- causationId TEXT,
31
- eventType TEXT NOT NULL,
32
- agentId TEXT,
33
- actionType TEXT,
34
- riskLevel TEXT,
35
- payload TEXT NOT NULL,
36
- outcome TEXT CHECK(outcome IS NULL OR outcome IN ('allowed', 'blocked', 'pending', 'expired')),
37
- createdAt TEXT NOT NULL
38
- );
39
- CREATE INDEX IF NOT EXISTS idx_audit_agent_time ON audit_events(agentId, createdAt);
40
- CREATE INDEX IF NOT EXISTS idx_audit_type_time ON audit_events(eventType, createdAt);
41
- CREATE INDEX IF NOT EXISTS idx_audit_correlation ON audit_events(correlationId);
42
- `);
43
- try {
44
- this.db.exec(`
45
- CREATE VIRTUAL TABLE IF NOT EXISTS audit_events_fts USING fts5(
46
- eventType, agentId, payload,
47
- content='audit_events', content_rowid='rowid'
48
- );
49
- `);
50
- this.db.exec(`
51
- CREATE TRIGGER IF NOT EXISTS audit_events_fts_ai AFTER INSERT ON audit_events BEGIN
52
- INSERT INTO audit_events_fts(rowid, eventType, agentId, payload)
53
- VALUES (new.rowid, new.eventType, new.agentId, new.payload);
54
- END;
55
- `);
56
- this.fts5Available = true;
57
- }
58
- catch {
59
- this.fts5Available = false;
60
- }
61
- this.db.exec(`
62
- CREATE TRIGGER IF NOT EXISTS prevent_audit_update
63
- BEFORE UPDATE ON audit_events
64
- BEGIN SELECT RAISE(ABORT, 'Audit logs are immutable'); END;
65
- CREATE TRIGGER IF NOT EXISTS prevent_audit_delete
66
- BEFORE DELETE ON audit_events
67
- BEGIN SELECT RAISE(ABORT, 'Audit logs are immutable'); END;
68
- `);
69
- }
70
- static redactSensitive(payload) {
71
- let redacted = payload;
72
- for (const [pattern, replacement] of SENSITIVE_PATTERNS) {
73
- redacted = redacted.replace(new RegExp(pattern.source, pattern.flags), replacement);
74
- }
75
- return redacted;
76
- }
77
- record(event) {
78
- const id = uuidv7();
79
- const payloadStr = AuditStore.redactSensitive(JSON.stringify(event.payload));
80
- this.insertStmt.run(id, event.correlationId, event.causationId ?? null, event.eventType, event.agentId ?? null, event.actionType ?? null, event.riskLevel ?? null, payloadStr, event.outcome ?? null, new Date().toISOString());
81
- return id;
82
- }
83
- recordBatch(events) {
84
- const ids = [];
85
- const batchInsert = this.db.transaction(() => {
86
- for (const event of events) {
87
- ids.push(this.record(event));
88
- }
89
- });
90
- batchInsert();
91
- return ids;
92
- }
93
- query(filters) {
94
- const conditions = [];
95
- const params = [];
96
- if (filters.agentId) {
97
- conditions.push('agentId = ?');
98
- params.push(filters.agentId);
99
- }
100
- if (filters.eventType) {
101
- conditions.push('eventType = ?');
102
- params.push(filters.eventType);
103
- }
104
- if (filters.riskLevel) {
105
- conditions.push('riskLevel = ?');
106
- params.push(filters.riskLevel);
107
- }
108
- if (filters.outcome) {
109
- conditions.push('outcome = ?');
110
- params.push(filters.outcome);
111
- }
112
- if (filters.startDate) {
113
- conditions.push('createdAt >= ?');
114
- params.push(filters.startDate);
115
- }
116
- if (filters.endDate) {
117
- conditions.push('createdAt <= ?');
118
- params.push(filters.endDate);
119
- }
120
- const where = conditions.length > 0 ? `WHERE ${conditions.join(' AND ')}` : '';
121
- const limit = Math.min(filters.limit || DEFAULT_PAGE_SIZE, MAX_PAGE_SIZE);
122
- const offset = filters.offset || 0;
123
- const sql = `SELECT * FROM audit_events ${where} ORDER BY createdAt DESC LIMIT ? OFFSET ?`;
124
- params.push(limit, offset);
125
- return this.db.prepare(sql).all(...params);
126
- }
127
- getByCorrelation(correlationId) {
128
- return this.db
129
- .prepare('SELECT * FROM audit_events WHERE correlationId = ? ORDER BY createdAt ASC')
130
- .all(correlationId);
131
- }
132
- getStats(dateRange) {
133
- const dateCondition = dateRange ? 'WHERE createdAt >= ? AND createdAt <= ?' : '';
134
- const dateParams = dateRange ? [dateRange.startDate, dateRange.endDate] : [];
135
- const total = this.db
136
- .prepare(`SELECT COUNT(*) as count FROM audit_events ${dateCondition}`)
137
- .get(...dateParams).count;
138
- const byType = this.db
139
- .prepare(`SELECT eventType, COUNT(*) as count FROM audit_events ${dateCondition} GROUP BY eventType`)
140
- .all(...dateParams);
141
- const riskCondition = dateRange
142
- ? 'WHERE createdAt >= ? AND createdAt <= ? AND riskLevel IS NOT NULL'
143
- : 'WHERE riskLevel IS NOT NULL';
144
- const byRisk = this.db
145
- .prepare(`SELECT riskLevel, COUNT(*) as count FROM audit_events ${riskCondition} GROUP BY riskLevel`)
146
- .all(...dateParams);
147
- const blockedCondition = dateRange
148
- ? `WHERE createdAt >= ? AND createdAt <= ? AND outcome = 'blocked'`
149
- : `WHERE outcome = 'blocked'`;
150
- const blocked = this.db
151
- .prepare(`SELECT COUNT(*) as count FROM audit_events ${blockedCondition}`)
152
- .get(...dateParams).count;
153
- return {
154
- totalEvents: total,
155
- byEventType: Object.fromEntries(byType.map((r) => [r.eventType, r.count])),
156
- byRiskLevel: Object.fromEntries(byRisk.map((r) => [r.riskLevel, r.count])),
157
- blockedCount: blocked,
158
- blockedRate: total > 0 ? blocked / total : 0,
159
- };
160
- }
161
- search(query, limit) {
162
- if (!this.fts5Available)
163
- return [];
164
- const sanitized = query
165
- .replace(/[*"()\-]/g, ' ')
166
- .replace(/\b(AND|OR|NOT)\b/gi, ' ')
167
- .trim();
168
- if (!sanitized)
169
- return [];
170
- const pageSize = Math.min(limit || DEFAULT_PAGE_SIZE, MAX_PAGE_SIZE);
171
- try {
172
- return this.db
173
- .prepare(`SELECT a.* FROM audit_events a
174
- JOIN audit_events_fts f ON a.rowid = f.rowid
175
- WHERE audit_events_fts MATCH ?
176
- ORDER BY rank
177
- LIMIT ?`)
178
- .all(sanitized, pageSize);
179
- }
180
- catch {
181
- return [];
182
- }
183
- }
184
- }
185
- //# sourceMappingURL=AuditStore.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AuditStore.js","sourceRoot":"","sources":["../../../../src/infra/lib/autonomy/AuditStore.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGhC,MAAM,iBAAiB,GAAG,EAAE,CAAC;AAC7B,MAAM,aAAa,GAAG,GAAG,CAAC;AAE1B,MAAM,kBAAkB,GAAoC;IAC1D,CAAC,4BAA4B,EAAE,oBAAoB,CAAC;IACpD,CAAC,6BAA6B,EAAE,oBAAoB,CAAC;IACrD,CAAC,6BAA6B,EAAE,mBAAmB,CAAC;IACpD,CAAC,mCAAmC,EAAE,gBAAgB,CAAC;IACvD,CAAC,iCAAiC,EAAE,gBAAgB,CAAC;IACrD,CAAC,gCAAgC,EAAE,gBAAgB,CAAC;CACrD,CAAC;AAiDF,MAAM,OAAO,UAAU;IACJ,EAAE,CAAoB;IACtB,UAAU,CAAqB;IACxC,aAAa,GAAG,KAAK,CAAC;IAE9B,YAAY,OAAwB;QAClC,IAAI,CAAC,EAAE,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;QAChC,IAAI,CAAC,UAAU,EAAE,CAAC;QAClB,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,EAAE,CAAC,OAAO,CAAC;;;;KAIjC,CAAC,CAAC;IACL,CAAC;IAEO,UAAU;QAChB,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC;;;;;;;;;;;;;;;;KAgBZ,CAAC,CAAC;QAEH,IAAI,CAAC;YACH,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC;;;;;OAKZ,CAAC,CAAC;YACH,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC;;;;;OAKZ,CAAC,CAAC;YACH,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC;QAC5B,CAAC;QAAC,MAAM,CAAC;YACP,IAAI,CAAC,aAAa,GA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AI,iBAAiB,EAAE,aAAa,CAAC,CAAC;QAErE,IAAI,CAAC;YACH,OAAO,IAAI,CAAC,EAAE;iBACX,OAAO,CACN;;;;mBAIS,CACV;iBACA,GAAG,CAAC,SAAS,EAAE,QAAQ,CAAoB,CAAC;QACjD,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,EAAE,CAAC;QACZ,CAAC;IACH,CAAC;CACF"}
@@ -1,84 +0,0 @@
1
- import { z } from 'zod';
2
- export declare const NotificationChannelEnum: z.ZodEnum<{
3
- telegram: "telegram";
4
- slack: "slack";
5
- web: "web";
6
- }>;
7
- export declare const SentinelConfigSchema: z.ZodObject<{
8
- enabled: z.ZodDefault<z.ZodBoolean>;
9
- notificationChannels: z.ZodDefault<z.ZodArray<z.ZodEnum<{
10
- telegram: "telegram";
11
- slack: "slack";
12
- web: "web";
13
- }>>>;
14
- confirmationTimeout: z.ZodDefault<z.ZodNumber>;
15
- rules: z.ZodDefault<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
16
- }, z.core.$strip>;
17
- export declare const ProactiveConfigSchema: z.ZodObject<{
18
- enabled: z.ZodDefault<z.ZodBoolean>;
19
- modules: z.ZodDefault<z.ZodArray<z.ZodEnum<{
20
- quality: "quality";
21
- performance: "performance";
22
- security: "security";
23
- dependency: "dependency";
24
- }>>>;
25
- }, z.core.$strip>;
26
- export declare const AutonomyModeEnum: z.ZodEnum<{
27
- auto: "auto";
28
- suggest: "suggest";
29
- disabled: "disabled";
30
- }>;
31
- export declare const AutonomyConfigSchema: z.ZodObject<{
32
- mode: z.ZodDefault<z.ZodEnum<{
33
- auto: "auto";
34
- suggest: "suggest";
35
- disabled: "disabled";
36
- }>>;
37
- proactive: z.ZodDefault<z.ZodObject<{
38
- enabled: z.ZodDefault<z.ZodBoolean>;
39
- modules: z.ZodDefault<z.ZodArray<z.ZodEnum<{
40
- quality: "quality";
41
- performance: "performance";
42
- security: "security";
43
- dependency: "dependency";
44
- }>>>;
45
- }, z.core.$strip>>;
46
- maxConcurrentSteps: z.ZodDefault<z.ZodNumber>;
47
- maxStepTimeout: z.ZodDefault<z.ZodNumber>;
48
- }, z.core.$strip>;
49
- export declare const FullConfigSchema: z.ZodObject<{
50
- sentinel: z.ZodDefault<z.ZodObject<{
51
- enabled: z.ZodDefault<z.ZodBoolean>;
52
- notificationChannels: z.ZodDefault<z.ZodArray<z.ZodEnum<{
53
- telegram: "telegram";
54
- slack: "slack";
55
- web: "web";
56
- }>>>;
57
- confirmationTimeout: z.ZodDefault<z.ZodNumber>;
58
- rules: z.ZodDefault<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
59
- }, z.core.$strip>>;
60
- autonomy: z.ZodDefault<z.ZodObject<{
61
- mode: z.ZodDefault<z.ZodEnum<{
62
- auto: "auto";
63
- suggest: "suggest";
64
- disabled: "disabled";
65
- }>>;
66
- proactive: z.ZodDefault<z.ZodObject<{
67
- enabled: z.ZodDefault<z.ZodBoolean>;
68
- modules: z.ZodDefault<z.ZodArray<z.ZodEnum<{
69
- quality: "quality";
70
- performance: "performance";
71
- security: "security";
72
- dependency: "dependency";
73
- }>>>;
74
- }, z.core.$strip>>;
75
- maxConcurrentSteps: z.ZodDefault<z.ZodNumber>;
76
- maxStepTimeout: z.ZodDefault<z.ZodNumber>;
77
- }, z.core.$strip>>;
78
- }, z.core.$strip>;
79
- export type SentinelConfig = z.infer<typeof SentinelConfigSchema>;
80
- export type AutonomyConfig = z.infer<typeof AutonomyConfigSchema>;
81
- export type FullConfig = z.infer<typeof FullConfigSchema>;
82
- export declare function loadConfig(rawConfig: unknown): FullConfig;
83
- export declare function getDefaultConfig(): FullConfig;
84
- //# sourceMappingURL=AutonomyConfig.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AutonomyConfig.d.ts","sourceRoot":"","sources":["../../../../src/infra/lib/autonomy/AutonomyConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,eAAO,MAAM,uBAAuB;;;;EAAuC,CAAC;AAE5E,eAAO,MAAM,oBAAoB;;;;;;;;;iBAK/B,CAAC;AAEH,eAAO,MAAM,qBAAqB;;;;;;;;iBAKhC,CAAC;AAEH,eAAO,MAAM,gBAAgB;;;;EAA0C,CAAC;AAExE,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;iBAK/B,CAAC;AAEH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAG3B,CAAC;AAEH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAClE,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAClE,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAM1D,wBAAgB,UAAU,CAAC,SAAS,EAAE,OAAO,GAAG,UAAU,CAczD;AAED,wBAAgB,gBAAgB,IAAI,UAAU,CAE7C"}
@@ -1,49 +0,0 @@
1
- import { z } from 'zod';
2
- // ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
3
- // Config Schemas
4
- // ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
5
- export const NotificationChannelEnum = z.enum(['telegram', 'slack', 'web']);
6
- export const SentinelConfigSchema = z.object({
7
- enabled: z.boolean().default(true),
8
- notificationChannels: z.array(NotificationChannelEnum).default(['telegram', 'slack', 'web']),
9
- confirmationTimeout: z.number().min(60).max(3600).default(300),
10
- rules: z.array(z.record(z.string(), z.unknown())).default([]),
11
- });
12
- export const ProactiveConfigSchema = z.object({
13
- enabled: z.boolean().default(true),
14
- modules: z
15
- .array(z.enum(['security', 'performance', 'quality', 'dependency']))
16
- .default(['security', 'performance', 'quality', 'dependency']),
17
- });
18
- export const AutonomyModeEnum = z.enum(['suggest', 'auto', 'disabled']);
19
- export const AutonomyConfigSchema = z.object({
20
- mode: AutonomyModeEnum.default('suggest'),
21
- proactive: ProactiveConfigSchema.default(() => ProactiveConfigSchema.parse({})),
22
- maxConcurrentSteps: z.number().min(1).max(5).default(3),
23
- maxStepTimeout: z.number().min(60).max(3600).default(600),
24
- });
25
- export const FullConfigSchema = z.object({
26
- sentinel: SentinelConfigSchema.default(() => SentinelConfigSchema.parse({})),
27
- autonomy: AutonomyConfigSchema.default(() => AutonomyConfigSchema.parse({})),
28
- });
29
- // ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
30
- // Config Loader
31
- // ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
32
- export function loadConfig(rawConfig) {
33
- try {
34
- return FullConfigSchema.parse(rawConfig ?? {});
35
- }
36
- catch (err) {
37
- if (err instanceof z.ZodError) {
38
- for (const issue of err.issues) {
39
- process.stderr.write(`[AutonomyConfig] Invalid config at '${issue.path.join('.')}': ${issue.message} — using default\n`);
40
- }
41
- }
42
- // Return defaults on validation failure
43
- return FullConfigSchema.parse({});
44
- }
45
- }
46
- export function getDefaultConfig() {
47
- return FullConfigSchema.parse({});
48
- }
49
- //# sourceMappingURL=AutonomyConfig.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AutonomyConfig.js","sourceRoot":"","sources":["../../../../src/infra/lib/autonomy/AutonomyConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,yDAAyD;AACzD,iBAAiB;AACjB,yDAAyD;AAEzD,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC;AAE5E,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3C,OAA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,CAAC;AACpC,CAAC"}
@@ -1,78 +0,0 @@
1
- import type { EventBus } from './EventBus.js';
2
- import type { AuditStore } from './AuditStore.js';
3
- import type { SecuritySentinel } from './SecuritySentinel.js';
4
- import type { ConfirmationManager } from './ConfirmationManager.js';
5
- import { TaskDecomposer } from './TaskDecomposer.js';
6
- import type { DecomposedTask, TaskStep, StepStatus } from './TaskDecomposer.js';
7
- import { CollaborationProtocol } from './CollaborationProtocol.js';
8
- import type { AgentAssignment } from './CollaborationProtocol.js';
9
- export type AutonomyMode = 'suggest' | 'auto' | 'disabled';
10
- export interface StepResult {
11
- stepId: string;
12
- status: StepStatus;
13
- agentName: string;
14
- output?: string;
15
- error?: string;
16
- startedAt: string;
17
- completedAt: string;
18
- durationMs: number;
19
- }
20
- export interface ExecutionResult {
21
- taskId: string;
22
- mode: AutonomyMode;
23
- status: 'completed' | 'partial' | 'failed' | 'pending_confirmation' | 'suggested';
24
- stepResults: StepResult[];
25
- totalDurationMs: number;
26
- startedAt: string;
27
- completedAt: string;
28
- }
29
- export interface TaskProgress {
30
- taskId: string;
31
- totalSteps: number;
32
- completedSteps: number;
33
- currentStep: string | null;
34
- percentComplete: number;
35
- status: 'pending' | 'running' | 'completed' | 'failed';
36
- }
37
- export type StepExecutor = (step: TaskStep, assignment: AgentAssignment) => Promise<{
38
- success: boolean;
39
- output?: string;
40
- error?: string;
41
- }>;
42
- export interface OrchestratorDeps {
43
- eventBus: EventBus;
44
- auditStore: AuditStore;
45
- sentinel: SecuritySentinel;
46
- confirmationManager?: ConfirmationManager;
47
- stepExecutor?: StepExecutor;
48
- maxConcurrentSteps?: number;
49
- maxStepTimeoutS?: number;
50
- }
51
- export declare class AutonomyOrchestrator {
52
- private readonly decomposer;
53
- private readonly protocol;
54
- private readonly eventBus;
55
- private readonly auditStore;
56
- private readonly sentinel;
57
- private readonly confirmationManager?;
58
- private readonly stepExecutor?;
59
- private readonly maxConcurrent;
60
- private readonly maxStepTimeoutS;
61
- private readonly progress;
62
- constructor(deps: OrchestratorDeps);
63
- decomposePrompt(prompt: string): DecomposedTask;
64
- execute(task: DecomposedTask, mode: AutonomyMode): Promise<ExecutionResult>;
65
- getProgress(taskId: string): TaskProgress | undefined;
66
- getDecomposer(): TaskDecomposer;
67
- getProtocol(): CollaborationProtocol;
68
- private executeStep;
69
- private buildSuggestResult;
70
- private buildStepResult;
71
- private emitStepEvent;
72
- private stepTypeToActionType;
73
- private executeWithTimeout;
74
- private initProgress;
75
- private updateProgress;
76
- private finalizeProgress;
77
- }
78
- //# sourceMappingURL=AutonomyOrchestrator.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AutonomyOrchestrator.d.ts","sourceRoot":"","sources":["../../../../src/infra/lib/autonomy/AutonomyOrchestrator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,KAAK,EAAE,mBAAmB,EAAsB,MAAM,0BAA0B,CAAC;AAExF,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,KAAK,EAAE,cAAc,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAChF,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAclE,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,MAAM,GAAG,UAAU,CAAC;AAE3D,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,UAAU,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,M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,CAAC,QAAQ,CAAwB;IACjD,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAW;IACpC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAa;IACxC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAmB;IAC5C,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAAC,CAAsB;IAC3D,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAe;IAC7C,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAS;IACvC,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAS;IACzC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAmC;gBAEhD,IAAI,EAAE,gBAAgB;IAYlC,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,cAAc;IAIzC,OAAO,CACX,IAAI,EAAE,cAAc,EACpB,IAAI,EAAE,YAAY,GACjB,OAAO,CAAC,eAAe,CAAC;IAgD3B,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY,GAAG,SAAS;IAIrD,aAAa,IAAI,cAAc;IAI/B,WAAW,IAAI,qBAAqB;YAItB,WAAW;IA2FzB,OAAO,CAAC,kBAAkB;IAyB1B,OAAO,CAAC,eAAe;IA4BvB,OAAO,CAAC,aAAa;IAuBrB,OAAO,CAAC,oBAAoB;YASd,kBAAkB;IAchC,OAAO,CAAC,YAAY;IAWpB,OAAO,CAAC,cAAc;IAatB,OAAO,CAAC,gBAAgB;CASzB"}
@@ -1,246 +0,0 @@
1
- import { TaskDecomposer } from './TaskDecomposer.js';
2
- import { CollaborationProtocol } from './CollaborationProtocol.js';
3
- // ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
4
- // Constants
5
- // ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
6
- const DEFAULT_MAX_CONCURRENT = 3;
7
- const DEFAULT_STEP_TIMEOUT_S = 600;
8
- const TASK_TIMEOUT_S = 3600;
9
- // ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
10
- // AutonomyOrchestrator
11
- // ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
12
- export class AutonomyOrchestrator {
13
- decomposer;
14
- protocol;
15
- eventBus;
16
- auditStore;
17
- sentinel;
18
- confirmationManager;
19
- stepExecutor;
20
- maxConcurrent;
21
- maxStepTimeoutS;
22
- progress = new Map();
23
- constructor(deps) {
24
- this.decomposer = new TaskDecomposer();
25
- this.protocol = new CollaborationProtocol();
26
- this.eventBus = deps.eventBus;
27
- this.auditStore = deps.auditStore;
28
- this.sentinel = deps.sentinel;
29
- this.confirmationManager = deps.confirmationManager;
30
- this.stepExecutor = deps.stepExecutor;
31
- this.maxConcurrent = deps.maxConcurrentSteps ?? DEFAULT_MAX_CONCURRENT;
32
- this.maxStepTimeoutS = deps.maxStepTimeoutS ?? DEFAULT_STEP_TIMEOUT_S;
33
- }
34
- decomposePrompt(prompt) {
35
- return this.decomposer.decompose(prompt);
36
- }
37
- async execute(task, mode) {
38
- const startedAt = new Date().toISOString();
39
- const startMs = Date.now();
40
- this.initProgress(task);
41
- if (mode === 'suggest' || mode === 'disabled') {
42
- return this.buildSuggestResult(task, mode, startedAt, startMs);
43
- }
44
- const stepResults = [];
45
- const taskTimeout = setTimeout(() => {
46
- // Mark in-progress steps as failed on task timeout
47
- }, TASK_TIMEOUT_S * 1000);
48
- try {
49
- for (const step of task.steps) {
50
- const result = await this.executeStep(task, step);
51
- stepResults.push(result);
52
- if (result.status === 'failed') {
53
- this.updateProgress(task.id, step, 'failed');
54
- break;
55
- }
56
- this.updateProgress(task.id, step, 'completed');
57
- }
58
- }
59
- finally {
60
- clearTimeout(taskTimeout);
61
- }
62
- const completedAt = new Date().toISOString();
63
- const totalDurationMs = Date.now() - startMs;
64
- const allCompleted = stepResults.every((r) => r.status === 'completed');
65
- const hasFailed = stepResults.some((r) => r.status === 'failed');
66
- this.finalizeProgress(task.id, hasFailed ? 'failed' : 'completed');
67
- return {
68
- taskId: task.id,
69
- mode,
70
- status: allCompleted ? 'completed' : hasFailed ? 'failed' : 'partial',
71
- stepResults,
72
- totalDurationMs,
73
- startedAt,
74
- completedAt,
75
- };
76
- }
77
- getProgress(taskId) {
78
- return this.progress.get(taskId);
79
- }
80
- getDecomposer() {
81
- return this.decomposer;
82
- }
83
- getProtocol() {
84
- return this.protocol;
85
- }
86
- async executeStep(task, step) {
87
- const assignment = this.protocol.assignAgent(step);
88
- const stepStartMs = Date.now();
89
- const stepStartedAt = new Date().toISOString();
90
- this.updateProgress(task.id, step, 'in_progress');
91
- // Emit step start event
92
- this.emitStepEvent(task, step, assignment, 'started');
93
- // Risk check via sentinel
94
- const actionForSentinel = {
95
- agentId: assignment.agentName,
96
- actionType: this.stepTypeToActionType(step.type),
97
- target: task.originalPrompt.slice(0, 200),
98
- params: {},
99
- };
100
- const riskResult = this.sentinel.intercept(actionForSentinel);
101
- // If HIGH risk in auto mode, request confirmation
102
- if (!riskResult.allowed && riskResult.policyDecision.requiredAction === 'confirm') {
103
- if (this.confirmationManager) {
104
- const riskAssessment = {
105
- riskLevel: riskResult.riskLevel,
106
- score: 80,
107
- factors: riskResult.policyDecision.matchedPolicies,
108
- reasoning: riskResult.policyDecision.reason,
109
- };
110
- const confirmation = await this.confirmationManager.requestConfirmation(actionForSentinel, riskAssessment);
111
- if (confirmation.status !== 'approved') {
112
- return this.buildStepResult(step, assignment, stepStartedAt, stepStartMs, 'failed', undefined, `Step blocked: ${confirmation.status}`);
113
- }
114
- }
115
- else {
116
- return this.buildStepResult(step, assignment, stepStartedAt, stepStartMs, 'failed', undefined, 'HIGH risk step requires confirmation but no ConfirmationManager configured');
117
- }
118
- }
119
- // If blocked outright, fail
120
- if (!riskResult.allowed && riskResult.policyDecision.requiredAction === 'block') {
121
- return this.buildStepResult(step, assignment, stepStartedAt, stepStartMs, 'failed', undefined, `Step blocked by policy: ${riskResult.policyDecision.reason}`);
122
- }
123
- // Execute the step
124
- if (this.stepExecutor) {
125
- try {
126
- const execResult = await this.executeWithTimeout(this.stepExecutor(step, assignment), this.maxStepTimeoutS * 1000);
127
- if (!execResult.success && this.protocol.canRetry(step.id)) {
128
- this.protocol.recordRetry(step.id);
129
- const retryResult = await this.executeWithTimeout(this.stepExecutor(step, assignment), this.maxStepTimeoutS * 1000);
130
- return this.buildStepResult(step, assignment, stepStartedAt, stepStartMs, retryResult.success ? 'completed' : 'failed', retryResult.output, retryResult.error);
131
- }
132
- return this.buildStepResult(step, assignment, stepStartedAt, stepStartMs, execResult.success ? 'completed' : 'failed', execResult.output, execResult.error);
133
- }
134
- catch (err) {
135
- return this.buildStepResult(step, assignment, stepStartedAt, stepStartMs, 'failed', undefined, err instanceof Error ? err.message : String(err));
136
- }
137
- }
138
- // No executor: mark as completed (dry-run)
139
- return this.buildStepResult(step, assignment, stepStartedAt, stepStartMs, 'completed', 'dry-run');
140
- }
141
- buildSuggestResult(task, mode, startedAt, startMs) {
142
- const completedAt = new Date().toISOString();
143
- return {
144
- taskId: task.id,
145
- mode,
146
- status: 'suggested',
147
- stepResults: task.steps.map((step) => ({
148
- stepId: step.id,
149
- status: 'pending',
150
- agentName: this.protocol.assignAgent(step).agentName,
151
- startedAt,
152
- completedAt,
153
- durationMs: 0,
154
- })),
155
- totalDurationMs: Date.now() - startMs,
156
- startedAt,
157
- completedAt,
158
- };
159
- }
160
- buildStepResult(step, assignment, startedAt, startMs, status, output, error) {
161
- const completedAt = new Date().toISOString();
162
- this.emitStepEvent({ id: step.id }, step, assignment, status === 'completed' ? 'completed' : 'failed');
163
- return {
164
- stepId: step.id,
165
- status,
166
- agentName: assignment.agentName,
167
- output,
168
- error,
169
- startedAt,
170
- completedAt,
171
- durationMs: Date.now() - startMs,
172
- };
173
- }
174
- emitStepEvent(task, step, assignment, status) {
175
- try {
176
- this.eventBus.emit('action_executed', {
177
- eventType: 'step_execution',
178
- sourceAgentId: assignment.agentName,
179
- payload: {
180
- taskId: task.id,
181
- stepId: step.id,
182
- stepType: step.type,
183
- status,
184
- agentName: assignment.agentName,
185
- },
186
- });
187
- }
188
- catch {
189
- // Non-critical
190
- }
191
- }
192
- stepTypeToActionType(type) {
193
- switch (type) {
194
- case 'implement': return 'file_write';
195
- case 'test': return 'bash_exec';
196
- case 'deploy': return 'bash_exec';
197
- default: return 'skill_generate';
198
- }
199
- }
200
- async executeWithTimeout(promise, timeoutMs) {
201
- return new Promise((resolve, reject) => {
202
- const timer = setTimeout(() => {
203
- reject(new Error(`Step execution timed out after ${timeoutMs / 1000}s`));
204
- }, timeoutMs);
205
- promise
206
- .then((result) => { clearTimeout(timer); resolve(result); })
207
- .catch((err) => { clearTimeout(timer); reject(err); });
208
- });
209
- }
210
- initProgress(task) {
211
- this.progress.set(task.id, {
212
- taskId: task.id,
213
- totalSteps: task.steps.length,
214
- completedSteps: 0,
215
- currentStep: null,
216
- percentComplete: 0,
217
- status: 'running',
218
- });
219
- }
220
- updateProgress(taskId, step, status) {
221
- const p = this.progress.get(taskId);
222
- if (!p)
223
- return;
224
- if (status === 'in_progress') {
225
- p.currentStep = step.id;
226
- }
227
- else if (status === 'completed') {
228
- p.completedSteps++;
229
- p.percentComplete = Math.round((p.completedSteps / p.totalSteps) * 100);
230
- }
231
- else if (status === 'failed') {
232
- p.status = 'failed';
233
- }
234
- }
235
- finalizeProgress(taskId, status) {
236
- const p = this.progress.get(taskId);
237
- if (!p)
238
- return;
239
- p.status = status;
240
- p.currentStep = null;
241
- if (status === 'completed') {
242
- p.percentComplete = 100;
243
- }
244
- }
245
- }
246
- //# sourceMappingURL=AutonomyOrchestrator.js.map