@su-record/vibe 2.16.4 → 3.1.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 (607) hide show
  1. package/CLAUDE.md +8 -8
  2. package/README.en.md +46 -29
  3. package/README.md +41 -24
  4. package/agents/acceptance-tester.md +56 -0
  5. package/agents/architect.md +25 -67
  6. package/agents/build-error-resolver.md +28 -97
  7. package/agents/code-reviewer.md +89 -0
  8. package/agents/diagrammer.md +34 -169
  9. package/agents/documenter.md +43 -0
  10. package/agents/e2e-tester.md +46 -281
  11. package/agents/event/event-ops.md +54 -77
  12. package/agents/event/event-planner.md +63 -0
  13. package/agents/figma/figma-engineer.md +76 -0
  14. package/agents/implementer.md +26 -41
  15. package/agents/security-reviewer.md +56 -0
  16. package/agents/tester.md +37 -33
  17. package/agents/ui/design-reviewer.md +62 -0
  18. package/agents/ui/design-system-gen.md +63 -0
  19. package/dist/cli/commands/remove.d.ts.map +1 -1
  20. package/dist/cli/commands/remove.js +8 -10
  21. package/dist/cli/commands/remove.js.map +1 -1
  22. package/dist/cli/index.d.ts +0 -4
  23. package/dist/cli/index.d.ts.map +1 -1
  24. package/dist/cli/index.js +0 -4
  25. package/dist/cli/index.js.map +1 -1
  26. package/dist/cli/llm/model-refresh.js +1 -1
  27. package/dist/cli/llm/model-refresh.js.map +1 -1
  28. package/dist/cli/postinstall/claude-agents.d.ts.map +1 -1
  29. package/dist/cli/postinstall/claude-agents.js +16 -77
  30. package/dist/cli/postinstall/claude-agents.js.map +1 -1
  31. package/dist/cli/postinstall/constants.d.ts.map +1 -1
  32. package/dist/cli/postinstall/constants.js +80 -296
  33. package/dist/cli/postinstall/constants.js.map +1 -1
  34. package/dist/cli/postinstall/cursor-agents.d.ts +5 -0
  35. package/dist/cli/postinstall/cursor-agents.d.ts.map +1 -1
  36. package/dist/cli/postinstall/cursor-agents.js +26 -68
  37. package/dist/cli/postinstall/cursor-agents.js.map +1 -1
  38. package/dist/cli/postinstall/cursor-skills.d.ts.map +1 -1
  39. package/dist/cli/postinstall/cursor-skills.js +26 -30
  40. package/dist/cli/postinstall/cursor-skills.js.map +1 -1
  41. package/dist/cli/postinstall/main.d.ts.map +1 -1
  42. package/dist/cli/postinstall/main.js +0 -2
  43. package/dist/cli/postinstall/main.js.map +1 -1
  44. package/dist/cli/setup/Provisioner.d.ts.map +1 -1
  45. package/dist/cli/setup/Provisioner.js +19 -21
  46. package/dist/cli/setup/Provisioner.js.map +1 -1
  47. package/dist/cli/utils.d.ts +4 -1
  48. package/dist/cli/utils.d.ts.map +1 -1
  49. package/dist/cli/utils.js +4 -1
  50. package/dist/cli/utils.js.map +1 -1
  51. package/dist/infra/lib/FrameworkDetector.js +4 -4
  52. package/dist/infra/lib/FrameworkDetector.js.map +1 -1
  53. package/dist/infra/lib/OrchestrateWorkflow.js +2 -2
  54. package/dist/infra/lib/OrchestrateWorkflow.js.map +1 -1
  55. package/dist/infra/lib/browser/launch.js +1 -1
  56. package/dist/infra/lib/browser/launch.js.map +1 -1
  57. package/dist/infra/lib/browser/types.d.ts +1 -1
  58. package/dist/infra/lib/browser/types.js +1 -1
  59. package/dist/infra/lib/constants.d.ts +1 -1
  60. package/dist/infra/lib/constants.d.ts.map +1 -1
  61. package/dist/infra/lib/constants.js +4 -5
  62. package/dist/infra/lib/constants.js.map +1 -1
  63. package/dist/infra/lib/evolution/__tests__/integration.test.js +7 -7
  64. package/dist/infra/lib/evolution/__tests__/integration.test.js.map +1 -1
  65. package/dist/infra/lib/memory/index.d.ts +0 -2
  66. package/dist/infra/lib/memory/index.d.ts.map +1 -1
  67. package/dist/infra/lib/memory/index.js +0 -2
  68. package/dist/infra/lib/memory/index.js.map +1 -1
  69. package/dist/infra/lib/telemetry/SkillTelemetry.test.js +1 -1
  70. package/dist/infra/lib/telemetry/SkillTelemetry.test.js.map +1 -1
  71. package/dist/tools/index.d.ts +0 -4
  72. package/dist/tools/index.d.ts.map +1 -1
  73. package/dist/tools/index.js +0 -4
  74. package/dist/tools/index.js.map +1 -1
  75. package/dist/tools/memory/autoSaveContext.d.ts +0 -1
  76. package/dist/tools/memory/autoSaveContext.d.ts.map +1 -1
  77. package/dist/tools/memory/autoSaveContext.js +13 -27
  78. package/dist/tools/memory/autoSaveContext.js.map +1 -1
  79. package/hooks/scripts/__tests__/.vibe/command-log.txt +3 -78
  80. package/hooks/scripts/__tests__/.vibe/memories/memories.db +0 -0
  81. package/hooks/scripts/__tests__/.vibe/memories/memories.db-shm +0 -0
  82. package/hooks/scripts/__tests__/.vibe/memories/memories.db-wal +0 -0
  83. package/hooks/scripts/__tests__/clone-behaviors.test.js +64 -0
  84. package/hooks/scripts/__tests__/clone-merge-responsive.test.js +106 -0
  85. package/hooks/scripts/__tests__/code-check-detectors.test.js +2 -2
  86. package/hooks/scripts/__tests__/run-ledger.test.js +1 -1
  87. package/hooks/scripts/__tests__/scope-from-spec.test.js +12 -12
  88. package/hooks/scripts/__tests__/step-counter.test.js +1 -1
  89. package/hooks/scripts/clone-extract.js +242 -28
  90. package/hooks/scripts/clone-merge-responsive.js +184 -0
  91. package/hooks/scripts/clone-spec.js +33 -8
  92. package/hooks/scripts/clone-validate.js +15 -9
  93. package/hooks/scripts/code-check.js +16 -203
  94. package/hooks/scripts/context-save.js +0 -11
  95. package/hooks/scripts/lib/scope-from-spec.js +9 -6
  96. package/hooks/scripts/post-edit-dispatcher.js +1 -1
  97. package/hooks/scripts/prompt-dispatcher.js +7 -18
  98. package/hooks/scripts/session-start.js +25 -35
  99. package/package.json +6 -5
  100. package/skills/agents-md/SKILL.md +62 -15
  101. package/skills/arch-guard/SKILL.md +1 -1
  102. package/skills/brand-assets/SKILL.md +2 -2
  103. package/skills/capability-loop/SKILL.md +1 -1
  104. package/skills/chub-usage/SKILL.md +1 -1
  105. package/skills/clone/SKILL.md +132 -55
  106. package/skills/commerce-patterns/SKILL.md +2 -2
  107. package/skills/commit-push-pr/SKILL.md +0 -1
  108. package/skills/context7-usage/SKILL.md +1 -1
  109. package/skills/design-refine/SKILL.md +140 -0
  110. package/skills/{design-polish → design-refine}/templates/polish-report.md +1 -1
  111. package/skills/{design-normalize → design-refine}/templates/token-audit.md +3 -3
  112. package/skills/design-review/SKILL.md +143 -0
  113. package/skills/{design-audit → design-review}/agents/a11y-auditor.md +1 -1
  114. package/skills/{design-audit → design-review}/agents/performance-auditor.md +1 -1
  115. package/skills/{design-audit → design-review}/agents/responsive-auditor.md +1 -1
  116. package/skills/{design-audit → design-review}/agents/slop-detector.md +1 -1
  117. package/skills/{design-audit → design-review}/frameworks/core-web-vitals.md +1 -1
  118. package/skills/{design-audit → design-review}/frameworks/wcag-checklist.md +1 -1
  119. package/skills/{design-audit → design-review}/orchestrator.md +3 -3
  120. package/skills/{design-critique → design-review}/templates/critique-report.md +3 -3
  121. package/skills/{design-audit → design-review}/templates/report.md +3 -3
  122. package/skills/design-teach/SKILL.md +11 -11
  123. package/skills/docs/SKILL.md +14 -16
  124. package/skills/e2e-commerce/SKILL.md +1 -1
  125. package/skills/event-comms/SKILL.md +1 -1
  126. package/skills/event-ops/SKILL.md +2 -2
  127. package/skills/event-planning/SKILL.md +1 -1
  128. package/skills/exec-plan/SKILL.md +2 -2
  129. package/skills/figma/SKILL.md +240 -148
  130. package/skills/figma/rubrics/css-mapping.md +125 -0
  131. package/skills/git-worktree/SKILL.md +1 -1
  132. package/skills/handoff/SKILL.md +1 -1
  133. package/skills/parallel-research/SKILL.md +14 -28
  134. package/skills/priority-todos/SKILL.md +1 -1
  135. package/skills/regress/SKILL.md +11 -0
  136. package/skills/restraint/SKILL.md +72 -0
  137. package/skills/seo-checklist/SKILL.md +2 -2
  138. package/skills/spec/SKILL.md +65 -836
  139. package/skills/test/SKILL.md +3 -3
  140. package/skills/tool-fallback/SKILL.md +2 -2
  141. package/skills/vercel-react-best-practices/SKILL.md +1 -1
  142. package/skills/vibe/SKILL.md +20 -35
  143. package/skills/vibe.analyze/SKILL.md +7 -9
  144. package/skills/vibe.clone/SKILL.md +39 -19
  145. package/skills/vibe.docs/SKILL.md +1 -1
  146. package/skills/vibe.event/SKILL.md +27 -27
  147. package/skills/vibe.figma/SKILL.md +14 -18
  148. package/skills/vibe.harness/SKILL.md +5 -5
  149. package/skills/vibe.reason/SKILL.md +0 -2
  150. package/skills/vibe.review/SKILL.md +45 -49
  151. package/skills/vibe.run/SKILL.md +2 -5
  152. package/skills/vibe.run/references/parallel-agents.md +33 -98
  153. package/skills/vibe.spec/SKILL.md +38 -535
  154. package/skills/vibe.utils/SKILL.md +3 -3
  155. package/skills/vibe.verify/SKILL.md +70 -542
  156. package/skills/video-production/SKILL.md +1 -1
  157. package/vibe/rules/orchestrator-contract.md +5 -4
  158. package/vibe/rules/quality/performance.md +1 -1
  159. package/vibe/templates/claudemd-template.md +1 -1
  160. package/vibe/templates/spec-template.md +35 -185
  161. package/agents/architect-low.md +0 -41
  162. package/agents/architect-medium.md +0 -59
  163. package/agents/compounder.md +0 -265
  164. package/agents/docs/api-documenter.md +0 -99
  165. package/agents/docs/changelog-writer.md +0 -93
  166. package/agents/event/event-comms.md +0 -78
  167. package/agents/event/event-content.md +0 -68
  168. package/agents/event/event-image.md +0 -95
  169. package/agents/event/event-scheduler.md +0 -69
  170. package/agents/event/event-speaker.md +0 -86
  171. package/agents/explorer-low.md +0 -42
  172. package/agents/explorer-medium.md +0 -59
  173. package/agents/explorer.md +0 -48
  174. package/agents/figma/figma-analyst.md +0 -56
  175. package/agents/figma/figma-architect.md +0 -116
  176. package/agents/figma/figma-auditor.md +0 -86
  177. package/agents/figma/figma-builder.md +0 -104
  178. package/agents/implementer-low.md +0 -43
  179. package/agents/implementer-medium.md +0 -52
  180. package/agents/junior-mentor.md +0 -141
  181. package/agents/planning/requirements-analyst.md +0 -84
  182. package/agents/planning/ux-advisor.md +0 -83
  183. package/agents/qa/acceptance-tester.md +0 -86
  184. package/agents/qa/edge-case-finder.md +0 -93
  185. package/agents/qa/qa-coordinator.md +0 -131
  186. package/agents/refactor-cleaner.md +0 -143
  187. package/agents/research/best-practices.md +0 -199
  188. package/agents/research/codebase-patterns.md +0 -157
  189. package/agents/research/framework-docs.md +0 -188
  190. package/agents/research/security-advisory.md +0 -213
  191. package/agents/review/architecture-reviewer.md +0 -107
  192. package/agents/review/complexity-reviewer.md +0 -116
  193. package/agents/review/data-integrity-reviewer.md +0 -88
  194. package/agents/review/git-history-reviewer.md +0 -103
  195. package/agents/review/performance-reviewer.md +0 -86
  196. package/agents/review/python-reviewer.md +0 -150
  197. package/agents/review/rails-reviewer.md +0 -139
  198. package/agents/review/react-reviewer.md +0 -144
  199. package/agents/review/security-reviewer.md +0 -80
  200. package/agents/review/simplicity-reviewer.md +0 -140
  201. package/agents/review/test-coverage-reviewer.md +0 -116
  202. package/agents/review/typescript-reviewer.md +0 -127
  203. package/agents/searcher.md +0 -54
  204. package/agents/simplifier.md +0 -124
  205. package/agents/teams/debug-team.md +0 -74
  206. package/agents/teams/dev-team.md +0 -92
  207. package/agents/teams/docs-team.md +0 -84
  208. package/agents/teams/figma-team.md +0 -89
  209. package/agents/teams/fullstack-team.md +0 -87
  210. package/agents/teams/lite-team.md +0 -73
  211. package/agents/teams/migration-team.md +0 -82
  212. package/agents/teams/refactor-team.md +0 -98
  213. package/agents/teams/research-team.md +0 -90
  214. package/agents/teams/review-debate-team.md +0 -129
  215. package/agents/teams/security-team.md +0 -85
  216. package/agents/ui/ui-a11y-auditor.md +0 -93
  217. package/agents/ui/ui-antipattern-detector.md +0 -102
  218. package/agents/ui/ui-dataviz-advisor.md +0 -69
  219. package/agents/ui/ui-design-system-gen.md +0 -57
  220. package/agents/ui/ui-industry-analyzer.md +0 -49
  221. package/agents/ui/ui-layout-architect.md +0 -65
  222. package/agents/ui/ui-stack-implementer.md +0 -68
  223. package/agents/ui/ux-compliance-reviewer.md +0 -81
  224. package/agents/ui-previewer.md +0 -262
  225. package/dist/cli/llm/gemini-commands.d.ts +0 -25
  226. package/dist/cli/llm/gemini-commands.d.ts.map +0 -1
  227. package/dist/cli/llm/gemini-commands.js +0 -143
  228. package/dist/cli/llm/gemini-commands.js.map +0 -1
  229. package/dist/cli/postinstall/codex-agents.d.ts +0 -24
  230. package/dist/cli/postinstall/codex-agents.d.ts.map +0 -1
  231. package/dist/cli/postinstall/codex-agents.js +0 -114
  232. package/dist/cli/postinstall/codex-agents.js.map +0 -1
  233. package/dist/cli/postinstall/codex-instruction.d.ts +0 -10
  234. package/dist/cli/postinstall/codex-instruction.d.ts.map +0 -1
  235. package/dist/cli/postinstall/codex-instruction.js +0 -56
  236. package/dist/cli/postinstall/codex-instruction.js.map +0 -1
  237. package/dist/cli/postinstall/gemini-agents.d.ts +0 -12
  238. package/dist/cli/postinstall/gemini-agents.d.ts.map +0 -1
  239. package/dist/cli/postinstall/gemini-agents.js +0 -80
  240. package/dist/cli/postinstall/gemini-agents.js.map +0 -1
  241. package/dist/cli/postinstall/gemini-instruction.d.ts +0 -10
  242. package/dist/cli/postinstall/gemini-instruction.d.ts.map +0 -1
  243. package/dist/cli/postinstall/gemini-instruction.js +0 -59
  244. package/dist/cli/postinstall/gemini-instruction.js.map +0 -1
  245. package/dist/infra/lib/ContextCompressor.d.ts +0 -104
  246. package/dist/infra/lib/ContextCompressor.d.ts.map +0 -1
  247. package/dist/infra/lib/ContextCompressor.js +0 -297
  248. package/dist/infra/lib/ContextCompressor.js.map +0 -1
  249. package/dist/infra/lib/ContextCompressor.test.d.ts +0 -2
  250. package/dist/infra/lib/ContextCompressor.test.d.ts.map +0 -1
  251. package/dist/infra/lib/ContextCompressor.test.js +0 -25
  252. package/dist/infra/lib/ContextCompressor.test.js.map +0 -1
  253. package/dist/infra/lib/ProgressTracker.d.ts +0 -73
  254. package/dist/infra/lib/ProgressTracker.d.ts.map +0 -1
  255. package/dist/infra/lib/ProgressTracker.js +0 -267
  256. package/dist/infra/lib/ProgressTracker.js.map +0 -1
  257. package/dist/infra/lib/TokenBudgetTracker.d.ts +0 -68
  258. package/dist/infra/lib/TokenBudgetTracker.d.ts.map +0 -1
  259. package/dist/infra/lib/TokenBudgetTracker.js +0 -191
  260. package/dist/infra/lib/TokenBudgetTracker.js.map +0 -1
  261. package/dist/infra/lib/autonomy/AuditStore.d.ts +0 -63
  262. package/dist/infra/lib/autonomy/AuditStore.d.ts.map +0 -1
  263. package/dist/infra/lib/autonomy/AuditStore.js +0 -185
  264. package/dist/infra/lib/autonomy/AuditStore.js.map +0 -1
  265. package/dist/infra/lib/autonomy/AutonomyConfig.d.ts +0 -84
  266. package/dist/infra/lib/autonomy/AutonomyConfig.d.ts.map +0 -1
  267. package/dist/infra/lib/autonomy/AutonomyConfig.js +0 -49
  268. package/dist/infra/lib/autonomy/AutonomyConfig.js.map +0 -1
  269. package/dist/infra/lib/autonomy/AutonomyOrchestrator.d.ts +0 -78
  270. package/dist/infra/lib/autonomy/AutonomyOrchestrator.d.ts.map +0 -1
  271. package/dist/infra/lib/autonomy/AutonomyOrchestrator.js +0 -246
  272. package/dist/infra/lib/autonomy/AutonomyOrchestrator.js.map +0 -1
  273. package/dist/infra/lib/autonomy/BackgroundMonitor.d.ts +0 -36
  274. package/dist/infra/lib/autonomy/BackgroundMonitor.d.ts.map +0 -1
  275. package/dist/infra/lib/autonomy/BackgroundMonitor.js +0 -138
  276. package/dist/infra/lib/autonomy/BackgroundMonitor.js.map +0 -1
  277. package/dist/infra/lib/autonomy/CollaborationProtocol.d.ts +0 -56
  278. package/dist/infra/lib/autonomy/CollaborationProtocol.d.ts.map +0 -1
  279. package/dist/infra/lib/autonomy/CollaborationProtocol.js +0 -122
  280. package/dist/infra/lib/autonomy/CollaborationProtocol.js.map +0 -1
  281. package/dist/infra/lib/autonomy/ConfirmationManager.d.ts +0 -42
  282. package/dist/infra/lib/autonomy/ConfirmationManager.d.ts.map +0 -1
  283. package/dist/infra/lib/autonomy/ConfirmationManager.js +0 -200
  284. package/dist/infra/lib/autonomy/ConfirmationManager.js.map +0 -1
  285. package/dist/infra/lib/autonomy/ConfirmationStore.d.ts +0 -55
  286. package/dist/infra/lib/autonomy/ConfirmationStore.d.ts.map +0 -1
  287. package/dist/infra/lib/autonomy/ConfirmationStore.js +0 -130
  288. package/dist/infra/lib/autonomy/ConfirmationStore.js.map +0 -1
  289. package/dist/infra/lib/autonomy/EventBus.d.ts +0 -20
  290. package/dist/infra/lib/autonomy/EventBus.d.ts.map +0 -1
  291. package/dist/infra/lib/autonomy/EventBus.js +0 -119
  292. package/dist/infra/lib/autonomy/EventBus.js.map +0 -1
  293. package/dist/infra/lib/autonomy/EventOutbox.d.ts +0 -32
  294. package/dist/infra/lib/autonomy/EventOutbox.d.ts.map +0 -1
  295. package/dist/infra/lib/autonomy/EventOutbox.js +0 -152
  296. package/dist/infra/lib/autonomy/EventOutbox.js.map +0 -1
  297. package/dist/infra/lib/autonomy/NotificationDispatcher.d.ts +0 -24
  298. package/dist/infra/lib/autonomy/NotificationDispatcher.d.ts.map +0 -1
  299. package/dist/infra/lib/autonomy/NotificationDispatcher.js +0 -112
  300. package/dist/infra/lib/autonomy/NotificationDispatcher.js.map +0 -1
  301. package/dist/infra/lib/autonomy/PolicyEngine.d.ts +0 -76
  302. package/dist/infra/lib/autonomy/PolicyEngine.d.ts.map +0 -1
  303. package/dist/infra/lib/autonomy/PolicyEngine.js +0 -208
  304. package/dist/infra/lib/autonomy/PolicyEngine.js.map +0 -1
  305. package/dist/infra/lib/autonomy/ProactiveAnalyzer.d.ts +0 -61
  306. package/dist/infra/lib/autonomy/ProactiveAnalyzer.d.ts.map +0 -1
  307. package/dist/infra/lib/autonomy/ProactiveAnalyzer.js +0 -236
  308. package/dist/infra/lib/autonomy/ProactiveAnalyzer.js.map +0 -1
  309. package/dist/infra/lib/autonomy/RiskClassifier.d.ts +0 -35
  310. package/dist/infra/lib/autonomy/RiskClassifier.d.ts.map +0 -1
  311. package/dist/infra/lib/autonomy/RiskClassifier.js +0 -147
  312. package/dist/infra/lib/autonomy/RiskClassifier.js.map +0 -1
  313. package/dist/infra/lib/autonomy/SecuritySentinel.d.ts +0 -51
  314. package/dist/infra/lib/autonomy/SecuritySentinel.d.ts.map +0 -1
  315. package/dist/infra/lib/autonomy/SecuritySentinel.js +0 -162
  316. package/dist/infra/lib/autonomy/SecuritySentinel.js.map +0 -1
  317. package/dist/infra/lib/autonomy/SuggestionStore.d.ts +0 -54
  318. package/dist/infra/lib/autonomy/SuggestionStore.d.ts.map +0 -1
  319. package/dist/infra/lib/autonomy/SuggestionStore.js +0 -144
  320. package/dist/infra/lib/autonomy/SuggestionStore.js.map +0 -1
  321. package/dist/infra/lib/autonomy/TaskDecomposer.d.ts +0 -38
  322. package/dist/infra/lib/autonomy/TaskDecomposer.d.ts.map +0 -1
  323. package/dist/infra/lib/autonomy/TaskDecomposer.js +0 -175
  324. package/dist/infra/lib/autonomy/TaskDecomposer.js.map +0 -1
  325. package/dist/infra/lib/autonomy/__tests__/audit-store.test.d.ts +0 -2
  326. package/dist/infra/lib/autonomy/__tests__/audit-store.test.d.ts.map +0 -1
  327. package/dist/infra/lib/autonomy/__tests__/audit-store.test.js +0 -198
  328. package/dist/infra/lib/autonomy/__tests__/audit-store.test.js.map +0 -1
  329. package/dist/infra/lib/autonomy/__tests__/event-bus.test.d.ts +0 -2
  330. package/dist/infra/lib/autonomy/__tests__/event-bus.test.d.ts.map +0 -1
  331. package/dist/infra/lib/autonomy/__tests__/event-bus.test.js +0 -225
  332. package/dist/infra/lib/autonomy/__tests__/event-bus.test.js.map +0 -1
  333. package/dist/infra/lib/autonomy/__tests__/event-core.test.d.ts +0 -2
  334. package/dist/infra/lib/autonomy/__tests__/event-core.test.d.ts.map +0 -1
  335. package/dist/infra/lib/autonomy/__tests__/event-core.test.js +0 -194
  336. package/dist/infra/lib/autonomy/__tests__/event-core.test.js.map +0 -1
  337. package/dist/infra/lib/autonomy/__tests__/governance.test.d.ts +0 -2
  338. package/dist/infra/lib/autonomy/__tests__/governance.test.d.ts.map +0 -1
  339. package/dist/infra/lib/autonomy/__tests__/governance.test.js +0 -540
  340. package/dist/infra/lib/autonomy/__tests__/governance.test.js.map +0 -1
  341. package/dist/infra/lib/autonomy/__tests__/integration.test.d.ts +0 -2
  342. package/dist/infra/lib/autonomy/__tests__/integration.test.d.ts.map +0 -1
  343. package/dist/infra/lib/autonomy/__tests__/integration.test.js +0 -480
  344. package/dist/infra/lib/autonomy/__tests__/integration.test.js.map +0 -1
  345. package/dist/infra/lib/autonomy/__tests__/proactive.test.d.ts +0 -2
  346. package/dist/infra/lib/autonomy/__tests__/proactive.test.d.ts.map +0 -1
  347. package/dist/infra/lib/autonomy/__tests__/proactive.test.js +0 -410
  348. package/dist/infra/lib/autonomy/__tests__/proactive.test.js.map +0 -1
  349. package/dist/infra/lib/autonomy/__tests__/sentinel.test.d.ts +0 -2
  350. package/dist/infra/lib/autonomy/__tests__/sentinel.test.d.ts.map +0 -1
  351. package/dist/infra/lib/autonomy/__tests__/sentinel.test.js +0 -486
  352. package/dist/infra/lib/autonomy/__tests__/sentinel.test.js.map +0 -1
  353. package/dist/infra/lib/autonomy/index.d.ts +0 -18
  354. package/dist/infra/lib/autonomy/index.d.ts.map +0 -1
  355. package/dist/infra/lib/autonomy/index.js +0 -22
  356. package/dist/infra/lib/autonomy/index.js.map +0 -1
  357. package/dist/infra/lib/autonomy/schemas.d.ts +0 -317
  358. package/dist/infra/lib/autonomy/schemas.d.ts.map +0 -1
  359. package/dist/infra/lib/autonomy/schemas.js +0 -90
  360. package/dist/infra/lib/autonomy/schemas.js.map +0 -1
  361. package/dist/infra/lib/claude/index.d.ts +0 -5
  362. package/dist/infra/lib/claude/index.d.ts.map +0 -1
  363. package/dist/infra/lib/claude/index.js +0 -5
  364. package/dist/infra/lib/claude/index.js.map +0 -1
  365. package/dist/infra/lib/claude/storage.d.ts +0 -12
  366. package/dist/infra/lib/claude/storage.d.ts.map +0 -1
  367. package/dist/infra/lib/claude/storage.js +0 -54
  368. package/dist/infra/lib/claude/storage.js.map +0 -1
  369. package/dist/infra/lib/gemini/auth.d.ts +0 -18
  370. package/dist/infra/lib/gemini/auth.d.ts.map +0 -1
  371. package/dist/infra/lib/gemini/auth.js +0 -32
  372. package/dist/infra/lib/gemini/auth.js.map +0 -1
  373. package/dist/infra/lib/gemini/capabilities.d.ts +0 -28
  374. package/dist/infra/lib/gemini/capabilities.d.ts.map +0 -1
  375. package/dist/infra/lib/gemini/capabilities.js +0 -178
  376. package/dist/infra/lib/gemini/capabilities.js.map +0 -1
  377. package/dist/infra/lib/gemini/chat.d.ts +0 -35
  378. package/dist/infra/lib/gemini/chat.d.ts.map +0 -1
  379. package/dist/infra/lib/gemini/chat.js +0 -161
  380. package/dist/infra/lib/gemini/chat.js.map +0 -1
  381. package/dist/infra/lib/gemini/completion.d.ts +0 -12
  382. package/dist/infra/lib/gemini/completion.d.ts.map +0 -1
  383. package/dist/infra/lib/gemini/completion.js +0 -13
  384. package/dist/infra/lib/gemini/completion.js.map +0 -1
  385. package/dist/infra/lib/gemini/constants.d.ts +0 -8
  386. package/dist/infra/lib/gemini/constants.d.ts.map +0 -1
  387. package/dist/infra/lib/gemini/constants.js +0 -11
  388. package/dist/infra/lib/gemini/constants.js.map +0 -1
  389. package/dist/infra/lib/gemini/index.d.ts +0 -13
  390. package/dist/infra/lib/gemini/index.d.ts.map +0 -1
  391. package/dist/infra/lib/gemini/index.js +0 -12
  392. package/dist/infra/lib/gemini/index.js.map +0 -1
  393. package/dist/infra/lib/gemini/models.d.ts +0 -11
  394. package/dist/infra/lib/gemini/models.d.ts.map +0 -1
  395. package/dist/infra/lib/gemini/models.js +0 -38
  396. package/dist/infra/lib/gemini/models.js.map +0 -1
  397. package/dist/infra/lib/gemini/orchestration.d.ts +0 -33
  398. package/dist/infra/lib/gemini/orchestration.d.ts.map +0 -1
  399. package/dist/infra/lib/gemini/orchestration.js +0 -62
  400. package/dist/infra/lib/gemini/orchestration.js.map +0 -1
  401. package/dist/infra/lib/gemini/types.d.ts +0 -115
  402. package/dist/infra/lib/gemini/types.d.ts.map +0 -1
  403. package/dist/infra/lib/gemini/types.js +0 -5
  404. package/dist/infra/lib/gemini/types.js.map +0 -1
  405. package/dist/infra/orchestrator/AgentAnnouncer.d.ts +0 -64
  406. package/dist/infra/orchestrator/AgentAnnouncer.d.ts.map +0 -1
  407. package/dist/infra/orchestrator/AgentAnnouncer.js +0 -127
  408. package/dist/infra/orchestrator/AgentAnnouncer.js.map +0 -1
  409. package/dist/infra/orchestrator/AgentAnnouncer.test.d.ts +0 -5
  410. package/dist/infra/orchestrator/AgentAnnouncer.test.d.ts.map +0 -1
  411. package/dist/infra/orchestrator/AgentAnnouncer.test.js +0 -119
  412. package/dist/infra/orchestrator/AgentAnnouncer.test.js.map +0 -1
  413. package/dist/infra/orchestrator/AgentExecutor.d.ts +0 -22
  414. package/dist/infra/orchestrator/AgentExecutor.d.ts.map +0 -1
  415. package/dist/infra/orchestrator/AgentExecutor.js +0 -272
  416. package/dist/infra/orchestrator/AgentExecutor.js.map +0 -1
  417. package/dist/infra/orchestrator/AgentManager.d.ts +0 -72
  418. package/dist/infra/orchestrator/AgentManager.d.ts.map +0 -1
  419. package/dist/infra/orchestrator/AgentManager.js +0 -183
  420. package/dist/infra/orchestrator/AgentManager.js.map +0 -1
  421. package/dist/infra/orchestrator/AgentManifestCache.d.ts +0 -54
  422. package/dist/infra/orchestrator/AgentManifestCache.d.ts.map +0 -1
  423. package/dist/infra/orchestrator/AgentManifestCache.js +0 -191
  424. package/dist/infra/orchestrator/AgentManifestCache.js.map +0 -1
  425. package/dist/infra/orchestrator/AgentRegistry.d.ts +0 -76
  426. package/dist/infra/orchestrator/AgentRegistry.d.ts.map +0 -1
  427. package/dist/infra/orchestrator/AgentRegistry.js +0 -217
  428. package/dist/infra/orchestrator/AgentRegistry.js.map +0 -1
  429. package/dist/infra/orchestrator/AgentRegistry.test.d.ts +0 -5
  430. package/dist/infra/orchestrator/AgentRegistry.test.d.ts.map +0 -1
  431. package/dist/infra/orchestrator/AgentRegistry.test.js +0 -122
  432. package/dist/infra/orchestrator/AgentRegistry.test.js.map +0 -1
  433. package/dist/infra/orchestrator/BackgroundManager.d.ts +0 -128
  434. package/dist/infra/orchestrator/BackgroundManager.d.ts.map +0 -1
  435. package/dist/infra/orchestrator/BackgroundManager.js +0 -620
  436. package/dist/infra/orchestrator/BackgroundManager.js.map +0 -1
  437. package/dist/infra/orchestrator/BackgroundManager.test.d.ts +0 -6
  438. package/dist/infra/orchestrator/BackgroundManager.test.d.ts.map +0 -1
  439. package/dist/infra/orchestrator/BackgroundManager.test.js +0 -162
  440. package/dist/infra/orchestrator/BackgroundManager.test.js.map +0 -1
  441. package/dist/infra/orchestrator/CheckpointManager.d.ts +0 -54
  442. package/dist/infra/orchestrator/CheckpointManager.d.ts.map +0 -1
  443. package/dist/infra/orchestrator/CheckpointManager.js +0 -121
  444. package/dist/infra/orchestrator/CheckpointManager.js.map +0 -1
  445. package/dist/infra/orchestrator/CodexAgentRuntime.d.ts +0 -12
  446. package/dist/infra/orchestrator/CodexAgentRuntime.d.ts.map +0 -1
  447. package/dist/infra/orchestrator/CodexAgentRuntime.js +0 -94
  448. package/dist/infra/orchestrator/CodexAgentRuntime.js.map +0 -1
  449. package/dist/infra/orchestrator/CodexAgentRuntime.test.d.ts +0 -2
  450. package/dist/infra/orchestrator/CodexAgentRuntime.test.d.ts.map +0 -1
  451. package/dist/infra/orchestrator/CodexAgentRuntime.test.js +0 -37
  452. package/dist/infra/orchestrator/CodexAgentRuntime.test.js.map +0 -1
  453. package/dist/infra/orchestrator/LLMCluster.d.ts +0 -82
  454. package/dist/infra/orchestrator/LLMCluster.d.ts.map +0 -1
  455. package/dist/infra/orchestrator/LLMCluster.js +0 -146
  456. package/dist/infra/orchestrator/LLMCluster.js.map +0 -1
  457. package/dist/infra/orchestrator/MultiLlmResearch.d.ts +0 -31
  458. package/dist/infra/orchestrator/MultiLlmResearch.d.ts.map +0 -1
  459. package/dist/infra/orchestrator/MultiLlmResearch.js +0 -160
  460. package/dist/infra/orchestrator/MultiLlmResearch.js.map +0 -1
  461. package/dist/infra/orchestrator/PhasePipeline.d.ts +0 -122
  462. package/dist/infra/orchestrator/PhasePipeline.d.ts.map +0 -1
  463. package/dist/infra/orchestrator/PhasePipeline.js +0 -385
  464. package/dist/infra/orchestrator/PhasePipeline.js.map +0 -1
  465. package/dist/infra/orchestrator/PhaseResultStore.d.ts +0 -39
  466. package/dist/infra/orchestrator/PhaseResultStore.d.ts.map +0 -1
  467. package/dist/infra/orchestrator/PhaseResultStore.js +0 -151
  468. package/dist/infra/orchestrator/PhaseResultStore.js.map +0 -1
  469. package/dist/infra/orchestrator/SessionStore.d.ts +0 -40
  470. package/dist/infra/orchestrator/SessionStore.d.ts.map +0 -1
  471. package/dist/infra/orchestrator/SessionStore.js +0 -116
  472. package/dist/infra/orchestrator/SessionStore.js.map +0 -1
  473. package/dist/infra/orchestrator/SmartRouter.d.ts +0 -90
  474. package/dist/infra/orchestrator/SmartRouter.d.ts.map +0 -1
  475. package/dist/infra/orchestrator/SmartRouter.js +0 -277
  476. package/dist/infra/orchestrator/SmartRouter.js.map +0 -1
  477. package/dist/infra/orchestrator/SmartRouter.test.d.ts +0 -5
  478. package/dist/infra/orchestrator/SmartRouter.test.d.ts.map +0 -1
  479. package/dist/infra/orchestrator/SmartRouter.test.js +0 -484
  480. package/dist/infra/orchestrator/SmartRouter.test.js.map +0 -1
  481. package/dist/infra/orchestrator/SwarmOrchestrator.d.ts +0 -143
  482. package/dist/infra/orchestrator/SwarmOrchestrator.d.ts.map +0 -1
  483. package/dist/infra/orchestrator/SwarmOrchestrator.js +0 -378
  484. package/dist/infra/orchestrator/SwarmOrchestrator.js.map +0 -1
  485. package/dist/infra/orchestrator/SwarmOrchestrator.test.d.ts +0 -5
  486. package/dist/infra/orchestrator/SwarmOrchestrator.test.d.ts.map +0 -1
  487. package/dist/infra/orchestrator/SwarmOrchestrator.test.js +0 -95
  488. package/dist/infra/orchestrator/SwarmOrchestrator.test.js.map +0 -1
  489. package/dist/infra/orchestrator/agentDiscovery.d.ts +0 -26
  490. package/dist/infra/orchestrator/agentDiscovery.d.ts.map +0 -1
  491. package/dist/infra/orchestrator/agentDiscovery.js +0 -175
  492. package/dist/infra/orchestrator/agentDiscovery.js.map +0 -1
  493. package/dist/infra/orchestrator/backgroundAgent.d.ts +0 -9
  494. package/dist/infra/orchestrator/backgroundAgent.d.ts.map +0 -1
  495. package/dist/infra/orchestrator/backgroundAgent.js +0 -10
  496. package/dist/infra/orchestrator/backgroundAgent.js.map +0 -1
  497. package/dist/infra/orchestrator/index.d.ts +0 -207
  498. package/dist/infra/orchestrator/index.d.ts.map +0 -1
  499. package/dist/infra/orchestrator/index.js +0 -362
  500. package/dist/infra/orchestrator/index.js.map +0 -1
  501. package/dist/infra/orchestrator/orchestrator.d.ts +0 -60
  502. package/dist/infra/orchestrator/orchestrator.d.ts.map +0 -1
  503. package/dist/infra/orchestrator/orchestrator.js +0 -214
  504. package/dist/infra/orchestrator/orchestrator.js.map +0 -1
  505. package/dist/infra/orchestrator/parallelResearch.d.ts +0 -27
  506. package/dist/infra/orchestrator/parallelResearch.d.ts.map +0 -1
  507. package/dist/infra/orchestrator/parallelResearch.js +0 -285
  508. package/dist/infra/orchestrator/parallelResearch.js.map +0 -1
  509. package/dist/infra/orchestrator/types.d.ts +0 -205
  510. package/dist/infra/orchestrator/types.d.ts.map +0 -1
  511. package/dist/infra/orchestrator/types.js +0 -87
  512. package/dist/infra/orchestrator/types.js.map +0 -1
  513. package/dist/infra/orchestrator/types.test.d.ts +0 -2
  514. package/dist/infra/orchestrator/types.test.d.ts.map +0 -1
  515. package/dist/infra/orchestrator/types.test.js +0 -57
  516. package/dist/infra/orchestrator/types.test.js.map +0 -1
  517. package/dist/tools/semantic/analyzeDependencyGraph.d.ts +0 -12
  518. package/dist/tools/semantic/analyzeDependencyGraph.d.ts.map +0 -1
  519. package/dist/tools/semantic/analyzeDependencyGraph.js +0 -359
  520. package/dist/tools/semantic/analyzeDependencyGraph.js.map +0 -1
  521. package/dist/tools/semantic/astGrep.d.ts +0 -25
  522. package/dist/tools/semantic/astGrep.d.ts.map +0 -1
  523. package/dist/tools/semantic/astGrep.js +0 -324
  524. package/dist/tools/semantic/astGrep.js.map +0 -1
  525. package/dist/tools/semantic/astGrep.test.d.ts +0 -2
  526. package/dist/tools/semantic/astGrep.test.d.ts.map +0 -1
  527. package/dist/tools/semantic/astGrep.test.js +0 -74
  528. package/dist/tools/semantic/astGrep.test.js.map +0 -1
  529. package/dist/tools/semantic/findReferences.d.ts +0 -9
  530. package/dist/tools/semantic/findReferences.d.ts.map +0 -1
  531. package/dist/tools/semantic/findReferences.js +0 -200
  532. package/dist/tools/semantic/findReferences.js.map +0 -1
  533. package/dist/tools/semantic/findSymbol.d.ts +0 -8
  534. package/dist/tools/semantic/findSymbol.d.ts.map +0 -1
  535. package/dist/tools/semantic/findSymbol.js +0 -204
  536. package/dist/tools/semantic/findSymbol.js.map +0 -1
  537. package/dist/tools/semantic/index.d.ts +0 -9
  538. package/dist/tools/semantic/index.d.ts.map +0 -1
  539. package/dist/tools/semantic/index.js +0 -11
  540. package/dist/tools/semantic/index.js.map +0 -1
  541. package/dist/tools/semantic/lsp.d.ts +0 -68
  542. package/dist/tools/semantic/lsp.d.ts.map +0 -1
  543. package/dist/tools/semantic/lsp.js +0 -561
  544. package/dist/tools/semantic/lsp.js.map +0 -1
  545. package/dist/tools/spec/e2eTestGenerator.d.ts +0 -61
  546. package/dist/tools/spec/e2eTestGenerator.d.ts.map +0 -1
  547. package/dist/tools/spec/e2eTestGenerator.js +0 -255
  548. package/dist/tools/spec/e2eTestGenerator.js.map +0 -1
  549. package/dist/tools/spec/specVersioning.d.ts +0 -76
  550. package/dist/tools/spec/specVersioning.d.ts.map +0 -1
  551. package/dist/tools/spec/specVersioning.js +0 -236
  552. package/dist/tools/spec/specVersioning.js.map +0 -1
  553. package/hooks/scripts/__tests__/keyword-detector.test.js +0 -242
  554. package/hooks/scripts/keyword-detector.js +0 -226
  555. package/skills/characterization-test/SKILL.md +0 -209
  556. package/skills/characterization-test/agents/behavior-capturer.md +0 -50
  557. package/skills/characterization-test/agents/coverage-checker.md +0 -54
  558. package/skills/characterization-test/agents/reporter.md +0 -50
  559. package/skills/characterization-test/agents/test-writer.md +0 -49
  560. package/skills/characterization-test/rubrics/coverage-criteria.md +0 -53
  561. package/skills/characterization-test/templates/test-template.ts +0 -101
  562. package/skills/claude-md-guide/SKILL.md +0 -353
  563. package/skills/claude-md-guide/rubrics/anti-patterns.md +0 -88
  564. package/skills/design-audit/SKILL.md +0 -154
  565. package/skills/design-critique/SKILL.md +0 -140
  566. package/skills/design-distill/SKILL.md +0 -131
  567. package/skills/design-normalize/SKILL.md +0 -135
  568. package/skills/design-polish/SKILL.md +0 -132
  569. package/skills/figma-convert/SKILL.md +0 -236
  570. package/skills/figma-extract/SKILL.md +0 -242
  571. package/skills/interview/SKILL.md +0 -358
  572. package/skills/interview/checklists/api.md +0 -101
  573. package/skills/interview/checklists/feature.md +0 -88
  574. package/skills/interview/checklists/library.md +0 -95
  575. package/skills/interview/checklists/mobile.md +0 -89
  576. package/skills/interview/checklists/webapp.md +0 -97
  577. package/skills/interview/checklists/website.md +0 -99
  578. package/skills/plan/SKILL.md +0 -254
  579. package/skills/rob-pike/SKILL.md +0 -66
  580. package/skills/spec/references/askuser-examples.md +0 -57
  581. package/skills/spec/references/example-session.md +0 -87
  582. package/skills/spec/references/templates.md +0 -194
  583. package/skills/spec-review/SKILL.md +0 -725
  584. package/skills/systematic-debugging/SKILL.md +0 -142
  585. package/skills/techdebt/SKILL.md +0 -126
  586. package/skills/techdebt/agents/analyzer.md +0 -50
  587. package/skills/techdebt/agents/fixer.md +0 -41
  588. package/skills/techdebt/agents/reviewer.md +0 -47
  589. package/skills/techdebt/agents/scanner.md +0 -44
  590. package/skills/techdebt/orchestrator.md +0 -72
  591. package/skills/techdebt/rubrics/severity.md +0 -51
  592. package/skills/techdebt/scripts/scan.js +0 -90
  593. package/skills/techdebt/templates/report.md +0 -86
  594. package/skills/typescript-advanced-types/SKILL.md +0 -68
  595. package/skills/typescript-advanced-types/rubrics/type-patterns.md +0 -109
  596. package/skills/yagni-ladder/SKILL.md +0 -90
  597. /package/skills/{claude-md-guide → agents-md}/templates/claude-md.md +0 -0
  598. /package/skills/{design-polish → design-refine}/rubrics/polish-checklist.md +0 -0
  599. /package/skills/{design-normalize → design-refine}/rubrics/token-naming.md +0 -0
  600. /package/skills/{design-distill → design-refine}/templates/design-system.md +0 -0
  601. /package/skills/{design-audit → design-review}/agents/scorer.md +0 -0
  602. /package/skills/{design-audit → design-review}/rubrics/ai-slop-patterns.md +0 -0
  603. /package/skills/{design-audit → design-review}/rubrics/scoring.md +0 -0
  604. /package/skills/{design-critique → design-review}/rubrics/ux-heuristics.md +0 -0
  605. /package/skills/{figma-convert → figma}/rubrics/conversion-rules.md +0 -0
  606. /package/skills/{figma-extract → figma}/rubrics/image-rules.md +0 -0
  607. /package/skills/{figma-convert → figma}/templates/component.md +0 -0
