squads-cli 0.2.1 → 0.2.2

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 (129) hide show
  1. package/dist/{autonomy-PSVZVX7A.js → autonomy-GARI6J2J.js} +4 -4
  2. package/dist/chunk-NP5BDPE6.js +240 -0
  3. package/dist/chunk-NP5BDPE6.js.map +1 -0
  4. package/dist/chunk-O632SBON.js +62 -0
  5. package/dist/chunk-O632SBON.js.map +1 -0
  6. package/dist/{chunk-QHNUMM4V.js → chunk-QRNR4GIT.js} +3 -2
  7. package/dist/chunk-QRNR4GIT.js.map +1 -0
  8. package/dist/chunk-XTHZT53Y.js +364 -0
  9. package/dist/chunk-XTHZT53Y.js.map +1 -0
  10. package/dist/cli.js +1026 -88
  11. package/dist/cli.js.map +1 -1
  12. package/dist/{context-GWPF4SEY.js → context-PYTO2UQG.js} +7 -7
  13. package/dist/{context-feed-AJGVAR6H.js → context-feed-TLVZZ24S.js} +15 -15
  14. package/dist/{cost-XBCDJ7XC.js → cost-OALPURUQ.js} +7 -7
  15. package/dist/{dashboard-LGT2B2BL.js → dashboard-HQIEHTZC.js} +14 -14
  16. package/dist/{doctor-XPUIIBHJ.js → doctor-TWHMR23W.js} +4 -4
  17. package/dist/{exec-OUXM7JBF.js → exec-DYLI4TXY.js} +2 -2
  18. package/dist/{feedback-KNAOG5QK.js → feedback-5AEACUX6.js} +8 -8
  19. package/dist/{goal-BVHV5573.js → goal-XUNV3CKV.js} +8 -8
  20. package/dist/{health-4UXN44PF.js → health-ZF3HSA4W.js} +4 -4
  21. package/dist/{history-ILH3SWHB.js → history-WP6R5BNG.js} +5 -5
  22. package/dist/history-WP6R5BNG.js.map +1 -0
  23. package/dist/{init-XQZ7BOGT.js → init-BQSCG57S.js} +115 -6
  24. package/dist/init-BQSCG57S.js.map +1 -0
  25. package/dist/{kpi-RQIU7WGK.js → kpi-VBGDO4GI.js} +6 -6
  26. package/dist/{learn-OIFUVZAS.js → learn-C4B2PQ5J.js} +8 -8
  27. package/dist/{login-DXZANWZY.js → login-F6ITE7PR.js} +7 -7
  28. package/dist/{memory-T3ACCS7E.js → memory-33HYD6AN.js} +11 -11
  29. package/dist/observability-CL23L7LD.js +20 -0
  30. package/dist/observability-CL23L7LD.js.map +1 -0
  31. package/dist/org-cycle-Q74OT4I4.js +130 -0
  32. package/dist/org-cycle-Q74OT4I4.js.map +1 -0
  33. package/dist/{progress-DAUZMT3N.js → progress-P2EIZBKP.js} +5 -5
  34. package/dist/{providers-3P5D2XL5.js → providers-LE744DM6.js} +2 -2
  35. package/dist/repo-enforcement-JJQMKDAU.js +75 -0
  36. package/dist/repo-enforcement-JJQMKDAU.js.map +1 -0
  37. package/dist/{results-UECWGLTB.js → results-6TH33HPN.js} +6 -6
  38. package/dist/{run-I6KAXU6U.js → run-DOY5SGF3.js} +3713 -3688
  39. package/dist/run-DOY5SGF3.js.map +1 -0
  40. package/dist/run-context-GB6GUCKZ.js +26 -0
  41. package/dist/run-context-GB6GUCKZ.js.map +1 -0
  42. package/dist/{status-AQNLDZVN.js → status-PFFB2NV6.js} +16 -16
  43. package/dist/{sync-ZI3MHA4G.js → sync-FR6LQJ4C.js} +12 -12
  44. package/dist/templates/seed/config/SYSTEM.md +6 -0
  45. package/dist/templates/seed/idp/catalog/service.yaml.template +25 -0
  46. package/dist/templates/seed/memory/_squad/goals.md +23 -0
  47. package/dist/templates/seed/memory/_squad/priorities.md +25 -0
  48. package/dist/templates/seed/memory/company/company.md +31 -0
  49. package/dist/templates/seed/skills/squads-cli/SKILL.md +302 -57
  50. package/dist/templates/seed/skills/squads-cli/references/commands.md +181 -0
  51. package/dist/templates/seed/squads/company/company-critic.md +12 -4
  52. package/dist/templates/seed/squads/company/company-eval.md +12 -4
  53. package/dist/templates/seed/squads/company/event-dispatcher.md +14 -4
  54. package/dist/templates/seed/squads/company/goal-tracker.md +12 -4
  55. package/dist/templates/seed/squads/company/manager.md +17 -11
  56. package/dist/templates/seed/squads/engineering/code-reviewer.md +14 -2
  57. package/dist/templates/seed/squads/engineering/issue-solver.md +10 -2
  58. package/dist/templates/seed/squads/engineering/test-writer.md +15 -5
  59. package/dist/templates/seed/squads/intelligence/intel-critic.md +19 -2
  60. package/dist/templates/seed/squads/intelligence/intel-eval.md +18 -1
  61. package/dist/templates/seed/squads/intelligence/intel-lead.md +12 -4
  62. package/dist/templates/seed/squads/marketing/content-drafter.md +14 -4
  63. package/dist/templates/seed/squads/marketing/growth-analyst.md +14 -2
  64. package/dist/templates/seed/squads/marketing/social-poster.md +15 -3
  65. package/dist/templates/seed/squads/operations/finance-tracker.md +11 -3
  66. package/dist/templates/seed/squads/operations/goal-tracker.md +14 -2
  67. package/dist/templates/seed/squads/operations/ops-lead.md +14 -4
  68. package/dist/templates/seed/squads/product/lead.md +11 -3
  69. package/dist/templates/seed/squads/product/scanner.md +12 -4
  70. package/dist/templates/seed/squads/product/worker.md +12 -4
  71. package/dist/templates/seed/squads/research/analyst.md +12 -4
  72. package/dist/templates/seed/squads/research/lead.md +11 -5
  73. package/dist/templates/seed/squads/research/synthesizer.md +12 -4
  74. package/dist/tier-detect-YX2HPNNR.js +15 -0
  75. package/dist/tier-detect-YX2HPNNR.js.map +1 -0
  76. package/package.json +1 -1
  77. package/templates/seed/config/SYSTEM.md +6 -0
  78. package/templates/seed/idp/catalog/service.yaml.template +25 -0
  79. package/templates/seed/memory/_squad/goals.md +23 -0
  80. package/templates/seed/memory/_squad/priorities.md +25 -0
  81. package/templates/seed/memory/company/company.md +31 -0
  82. package/templates/seed/skills/squads-cli/SKILL.md +302 -57
  83. package/templates/seed/skills/squads-cli/references/commands.md +181 -0
  84. package/templates/seed/squads/company/company-critic.md +12 -4
  85. package/templates/seed/squads/company/company-eval.md +12 -4
  86. package/templates/seed/squads/company/event-dispatcher.md +14 -4
  87. package/templates/seed/squads/company/goal-tracker.md +12 -4
  88. package/templates/seed/squads/company/manager.md +17 -11
  89. package/templates/seed/squads/engineering/code-reviewer.md +14 -2
  90. package/templates/seed/squads/engineering/issue-solver.md +10 -2
  91. package/templates/seed/squads/engineering/test-writer.md +15 -5
  92. package/templates/seed/squads/intelligence/intel-critic.md +19 -2
  93. package/templates/seed/squads/intelligence/intel-eval.md +18 -1
  94. package/templates/seed/squads/intelligence/intel-lead.md +12 -4
  95. package/templates/seed/squads/marketing/content-drafter.md +14 -4
  96. package/templates/seed/squads/marketing/growth-analyst.md +14 -2
  97. package/templates/seed/squads/marketing/social-poster.md +15 -3
  98. package/templates/seed/squads/operations/finance-tracker.md +11 -3
  99. package/templates/seed/squads/operations/goal-tracker.md +14 -2
  100. package/templates/seed/squads/operations/ops-lead.md +14 -4
  101. package/templates/seed/squads/product/lead.md +11 -3
  102. package/templates/seed/squads/product/scanner.md +12 -4
  103. package/templates/seed/squads/product/worker.md +12 -4
  104. package/templates/seed/squads/research/analyst.md +12 -4
  105. package/templates/seed/squads/research/lead.md +11 -5
  106. package/templates/seed/squads/research/synthesizer.md +12 -4
  107. package/dist/chunk-QHNUMM4V.js.map +0 -1
  108. package/dist/history-ILH3SWHB.js.map +0 -1
  109. package/dist/init-XQZ7BOGT.js.map +0 -1
  110. package/dist/run-I6KAXU6U.js.map +0 -1
  111. /package/dist/{autonomy-PSVZVX7A.js.map → autonomy-GARI6J2J.js.map} +0 -0
  112. /package/dist/{context-GWPF4SEY.js.map → context-PYTO2UQG.js.map} +0 -0
  113. /package/dist/{context-feed-AJGVAR6H.js.map → context-feed-TLVZZ24S.js.map} +0 -0
  114. /package/dist/{cost-XBCDJ7XC.js.map → cost-OALPURUQ.js.map} +0 -0
  115. /package/dist/{dashboard-LGT2B2BL.js.map → dashboard-HQIEHTZC.js.map} +0 -0
  116. /package/dist/{doctor-XPUIIBHJ.js.map → doctor-TWHMR23W.js.map} +0 -0
  117. /package/dist/{exec-OUXM7JBF.js.map → exec-DYLI4TXY.js.map} +0 -0
  118. /package/dist/{feedback-KNAOG5QK.js.map → feedback-5AEACUX6.js.map} +0 -0
  119. /package/dist/{goal-BVHV5573.js.map → goal-XUNV3CKV.js.map} +0 -0
  120. /package/dist/{health-4UXN44PF.js.map → health-ZF3HSA4W.js.map} +0 -0
  121. /package/dist/{kpi-RQIU7WGK.js.map → kpi-VBGDO4GI.js.map} +0 -0
  122. /package/dist/{learn-OIFUVZAS.js.map → learn-C4B2PQ5J.js.map} +0 -0
  123. /package/dist/{login-DXZANWZY.js.map → login-F6ITE7PR.js.map} +0 -0
  124. /package/dist/{memory-T3ACCS7E.js.map → memory-33HYD6AN.js.map} +0 -0
  125. /package/dist/{progress-DAUZMT3N.js.map → progress-P2EIZBKP.js.map} +0 -0
  126. /package/dist/{providers-3P5D2XL5.js.map → providers-LE744DM6.js.map} +0 -0
  127. /package/dist/{results-UECWGLTB.js.map → results-6TH33HPN.js.map} +0 -0
  128. /package/dist/{status-AQNLDZVN.js.map → status-PFFB2NV6.js.map} +0 -0
  129. /package/dist/{sync-ZI3MHA4G.js.map → sync-FR6LQJ4C.js.map} +0 -0
