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
@@ -3,12 +3,6 @@ import {
3
3
  Events,
4
4
  track
5
5
  } from "./chunk-QJ7C7CMB.js";
6
- import {
7
- findSquadsDir,
8
- listSquads,
9
- loadSquad,
10
- resolveExecutionContext
11
- } from "./chunk-TYFTF53O.js";
12
6
  import {
13
7
  RESET,
14
8
  bold,
@@ -19,6 +13,12 @@ import {
19
13
  padEnd,
20
14
  writeLine
21
15
  } from "./chunk-M5FXNY6Y.js";
16
+ import {
17
+ findSquadsDir,
18
+ listSquads,
19
+ loadSquad,
20
+ resolveExecutionContext
21
+ } from "./chunk-TYFTF53O.js";
22
22
  import "./chunk-7OCVIDC7.js";
23
23
 
24
24
  // src/commands/context.ts
@@ -288,4 +288,4 @@ export {
288
288
  contextPromptCommand,
289
289
  contextShowCommand
290
290
  };
291
- //# sourceMappingURL=context-GWPF4SEY.js.map
291
+ //# sourceMappingURL=context-PYTO2UQG.js.map
@@ -4,26 +4,12 @@ import {
4
4
  fetchRateLimits
5
5
  } from "./chunk-WVOIY5GW.js";
6
6
  import "./chunk-LOA3KWYJ.js";
7
- import {
8
- getEnv
9
- } from "./chunk-EHQJHRIW.js";
10
7
  import {
11
8
  getLiveSessionSummaryAsync
12
9
  } from "./chunk-BODLDQY7.js";
13
10
  import {
14
11
  getMultiRepoGitStats
15
12
  } from "./chunk-TZXD6WFN.js";
16
- import {
17
- findSquadsDir,
18
- listAgents,
19
- listSquads,
20
- loadSquad
21
- } from "./chunk-TYFTF53O.js";
22
- import {
23
- findMemoryDir,
24
- getSquadState,
25
- searchMemory
26
- } from "./chunk-ZTQ7ISUR.js";
27
13
  import {
28
14
  RESET,
29
15
  bold,
@@ -34,6 +20,20 @@ import {
34
20
  padEnd,
35
21
  writeLine
36
22
  } from "./chunk-M5FXNY6Y.js";
23
+ import {
24
+ findMemoryDir,
25
+ getSquadState,
26
+ searchMemory
27
+ } from "./chunk-ZTQ7ISUR.js";
28
+ import {
29
+ getEnv
30
+ } from "./chunk-EHQJHRIW.js";
31
+ import {
32
+ findSquadsDir,
33
+ listAgents,
34
+ listSquads,
35
+ loadSquad
36
+ } from "./chunk-TYFTF53O.js";
37
37
  import "./chunk-7OCVIDC7.js";
38
38
 
39
39
  // src/commands/context-feed.ts
@@ -391,4 +391,4 @@ async function contextFeedCommand(options = {}) {
391
391
  export {
392
392
  contextFeedCommand
393
393
  };
394
- //# sourceMappingURL=context-feed-AJGVAR6H.js.map
394
+ //# sourceMappingURL=context-feed-TLVZZ24S.js.map
@@ -4,16 +4,10 @@ import {
4
4
  fetchBridgeStats
5
5
  } from "./chunk-WVOIY5GW.js";
6
6
  import "./chunk-LOA3KWYJ.js";
7
- import "./chunk-EHQJHRIW.js";
8
7
  import {
9
8
  Events,
10
9
  track
11
10
  } from "./chunk-QJ7C7CMB.js";
12
- import {
13
- findSquadsDir,
14
- listSquads,
15
- loadSquad
16
- } from "./chunk-TYFTF53O.js";
17
11
  import {
18
12
  RESET,
19
13
  bold,
@@ -23,6 +17,12 @@ import {
23
17
  padEnd,
24
18
  writeLine
25
19
  } from "./chunk-M5FXNY6Y.js";
20
+ import "./chunk-EHQJHRIW.js";
21
+ import {
22
+ findSquadsDir,
23
+ listSquads,
24
+ loadSquad
25
+ } from "./chunk-TYFTF53O.js";
26
26
  import "./chunk-7OCVIDC7.js";
27
27
 
28
28
  // src/commands/cost.ts
@@ -272,4 +272,4 @@ export {
272
272
  budgetCheckCommand,
273
273
  costCommand
274
274
  };
275
- //# sourceMappingURL=cost-XBCDJ7XC.js.map
275
+ //# sourceMappingURL=cost-OALPURUQ.js.map
@@ -12,11 +12,13 @@ import {
12
12
  isMaxPlan
13
13
  } from "./chunk-WVOIY5GW.js";
14
14
  import "./chunk-LOA3KWYJ.js";
15
- import "./chunk-EHQJHRIW.js";
16
15
  import {
17
16
  cleanupStaleSessions,
18
17
  getLiveSessionSummaryAsync
19
18
  } from "./chunk-BODLDQY7.js";
19
+ import {
20
+ checkForUpdate
21
+ } from "./chunk-J6QF4ZQX.js";
20
22
  import {
21
23
  getActivitySparkline,
22
24
  getGitHubStatsOptimized,
@@ -26,18 +28,6 @@ import {
26
28
  Events,
27
29
  track
28
30
  } from "./chunk-QJ7C7CMB.js";
29
- import {
30
- findSquadsDir,
31
- hasLocalInfraConfig,
32
- listSquads,
33
- loadSquad
34
- } from "./chunk-TYFTF53O.js";
35
- import {
36
- findMemoryDir
37
- } from "./chunk-ZTQ7ISUR.js";
38
- import {
39
- checkForUpdate
40
- } from "./chunk-J6QF4ZQX.js";
41
31
  import {
42
32
  RESET,
43
33
  barChart,
@@ -52,6 +42,16 @@ import {
52
42
  truncate,
53
43
  writeLine
54
44
  } from "./chunk-M5FXNY6Y.js";
45
+ import {
46
+ findMemoryDir
47
+ } from "./chunk-ZTQ7ISUR.js";
48
+ import "./chunk-EHQJHRIW.js";
49
+ import {
50
+ findSquadsDir,
51
+ hasLocalInfraConfig,
52
+ listSquads,
53
+ loadSquad
54
+ } from "./chunk-TYFTF53O.js";
55
55
  import "./chunk-7OCVIDC7.js";
56
56
 
57
57
  // src/commands/dashboard.ts
@@ -948,4 +948,4 @@ function renderROICached(cache, goalCount) {
948
948
  export {
949
949
  dashboardCommand
950
950
  };
951
- //# sourceMappingURL=dashboard-LGT2B2BL.js.map
951
+ //# sourceMappingURL=dashboard-HQIEHTZC.js.map
@@ -1,7 +1,4 @@
1
1
  #!/usr/bin/env node
2
- import {
3
- findProjectRoot
4
- } from "./chunk-TYFTF53O.js";
5
2
  import {
6
3
  RESET,
7
4
  colors,
@@ -9,6 +6,9 @@ import {
9
6
  padEnd,
10
7
  writeLine
11
8
  } from "./chunk-M5FXNY6Y.js";
9
+ import {
10
+ findProjectRoot
11
+ } from "./chunk-TYFTF53O.js";
12
12
  import "./chunk-7OCVIDC7.js";
13
13
 
14
14
  // src/commands/doctor.ts
@@ -371,4 +371,4 @@ async function doctorCommand(options = {}) {
371
371
  export {
372
372
  doctorCommand
373
373
  };
374
- //# sourceMappingURL=doctor-XPUIIBHJ.js.map
374
+ //# sourceMappingURL=doctor-TWHMR23W.js.map
@@ -9,7 +9,6 @@ import {
9
9
  Events,
10
10
  track
11
11
  } from "./chunk-QJ7C7CMB.js";
12
- import "./chunk-ZTQ7ISUR.js";
13
12
  import {
14
13
  RESET,
15
14
  bold,
@@ -20,6 +19,7 @@ import {
20
19
  padEnd,
21
20
  writeLine
22
21
  } from "./chunk-M5FXNY6Y.js";
22
+ import "./chunk-ZTQ7ISUR.js";
23
23
  import "./chunk-7OCVIDC7.js";
24
24
 
25
25
  // src/commands/exec.ts
@@ -220,4 +220,4 @@ export {
220
220
  execShowCommand,
221
221
  execStatsCommand
222
222
  };
223
- //# sourceMappingURL=exec-OUXM7JBF.js.map
223
+ //# sourceMappingURL=exec-DYLI4TXY.js.map
@@ -3,13 +3,6 @@ import {
3
3
  Events,
4
4
  track
5
5
  } from "./chunk-QJ7C7CMB.js";
6
- import {
7
- loadSquad
8
- } from "./chunk-TYFTF53O.js";
9
- import {
10
- appendToMemory,
11
- findMemoryDir
12
- } from "./chunk-ZTQ7ISUR.js";
13
6
  import {
14
7
  RESET,
15
8
  bold,
@@ -20,6 +13,13 @@ import {
20
13
  padEnd,
21
14
  writeLine
22
15
  } from "./chunk-M5FXNY6Y.js";
16
+ import {
17
+ appendToMemory,
18
+ findMemoryDir
19
+ } from "./chunk-ZTQ7ISUR.js";
20
+ import {
21
+ loadSquad
22
+ } from "./chunk-TYFTF53O.js";
23
23
  import "./chunk-7OCVIDC7.js";
24
24
 
25
25
  // src/commands/feedback.ts
@@ -226,4 +226,4 @@ export {
226
226
  feedbackShowCommand,
227
227
  feedbackStatsCommand
228
228
  };
229
- //# sourceMappingURL=feedback-KNAOG5QK.js.map
229
+ //# sourceMappingURL=feedback-5AEACUX6.js.map
@@ -3,13 +3,6 @@ import {
3
3
  Events,
4
4
  track
5
5
  } from "./chunk-QJ7C7CMB.js";
6
- import {
7
- addGoalToSquad,
8
- findSquadsDir,
9
- listSquads,
10
- loadSquad,
11
- updateGoalInSquad
12
- } from "./chunk-TYFTF53O.js";
13
6
  import {
14
7
  RESET,
15
8
  bold,
@@ -19,6 +12,13 @@ import {
19
12
  truncate,
20
13
  writeLine
21
14
  } from "./chunk-M5FXNY6Y.js";
15
+ import {
16
+ addGoalToSquad,
17
+ findSquadsDir,
18
+ listSquads,
19
+ loadSquad,
20
+ updateGoalInSquad
21
+ } from "./chunk-TYFTF53O.js";
22
22
  import "./chunk-7OCVIDC7.js";
23
23
 
24
24
  // src/commands/goal.ts
@@ -165,4 +165,4 @@ export {
165
165
  goalProgressCommand,
166
166
  goalSetCommand
167
167
  };
168
- //# sourceMappingURL=goal-BVHV5573.js.map
168
+ //# sourceMappingURL=goal-XUNV3CKV.js.map
@@ -1,7 +1,4 @@
1
1
  #!/usr/bin/env node
2
- import {
3
- getEnv
4
- } from "./chunk-EHQJHRIW.js";
5
2
  import {
6
3
  RESET,
7
4
  colors,
@@ -10,6 +7,9 @@ import {
10
7
  padEnd,
11
8
  writeLine
12
9
  } from "./chunk-M5FXNY6Y.js";
10
+ import {
11
+ getEnv
12
+ } from "./chunk-EHQJHRIW.js";
13
13
  import "./chunk-7OCVIDC7.js";
14
14
 
15
15
  // src/commands/health.ts
@@ -215,4 +215,4 @@ async function healthCommand(_options = {}) {
215
215
  export {
216
216
  healthCommand
217
217
  };
218
- //# sourceMappingURL=health-4UXN44PF.js.map
218
+ //# sourceMappingURL=health-ZF3HSA4W.js.map
@@ -1,7 +1,4 @@
1
1
  #!/usr/bin/env node
2
- import {
3
- getEnv
4
- } from "./chunk-EHQJHRIW.js";
5
2
  import {
6
3
  RESET,
7
4
  bold,
@@ -12,6 +9,9 @@ import {
12
9
  truncate,
13
10
  writeLine
14
11
  } from "./chunk-M5FXNY6Y.js";
12
+ import {
13
+ getEnv
14
+ } from "./chunk-EHQJHRIW.js";
15
15
  import "./chunk-7OCVIDC7.js";
16
16
 
17
17
  // src/commands/history.ts
@@ -62,7 +62,7 @@ function fetchFromLocal(days, squad) {
62
62
  const executions = [];
63
63
  const historyPaths = [
64
64
  join(process.cwd(), ".agents/sessions/history.jsonl"),
65
- join(process.env.HOME || "", "agents-squads/hq/.agents/sessions/history.jsonl")
65
+ join(process.env.HOME || "", ".squads-cli/history.jsonl")
66
66
  ];
67
67
  let historyPath;
68
68
  for (const path of historyPaths) {
@@ -229,4 +229,4 @@ async function historyCommand(options = {}) {
229
229
  export {
230
230
  historyCommand
231
231
  };
232
- //# sourceMappingURL=history-ILH3SWHB.js.map
232
+ //# sourceMappingURL=history-WP6R5BNG.js.map
@@ -0,0 +1 @@
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 || '', '.squads-cli/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,CAA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AM,SAAI,SAAI,OAAO,EAAE,CAAC,SAAI,KAAK,EAAE;AACzD,cAAU;AAAA,EACZ;AAGA,QAAM,eAAe,cAAc,OAAO,OAAK,EAAE,WAAW,SAAS,EAAE;AACvE,QAAM,aAAa,cAAc,OAAO,OAAK,EAAE,WAAW,OAAO,EAAE;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,11 +1,11 @@
1
1
  #!/usr/bin/env node
2
- import {
3
- loadTemplate
4
- } from "./chunk-FFFCFZ6A.js";
5
2
  import {
6
3
  checkGitStatus,
7
4
  getRepoName
8
5
  } from "./chunk-TZXD6WFN.js";
6
+ import {
7
+ loadTemplate
8
+ } from "./chunk-FFFCFZ6A.js";
9
9
  import {
10
10
  Events,
11
11
  track
@@ -25,6 +25,7 @@ import fs from "fs/promises";
25
25
  import path from "path";
26
26
  import { execSync as execSync2 } from "child_process";
27
27
  import { createInterface } from "readline";
28
+ import { existsSync, readFileSync } from "fs";
28
29
 
29
30
  // src/lib/setup-checks.ts
30
31
  import { execSync, spawn } from "child_process";
@@ -158,7 +159,7 @@ function checkProviderAuth(providerId) {
158
159
  if (!commandExists(provider.cliCheck)) {
159
160
  return {
160
161
  name: provider.name,
161
- status: "missing",
162
+ status: "warning",
162
163
  message: `CLI not installed`,
163
164
  hint: provider.installCmd ? `Install: ${provider.installCmd}` : void 0,
164
165
  fixCommand: provider.installCmd
@@ -359,6 +360,57 @@ function getOperationsSquad() {
359
360
  ]
360
361
  };
361
362
  }
363
+ function detectProjectInfo(cwd, gitStatus) {
364
+ const dirName = path.basename(cwd);
365
+ let name = dirName;
366
+ let repoName = dirName;
367
+ if (gitStatus.remoteUrl) {
368
+ const full = getRepoName(gitStatus.remoteUrl);
369
+ if (full) {
370
+ repoName = full;
371
+ name = full.includes("/") ? full.split("/")[1] : full;
372
+ }
373
+ }
374
+ let stack = "unknown";
375
+ let type = "domain";
376
+ let buildCommand = null;
377
+ let testCommand = null;
378
+ if (existsSync(path.join(cwd, "package.json"))) {
379
+ stack = "node";
380
+ type = "product";
381
+ buildCommand = "npm run build";
382
+ testCommand = "npm test";
383
+ try {
384
+ const pkg = JSON.parse(readFileSync(path.join(cwd, "package.json"), "utf-8"));
385
+ const deps = { ...pkg.dependencies, ...pkg.devDependencies };
386
+ if (deps["next"]) stack = "next";
387
+ else if (deps["nuxt"]) stack = "nuxt";
388
+ else if (deps["astro"]) stack = "astro";
389
+ else if (deps["react"]) stack = "react";
390
+ else if (deps["vue"]) stack = "vue";
391
+ } catch {
392
+ }
393
+ } else if (existsSync(path.join(cwd, "go.mod"))) {
394
+ stack = "go";
395
+ type = "product";
396
+ buildCommand = "go build ./...";
397
+ testCommand = "go test ./...";
398
+ } else if (existsSync(path.join(cwd, "requirements.txt")) || existsSync(path.join(cwd, "pyproject.toml")) || existsSync(path.join(cwd, "setup.py"))) {
399
+ stack = "python";
400
+ type = "product";
401
+ testCommand = "pytest";
402
+ } else if (existsSync(path.join(cwd, "Gemfile"))) {
403
+ stack = "ruby";
404
+ type = "product";
405
+ testCommand = "bundle exec rspec";
406
+ } else if (existsSync(path.join(cwd, "Cargo.toml"))) {
407
+ stack = "rust";
408
+ type = "product";
409
+ buildCommand = "cargo build";
410
+ testCommand = "cargo test";
411
+ }
412
+ return { name, type, stack, repoName, buildCommand, testCommand };
413
+ }
362
414
  function isInteractive() {
363
415
  return process.stdin.isTTY === true && process.stdout.isTTY === true;
364
416
  }
@@ -482,6 +534,7 @@ async function initCommand(options) {
482
534
  process.exit(1);
483
535
  }
484
536
  writeLine();
537
+ const projectInfo = detectProjectInfo(cwd, gitStatus);
485
538
  let businessName;
486
539
  let businessDescription;
487
540
  let businessFocus;
@@ -598,7 +651,8 @@ ${businessCompetitors}
598
651
  ` : "",
599
652
  PLACEHOLDER_SENTINEL: isPlaceholder ? '<!-- STATUS: PLACEHOLDER \u2014 Edit this file before running agents. -->\n<!-- Agents that read "PLACEHOLDER" in this comment will ask you to fill it in. -->\n\n' : "",
600
653
  PROVIDER: selectedProvider,
601
- PROVIDER_NAME: provider?.name || "Unknown"
654
+ PROVIDER_NAME: provider?.name || "Unknown",
655
+ CURRENT_DATE: (/* @__PURE__ */ new Date()).toISOString().split("T")[0]
602
656
  };
603
657
  const dirs = [
604
658
  ".agents/squads/company",
@@ -674,14 +728,69 @@ ${businessCompetitors}
674
728
  for (const [dest, template] of [...coreMemoryFiles, ...useCaseMemoryFiles]) {
675
729
  await writeIfNew(path.join(cwd, dest), loadSeedTemplate(template, variables));
676
730
  }
731
+ const reviewDate = /* @__PURE__ */ new Date();
732
+ reviewDate.setDate(reviewDate.getDate() + 14);
733
+ const allSquads = [
734
+ { name: "company", label: "Company", lead: "manager" },
735
+ { name: "research", label: "Research", lead: "lead" },
736
+ { name: "intelligence", label: "Intelligence", lead: "intel-lead" },
737
+ { name: "product", label: "Product", lead: "lead" },
738
+ ...useCaseConfig.squads.map((s) => ({
739
+ name: s.name,
740
+ label: s.name.charAt(0).toUpperCase() + s.name.slice(1),
741
+ lead: s.agentSummary.split(",")[0].trim()
742
+ }))
743
+ ];
744
+ for (const squad of allSquads) {
745
+ const squadVars = {
746
+ ...variables,
747
+ SQUAD_NAME: squad.name,
748
+ SQUAD_LABEL: squad.label,
749
+ SQUAD_LEAD: squad.lead,
750
+ REVIEW_DATE: reviewDate.toISOString().split("T")[0]
751
+ };
752
+ await writeIfNew(
753
+ path.join(cwd, `.agents/memory/${squad.name}/priorities.md`),
754
+ loadSeedTemplate("memory/_squad/priorities.md", squadVars)
755
+ );
756
+ await writeIfNew(
757
+ path.join(cwd, `.agents/memory/${squad.name}/goals.md`),
758
+ loadSeedTemplate("memory/_squad/goals.md", squadVars)
759
+ );
760
+ }
677
761
  const skillContent = loadSeedTemplate("skills/squads-cli/SKILL.md", variables);
678
762
  await writeFile(path.join(cwd, ".agents/skills/squads-cli/SKILL.md"), skillContent);
763
+ const skillRefContent = loadSeedTemplate("skills/squads-cli/references/commands.md", variables);
764
+ await writeFile(path.join(cwd, ".agents/skills/squads-cli/references/commands.md"), skillRefContent);
679
765
  const ghSkillContent = loadSeedTemplate("skills/gh/SKILL.md", variables);
680
766
  await writeFile(path.join(cwd, ".agents/skills/gh/SKILL.md"), ghSkillContent);
681
767
  const providerConfig = loadSeedTemplate("config/provider.yaml", variables);
682
768
  await writeFile(path.join(cwd, ".agents/config/provider.yaml"), providerConfig);
683
769
  const systemMd = loadSeedTemplate("config/SYSTEM.md", variables);
684
770
  await writeFile(path.join(cwd, ".agents/config/SYSTEM.md"), systemMd);
771
+ const idpCatalogDir = path.join(cwd, ".agents", "idp", "catalog");
772
+ if (!existsSync(idpCatalogDir)) {
773
+ const ownerSquad = useCaseConfig.squads[0]?.name || "engineering";
774
+ const isProduct = projectInfo.type === "product";
775
+ const idpVariables = {
776
+ ...variables,
777
+ SERVICE_NAME: projectInfo.name,
778
+ SERVICE_TYPE: projectInfo.type,
779
+ SERVICE_STACK: projectInfo.stack,
780
+ SERVICE_SCORECARD: isProduct ? "product" : "domain",
781
+ REPO_NAME: projectInfo.repoName,
782
+ OWNER_SQUAD: ownerSquad,
783
+ BRANCHES_WORKFLOW: isProduct ? "pr-to-develop" : "direct-to-main",
784
+ BRANCHES_DEVELOPMENT: isProduct ? "develop" : "",
785
+ CI_TEMPLATE: isProduct ? projectInfo.stack : "null",
786
+ BUILD_COMMAND: projectInfo.buildCommand ?? "null",
787
+ TEST_COMMAND: projectInfo.testCommand ?? "null"
788
+ };
789
+ const catalogContent = loadSeedTemplate("idp/catalog/service.yaml.template", idpVariables);
790
+ await writeFile(path.join(idpCatalogDir, `${projectInfo.name}.yaml`), catalogContent);
791
+ }
792
+ const companyMd = loadSeedTemplate("memory/company/company.md", variables);
793
+ await writeIfNew(path.join(cwd, ".agents/memory/company/company.md"), companyMd);
685
794
  const directivesMd = loadSeedTemplate("memory/company/directives.md", variables);
686
795
  await writeIfNew(path.join(cwd, ".agents/memory/company/directives.md"), directivesMd);
687
796
  const businessBrief = loadSeedTemplate("BUSINESS_BRIEF.md.template", variables);
@@ -809,4 +918,4 @@ function getFirstRunCommand(useCase) {
809
918
  export {
810
919
  initCommand
811
920
  };
812
- //# sourceMappingURL=init-XQZ7BOGT.js.map
921
+ //# sourceMappingURL=init-BQSCG57S.js.map