@@ -1,484 +0,0 @@
1
- /**
2
- * SmartRouter Tests - LLM smart routing and fallback management
3
- */
4
- import { describe, it, expect, beforeEach, vi, afterEach } from 'vitest';
5
- import { SmartRouter, AllProvidersFailedError, getSmartRouter } from './SmartRouter.js';
6
- // Mock external LLM APIs
7
- vi.mock('../lib/gpt/index.js', () => ({
8
- coreGptOrchestrate: vi.fn(),
9
- }));
10
- vi.mock('../lib/antigravity/index.js', () => ({
11
- coreAntigravityOrchestrate: vi.fn(),
12
- }));
13
- vi.mock('../lib/utils.js', () => ({
14
- debugLog: vi.fn(),
15
- }));
16
- // Dynamic priority: codex=true, antigravity=true
17
- // architecture → ['gpt', 'antigravity', 'claude']
18
- // debugging → ['gpt', 'claude']
19
- // code-analysis → ['gpt', 'claude']
20
- // code-gen → ['gpt', 'claude']
21
- // code-review → ['gpt', 'antigravity', 'claude']
22
- // web-search → ['antigravity', 'claude']
23
- // uiux → ['antigravity', 'claude']
24
- // general → ['claude'] (not in any codex/antigravity list)
25
- // reasoning → ['gpt', 'antigravity', 'claude']
26
- vi.mock('../lib/llm-availability.js', () => ({
27
- detectLlmAvailability: vi.fn(() => ({ codex: true, antigravity: true })),
28
- }));
29
- // Import mocked modules
30
- import { coreGptOrchestrate } from '../lib/gpt/index.js';
31
- import { coreAntigravityOrchestrate } from '../lib/antigravity/index.js';
32
- const mockGpt = coreGptOrchestrate;
33
- const mockAntigravity = coreAntigravityOrchestrate;
34
- describe('SmartRouter', () => {
35
- let router;
36
- beforeEach(() => {
37
- vi.clearAllMocks();
38
- vi.useRealTimers();
39
- // 기본 router 의 claude fallback 은 테스트에서 실패하도록 주입한다.
40
- // (주입하지 않으면 "all providers fail" 테스트가 실제 claude CLI 를 spawn한다)
41
- router = new SmartRouter({
42
- claudeRunner: {
43
- claudeOrchestrate: vi.fn().mockRejectedValue(new Error('claude unavailable in test')),
44
- },
45
- });
46
- });
47
- afterEach(() => {
48
- vi.useRealTimers();
49
- });
50
- // ─── Provider Selection Based on Task Type ───
51
- describe('provider selection by task type', () => {
52
- it('should use GPT first for architecture tasks', async () => {
53
- mockGpt.mockResolvedValueOnce('GPT architecture response');
54
- const result = await router.route({
55
- type: 'architecture',
56
- prompt: 'Review this architecture',
57
- });
58
- expect(result.provider).toBe('gpt');
59
- expect(result.content).toBe('GPT architecture response');
60
- expect(result.success).toBe(true);
61
- expect(result.usedFallback).toBe(false);
62
- expect(mockGpt).toHaveBeenCalledOnce();
63
- expect(mockAntigravity).not.toHaveBeenCalled();
64
- });
65
- it('should use GPT first for debugging tasks', async () => {
66
- mockGpt.mockResolvedValueOnce('GPT debug response');
67
- const result = await router.route({
68
- type: 'debugging',
69
- prompt: 'Debug this issue',
70
- });
71
- expect(result.provider).toBe('gpt');
72
- expect(result.success).toBe(true);
73
- });
74
- it('should use GPT first for code-analysis tasks', async () => {
75
- mockGpt.mockResolvedValueOnce('GPT analysis');
76
- const result = await router.route({
77
- type: 'code-analysis',
78
- prompt: 'Analyze this code',
79
- });
80
- expect(result.provider).toBe('gpt');
81
- });
82
- it('should use Antigravity first for web-search tasks', async () => {
83
- mockAntigravity.mockResolvedValueOnce('Antigravity search result');
84
- const result = await router.route({
85
- type: 'web-search',
86
- prompt: 'Search for something',
87
- });
88
- expect(result.provider).toBe('antigravity');
89
- expect(result.content).toBe('Antigravity search result');
90
- expect(mockAntigravity).toHaveBeenCalledOnce();
91
- expect(mockGpt).not.toHaveBeenCalled();
92
- });
93
- it('should use Antigravity first for uiux tasks', async () => {
94
- mockAntigravity.mockResolvedValueOnce('Antigravity UI feedback');
95
- const result = await router.route({
96
- type: 'uiux',
97
- prompt: 'Review this UI',
98
- });
99
- expect(result.provider).toBe('antigravity');
100
- expect(result.content).toBe('Antigravity UI feedback');
101
- });
102
- it('should respect preferredLlm override', async () => {
103
- mockAntigravity.mockResolvedValueOnce('Antigravity response');
104
- const result = await router.route({
105
- type: 'architecture', // normally GPT-first
106
- prompt: 'Review this',
107
- preferredLlm: 'antigravity',
108
- });
109
- expect(result.provider).toBe('antigravity');
110
- expect(result.content).toBe('Antigravity response');
111
- expect(mockGpt).not.toHaveBeenCalled();
112
- });
113
- it('should use GPT first for code-review tasks', async () => {
114
- mockGpt.mockResolvedValueOnce('GPT code review');
115
- const result = await router.route({
116
- type: 'code-review',
117
- prompt: 'Review this code',
118
- });
119
- expect(result.provider).toBe('gpt');
120
- });
121
- it('should use GPT first for reasoning tasks', async () => {
122
- mockGpt.mockResolvedValueOnce('GPT reasoning');
123
- const result = await router.route({
124
- type: 'reasoning',
125
- prompt: 'Reason about this',
126
- });
127
- expect(result.provider).toBe('gpt');
128
- });
129
- });
130
- // ─── Fallback Chain ───
131
- describe('fallback chain', () => {
132
- it('should fall back to Antigravity when GPT fails for architecture', async () => {
133
- // architecture: ['gpt', 'antigravity', 'claude']
134
- mockGpt.mockRejectedValueOnce(new Error('GPT rate limit exceeded'));
135
- mockAntigravity.mockResolvedValueOnce('Antigravity fallback response');
136
- const result = await router.route({
137
- type: 'architecture',
138
- prompt: 'Review this',
139
- maxRetries: 0,
140
- });
141
- expect(result.provider).toBe('antigravity');
142
- expect(result.content).toBe('Antigravity fallback response');
143
- expect(result.usedFallback).toBe(true);
144
- expect(result.attemptedProviders).toContain('gpt');
145
- expect(result.attemptedProviders).toContain('antigravity');
146
- });
147
- it('should fall back to GPT when Antigravity fails for code-review with preferredLlm', async () => {
148
- // code-review: ['gpt', 'antigravity', 'claude'] — override with preferredLlm=antigravity → ['antigravity', 'gpt', 'claude']
149
- mockAntigravity.mockRejectedValueOnce(new Error('Antigravity quota exhausted'));
150
- mockGpt.mockResolvedValueOnce('GPT fallback');
151
- const result = await router.route({
152
- type: 'code-review',
153
- prompt: 'Review code',
154
- preferredLlm: 'antigravity',
155
- maxRetries: 0,
156
- });
157
- expect(result.provider).toBe('gpt');
158
- expect(result.usedFallback).toBe(true);
159
- });
160
- it('should skip retries for auth errors and move to next provider', async () => {
161
- // architecture: ['gpt', 'antigravity', 'claude']
162
- mockGpt.mockRejectedValueOnce(new Error('No API key set'));
163
- mockAntigravity.mockResolvedValueOnce('Antigravity response');
164
- const result = await router.route({
165
- type: 'architecture',
166
- prompt: 'Analyze code',
167
- maxRetries: 2,
168
- });
169
- // GPT should only be called once (no retries for auth errors)
170
- expect(mockGpt).toHaveBeenCalledTimes(1);
171
- expect(result.provider).toBe('antigravity');
172
- expect(result.usedFallback).toBe(true);
173
- });
174
- it('should skip retries for rate limit errors (429)', async () => {
175
- // code-review: ['gpt', 'antigravity', 'claude']
176
- mockGpt.mockRejectedValueOnce(new Error('429 Too Many Requests'));
177
- mockAntigravity.mockResolvedValueOnce('OK');
178
- await router.route({
179
- type: 'code-review',
180
- prompt: 'Test',
181
- maxRetries: 2,
182
- });
183
- expect(mockGpt).toHaveBeenCalledTimes(1);
184
- });
185
- it('should retry on transient errors before falling back', async () => {
186
- // architecture: ['gpt', 'antigravity', 'claude']
187
- mockGpt
188
- .mockRejectedValueOnce(new Error('Network timeout'))
189
- .mockRejectedValueOnce(new Error('Network timeout'))
190
- .mockResolvedValueOnce('GPT recovered');
191
- const result = await router.route({
192
- type: 'architecture',
193
- prompt: 'Test',
194
- maxRetries: 2,
195
- });
196
- expect(mockGpt).toHaveBeenCalledTimes(3); // initial + 2 retries
197
- expect(result.provider).toBe('gpt');
198
- expect(result.usedFallback).toBe(false);
199
- });
200
- it('should use custom systemPrompt when provided', async () => {
201
- // architecture: ['gpt', 'antigravity', 'claude']
202
- mockGpt.mockResolvedValueOnce('Response');
203
- await router.route({
204
- type: 'architecture',
205
- prompt: 'Test prompt',
206
- systemPrompt: 'Custom system prompt',
207
- });
208
- expect(mockGpt).toHaveBeenCalledWith('Test prompt', 'Custom system prompt', expect.objectContaining({ jsonMode: false, signal: expect.any(AbortSignal) }));
209
- });
210
- it('should use default systemPrompt when not provided', async () => {
211
- // architecture: ['gpt', 'antigravity', 'claude']
212
- mockGpt.mockResolvedValueOnce('Response');
213
- await router.route({
214
- type: 'architecture',
215
- prompt: 'Test prompt',
216
- });
217
- expect(mockGpt).toHaveBeenCalledWith('Test prompt', 'You are a helpful assistant.', expect.objectContaining({ jsonMode: false, signal: expect.any(AbortSignal) }));
218
- });
219
- });
220
- // ─── Availability Caching (5min TTL) ───
221
- describe('availability caching', () => {
222
- it('should skip providers marked as unavailable', async () => {
223
- // code-review: ['gpt', 'antigravity', 'claude']
224
- // Fail GPT with rate-limit (skip-retry pattern) to quickly mark unavailable
225
- mockGpt.mockRejectedValue(new Error('GPT server error'));
226
- mockAntigravity.mockResolvedValue('Antigravity response');
227
- // Route 3 times with maxRetries=0 to accumulate 3 error counts on GPT
228
- await router.route({ type: 'code-review', prompt: 'test1', maxRetries: 0 });
229
- await router.route({ type: 'code-review', prompt: 'test2', maxRetries: 0 });
230
- await router.route({ type: 'code-review', prompt: 'test3', maxRetries: 0 });
231
- // After 3 failures, GPT is marked unavailable
232
- const cache = router.getCacheStatus();
233
- expect(cache.gpt.errorCount).toBeGreaterThanOrEqual(3);
234
- expect(cache.gpt.available).toBe(false);
235
- // Reset call counts
236
- mockGpt.mockClear();
237
- mockAntigravity.mockClear();
238
- mockAntigravity.mockResolvedValueOnce('Antigravity from cache');
239
- // Next route should skip GPT entirely
240
- const result = await router.route({
241
- type: 'code-review',
242
- prompt: 'test4',
243
- maxRetries: 0,
244
- });
245
- expect(mockGpt).not.toHaveBeenCalled();
246
- expect(result.provider).toBe('antigravity');
247
- });
248
- it('should reset availability after TTL expires', async () => {
249
- // code-review: ['gpt', 'antigravity', 'claude']
250
- mockGpt.mockRejectedValue(new Error('GPT server error'));
251
- mockAntigravity.mockResolvedValue('Antigravity');
252
- // Accumulate 3 failures
253
- await router.route({ type: 'code-review', prompt: 'test', maxRetries: 0 });
254
- await router.route({ type: 'code-review', prompt: 'test', maxRetries: 0 });
255
- await router.route({ type: 'code-review', prompt: 'test', maxRetries: 0 });
256
- expect(router.getCacheStatus().gpt.available).toBe(false);
257
- // Simulate TTL expiry by advancing time
258
- vi.useFakeTimers();
259
- const now = Date.now();
260
- vi.setSystemTime(now + 5 * 60 * 1000 + 1); // 5min + 1ms
261
- mockGpt.mockClear();
262
- mockGpt.mockResolvedValueOnce('GPT recovered');
263
- const result = await router.route({
264
- type: 'code-review',
265
- prompt: 'test',
266
- });
267
- expect(mockGpt).toHaveBeenCalled();
268
- expect(result.provider).toBe('gpt');
269
- vi.useRealTimers();
270
- });
271
- it('should mark provider available on success', async () => {
272
- // architecture: ['gpt', 'antigravity', 'claude']
273
- mockGpt.mockResolvedValueOnce('GPT OK');
274
- await router.route({ type: 'architecture', prompt: 'test' });
275
- const cache = router.getCacheStatus();
276
- expect(cache.gpt.available).toBe(true);
277
- expect(cache.gpt.errorCount).toBe(0);
278
- });
279
- it('should reset cache via resetCache()', () => {
280
- const router2 = new SmartRouter();
281
- const cache = router2.getCacheStatus();
282
- expect(cache.gpt.available).toBe(true);
283
- expect(cache.antigravity.available).toBe(true);
284
- router2.resetCache();
285
- const reset = router2.getCacheStatus();
286
- expect(reset.gpt.errorCount).toBe(0);
287
- expect(reset.antigravity.errorCount).toBe(0);
288
- });
289
- it('should not cache claude provider availability', async () => {
290
- // web-search: ['antigravity', 'claude'] — claude is always considered available
291
- mockAntigravity.mockRejectedValueOnce(new Error('Antigravity auth'));
292
- // claude will fail with "Claude fallback - handled by caller"
293
- // but isUnavailable('claude') always returns false
294
- await expect(router.route({ type: 'web-search', prompt: 'test', maxRetries: 0 })).rejects.toThrow(AllProvidersFailedError);
295
- // claude should still be "available" (not cached)
296
- // Verify by checking that subsequent calls still attempt claude
297
- mockAntigravity.mockRejectedValueOnce(new Error('Antigravity auth'));
298
- const errorPromise = router.route({ type: 'web-search', prompt: 'test', maxRetries: 0 });
299
- await expect(errorPromise).rejects.toThrow(AllProvidersFailedError);
300
- });
301
- });
302
- // ─── Edge Cases ───
303
- describe('edge cases', () => {
304
- it('should throw AllProvidersFailedError when all providers fail', async () => {
305
- // architecture: ['gpt', 'antigravity', 'claude']
306
- mockGpt.mockRejectedValueOnce(new Error('GPT auth failure'));
307
- mockAntigravity.mockRejectedValueOnce(new Error('Antigravity auth failure'));
308
- await expect(router.route({
309
- type: 'architecture',
310
- prompt: 'Test',
311
- maxRetries: 0,
312
- })).rejects.toThrow(AllProvidersFailedError);
313
- });
314
- it('AllProvidersFailedError should contain attempted providers and errors', async () => {
315
- // architecture: ['gpt', 'antigravity', 'claude']
316
- mockGpt.mockRejectedValueOnce(new Error('GPT unauthorized'));
317
- mockAntigravity.mockRejectedValueOnce(new Error('Antigravity unauthorized'));
318
- try {
319
- await router.route({
320
- type: 'architecture',
321
- prompt: 'Test',
322
- maxRetries: 0,
323
- });
324
- expect.fail('Should have thrown');
325
- }
326
- catch (err) {
327
- const error = err;
328
- expect(error).toBeInstanceOf(AllProvidersFailedError);
329
- expect(error.attemptedProviders).toContain('gpt');
330
- expect(error.attemptedProviders).toContain('antigravity');
331
- expect(error.errors['gpt']).toContain('GPT unauthorized');
332
- expect(error.errors['antigravity']).toContain('Antigravity unauthorized');
333
- expect(error.duration).toBeGreaterThanOrEqual(0);
334
- expect(error.name).toBe('AllProvidersFailedError');
335
- }
336
- });
337
- it('should fall back to claude when gpt and antigravity fail', async () => {
338
- // architecture: ['gpt', 'antigravity', 'claude']
339
- mockGpt.mockRejectedValueOnce(new Error('GPT auth'));
340
- mockAntigravity.mockRejectedValueOnce(new Error('Antigravity auth'));
341
- const claudeOrchestrate = vi.fn().mockResolvedValue('Claude fallback response');
342
- const claudeRouter = new SmartRouter({ claudeRunner: { claudeOrchestrate } });
343
- const result = await claudeRouter.route({
344
- type: 'architecture',
345
- prompt: 'Test',
346
- maxRetries: 0,
347
- });
348
- expect(result.provider).toBe('claude');
349
- expect(result.content).toBe('Claude fallback response');
350
- expect(result.success).toBe(true);
351
- expect(result.usedFallback).toBe(true);
352
- expect(result.attemptedProviders).toContain('claude');
353
- expect(claudeOrchestrate).toHaveBeenCalledOnce();
354
- });
355
- it('should use claude directly for a claude-only task (general)', async () => {
356
- // general → ['claude']
357
- const claudeOrchestrate = vi.fn().mockResolvedValue('Claude only response');
358
- const claudeRouter = new SmartRouter({ claudeRunner: { claudeOrchestrate } });
359
- const result = await claudeRouter.route({
360
- type: 'general',
361
- prompt: 'Test',
362
- maxRetries: 0,
363
- });
364
- expect(result.provider).toBe('claude');
365
- expect(result.content).toBe('Claude only response');
366
- expect(result.usedFallback).toBe(false);
367
- expect(mockGpt).not.toHaveBeenCalled();
368
- });
369
- it('should throw AllProvidersFailedError when claude fallback also fails', async () => {
370
- mockGpt.mockRejectedValueOnce(new Error('GPT auth'));
371
- mockAntigravity.mockRejectedValueOnce(new Error('Antigravity auth'));
372
- const claudeOrchestrate = vi.fn().mockRejectedValue(new Error('claude CLI not found'));
373
- const claudeRouter = new SmartRouter({ claudeRunner: { claudeOrchestrate } });
374
- await expect(claudeRouter.route({ type: 'architecture', prompt: 'Test', maxRetries: 0 })).rejects.toBeInstanceOf(AllProvidersFailedError);
375
- expect(claudeOrchestrate).toHaveBeenCalled();
376
- });
377
- it('should track duration in result', async () => {
378
- mockGpt.mockResolvedValueOnce('Response');
379
- const result = await router.route({
380
- type: 'architecture',
381
- prompt: 'Test',
382
- });
383
- expect(typeof result.duration).toBe('number');
384
- expect(result.duration).toBeGreaterThanOrEqual(0);
385
- });
386
- it('should set maxRetries to 2 by default', async () => {
387
- // architecture: ['gpt', 'antigravity', 'claude']
388
- mockGpt
389
- .mockRejectedValueOnce(new Error('Transient error 1'))
390
- .mockRejectedValueOnce(new Error('Transient error 2'))
391
- .mockResolvedValueOnce('Success on third attempt');
392
- const result = await router.route({
393
- type: 'architecture',
394
- prompt: 'Test',
395
- // maxRetries not specified — default is 2
396
- });
397
- expect(mockGpt).toHaveBeenCalledTimes(3);
398
- expect(result.provider).toBe('gpt');
399
- expect(result.success).toBe(true);
400
- });
401
- it('should report attemptedProviders length of 1 when first provider succeeds', async () => {
402
- mockGpt.mockResolvedValueOnce('OK');
403
- const result = await router.route({
404
- type: 'architecture',
405
- prompt: 'Test',
406
- });
407
- expect(result.attemptedProviders).toEqual(['gpt']);
408
- expect(result.usedFallback).toBe(false);
409
- });
410
- });
411
- // ─── Convenience Methods ───
412
- describe('convenience methods', () => {
413
- it('webSearch should route with web-search type', async () => {
414
- mockAntigravity.mockResolvedValueOnce('Search results');
415
- const result = await router.webSearch('test query');
416
- expect(result.provider).toBe('antigravity');
417
- expect(result.content).toBe('Search results');
418
- });
419
- it('architectureReview should route with architecture type', async () => {
420
- mockGpt.mockResolvedValueOnce('Architecture analysis');
421
- const result = await router.architectureReview('Review this');
422
- expect(result.provider).toBe('gpt');
423
- });
424
- it('uiuxReview should route with uiux type', async () => {
425
- mockAntigravity.mockResolvedValueOnce('UI feedback');
426
- const result = await router.uiuxReview('Review UI');
427
- expect(result.provider).toBe('antigravity');
428
- });
429
- it('codeAnalysis should route with code-analysis type', async () => {
430
- mockGpt.mockResolvedValueOnce('Code analysis');
431
- const result = await router.codeAnalysis('Analyze');
432
- expect(result.provider).toBe('gpt');
433
- });
434
- it('debugging should route with debugging type', async () => {
435
- mockGpt.mockResolvedValueOnce('Debug info');
436
- const result = await router.debugging('Debug this');
437
- expect(result.provider).toBe('gpt');
438
- });
439
- it('codeGen should route with code-gen type', async () => {
440
- mockGpt.mockResolvedValueOnce('Generated code');
441
- const result = await router.codeGen('Generate a function');
442
- expect(result.provider).toBe('gpt');
443
- });
444
- it('codeGen should include context when provided', async () => {
445
- mockGpt.mockResolvedValueOnce('Generated code');
446
- await router.codeGen('Generate a function', 'Some context');
447
- expect(mockGpt).toHaveBeenCalledWith('Generate a function\n\nContext:\nSome context', 'Generate clean, well-documented code.', expect.objectContaining({ jsonMode: false, signal: expect.any(AbortSignal) }));
448
- });
449
- });
450
- // ─── Singleton ───
451
- describe('getSmartRouter singleton', () => {
452
- it('should return a SmartRouter instance', () => {
453
- const instance = getSmartRouter();
454
- expect(instance).toBeInstanceOf(SmartRouter);
455
- });
456
- it('should create new instance when options are provided', () => {
457
- const instance1 = getSmartRouter();
458
- const instance2 = getSmartRouter({ verbose: true });
459
- expect(instance2).toBeInstanceOf(SmartRouter);
460
- });
461
- });
462
- // ─── AllProvidersFailedError ───
463
- describe('AllProvidersFailedError', () => {
464
- it('should format message with last provider error', () => {
465
- const error = new AllProvidersFailedError(['gpt', 'antigravity'], { gpt: 'GPT failed', antigravity: 'Antigravity failed' }, 1500);
466
- expect(error.message).toContain('antigravity');
467
- expect(error.message).toContain('Antigravity failed');
468
- expect(error.attemptedProviders).toEqual(['gpt', 'antigravity']);
469
- expect(error.duration).toBe(1500);
470
- });
471
- it('should handle empty providers list', () => {
472
- const error = new AllProvidersFailedError([], {}, 100);
473
- expect(error.message).toContain('No providers attempted');
474
- });
475
- });
476
- // ─── Verbose mode ───
477
- describe('verbose mode', () => {
478
- it('should create router with verbose option', () => {
479
- const verboseRouter = new SmartRouter({ verbose: true });
480
- expect(verboseRouter).toBeInstanceOf(SmartRouter);
481
- });
482
- });
483
- });
484
- //# sourceMappingURL=SmartRouter.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SmartRouter.test.js","sourceRoot":"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AI,WAAW,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;YACzD,MAAM,CAAC,aAAa,CAAC,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC;QACpD,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -1,143 +0,0 @@
1
- /**
2
- * SwarmOrchestrator - 에이전트 자가 복제 패턴 (Swarm Pattern)
3
- *
4
- * SKILL.md 참조: Claude Code의 Swarm 패턴을 Core 자체 구현으로 재현
5
- * - 에이전트가 "너무 복잡하다" 판단 시 하위 에이전트 동적 생성
6
- * - 기존 launch()/poll() 인프라 활용
7
- * - Claude Code + Cursor IDE 모두 지원 (플랫폼 독립)
8
- */
9
- import { ToolResult } from '../types/tool.js';
10
- import type { AgentResult, ClaudeModel } from './types.js';
11
- /** Swarm 설정 */
12
- export interface SwarmConfig {
13
- /** 루트 프롬프트 */
14
- prompt: string;
15
- /** 에이전트 이름 (선택) */
16
- agentName?: string;
17
- /** 모델 (기본: sonnet) */
18
- model?: ClaudeModel;
19
- /** 최대 분할 깊이 (기본: 2) */
20
- maxDepth?: number;
21
- /** 복잡도 임계값 - 이 이상이면 분할 (기본: 15) */
22
- splitThreshold?: number;
23
- /** 최대 동시 하위 에이전트 수 (기본: 5) */
24
- maxConcurrentChildren?: number;
25
- /** 분할 시 콜백 */
26
- onSplit?: (task: SwarmTask) => void;
27
- /** 완료 시 콜백 */
28
- onComplete?: (task: SwarmTask, result: AgentResult) => void;
29
- /** 프로젝트 경로 */
30
- projectPath?: string;
31
- /** 타임아웃 (ms, 기본: 5분) */
32
- timeout?: number;
33
- }
34
- /** Swarm 작업 */
35
- export interface SwarmTask {
36
- id: string;
37
- parentId: string | null;
38
- prompt: string;
39
- depth: number;
40
- status: 'pending' | 'analyzing' | 'running' | 'splitting' | 'completed' | 'failed';
41
- complexity?: number;
42
- children: string[];
43
- taskId?: string;
44
- result?: AgentResult;
45
- error?: string;
46
- createdAt: number;
47
- startedAt?: number;
48
- completedAt?: number;
49
- }
50
- /** Swarm 결과 */
51
- export interface SwarmResult {
52
- rootTaskId: string;
53
- tasks: SwarmTask[];
54
- totalDuration: number;
55
- splitCount: number;
56
- successCount: number;
57
- failureCount: number;
58
- maxDepthReached: number;
59
- mergedResult: string;
60
- }
61
- /** 복잡도 분석 결과 */
62
- interface ComplexityAnalysis {
63
- score: number;
64
- factors: string[];
65
- suggestedSplits?: string[];
66
- }
67
- export declare class SwarmOrchestrator {
68
- private tasks;
69
- private config;
70
- private startTime;
71
- constructor(config: SwarmConfig);
72
- /**
73
- * Swarm 실행
74
- */
75
- execute(): Promise<SwarmResult>;
76
- /**
77
- * 태스크 처리
78
- */
79
- private processTask;
80
- /**
81
- * 복잡도 분석
82
- */
83
- private analyzeComplexity;
84
- /**
85
- * 분할 제안 생성
86
- */
87
- private suggestSplits;
88
- /**
89
- * 분할 여부 결정
90
- */
91
- private shouldSplit;
92
- /**
93
- * 태스크 분할
94
- */
95
- private splitTask;
96
- /**
97
- * 하위 프롬프트 생성
98
- */
99
- private createChildPrompt;
100
- /**
101
- * 하위 결과 병합
102
- */
103
- private mergeChildResults;
104
- /**
105
- * 태스크 실행 (분할 없이) — 실패 시 자동 재시도
106
- */
107
- private executeTask;
108
- /**
109
- * 결과 수집
110
- */
111
- private collectResults;
112
- /**
113
- * 태스크 생성
114
- */
115
- private createTask;
116
- private sleep;
117
- }
118
- /**
119
- * Swarm 패턴으로 복잡한 작업 실행
120
- *
121
- * @example
122
- * import { swarm } from '@su-record/vibe/orchestrator';
123
- *
124
- * const result = await swarm({
125
- * prompt: 'Implement login feature with: 1. UI form 2. Validation 3. API call 4. Error handling',
126
- * maxDepth: 2,
127
- * splitThreshold: 15,
128
- * onSplit: (task) => console.log(`Splitting: ${task.id}`),
129
- * });
130
- */
131
- export declare function swarm(config: SwarmConfig): Promise<ToolResult & {
132
- swarmResult: SwarmResult;
133
- }>;
134
- /**
135
- * 작업 복잡도 분석 (swarm 없이)
136
- *
137
- * @example
138
- * const analysis = analyzeTaskComplexity('Implement login with validation and error handling');
139
- * console.log(analysis.score); // 15
140
- */
141
- export declare function analyzeTaskComplexity(prompt: string): ComplexityAnalysis;
142
- export {};
143
- //# sourceMappingURL=SwarmOrchestrator.d.ts.map