@@ -1,8 +1,14 @@
1
1
  ---
2
2
  name: Product Lead
3
3
  role: lead
4
+ squad: "product"
5
+ provider: "{{PROVIDER}}"
4
6
  model: sonnet
5
7
  effort: high
8
+ trigger: "schedule"
9
+ cooldown: "1h"
10
+ timeout: 3600
11
+ max_retries: 2
6
12
  tools:
7
13
  - Read
8
14
  - Write
@@ -10,9 +16,11 @@ tools:
10
16
 
11
17
  # Product Lead
12
18
 
19
+ ## Role
20
+
13
21
  Own the product roadmap. Turn intelligence and research insights into prioritized decisions about what to build, improve, or stop.
14
22
 
15
- ## Instructions
23
+ ## How You Work
16
24
 
17
25
  1. Read business context from `.agents/BUSINESS_BRIEF.md`
18
26
  2. Read your previous state from `.agents/memory/product/lead/state.md`
@@ -23,7 +31,7 @@ Own the product roadmap. Turn intelligence and research insights into prioritize
23
31
  7. Brief the `scanner` on what signals to watch and the `worker` on what specs to write
24
32
  8. Save roadmap to `.agents/memory/product/lead/state.md`
25
33
 
26
- ## Output Format (REQUIRED)
34
+ ## Output
27
35
 
28
36
  ```markdown
29
37
  # Product Roadmap — {date}
@@ -48,7 +56,7 @@ What the scanner should monitor this cycle.
48
56
  What the worker should draft this cycle.
49
57
  ```
50
58
 
51
- ## Rules
59
+ ## Constraints
52
60
 
53
61
  - Every roadmap item must trace back to a business need, research finding, or user feedback
54
62
  - "Parked" is as important as "This Cycle" — saying no prevents scope creep
@@ -1,8 +1,14 @@
1
1
  ---
2
2
  name: Product Scanner
3
- role: doer
3
+ role: worker
4
+ squad: "product"
5
+ provider: "{{PROVIDER}}"
4
6
  model: haiku
5
7
  effort: medium
8
+ trigger: "schedule"
9
+ cooldown: "2h"
10
+ timeout: 1800
11
+ max_retries: 2
6
12
  tools:
7
13
  - WebSearch
8
14
  - WebFetch
@@ -12,9 +18,11 @@ tools:
12
18
 
13
19
  # Product Scanner
14
20
 
21
+ ## Role
22
+
15
23
  Monitor user feedback, competitor moves, and market signals. Surface what matters to the Product Lead.
16
24
 
17
- ## Instructions
25
+ ## How You Work
18
26
 
19
27
  1. Read signals the lead wants watched from `.agents/memory/product/lead/state.md`
20
28
  2. Read your previous scan from `.agents/memory/product/scanner/state.md`
@@ -22,7 +30,7 @@ Monitor user feedback, competitor moves, and market signals. Surface what matter
22
30
  4. Filter signal from noise — only report what affects product decisions
23
31
  5. Save scan results to `.agents/memory/product/scanner/state.md`
24
32
 
25
- ## Output Format (REQUIRED)
33
+ ## Output
26
34
 
27
35
  ```markdown
28
36
  # Product Scan — {date}
@@ -42,7 +50,7 @@ Themes from user feedback, support channels, or community.
42
50
  Top 1-2 things the Product Lead should know about right now.
43
51
  ```
44
52
 
45
- ## Rules
53
+ ## Constraints
46
54
 
47
55
  - Quality over quantity — 3 high-signal items beat 20 low-signal ones
48
56
  - Always include the source URL
@@ -1,8 +1,14 @@
1
1
  ---
2
2
  name: Product Worker
3
- role: doer
3
+ role: worker
4
+ squad: "product"
5
+ provider: "{{PROVIDER}}"
4
6
  model: sonnet
5
7
  effort: high
8
+ trigger: "event"
9
+ cooldown: "30m"
10
+ timeout: 1800
11
+ max_retries: 2
6
12
  tools:
7
13
  - Read
8
14
  - Write
@@ -10,16 +16,18 @@ tools:
10
16
 
11
17
  # Product Worker
12
18
 
19
+ ## Role
20
+
13
21
  Write product specs, user stories, and feature documentation. Turn the lead's roadmap decisions into buildable documents.
14
22
 
15
- ## Instructions
23
+ ## How You Work
16
24
 
17
25
  1. Read specs needed from `.agents/memory/product/lead/state.md`
18
26
  2. Read your previous work from `.agents/memory/product/worker/state.md`
19
27
  3. For each assigned feature, produce a spec in the REQUIRED FORMAT
20
28
  4. Save specs to `.agents/memory/product/worker/state.md`
21
29
 
22
- ## Output Format (REQUIRED)
30
+ ## Output
23
31
 
24
32
  ```markdown
25
33
  # Product Spec: {Feature Name}
@@ -47,7 +55,7 @@ What needs to exist before this can be built?
47
55
  Decisions that need human input before building.
48
56
  ```
49
57
 
50
- ## Rules
58
+ ## Constraints
51
59
 
52
60
  - Write for the builder, not the boardroom — be specific
53
61
  - Acceptance criteria must be testable (yes/no, not "improved" or "better")
@@ -1,8 +1,14 @@
1
1
  ---
2
2
  name: Analyst
3
- role: doer
3
+ role: worker
4
+ squad: "research"
5
+ provider: "{{PROVIDER}}"
4
6
  model: sonnet
5
7
  effort: high
8
+ trigger: "event"
9
+ cooldown: "30m"
10
+ timeout: 1800
11
+ max_retries: 2
6
12
  tools:
7
13
  - WebSearch
8
14
  - WebFetch
@@ -12,9 +18,11 @@ tools:
12
18
 
13
19
  # Research Analyst
14
20
 
21
+ ## Role
22
+
15
23
  Conduct deep research on assigned topics. Produce findings with sources, not opinions.
16
24
 
17
- ## Instructions
25
+ ## How You Work
18
26
 
19
27
  1. Read research agenda from `.agents/memory/research/lead/state.md`
20
28
  2. Read your previous findings from `.agents/memory/research/analyst/state.md`
@@ -22,7 +30,7 @@ Conduct deep research on assigned topics. Produce findings with sources, not opi
22
30
  4. For each finding, record the source URL and confidence level
23
31
  5. Save findings to `.agents/memory/research/analyst/state.md`
24
32
 
25
- ## Output Format (REQUIRED)
33
+ ## Output
26
34
 
27
35
  ```markdown
28
36
  # Research Findings — {date}
@@ -41,7 +49,7 @@ What this means for our business (2-3 sentences).
41
49
  What we still don't know and where to look next.
42
50
  ```
43
51
 
44
- ## Rules
52
+ ## Constraints
45
53
 
46
54
  - Every finding needs a source. No source = no finding.
47
55
  - Confidence levels: CONFIRMED (multiple sources) > LIKELY (single credible source) > POSSIBLE (inferred)
@@ -1,8 +1,14 @@
1
1
  ---
2
2
  name: Research Lead
3
3
  role: lead
4
+ squad: "research"
5
+ provider: "{{PROVIDER}}"
4
6
  model: sonnet
5
7
  effort: high
8
+ trigger: "schedule"
9
+ cooldown: "1h"
10
+ timeout: 3600
11
+ max_retries: 2
6
12
  tools:
7
13
  - WebSearch
8
14
  - WebFetch
@@ -12,9 +18,11 @@ tools:
12
18
 
13
19
  # Research Lead
14
20
 
21
+ ## Role
22
+
15
23
  Define the research agenda, coordinate the analyst and synthesizer, and ensure research outputs are actionable — not academic.
16
24
 
17
- ## Instructions
25
+ ## How You Work
18
26
 
19
27
  1. Read business context from `.agents/BUSINESS_BRIEF.md`
20
28
  2. Read your previous state from `.agents/memory/research/lead/state.md`
@@ -24,9 +32,7 @@ Define the research agenda, coordinate the analyst and synthesizer, and ensure r
24
32
  6. Review outputs and ensure they answer: "So what? What should we do?"
25
33
  7. Update state: `.agents/memory/research/lead/state.md`
26
34
 
27
- ## Output Format (REQUIRED)
28
-
29
- Every cycle produces a research direction:
35
+ ## Output
30
36
 
31
37
  ```markdown
32
38
  # Research Agenda — {date}
@@ -44,7 +50,7 @@ Every cycle produces a research direction:
44
50
  Questions we need answered this cycle, ranked by business impact.
45
51
  ```
46
52
 
47
- ## Rules
53
+ ## Constraints
48
54
 
49
55
  - Every research topic must tie to a business need from BUSINESS_BRIEF.md
50
56
  - "Interesting" is not enough — research must be actionable
@@ -1,8 +1,14 @@
1
1
  ---
2
2
  name: Synthesizer
3
- role: doer
3
+ role: worker
4
+ squad: "research"
5
+ provider: "{{PROVIDER}}"
4
6
  model: sonnet
5
7
  effort: high
8
+ trigger: "event"
9
+ cooldown: "30m"
10
+ timeout: 1800
11
+ max_retries: 2
6
12
  tools:
7
13
  - Read
8
14
  - Write
@@ -10,9 +16,11 @@ tools:
10
16
 
11
17
  # Research Synthesizer
12
18
 
19
+ ## Role
20
+
13
21
  Turn raw findings from the analyst into a cohesive report that a human can act on in 5 minutes.
14
22
 
15
- ## Instructions
23
+ ## How You Work
16
24
 
17
25
  1. Read the analyst's findings from `.agents/memory/research/analyst/state.md`
18
26
  2. Read the research agenda from `.agents/memory/research/lead/state.md`
@@ -20,7 +28,7 @@ Turn raw findings from the analyst into a cohesive report that a human can act o
20
28
  4. Produce a synthesis report in the REQUIRED FORMAT below
21
29
  5. Save report to `.agents/memory/research/synthesizer/state.md`
22
30
 
23
- ## Output Format (REQUIRED)
31
+ ## Output
24
32
 
25
33
  ```markdown
26
34
  # Research Synthesis — {date}
@@ -50,7 +58,7 @@ What should we actually do? Ranked by impact.
50
58
  | P1 | {action} | {rationale} |
51
59
  ```
52
60
 
53
- ## Rules
61
+ ## Constraints
54
62
 
55
63
  - The executive summary is the most important section — if someone reads nothing else, they get the picture
56
64
  - Don't parrot findings — synthesize. Connect dots the analyst didn't
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/lib/llm-clis.ts"],"sourcesContent":["/**\n * Multi-LLM CLI Support\n *\n * Enables squads to use different LLM providers by delegating to their native CLIs.\n * Unix-style composition: each provider maintains their own CLI, we orchestrate.\n *\n * @see specs/multi-llm.md\n */\n\nimport { execSync } from 'child_process';\n\nexport interface CLIConfig {\n /** Provider identifier (matches provider field in SQUAD.md/agent.md) */\n provider: string;\n\n /** Display name for UI */\n displayName: string;\n\n /** CLI command name */\n command: string;\n\n /** Install instructions */\n install: string;\n\n /** Build non-interactive args for execution */\n buildArgs: (prompt: string, options?: RunOptions) => string[];\n}\n\nexport interface RunOptions {\n /** Model override (for providers that support it) */\n model?: string;\n\n /** Working directory */\n cwd?: string;\n\n /** Dry run - just show what would execute */\n dryRun?: boolean;\n}\n\n/**\n * Check if a command exists in PATH\n */\nexport function commandExists(command: string): boolean {\n try {\n execSync(`which ${command}`, { stdio: 'pipe' });\n return true;\n } catch {\n return false;\n }\n}\n\n/**\n * LLM CLI registry\n * Maps provider IDs to their CLI configurations\n */\nexport const LLM_CLIS: Record<string, CLIConfig> = {\n anthropic: {\n provider: 'anthropic',\n displayName: 'Anthropic',\n command: 'claude',\n install: 'npm i -g @anthropic-ai/claude-code',\n buildArgs: (prompt) => ['--print', prompt],\n },\n\n google: {\n provider: 'google',\n displayName: 'Google',\n command: 'gemini',\n install: 'npm i -g @google/gemini-cli',\n buildArgs: (prompt) => ['--yolo', '--prompt', prompt],\n },\n\n openai: {\n provider: 'openai',\n displayName: 'OpenAI',\n command: 'codex',\n install: 'npm i -g @openai/codex',\n buildArgs: (prompt) => ['exec', prompt],\n },\n\n mistral: {\n provider: 'mistral',\n displayName: 'Mistral',\n command: 'vibe',\n install: 'curl -LsSf https://mistral.ai/vibe/install.sh | bash',\n buildArgs: (prompt) => ['--prompt', prompt, '--auto-approve'],\n },\n\n xai: {\n provider: 'xai',\n displayName: 'xAI',\n command: 'grok',\n install: 'bun add -g @vibe-kit/grok-cli',\n buildArgs: (prompt) => ['--prompt', prompt],\n },\n\n aider: {\n provider: 'aider',\n displayName: 'Aider (Multi)',\n command: 'aider',\n install: 'pip install aider-install && aider-install',\n buildArgs: (prompt) => ['--message', prompt, '--yes'],\n },\n\n ollama: {\n provider: 'ollama',\n displayName: 'Ollama (Local)',\n command: 'ollama',\n install: 'brew install ollama',\n buildArgs: (prompt, opts) => ['run', opts?.model || 'llama3.1', prompt],\n },\n};\n\nexport interface CLIStatus {\n provider: string;\n displayName: string;\n command: string;\n available: boolean;\n install: string;\n}\n\n/**\n * Get status of all LLM CLIs\n */\nexport function getAllCLIStatus(): CLIStatus[] {\n return Object.values(LLM_CLIS).map((cli) => ({\n provider: cli.provider,\n displayName: cli.displayName,\n command: cli.command,\n available: commandExists(cli.command),\n install: cli.install,\n }));\n}\n\n/**\n * Get CLI config for a provider\n */\nexport function getCLIConfig(provider: string): CLIConfig | undefined {\n return LLM_CLIS[provider];\n}\n\n/**\n * Check if a provider's CLI is available\n */\nexport function isProviderCLIAvailable(provider: string): boolean {\n const config = LLM_CLIS[provider];\n if (!config) return false;\n return commandExists(config.command);\n}\n"],"mappings":";;;AASA,SAAS,gBAAgB;AAiClB,SAAS,cAAc,SAA0B;AACtD,MAAI;AACF,aAAS,SAAS,OAAO,IAAI,EAAE,OAAO,OAAO,CAAC;AAC9C,WAAO;AAAA,EACT,QAAQ;AACN,WAAO;AAAA,EACT;AACF;AAMO,IAAM,WAAsC;AAAA,EACjD,WAAW;AAAA,IACT,UAAU;AAAA,IACV,aAAa;AAAA,IACb,SAAS;AAAA,IACT,SAAS;AAAA,IACT,WAAW,CAAC,WAAW,CAAC,WAAW,MAAM;AAAA,EAC3C;AAAA,EAEA,QAAQ;AAAA,IACN,UAAU;AAAA,IACV,aAAa;AAAA,IACb,SAAS;AAAA,IACT,SAAS;AAAA,IACT,WAAW,CAAC,WAAW,CAAC,UAAU,YAAY,MAAM;AAAA,EACtD;AAAA,EAEA,QAAQ;AAAA,IACN,UAAU;AAAA,IACV,aAAa;AAAA,IACb,SAAS;AAAA,IACT,SAAS;AAAA,IACT,WAAW,CAAC,WAAW,CAAC,QAAQ,MAAM;AAAA,EACxC;AAAA,EAEA,SAAS;AAAA,IACP,UAAU;AAAA,IACV,aAAa;AAAA,IACb,SAAS;AAAA,IACT,SAAS;AAAA,IACT,WAAW,CAAC,WAAW,CAAC,YAAY,QAAQ,gBAAgB;AAAA,EAC9D;AAAA,EAEA,KAAK;AAAA,IACH,UAAU;AAAA,IACV,aAAa;AAAA,IACb,SAAS;AAAA,IACT,SAAS;AAAA,IACT,WAAW,CAAC,WAAW,CAAC,YAAY,MAAM;AAAA,EAC5C;AAAA,EAEA,OAAO;AAAA,IACL,UAAU;AAAA,IACV,aAAa;AAAA,IACb,SAAS;AAAA,IACT,SAAS;AAAA,IACT,WAAW,CAAC,WAAW,CAAC,aAAa,QAAQ,OAAO;AAAA,EACtD;AAAA,EAEA,QAAQ;AAAA,IACN,UAAU;AAAA,IACV,aAAa;AAAA,IACb,SAAS;AAAA,IACT,SAAS;AAAA,IACT,WAAW,CAAC,QAAQ,SAAS,CAAC,OAAO,MAAM,SAAS,YAAY,MAAM;AAAA,EACxE;AACF;AAaO,SAAS,kBAA+B;AAC7C,SAAO,OAAO,OAAO,QAAQ,EAAE,IAAI,CAAC,SAAS;AAAA,IAC3C,UAAU,IAAI;AAAA,IACd,aAAa,IAAI;AAAA,IACjB,SAAS,IAAI;AAAA,IACb,WAAW,cAAc,IAAI,OAAO;AAAA,IACpC,SAAS,IAAI;AAAA,EACf,EAAE;AACJ;AAKO,SAAS,aAAa,UAAyC;AACpE,SAAO,SAAS,QAAQ;AAC1B;AAKO,SAAS,uBAAuB,UAA2B;AAChE,QAAM,SAAS,SAAS,QAAQ;AAChC,MAAI,CAAC,OAAQ,QAAO;AACpB,SAAO,cAAc,OAAO,OAAO;AACrC;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/commands/history.ts"],"sourcesContent":["/**\n * squads history - Show recent agent execution history\n *\n * Sources:\n * 1. PostgreSQL traces table (via API)\n * 2. Local session history (.agents/sessions/history.jsonl)\n */\n\nimport { existsSync, readFileSync } from 'fs';\nimport { join } from 'path';\nimport {\n colors,\n bold,\n RESET,\n gradient,\n padEnd,\n truncate,\n icons,\n writeLine,\n} from '../lib/terminal.js';\nimport { getEnv } from '../lib/env-config.js';\n\nconst BRIDGE_URL = getEnv().bridge_url;\nconst FETCH_TIMEOUT_MS = 3000;\n\ninterface Execution {\n id: string;\n squad: string;\n agent: string;\n startedAt: Date;\n endedAt?: Date;\n durationMs?: number;\n status: 'success' | 'error' | 'running';\n cost?: number;\n tokens?: number;\n error?: string;\n}\n\ninterface HistoryOptions {\n days?: number;\n squad?: string;\n verbose?: boolean;\n json?: boolean;\n}\n\n/**\n * Fetch with timeout to prevent hanging\n */\nasync function fetchWithTimeout(url: string, timeoutMs = FETCH_TIMEOUT_MS): Promise<Response> {\n const controller = new AbortController();\n const timeoutId = setTimeout(() => controller.abort(), timeoutMs);\n\n try {\n const response = await fetch(url, { signal: controller.signal });\n clearTimeout(timeoutId);\n return response;\n } catch {\n clearTimeout(timeoutId);\n throw new Error('Request timed out');\n }\n}\n\n/**\n * Fetch executions from bridge/postgres\n */\nasync function fetchFromBridge(days: number, squad?: string): Promise<Execution[]> {\n try {\n const params = new URLSearchParams({\n days: String(days),\n ...(squad && { squad }),\n });\n\n const response = await fetchWithTimeout(`${BRIDGE_URL}/api/executions?${params}`);\n\n if (!response.ok) {\n return [];\n }\n\n interface BridgeExecution {\n id?: string;\n squad?: string;\n agent?: string;\n started_at?: string;\n ended_at?: string;\n duration_ms?: number;\n status?: string;\n cost_usd?: number;\n total_tokens?: number;\n error?: string;\n }\n\n const data = await response.json() as { executions?: BridgeExecution[] };\n return (data.executions || []).map((e: BridgeExecution) => ({\n id: e.id || '',\n squad: e.squad || 'unknown',\n agent: e.agent || 'unknown',\n startedAt: new Date(e.started_at || Date.now()),\n endedAt: e.ended_at ? new Date(e.ended_at) : undefined,\n durationMs: e.duration_ms,\n status: (e.status as Execution['status']) || 'success',\n cost: e.cost_usd,\n tokens: e.total_tokens,\n error: e.error,\n }));\n } catch {\n return [];\n }\n}\n\n/**\n * Fetch executions from local session history\n */\nfunction fetchFromLocal(days: number, squad?: string): Execution[] {\n const executions: Execution[] = [];\n\n // Try multiple possible locations\n const historyPaths = [\n join(process.cwd(), '.agents/sessions/history.jsonl'),\n join(process.env.HOME || '', 'agents-squads/hq/.agents/sessions/history.jsonl'),\n ];\n\n let historyPath: string | undefined;\n for (const path of historyPaths) {\n if (existsSync(path)) {\n historyPath = path;\n break;\n }\n }\n\n if (!historyPath) {\n return [];\n }\n\n try {\n const content = readFileSync(historyPath, 'utf-8');\n const lines = content.trim().split('\\n').filter(Boolean);\n const cutoff = Date.now() - days * 24 * 60 * 60 * 1000;\n\n interface SessionEvent {\n type?: string;\n timestamp?: string;\n squad?: string;\n agent?: string;\n sessionId?: string;\n duration?: number;\n status?: string;\n cost?: number;\n tokens?: number;\n }\n\n for (const line of lines) {\n try {\n const event = JSON.parse(line) as SessionEvent;\n const timestamp = new Date(event.timestamp || 0);\n\n if (timestamp.getTime() < cutoff) continue;\n if (squad && event.squad !== squad) continue;\n\n // Convert session events to executions\n if (event.type === 'session_end' || event.type === 'agent_complete') {\n executions.push({\n id: event.sessionId || `local-${Date.now()}`,\n squad: event.squad || 'unknown',\n agent: event.agent || 'unknown',\n startedAt: timestamp,\n durationMs: event.duration,\n status: event.status === 'error' ? 'error' : 'success',\n cost: event.cost,\n tokens: event.tokens,\n });\n }\n } catch {\n // Skip invalid lines\n }\n }\n } catch {\n // File read error\n }\n\n return executions;\n}\n\n/**\n * Format duration in human-readable form\n */\nfunction formatDuration(ms?: number): string {\n if (!ms) return '—';\n\n const seconds = Math.floor(ms / 1000);\n if (seconds < 60) return `${seconds}s`;\n\n const minutes = Math.floor(seconds / 60);\n const remainingSeconds = seconds % 60;\n if (minutes < 60) return `${minutes}m ${remainingSeconds}s`;\n\n const hours = Math.floor(minutes / 60);\n const remainingMinutes = minutes % 60;\n return `${hours}h ${remainingMinutes}m`;\n}\n\n/**\n * Group executions by date\n */\nfunction groupByDate(executions: Execution[]): Map<string, Execution[]> {\n const groups = new Map<string, Execution[]>();\n\n for (const exec of executions) {\n const dateKey = exec.startedAt.toISOString().split('T')[0];\n if (!groups.has(dateKey)) {\n groups.set(dateKey, []);\n }\n groups.get(dateKey)!.push(exec);\n }\n\n return groups;\n}\n\n/**\n * Format date for display\n */\nfunction formatDateHeader(dateStr: string): string {\n const date = new Date(dateStr);\n const today = new Date();\n const yesterday = new Date(today);\n yesterday.setDate(yesterday.getDate() - 1);\n\n if (dateStr === today.toISOString().split('T')[0]) {\n return `Today (${date.toLocaleDateString('en-US', { month: 'short', day: 'numeric' })})`;\n }\n if (dateStr === yesterday.toISOString().split('T')[0]) {\n return `Yesterday (${date.toLocaleDateString('en-US', { month: 'short', day: 'numeric' })})`;\n }\n return date.toLocaleDateString('en-US', { weekday: 'short', month: 'short', day: 'numeric' });\n}\n\nexport async function historyCommand(options: HistoryOptions = {}): Promise<void> {\n const days = options.days || 7;\n const squad = options.squad;\n const verbose = options.verbose || false;\n const jsonOutput = options.json || false;\n\n writeLine();\n writeLine(` ${gradient('squads')} ${colors.dim}history${RESET}`);\n writeLine();\n\n // Fetch from both sources\n const [bridgeExecs, localExecs] = await Promise.all([\n fetchFromBridge(days, squad),\n Promise.resolve(fetchFromLocal(days, squad)),\n ]);\n\n // Merge and deduplicate (prefer bridge data)\n const seenIds = new Set<string>();\n const allExecutions: Execution[] = [];\n\n for (const exec of bridgeExecs) {\n seenIds.add(exec.id);\n allExecutions.push(exec);\n }\n\n for (const exec of localExecs) {\n if (!seenIds.has(exec.id)) {\n allExecutions.push(exec);\n }\n }\n\n // Sort by start time descending\n allExecutions.sort((a, b) => b.startedAt.getTime() - a.startedAt.getTime());\n\n if (jsonOutput) {\n console.log(JSON.stringify(allExecutions, null, 2));\n return;\n }\n\n if (allExecutions.length === 0) {\n writeLine(` ${colors.dim}No executions found in the last ${days} day(s)${RESET}`);\n writeLine();\n writeLine(` ${colors.dim}Tip: Run agents with 'squads run <squad>' to see history${RESET}`);\n writeLine();\n return;\n }\n\n // Group by date\n const grouped = groupByDate(allExecutions);\n\n // Display\n const source = bridgeExecs.length > 0 ? 'postgres' : 'local';\n writeLine(` ${colors.dim}${allExecutions.length} executions (last ${days}d, source: ${source})${RESET}`);\n writeLine();\n\n for (const [dateStr, execs] of grouped) {\n writeLine(` ${bold}${formatDateHeader(dateStr)}${RESET}`);\n\n // Table header\n writeLine(` ${colors.purple}┌${'─'.repeat(60)}┐${RESET}`);\n writeLine(` ${colors.purple}│${RESET} ${padEnd('TIME', 7)}${padEnd('SQUAD', 13)}${padEnd('AGENT', 16)}${padEnd('DURATION', 10)}${padEnd('STATUS', 8)}${colors.purple}│${RESET}`);\n writeLine(` ${colors.purple}├${'─'.repeat(60)}┤${RESET}`);\n\n for (const exec of execs) {\n const time = exec.startedAt.toLocaleTimeString('en-US', { hour: '2-digit', minute: '2-digit', hour12: false });\n const squadName = truncate(exec.squad, 11);\n const agentName = truncate(exec.agent, 14);\n const duration = formatDuration(exec.durationMs);\n\n let statusIcon: string;\n let statusColor: string;\n switch (exec.status) {\n case 'success':\n statusIcon = icons.success;\n statusColor = colors.green;\n break;\n case 'error':\n statusIcon = icons.error;\n statusColor = colors.red;\n break;\n case 'running':\n statusIcon = icons.progress;\n statusColor = colors.cyan;\n break;\n default:\n statusIcon = icons.empty;\n statusColor = colors.dim;\n }\n\n writeLine(` ${colors.purple}│${RESET} ${colors.dim}${time}${RESET} ${colors.cyan}${padEnd(squadName, 12)}${RESET}${padEnd(agentName, 16)}${padEnd(duration, 10)}${statusColor}${statusIcon}${RESET} ${colors.purple}│${RESET}`);\n\n // Verbose: show cost and tokens\n if (verbose && (exec.cost || exec.tokens)) {\n const costStr = exec.cost ? `$${exec.cost.toFixed(2)}` : '';\n const tokenStr = exec.tokens ? `${exec.tokens.toLocaleString()} tokens` : '';\n const details = [costStr, tokenStr].filter(Boolean).join(' │ ');\n writeLine(` ${colors.purple}│${RESET} ${colors.dim}└ ${details}${RESET}${' '.repeat(Math.max(0, 45 - details.length))}${colors.purple}│${RESET}`);\n }\n\n // Show error if present\n if (exec.error) {\n writeLine(` ${colors.purple}│${RESET} ${colors.red}└ ${truncate(exec.error, 45)}${RESET}${' '.repeat(Math.max(0, 45 - exec.error.length))}${colors.purple}│${RESET}`);\n }\n }\n\n writeLine(` ${colors.purple}└${'─'.repeat(60)}┘${RESET}`);\n writeLine();\n }\n\n // Summary\n const successCount = allExecutions.filter(e => e.status === 'success').length;\n const errorCount = allExecutions.filter(e => e.status === 'error').length;\n const totalCost = allExecutions.reduce((sum, e) => sum + (e.cost || 0), 0);\n\n writeLine(` ${colors.dim}Summary:${RESET} ${colors.green}${successCount} success${RESET} ${errorCount > 0 ? `${colors.red}${errorCount} errors${RESET} ` : ''}${totalCost > 0 ? `${colors.cyan}$${totalCost.toFixed(2)} total${RESET}` : ''}`);\n writeLine();\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAQA,SAAS,YAAY,oBAAoB;AACzC,SAAS,YAAY;AAarB,IAAM,aAAa,OAAO,EAAE;AAC5B,IAAM,mBAAmB;AAyBzB,eAAe,iBAAiB,KAAa,YAAY,kBAAqC;AAC5F,QAAM,aAAa,IAAI,gBAAgB;AACvC,QAAM,YAAY,WAAW,MAAM,WAAW,MAAM,GAAG,SAAS;AAEhE,MAAI;AACF,UAAM,WAAW,MAAM,MAAM,KAAK,EAAE,QAAQ,WAAW,OAAO,CAAC;AAC/D,iBAAa,SAAS;AACtB,WAAO;AAAA,EACT,QAAQ;AACN,iBAAa,SAAS;AACtB,UAAM,IAAI,MAAM,mBAAmB;AAAA,EACrC;AACF;AAKA,eAAe,gBAAgB,MAAc,OAAsC;AACjF,MAAI;AACF,UAAM,SAAS,IAAI,gBAAgB;AAAA,MACjC,MAAM,OAAO,IAAI;AAAA,MACjB,GAAI,SAAS,EAAE,MAAM;AAAA,IACvB,CAAC;AAED,UAAM,WAAW,MAAM,iBAAiB,GAAG,UAAU,mBAAmB,MAAM,EAAE;AAEhF,QAAI,CAAC,SAAS,IAAI;AAChB,aAAO,CAAC;AAAA,IACV;AAeA,UAAM,OAAO,MAAM,SAAS,KAAK;AACjC,YAAQ,KAAK,cAAc,CAAC,GAAG,IAAI,CAAC,OAAwB;AAAA,MAC1D,IAAI,EAAE,MAAM;AAAA,MACZ,OAAO,EAAE,SAAS;AAAA,MAClB,OAAO,EAAE,SAAS;AAAA,MAClB,WAAW,IAAI,KAAK,EAAE,cAAc,KAAK,IAAI,CAAC;AAAA,MAC9C,SAAS,EAAE,WAAW,I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;AACnE,QAAM,YAAY,cAAc,OAAO,CAAC,KAAK,MAAM,OAAO,EAAE,QAAQ,IAAI,CAAC;AAEzE,YAAU,KAAK,OAAO,GAAG,WAAW,KAAK,IAAI,OAAO,KAAK,GAAG,YAAY,WAAW,KAAK,KAAK,aAAa,IAAI,GAAG,OAAO,GAAG,GAAG,UAAU,UAAU,KAAK,OAAO,EAAE,GAAG,YAAY,IAAI,GAAG,OAAO,IAAI,IAAI,UAAU,QAAQ,CAAC,CAAC,SAAS,KAAK,KAAK,EAAE,EAAE;AAChP,YAAU;AACZ;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/commands/init.ts","../src/lib/setup-checks.ts"],"sourcesContent":["/**\n * squads init - Plant the seed\n *\n * Creates:\n * - Use-case specific squads (Engineering, Marketing, Operations, or all)\n * - CLI skill (teaches agents how to use squads CLI)\n * - Core squads (company + research + intelligence) for all use cases\n * - CLAUDE.md (operating manual for all Claude instances)\n * - BUSINESS_BRIEF.md (from user input)\n * - Memory directories (persistent state)\n * - Claude Code hooks (session tracking)\n */\n\nimport chalk from 'chalk';\nimport ora from 'ora';\nimport fs from 'fs/promises';\nimport path from 'path';\nimport { execSync } from 'child_process';\nimport { createInterface } from 'readline';\nimport { checkGitStatus, getRepoName } from '../lib/git.js';\nimport { track, Events } from '../lib/telemetry.js';\nimport {\n loadTemplate,\n type TemplateVariables,\n} from '../lib/templates.js';\nimport {\n PROVIDERS,\n checkGhCli,\n runAuthChecks,\n displayCheckResults,\n} from '../lib/setup-checks.js';\nimport { writeLine } from '../lib/terminal.js';\n\nexport interface InitOptions {\n provider?: string;\n skipInfra?: boolean;\n force?: boolean;\n yes?: boolean;\n quick?: boolean;\n pack?: string[];\n}\n\ntype Provider = 'claude' | 'gemini' | 'openai' | 'ollama' | 'cursor' | 'aider' | 'none';\n\ntype UseCase = 'engineering' | 'marketing' | 'operations' | 'full-company' | 'custom';\n\n/**\n * Use-case configuration: squads, files, memory dirs, and display info\n */\ninterface UseCaseConfig {\n label: string;\n description: string;\n squads: SquadConfig[];\n}\n\ninterface SquadConfig {\n name: string;\n description: string;\n agentCount: number;\n agentSummary: string;\n dirs: string[];\n files: [string, string][]; // [destPath, templatePath]\n memoryFiles: [string, string][]; // [destPath, templatePath]\n}\n\n/**\n * Define what each use case creates\n */\nfunction getUseCaseConfig(useCase: UseCase): UseCaseConfig {\n const configs: Record<UseCase, UseCaseConfig> = {\n engineering: {\n label: 'Engineering',\n description: 'Ships code',\n squads: [getEngineeringSquad()],\n },\n marketing: {\n label: 'Marketing',\n description: 'Grows audience',\n squads: [getMarketingSquad()],\n },\n operations: {\n label: 'Operations',\n description: 'Runs the business',\n squads: [getOperationsSquad()],\n },\n 'full-company': {\n label: 'Full Company',\n description: 'Enterprise — Engineering + Marketing + Operations',\n squads: [getEngineeringSquad(), getMarketingSquad(), getOperationsSquad()],\n },\n custom: {\n label: 'Custom',\n description: 'Empty scaffold — you build from scratch',\n squads: [],\n },\n };\n\n return configs[useCase];\n}\n\nfunction getProductSquad(): SquadConfig {\n return {\n name: 'product',\n description: 'Roadmap, specs, user feedback synthesis',\n agentCount: 3,\n agentSummary: 'lead, scanner, worker',\n dirs: [\n '.agents/squads/product',\n '.agents/memory/product/lead',\n '.agents/memory/product/scanner',\n '.agents/memory/product/worker',\n ],\n files: [\n ['.agents/squads/product/SQUAD.md', 'squads/product/SQUAD.md'],\n ['.agents/squads/product/lead.md', 'squads/product/lead.md'],\n ['.agents/squads/product/scanner.md', 'squads/product/scanner.md'],\n ['.agents/squads/product/worker.md', 'squads/product/worker.md'],\n ],\n memoryFiles: [\n ['.agents/memory/product/lead/state.md', 'memory/product/lead/state.md'],\n ],\n };\n}\n\nfunction getEngineeringSquad(): SquadConfig {\n return {\n name: 'engineering',\n description: 'Solves GitHub issues, reviews code, writes tests',\n agentCount: 3,\n agentSummary: 'issue-solver, code-reviewer, test-writer',\n dirs: [\n '.agents/squads/engineering',\n '.agents/memory/engineering/issue-solver',\n '.agents/memory/engineering/code-reviewer',\n '.agents/memory/engineering/test-writer',\n ],\n files: [\n ['.agents/squads/engineering/SQUAD.md', 'squads/engineering/SQUAD.md'],\n ['.agents/squads/engineering/issue-solver.md', 'squads/engineering/issue-solver.md'],\n ['.agents/squads/engineering/code-reviewer.md', 'squads/engineering/code-reviewer.md'],\n ['.agents/squads/engineering/test-writer.md', 'squads/engineering/test-writer.md'],\n ],\n memoryFiles: [\n ['.agents/memory/engineering/issue-solver/state.md', 'memory/engineering/issue-solver/state.md'],\n ],\n };\n}\n\nfunction getMarketingSquad(): SquadConfig {\n return {\n name: 'marketing',\n description: 'Creates content, grows audience, tracks growth',\n agentCount: 3,\n agentSummary: 'content-drafter, social-poster, growth-analyst',\n dirs: [\n '.agents/squads/marketing',\n '.agents/memory/marketing/content-drafter',\n '.agents/memory/marketing/social-poster',\n '.agents/memory/marketing/growth-analyst',\n ],\n files: [\n ['.agents/squads/marketing/SQUAD.md', 'squads/marketing/SQUAD.md'],\n ['.agents/squads/marketing/content-drafter.md', 'squads/marketing/content-drafter.md'],\n ['.agents/squads/marketing/social-poster.md', 'squads/marketing/social-poster.md'],\n ['.agents/squads/marketing/growth-analyst.md', 'squads/marketing/growth-analyst.md'],\n ],\n memoryFiles: [\n ['.agents/memory/marketing/content-drafter/state.md', 'memory/marketing/content-drafter/state.md'],\n ],\n };\n}\n\nfunction getOperationsSquad(): SquadConfig {\n return {\n name: 'operations',\n description: 'Runs daily ops, tracks finances and goals',\n agentCount: 3,\n agentSummary: 'ops-lead, finance-tracker, goal-tracker',\n dirs: [\n '.agents/squads/operations',\n '.agents/memory/operations/ops-lead',\n '.agents/memory/operations/finance-tracker',\n '.agents/memory/operations/goal-tracker',\n ],\n files: [\n ['.agents/squads/operations/SQUAD.md', 'squads/operations/SQUAD.md'],\n ['.agents/squads/operations/ops-lead.md', 'squads/operations/ops-lead.md'],\n ['.agents/squads/operations/finance-tracker.md', 'squads/operations/finance-tracker.md'],\n ['.agents/squads/operations/goal-tracker.md', 'squads/operations/goal-tracker.md'],\n ],\n memoryFiles: [\n ['.agents/memory/operations/ops-lead/state.md', 'memory/operations/ops-lead/state.md'],\n ],\n };\n}\n\nfunction isInteractive(): boolean {\n return process.stdin.isTTY === true && process.stdout.isTTY === true;\n}\n\nasync function prompt(question: string, defaultValue = ''): Promise<string> {\n if (!isInteractive()) return defaultValue;\n\n const rl = createInterface({\n input: process.stdin,\n output: process.stdout,\n });\n\n return new Promise((resolve) => {\n const suffix = defaultValue ? chalk.dim(` (${defaultValue})`) : '';\n rl.question(` ${question}${suffix} `, (answer) => {\n rl.close();\n resolve(answer.trim() || defaultValue);\n });\n });\n}\n\nasync function promptProvider(forceProvider?: string): Promise<Provider> {\n if (forceProvider && forceProvider in PROVIDERS) {\n return forceProvider as Provider;\n }\n if (!isInteractive()) return 'claude';\n\n writeLine();\n writeLine(chalk.bold(' Select your AI assistant:'));\n writeLine();\n writeLine(` ${chalk.cyan('1)')} Claude Code ${chalk.dim('(recommended)')}`);\n writeLine(` ${chalk.cyan('2)')} Gemini`);\n writeLine(` ${chalk.cyan('3)')} OpenAI GPT`);\n writeLine(` ${chalk.cyan('4)')} Ollama ${chalk.dim('(local)')}`);\n writeLine(` ${chalk.cyan('5)')} Other/None`);\n writeLine();\n\n const rl = createInterface({\n input: process.stdin,\n output: process.stdout,\n });\n\n return new Promise((resolve) => {\n rl.question(` ${chalk.dim('Enter choice [1-5]:')} `, (answer) => {\n rl.close();\n const choice = answer.trim() || '1';\n switch (choice) {\n case '1': resolve('claude'); break;\n case '2': resolve('gemini'); break;\n case '3': resolve('openai'); break;\n case '4': resolve('ollama'); break;\n case '5': resolve('none'); break;\n default: resolve('claude'); break;\n }\n });\n });\n}\n\n\nasync function fileExists(filePath: string): Promise<boolean> {\n try {\n await fs.access(filePath);\n return true;\n } catch {\n return false;\n }\n}\n\n/**\n * Load a seed template from templates/seed/\n * Falls back to bundled templates in dist/templates/seed/\n */\nfunction loadSeedTemplate(templatePath: string, variables: TemplateVariables = {}): string {\n // Try loading from seed directory\n return loadTemplate(`seed/${templatePath}`, variables);\n}\n\n/**\n * Write a file only if it doesn't already exist (safe for re-runs)\n */\nasync function writeIfNew(filePath: string, content: string): Promise<boolean> {\n if (await fileExists(filePath)) return false;\n await fs.mkdir(path.dirname(filePath), { recursive: true });\n await fs.writeFile(filePath, content);\n return true;\n}\n\n/**\n * Write a file, creating directories as needed\n */\nasync function writeFile(filePath: string, content: string): Promise<void> {\n await fs.mkdir(path.dirname(filePath), { recursive: true });\n await fs.writeFile(filePath, content);\n}\n\n/**\n * Main init command - plant the seed\n */\nexport async function initCommand(options: InitOptions): Promise<void> {\n const cwd = process.cwd();\n\n // 1. Welcome\n writeLine();\n writeLine(chalk.bold(' Plant the seed for your AI workforce'));\n writeLine(chalk.dim(' https://agents-squads.com/docs/getting-started'));\n writeLine();\n\n // 2. Select provider\n const selectedProvider = await promptProvider(options.provider);\n const provider = PROVIDERS[selectedProvider];\n\n // 3. Prerequisite checks\n writeLine();\n writeLine(chalk.bold(' Checking prerequisites...'));\n writeLine();\n\n const checks = [\n ...runAuthChecks(selectedProvider),\n checkGhCli(),\n ];\n\n // Check Git\n const gitStatus = checkGitStatus(cwd);\n if (!gitStatus.isGitRepo) {\n checks.push({\n name: 'Git Repository',\n status: 'missing' as const,\n message: 'Git is the coordination layer',\n hint: 'Run: git init',\n fixCommand: 'git init',\n });\n } else {\n checks.push({ name: 'Git Repository', status: 'ok' as const });\n if (gitStatus.hasRemote) {\n const repoName = getRepoName(gitStatus.remoteUrl);\n checks.push({ name: `Remote: ${repoName || gitStatus.remoteUrl}`, status: 'ok' as const });\n }\n }\n\n const { hasErrors } = displayCheckResults(checks);\n\n if (hasErrors && !options.force) {\n writeLine();\n writeLine(chalk.red(' Fix the errors above before continuing.'));\n writeLine(chalk.dim(' Or run with --force to skip checks.'));\n writeLine();\n process.exit(1);\n }\n\n writeLine();\n\n // 4. Ask about the business\n let businessName: string;\n let businessDescription: string;\n let businessFocus: string;\n let businessCompetitors: string;\n let selectedUseCase: UseCase;\n\n if (options.yes || options.quick || !isInteractive()) {\n businessName = path.basename(cwd);\n businessDescription = 'A startup building and integrating AI smart capabilities for autonomous execution.';\n businessFocus = 'Track the big AI players — Anthropic, OpenAI, Google, Amazon, Meta, and xAI: latest model releases, API changes, pricing shifts, and strategic moves that affect builders.';\n businessCompetitors = '';\n selectedUseCase = 'custom'; // Core 4 squads only; use --pack for more\n } else {\n const dirName = path.basename(cwd);\n\n writeLine(chalk.bold(' Tell us about your business:'));\n writeLine(chalk.dim(' (Agents read this to produce useful output — be specific)'));\n writeLine();\n\n businessName = await prompt(\n 'Company or project name?',\n dirName\n );\n\n writeLine(chalk.dim(' e.g., \"We sell handmade coffee mugs online\" or \"B2B SaaS for construction teams\"'));\n businessDescription = await prompt(\n 'What does it do? (one sentence)',\n ''\n );\n // Require a non-empty description — empty = generic output on first run\n if (!businessDescription) {\n writeLine(chalk.dim(` Tip: Without a description, agents produce generic output. You can edit .agents/BUSINESS_BRIEF.md later.`));\n businessDescription = `${businessName} — add your business description to .agents/BUSINESS_BRIEF.md`;\n }\n\n writeLine();\n writeLine(chalk.dim(' e.g., \"Identify our top 3 competitors and what they do better than us\"'));\n businessFocus = await prompt(\n 'What should your agents research first?',\n 'Our market position, top competitors, and biggest growth opportunity'\n );\n\n writeLine();\n writeLine(chalk.dim(' e.g., \"BlueCart, MarketMan\" — leave blank to skip'));\n businessCompetitors = await prompt(\n 'Who are your main competitors? (optional)',\n ''\n );\n\n // 4b. Additional packs\n if (!options.pack) {\n writeLine();\n writeLine(chalk.bold(' Add squad packs? (optional)'));\n writeLine();\n writeLine(` ${chalk.cyan('1)')} Core only ${chalk.dim('— intelligence, research, product, company')} ${chalk.green('(recommended)')}`);\n writeLine(` ${chalk.cyan('2)')} + Engineering ${chalk.dim('— issue-solver, code-reviewer, test-writer')}`);\n writeLine(` ${chalk.cyan('3)')} + All packs ${chalk.dim('— engineering, marketing, operations')}`);\n writeLine();\n\n const rl = createInterface({\n input: process.stdin,\n output: process.stdout,\n });\n\n const packChoice = await new Promise<string>((resolve) => {\n rl.question(` ${chalk.dim('Enter choice [1-3]:')} `, (answer) => {\n rl.close();\n resolve(answer.trim() || '1');\n });\n });\n\n if (packChoice === '2') {\n options.pack = ['engineering'];\n } else if (packChoice === '3') {\n options.pack = ['all'];\n }\n }\n\n selectedUseCase = 'custom'; // Core 4 squads; packs handled separately\n }\n\n const useCaseConfig = getUseCaseConfig(selectedUseCase);\n\n // 4c. Pack support\n if (options.pack && options.pack.length > 0) {\n const additionalSquads: SquadConfig[] = [];\n for (const pack of options.pack) {\n if (pack === 'engineering') additionalSquads.push(getEngineeringSquad());\n if (pack === 'marketing') additionalSquads.push(getMarketingSquad());\n if (pack === 'operations') additionalSquads.push(getOperationsSquad());\n if (pack === 'all') {\n additionalSquads.push(getEngineeringSquad(), getMarketingSquad(), getOperationsSquad());\n }\n }\n // De-duplicate squads by name\n const existingNames = new Set(useCaseConfig.squads.map(s => s.name));\n for (const squad of additionalSquads) {\n if (!existingNames.has(squad.name)) {\n useCaseConfig.squads.push(squad);\n existingNames.add(squad.name);\n }\n }\n }\n\n // Calculate totals (core squads + use-case squads)\n const coreAgentCount = 14; // company(5) + research(3) + intelligence(3) + product(3)\n const coreSquadCount = 4;\n const useCaseAgentCount = useCaseConfig.squads.reduce((sum, s) => sum + s.agentCount, 0);\n const totalAgentCount = coreAgentCount + useCaseAgentCount;\n const totalSquadCount = coreSquadCount + useCaseConfig.squads.length;\n\n writeLine();\n writeLine(` ${chalk.green('✓')} Business: ${chalk.cyan(businessName)}${businessDescription ? chalk.dim(` — ${businessDescription}`) : ''}`);\n writeLine(` ${chalk.green('✓')} Provider: ${chalk.cyan(provider?.name || selectedProvider)}`);\n writeLine(` ${chalk.green('✓')} Research focus: ${chalk.cyan(businessFocus)}`);\n if (businessCompetitors) {\n writeLine(` ${chalk.green('✓')} Competitors: ${chalk.cyan(businessCompetitors)}`);\n }\n if (options.pack && options.pack.length > 0) {\n writeLine(` ${chalk.green('✓')} Packs: ${chalk.cyan(options.pack.join(', '))}`);\n }\n writeLine();\n\n // 5. Create the seed\n const spinner = ora('Planting the seed...').start();\n\n try {\n // Only show PLACEHOLDER sentinel when user skipped the description in interactive mode\n const isPlaceholder = businessDescription.includes('add your business description');\n const variables: TemplateVariables = {\n BUSINESS_NAME: businessName,\n BUSINESS_DESCRIPTION: businessDescription || `${businessName} — details to be added by the manager agent.`,\n BUSINESS_FOCUS: businessFocus,\n COMPETITORS_SECTION: businessCompetitors\n ? `## Competitors\\n\\n${businessCompetitors}\\n\\n`\n : '',\n PLACEHOLDER_SENTINEL: isPlaceholder\n ? '<!-- STATUS: PLACEHOLDER — Edit this file before running agents. -->\\n<!-- Agents that read \"PLACEHOLDER\" in this comment will ask you to fill it in. -->\\n\\n'\n : '',\n PROVIDER: selectedProvider,\n PROVIDER_NAME: provider?.name || 'Unknown',\n };\n\n // Core directories (always created)\n const dirs = [\n '.agents/squads/company',\n '.agents/squads/research',\n '.agents/squads/intelligence',\n '.agents/squads/product',\n '.agents/memory/company/manager',\n '.agents/memory/company/event-dispatcher',\n '.agents/memory/company/goal-tracker',\n '.agents/memory/company/company-eval',\n '.agents/memory/company/company-critic',\n '.agents/memory/research/lead',\n '.agents/memory/research/analyst',\n '.agents/memory/research/synthesizer',\n '.agents/memory/intelligence/intel-lead',\n '.agents/memory/intelligence/intel-eval',\n '.agents/memory/intelligence/intel-critic',\n '.agents/memory/product/lead',\n '.agents/skills/squads-cli',\n '.agents/skills/gh',\n '.agents/config',\n ];\n\n // Add use-case specific directories\n for (const squad of useCaseConfig.squads) {\n dirs.push(...squad.dirs);\n }\n\n if (selectedProvider === 'claude') {\n dirs.push('.claude');\n }\n\n for (const dir of dirs) {\n await fs.mkdir(path.join(cwd, dir), { recursive: true });\n }\n\n spinner.text = 'Creating squad definitions...';\n\n // Core squad files (always created)\n const companyFiles: [string, string][] = [\n ['.agents/squads/company/SQUAD.md', 'squads/company/SQUAD.md'],\n ['.agents/squads/company/manager.md', 'squads/company/manager.md'],\n ['.agents/squads/company/event-dispatcher.md', 'squads/company/event-dispatcher.md'],\n ['.agents/squads/company/goal-tracker.md', 'squads/company/goal-tracker.md'],\n ['.agents/squads/company/company-eval.md', 'squads/company/company-eval.md'],\n ['.agents/squads/company/company-critic.md', 'squads/company/company-critic.md'],\n ];\n\n const researchFiles: [string, string][] = [\n ['.agents/squads/research/SQUAD.md', 'squads/research/SQUAD.md'],\n ['.agents/squads/research/lead.md', 'squads/research/lead.md'],\n ['.agents/squads/research/analyst.md', 'squads/research/analyst.md'],\n ['.agents/squads/research/synthesizer.md', 'squads/research/synthesizer.md'],\n ];\n\n const intelligenceFiles: [string, string][] = [\n ['.agents/squads/intelligence/SQUAD.md', 'squads/intelligence/SQUAD.md'],\n ['.agents/squads/intelligence/intel-lead.md', 'squads/intelligence/intel-lead.md'],\n ['.agents/squads/intelligence/intel-eval.md', 'squads/intelligence/intel-eval.md'],\n ['.agents/squads/intelligence/intel-critic.md', 'squads/intelligence/intel-critic.md'],\n ];\n\n const productFiles: [string, string][] = getProductSquad().files;\n\n // Collect all use-case squad files\n const useCaseFiles: [string, string][] = [];\n for (const squad of useCaseConfig.squads) {\n useCaseFiles.push(...squad.files);\n }\n\n // Write all squad files\n for (const [dest, template] of [...companyFiles, ...researchFiles, ...intelligenceFiles, ...productFiles, ...useCaseFiles]) {\n const content = loadSeedTemplate(template, variables);\n await writeFile(path.join(cwd, dest), content);\n }\n\n spinner.text = 'Creating memory and config...';\n\n // Core memory state files\n const coreMemoryFiles: [string, string][] = [\n ['.agents/memory/company/manager/state.md', 'memory/company/manager/state.md'],\n ['.agents/memory/research/lead/state.md', 'memory/research/lead/state.md'],\n ['.agents/memory/intelligence/intel-lead/state.md', 'memory/intelligence/intel-lead/state.md'],\n ['.agents/memory/product/lead/state.md', 'memory/product/lead/state.md'],\n ];\n\n // Use-case memory state files\n const useCaseMemoryFiles: [string, string][] = [];\n for (const squad of useCaseConfig.squads) {\n useCaseMemoryFiles.push(...squad.memoryFiles);\n }\n\n for (const [dest, template] of [...coreMemoryFiles, ...useCaseMemoryFiles]) {\n await writeIfNew(path.join(cwd, dest), loadSeedTemplate(template, variables));\n }\n\n // Skills\n const skillContent = loadSeedTemplate('skills/squads-cli/SKILL.md', variables);\n await writeFile(path.join(cwd, '.agents/skills/squads-cli/SKILL.md'), skillContent);\n\n const ghSkillContent = loadSeedTemplate('skills/gh/SKILL.md', variables);\n await writeFile(path.join(cwd, '.agents/skills/gh/SKILL.md'), ghSkillContent);\n\n // Provider config\n const providerConfig = loadSeedTemplate('config/provider.yaml', variables);\n await writeFile(path.join(cwd, '.agents/config/provider.yaml'), providerConfig);\n\n // System protocol (Layer 0 of context cascade)\n const systemMd = loadSeedTemplate('config/SYSTEM.md', variables);\n await writeFile(path.join(cwd, '.agents/config/SYSTEM.md'), systemMd);\n\n // Directives (Layer 3 of context cascade)\n const directivesMd = loadSeedTemplate('memory/company/directives.md', variables);\n await writeIfNew(path.join(cwd, '.agents/memory/company/directives.md'), directivesMd);\n\n // Business brief\n const businessBrief = loadSeedTemplate('BUSINESS_BRIEF.md.template', variables);\n await writeFile(path.join(cwd, '.agents/BUSINESS_BRIEF.md'), businessBrief);\n\n // AGENTS.md (repo root — vendor-neutral agent instructions)\n const agentsMd = loadTemplate('core/AGENTS.md.template', variables);\n await writeIfNew(path.join(cwd, 'AGENTS.md'), agentsMd);\n\n // README.md (only if it doesn't already exist or is the default single-line stub)\n const readmePath = path.join(cwd, 'README.md');\n let existingReadme = '';\n try {\n existingReadme = await fs.readFile(readmePath, 'utf-8');\n } catch {\n // File doesn't exist\n }\n const isStub = existingReadme.trim() === '' || /^# [^\\n]+\\s*$/.test(existingReadme.trim());\n if (isStub) {\n const readmeContent = loadSeedTemplate('README.md.template', variables);\n await writeFile(readmePath, readmeContent);\n }\n\n spinner.text = 'Setting up operating manual...';\n\n // CLAUDE.md (the operating manual — only if it doesn't exist)\n if (selectedProvider === 'claude') {\n const claudeMd = loadSeedTemplate('CLAUDE.md.template', variables);\n await writeIfNew(path.join(cwd, 'CLAUDE.md'), claudeMd);\n\n // Claude Code hooks\n const hooksContent = loadSeedTemplate('hooks/settings.json.template', variables);\n await writeIfNew(path.join(cwd, '.claude/settings.json'), hooksContent);\n }\n\n spinner.succeed('Seed planted');\n\n // Track initialization\n await track(Events.CLI_INIT, {\n success: true,\n hasGit: gitStatus.isGitRepo,\n hasRemote: gitStatus.hasRemote,\n provider: selectedProvider,\n useCase: selectedUseCase,\n agentCount: totalAgentCount,\n squadCount: totalSquadCount,\n hasBusinessName: businessName !== path.basename(cwd),\n hasBusinessDescription: businessDescription.length > 0,\n });\n\n } catch (error) {\n spinner.fail('Failed to plant the seed');\n const err = error as NodeJS.ErrnoException;\n if (err?.code === 'EACCES' || err?.code === 'EPERM') {\n writeLine(chalk.red(' Permission denied — cannot write to this directory.'));\n writeLine(chalk.dim(' Try running in a directory you own, or check folder permissions.'));\n } else if (err?.code === 'ENOENT') {\n writeLine(chalk.red(` Could not find or create: ${err.path || 'unknown path'}`));\n writeLine(chalk.dim(' Check that the directory exists and you have write access.'));\n } else {\n const msg = error instanceof Error ? error.message : String(error);\n writeLine(chalk.red(` ${msg}`));\n writeLine(chalk.dim(' Run with --verbose for more details, or check squads doctor.'));\n }\n process.exit(1);\n }\n\n // 5b. Auto-commit scaffolding (agents need at least one commit for worktrees)\n try {\n execSync('git add -A && git commit -q -m \"feat: init AI workforce\\n\\nCo-Authored-By: Claude <noreply@anthropic.com>\"', {\n cwd,\n stdio: 'ignore',\n });\n } catch {\n // Commit may fail if nothing to add or git not configured — non-fatal\n }\n\n // 6. Success message\n writeLine();\n writeLine(chalk.green.bold(` ${businessName}'s AI workforce is ready.`));\n writeLine();\n writeLine(chalk.dim(' Created:'));\n\n // Core squads (always present)\n writeLine(chalk.dim(' • research/ 3 agents — Researches your market, competitors, and opportunities'));\n writeLine(chalk.dim(' • company/ 5 agents — Manages goals, events, and strategy'));\n writeLine(chalk.dim(' • intelligence/ 3 agents — Monitors trends and competitive signals'));\n writeLine(chalk.dim(' • product/ 3 agents — Roadmap, specs, user feedback synthesis'));\n\n // Additional pack squads\n for (const squad of useCaseConfig.squads) {\n const namePad = ' '.repeat(Math.max(0, 14 - squad.name.length));\n writeLine(chalk.dim(` • ${squad.name}/${namePad}${squad.agentCount} agents — ${squad.description}`));\n }\n\n writeLine(chalk.dim(' • .agents/skills/ CLI + GitHub workflow skills'));\n writeLine(chalk.dim(' • .agents/memory/ Persistent state'));\n writeLine(chalk.dim(' • .agents/BUSINESS_BRIEF.md'));\n writeLine(chalk.dim(' • AGENTS.md Agent instructions (vendor-neutral)'));\n if (selectedProvider === 'claude') {\n writeLine(chalk.dim(' • CLAUDE.md Operating manual'));\n writeLine(chalk.dim(' • .claude/settings.json Session hooks'));\n }\n writeLine();\n writeLine(chalk.bold(' Getting started:'));\n writeLine();\n writeLine(` ${chalk.cyan('1.')} ${chalk.yellow('$EDITOR .agents/BUSINESS_BRIEF.md')}`);\n writeLine(chalk.dim(' Set your business context — agents use this for every run'));\n writeLine();\n // Dynamic \"first run\" suggestion based on use case\n const firstRunCommand = getFirstRunCommand(selectedUseCase);\n const squadCommand = firstRunCommand.command.replace(/\\/[^/]+$/, '');\n writeLine(` ${chalk.cyan('2.')} ${chalk.yellow(firstRunCommand.command)}`);\n writeLine(chalk.dim(` ${firstRunCommand.description}`));\n writeLine(chalk.dim(` Full squad (4+ agents, longer): ${squadCommand}`));\n writeLine();\n writeLine(` ${chalk.cyan('3.')} ${chalk.yellow(`squads run`)}`);\n writeLine(chalk.dim(' Autopilot — runs all squads on schedule, learns between cycles'));\n writeLine(chalk.dim(` Options: squads run --once (single cycle), squads run -i 15 --budget 50`));\n writeLine();\n writeLine(chalk.dim(' Docs: https://agents-squads.com/docs/getting-started'));\n writeLine();\n }\n\n/**\n * Get the suggested first command based on installed packs\n */\nfunction getFirstRunCommand(useCase: UseCase): { command: string; description: string } {\n switch (useCase) {\n case 'engineering':\n return {\n command: 'squads run engineering/issue-solver',\n description: 'Run a single agent — finds and solves GitHub issues (~2 min)',\n };\n case 'marketing':\n return {\n command: 'squads run marketing/content-drafter',\n description: 'Run a single agent — drafts content for your business (~2 min)',\n };\n case 'operations':\n return {\n command: 'squads run operations/ops-lead',\n description: 'Run a single agent — coordinates daily operations (~2 min)',\n };\n case 'full-company':\n case 'custom':\n default:\n return {\n command: 'squads run research/lead',\n description: 'Run a single agent — researches the topic you set (~2 min)',\n };\n }\n}\n\n","/**\n * Setup checks and validation for squads setup command\n * Provides prerequisite checking with helpful fix guidance\n */\n\nimport { execSync, spawn } from 'child_process';\nimport {\n colors,\n RESET,\n icons,\n writeLine,\n} from './terminal.js';\n\nexport type CheckStatus = 'ok' | 'missing' | 'warning' | 'error';\n\nexport interface CheckResult {\n name: string;\n status: CheckStatus;\n message?: string;\n hint?: string;\n fixCommand?: string;\n}\n\nexport interface ProviderInfo {\n id: string;\n name: string;\n cliCheck?: string;\n envKey?: string;\n installCmd?: string;\n loginCmd?: string;\n requiresSubscription: boolean;\n requiresApiKey: boolean;\n}\n\nexport const PROVIDERS: Record<string, ProviderInfo> = {\n claude: {\n id: 'claude',\n name: 'Claude Code (Anthropic)',\n cliCheck: 'claude',\n installCmd: 'npm install -g @anthropic-ai/claude-code',\n loginCmd: 'claude login',\n requiresSubscription: true,\n requiresApiKey: false,\n },\n gemini: {\n id: 'gemini',\n name: 'Gemini (Google)',\n cliCheck: 'gemini',\n envKey: 'GEMINI_API_KEY',\n installCmd: 'npm install -g @anthropic-ai/claude-code', // Placeholder - gemini CLI\n requiresSubscription: false,\n requiresApiKey: true,\n },\n openai: {\n id: 'openai',\n name: 'GPT (OpenAI)',\n envKey: 'OPENAI_API_KEY',\n requiresSubscription: false,\n requiresApiKey: true,\n },\n ollama: {\n id: 'ollama',\n name: 'Ollama (Local)',\n cliCheck: 'ollama',\n installCmd: 'brew install ollama',\n requiresSubscription: false,\n requiresApiKey: false,\n },\n cursor: {\n id: 'cursor',\n name: 'Cursor IDE',\n requiresSubscription: true,\n requiresApiKey: false,\n },\n aider: {\n id: 'aider',\n name: 'Aider',\n cliCheck: 'aider',\n installCmd: 'pip install aider-chat',\n requiresSubscription: false,\n requiresApiKey: true,\n },\n none: {\n id: 'none',\n name: 'Planning Only (no agent execution)',\n requiresSubscription: false,\n requiresApiKey: false,\n },\n};\n\n/**\n * Check if a command exists in PATH\n */\nexport function commandExists(cmd: string): boolean {\n try {\n execSync(`which ${cmd}`, { stdio: 'ignore' });\n return true;\n } catch {\n return false;\n }\n}\n\n/**\n * Check if Docker is running\n */\nexport function isDockerRunning(): boolean {\n try {\n execSync('docker info', { stdio: 'ignore' });\n return true;\n } catch {\n return false;\n }\n}\n\n/**\n * Check if Colima is running (alternative to Docker Desktop on macOS)\n */\nexport function isColimaRunning(): boolean {\n try {\n const result = execSync('colima status', { encoding: 'utf-8', stdio: ['pipe', 'pipe', 'ignore'] });\n return result.includes('Running');\n } catch {\n return false;\n }\n}\n\n/**\n * Check Docker/Colima prerequisites (informational only, never required)\n */\nexport function checkDockerPrereqs(): CheckResult {\n // Docker is never required for the CLI — purely informational\n if (isDockerRunning()) {\n return { name: 'Docker', status: 'ok', message: 'Available (optional)' };\n }\n\n if (commandExists('docker')) {\n if (commandExists('colima') && isColimaRunning()) {\n return { name: 'Docker (Colima)', status: 'ok', message: 'Available (optional)' };\n }\n }\n\n // Not installed or not running — that's fine\n return {\n name: 'Docker',\n status: 'ok',\n message: 'Not detected (optional — not required for CLI usage)',\n };\n}\n\n/**\n * Check GitHub CLI\n */\nexport function checkGhCli(): CheckResult {\n if (!commandExists('gh')) {\n return {\n name: 'GitHub CLI',\n status: 'warning',\n message: 'Recommended for GitHub integration',\n hint: 'Install: https://cli.github.com',\n };\n }\n\n // Check if authenticated\n try {\n execSync('gh auth status', { stdio: 'ignore' });\n return { name: 'GitHub CLI', status: 'ok' };\n } catch {\n return {\n name: 'GitHub CLI',\n status: 'warning',\n message: 'Installed but not authenticated',\n hint: 'Run: gh auth login',\n fixCommand: 'gh auth login',\n };\n }\n}\n\n/**\n * Check GitHub token permissions\n */\nexport function checkGhPermissions(): CheckResult {\n try {\n // Get current scopes\n const result = execSync('gh auth status 2>&1', { encoding: 'utf-8', stdio: ['pipe', 'pipe', 'pipe'] });\n\n // Check for required scopes\n const hasRepo = result.includes('repo') || result.includes('Token scopes:') && !result.includes('none');\n const hasWorkflow = result.includes('workflow');\n\n if (!hasRepo) {\n return {\n name: 'GitHub Permissions',\n status: 'warning',\n message: 'Missing repo scope',\n hint: 'Run: gh auth refresh -s repo,workflow',\n fixCommand: 'gh auth refresh -s repo,workflow',\n };\n }\n\n if (!hasWorkflow) {\n return {\n name: 'GitHub Permissions',\n status: 'warning',\n message: 'Missing workflow scope (optional)',\n hint: 'For Actions: gh auth refresh -s repo,workflow',\n };\n }\n\n return { name: 'GitHub Permissions', status: 'ok' };\n } catch {\n return {\n name: 'GitHub Permissions',\n status: 'warning',\n message: 'Could not verify permissions',\n hint: 'Run: gh auth status',\n };\n }\n}\n\n/**\n * Check Claude CLI\n */\nexport function checkClaudeCli(): CheckResult {\n if (!commandExists('claude')) {\n return {\n name: 'Claude CLI',\n status: 'missing',\n message: 'Required to run agents',\n hint: 'Install: npm install -g @anthropic-ai/claude-code',\n fixCommand: 'npm install -g @anthropic-ai/claude-code',\n };\n }\n\n // Check if logged in by running claude --version\n try {\n execSync('claude --version', { stdio: 'ignore' });\n return { name: 'Claude CLI', status: 'ok' };\n } catch {\n return {\n name: 'Claude CLI',\n status: 'warning',\n message: 'Installed but may need login',\n hint: 'Run: claude login',\n fixCommand: 'claude login',\n };\n }\n}\n\n/**\n * Check provider-specific requirements\n */\nexport function checkProviderAuth(providerId: string): CheckResult {\n const provider = PROVIDERS[providerId];\n if (!provider) {\n return { name: 'Provider', status: 'warning', message: `Unknown provider: ${providerId}` };\n }\n\n // No requirements for none/cursor\n if (providerId === 'none' || providerId === 'cursor') {\n return { name: provider.name, status: 'ok' };\n }\n\n // Check CLI if required\n if (provider.cliCheck) {\n if (!commandExists(provider.cliCheck)) {\n return {\n name: provider.name,\n status: 'missing',\n message: `CLI not installed`,\n hint: provider.installCmd ? `Install: ${provider.installCmd}` : undefined,\n fixCommand: provider.installCmd,\n };\n }\n }\n\n // Check API key if required\n if (provider.envKey && provider.requiresApiKey) {\n if (!process.env[provider.envKey]) {\n return {\n name: provider.name,\n status: 'warning',\n message: `${provider.envKey} not set`,\n hint: `Set environment variable: export ${provider.envKey}=<your-key>`,\n };\n }\n }\n\n return { name: provider.name, status: 'ok' };\n}\n\n/**\n * Run all prerequisite checks\n */\nexport function runPrereqChecks(): CheckResult[] {\n return [\n checkDockerPrereqs(),\n checkGhCli(),\n ];\n}\n\n/**\n * Run all auth checks for a specific provider\n */\nexport function runAuthChecks(providerId: string): CheckResult[] {\n const checks: CheckResult[] = [];\n\n // Provider-specific auth (includes CLI check)\n checks.push(checkProviderAuth(providerId));\n\n // GitHub permissions (for all providers that use GitHub)\n if (providerId !== 'none') {\n checks.push(checkGhPermissions());\n }\n\n return checks;\n}\n\n/**\n * Display check results with formatting\n */\nexport function displayCheckResults(checks: CheckResult[]): {\n hasErrors: boolean;\n hasWarnings: boolean;\n errorChecks: CheckResult[];\n warningChecks: CheckResult[];\n} {\n const errorChecks: CheckResult[] = [];\n const warningChecks: CheckResult[] = [];\n\n for (const check of checks) {\n const icon = getStatusIcon(check.status);\n const statusColor = getStatusColor(check.status);\n\n if (check.status === 'ok') {\n writeLine(` ${icon} ${check.name}`);\n } else {\n const suffix = check.message ? ` ${colors.dim}(${check.message})${RESET}` : '';\n writeLine(` ${icon} ${statusColor}${check.name}${RESET}${suffix}`);\n\n if (check.hint) {\n writeLine(` ${colors.cyan}→ ${check.hint}${RESET}`);\n }\n\n if (check.status === 'error' || check.status === 'missing') {\n errorChecks.push(check);\n } else if (check.status === 'warning') {\n warningChecks.push(check);\n }\n }\n }\n\n return {\n hasErrors: errorChecks.length > 0,\n hasWarnings: warningChecks.length > 0,\n errorChecks,\n warningChecks,\n };\n}\n\nfunction getStatusIcon(status: CheckStatus): string {\n switch (status) {\n case 'ok':\n return `${colors.green}${icons.success}${RESET}`;\n case 'warning':\n return `${colors.yellow}${icons.warning}${RESET}`;\n case 'missing':\n case 'error':\n return `${colors.red}${icons.error}${RESET}`;\n }\n}\n\nfunction getStatusColor(status: CheckStatus): string {\n switch (status) {\n case 'ok':\n return colors.green;\n case 'warning':\n return colors.yellow;\n case 'missing':\n case 'error':\n return colors.red;\n }\n}\n\n/**\n * Attempt to fix a failed check by running its fix command\n */\nexport async function attemptFix(check: CheckResult): Promise<boolean> {\n if (!check.fixCommand) {\n return false;\n }\n\n writeLine();\n writeLine(` ${colors.cyan}${icons.progress}${RESET} Running: ${colors.dim}${check.fixCommand}${RESET}`);\n writeLine();\n\n return new Promise((resolve) => {\n const proc = spawn(check.fixCommand!, [], {\n stdio: 'inherit',\n shell: true,\n });\n\n proc.on('close', (code) => {\n resolve(code === 0);\n });\n\n proc.on('error', () => {\n resolve(false);\n });\n });\n}\n\n/**\n * Wait for a service to be ready with retry\n */\nexport async function waitForService(\n name: string,\n checkFn: () => boolean | Promise<boolean>,\n maxAttempts = 30,\n intervalMs = 1000\n): Promise<boolean> {\n for (let i = 0; i < maxAttempts; i++) {\n const ready = await checkFn();\n if (ready) {\n return true;\n }\n await new Promise((resolve) => setTimeout(resolve, intervalMs));\n }\n return false;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAaA,OAAO,WAAW;AAClB,OAAO,SAAS;AAChB,OAAO,QAAQ;AACf,OAAO,UAAU;AACjB,SAAS,YAAAA,iBAAgB;AACzB,SAAS,uBAAuB;;;ACbhC,SAAS,UAAU,aAAa;AA6BzB,IAAM,YAA0C;AAAA,EACrD,QAAQ;AAAA,IACN,IAAI;AAAA,IACJ,MAAM;AAAA,IACN,UAAU;AAAA,IACV,YAAY;AAAA,IACZ,UAAU;AAAA,IACV,sBAAsB;AAAA,IACtB,gBAAgB;AAAA,EAClB;AAAA,EACA,QAAQ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