squads-cli 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +521 -288
- package/dist/auth-YW3UPFSB.js +23 -0
- package/dist/auth-YW3UPFSB.js.map +1 -0
- package/dist/autonomy-PSVZVX7A.js +105 -0
- package/dist/autonomy-PSVZVX7A.js.map +1 -0
- package/dist/chunk-67RO2HKR.js +174 -0
- package/dist/chunk-67RO2HKR.js.map +1 -0
- package/dist/chunk-7OCVIDC7.js +12 -0
- package/dist/chunk-7OCVIDC7.js.map +1 -0
- package/dist/chunk-BODLDQY7.js +452 -0
- package/dist/chunk-BODLDQY7.js.map +1 -0
- package/dist/chunk-EHQJHRIW.js +103 -0
- package/dist/chunk-EHQJHRIW.js.map +1 -0
- package/dist/chunk-FFFCFZ6A.js +121 -0
- package/dist/chunk-FFFCFZ6A.js.map +1 -0
- package/dist/chunk-FIWT2NMM.js +165 -0
- package/dist/chunk-FIWT2NMM.js.map +1 -0
- package/dist/chunk-HF4WR7RA.js +154 -0
- package/dist/chunk-HF4WR7RA.js.map +1 -0
- package/dist/chunk-J6QF4ZQX.js +230 -0
- package/dist/chunk-J6QF4ZQX.js.map +1 -0
- package/dist/chunk-LOA3KWYJ.js +294 -0
- package/dist/chunk-LOA3KWYJ.js.map +1 -0
- package/dist/chunk-M5FXNY6Y.js +384 -0
- package/dist/chunk-M5FXNY6Y.js.map +1 -0
- package/dist/chunk-QHNUMM4V.js +87 -0
- package/dist/chunk-QHNUMM4V.js.map +1 -0
- package/dist/chunk-QJ7C7CMB.js +223 -0
- package/dist/chunk-QJ7C7CMB.js.map +1 -0
- package/dist/chunk-RM6BWILN.js +74 -0
- package/dist/chunk-RM6BWILN.js.map +1 -0
- package/dist/chunk-TYFTF53O.js +613 -0
- package/dist/chunk-TYFTF53O.js.map +1 -0
- package/dist/chunk-TZXD6WFN.js +420 -0
- package/dist/chunk-TZXD6WFN.js.map +1 -0
- package/dist/chunk-WVOIY5GW.js +621 -0
- package/dist/chunk-WVOIY5GW.js.map +1 -0
- package/dist/chunk-Z2UKDBNL.js +162 -0
- package/dist/chunk-Z2UKDBNL.js.map +1 -0
- package/dist/chunk-ZTQ7ISUR.js +338 -0
- package/dist/chunk-ZTQ7ISUR.js.map +1 -0
- package/dist/cli.js +2483 -5902
- package/dist/cli.js.map +1 -1
- package/dist/context-GWPF4SEY.js +291 -0
- package/dist/context-GWPF4SEY.js.map +1 -0
- package/dist/context-feed-AJGVAR6H.js +394 -0
- package/dist/context-feed-AJGVAR6H.js.map +1 -0
- package/dist/cost-XBCDJ7XC.js +275 -0
- package/dist/cost-XBCDJ7XC.js.map +1 -0
- package/dist/create-BLFGG6PF.js +286 -0
- package/dist/create-BLFGG6PF.js.map +1 -0
- package/dist/dashboard-LGT2B2BL.js +951 -0
- package/dist/dashboard-LGT2B2BL.js.map +1 -0
- package/dist/dashboard-RMK2BOD2.js +794 -0
- package/dist/dashboard-RMK2BOD2.js.map +1 -0
- package/dist/doctor-XPUIIBHJ.js +374 -0
- package/dist/doctor-XPUIIBHJ.js.map +1 -0
- package/dist/env-config-SQEI3Y7Y.js +21 -0
- package/dist/env-config-SQEI3Y7Y.js.map +1 -0
- package/dist/exec-OUXM7JBF.js +223 -0
- package/dist/exec-OUXM7JBF.js.map +1 -0
- package/dist/feedback-KNAOG5QK.js +229 -0
- package/dist/feedback-KNAOG5QK.js.map +1 -0
- package/dist/github-UQTM5KMS.js +23 -0
- package/dist/github-UQTM5KMS.js.map +1 -0
- package/dist/goal-BVHV5573.js +168 -0
- package/dist/goal-BVHV5573.js.map +1 -0
- package/dist/health-4UXN44PF.js +218 -0
- package/dist/health-4UXN44PF.js.map +1 -0
- package/dist/history-ILH3SWHB.js +232 -0
- package/dist/history-ILH3SWHB.js.map +1 -0
- package/dist/index.d.ts +736 -8
- package/dist/index.js +1312 -6
- package/dist/index.js.map +1 -1
- package/dist/init-XQZ7BOGT.js +812 -0
- package/dist/init-XQZ7BOGT.js.map +1 -0
- package/dist/kpi-RQIU7WGK.js +413 -0
- package/dist/kpi-RQIU7WGK.js.map +1 -0
- package/dist/learn-OIFUVZAS.js +269 -0
- package/dist/learn-OIFUVZAS.js.map +1 -0
- package/dist/login-DXZANWZY.js +155 -0
- package/dist/login-DXZANWZY.js.map +1 -0
- package/dist/memory-T3ACCS7E.js +560 -0
- package/dist/memory-T3ACCS7E.js.map +1 -0
- package/dist/memory-VNF2VFRB.js +23 -0
- package/dist/memory-VNF2VFRB.js.map +1 -0
- package/dist/progress-DAUZMT3N.js +202 -0
- package/dist/progress-DAUZMT3N.js.map +1 -0
- package/dist/providers-3P5D2XL5.js +65 -0
- package/dist/providers-3P5D2XL5.js.map +1 -0
- package/dist/results-UECWGLTB.js +224 -0
- package/dist/results-UECWGLTB.js.map +1 -0
- package/dist/run-I6KAXU6U.js +4049 -0
- package/dist/run-I6KAXU6U.js.map +1 -0
- package/dist/session-HBU6KZOD.js +64 -0
- package/dist/session-HBU6KZOD.js.map +1 -0
- package/dist/sessions-CK25VGPL.js +333 -0
- package/dist/sessions-CK25VGPL.js.map +1 -0
- package/dist/squad-parser-DCG65BJS.js +35 -0
- package/dist/squad-parser-DCG65BJS.js.map +1 -0
- package/dist/stats-G6NAU5BD.js +334 -0
- package/dist/stats-G6NAU5BD.js.map +1 -0
- package/dist/status-AQNLDZVN.js +352 -0
- package/dist/status-AQNLDZVN.js.map +1 -0
- package/dist/sync-ZI3MHA4G.js +836 -0
- package/dist/sync-ZI3MHA4G.js.map +1 -0
- package/dist/templates/core/AGENTS.md.template +51 -0
- package/dist/templates/core/BUSINESS_BRIEF.md.template +29 -0
- package/dist/templates/core/CLAUDE.md.template +48 -0
- package/dist/templates/core/provider.yaml.template +5 -0
- package/dist/templates/first-squad/SQUAD.md.template +23 -0
- package/dist/templates/first-squad/lead.md.template +44 -0
- package/dist/templates/memory/getting-started/state.md.template +19 -0
- package/dist/templates/seed/BUSINESS_BRIEF.md.template +27 -0
- package/dist/templates/seed/CLAUDE.md.template +119 -0
- package/dist/templates/seed/README.md.template +42 -0
- package/dist/templates/seed/config/SYSTEM.md +52 -0
- package/dist/templates/seed/config/provider.yaml +4 -0
- package/dist/templates/seed/hooks/settings.json.template +31 -0
- package/dist/templates/seed/memory/company/directives.md +37 -0
- package/dist/templates/seed/memory/company/manager/state.md +16 -0
- package/dist/templates/seed/memory/engineering/issue-solver/state.md +12 -0
- package/dist/templates/seed/memory/intelligence/intel-lead/state.md +9 -0
- package/dist/templates/seed/memory/marketing/content-drafter/state.md +12 -0
- package/dist/templates/seed/memory/operations/ops-lead/state.md +12 -0
- package/dist/templates/seed/memory/product/lead/state.md +14 -0
- package/dist/templates/seed/memory/research/lead/state.md +14 -0
- package/dist/templates/seed/skills/gh/SKILL.md +57 -0
- package/dist/templates/seed/skills/squads-cli/SKILL.md +84 -0
- package/dist/templates/seed/squads/company/SQUAD.md +51 -0
- package/dist/templates/seed/squads/company/company-critic.md +49 -0
- package/dist/templates/seed/squads/company/company-eval.md +49 -0
- package/dist/templates/seed/squads/company/event-dispatcher.md +43 -0
- package/dist/templates/seed/squads/company/goal-tracker.md +43 -0
- package/dist/templates/seed/squads/company/manager.md +54 -0
- package/dist/templates/seed/squads/engineering/SQUAD.md +48 -0
- package/dist/templates/seed/squads/engineering/code-reviewer.md +57 -0
- package/dist/templates/seed/squads/engineering/issue-solver.md +58 -0
- package/dist/templates/seed/squads/engineering/test-writer.md +50 -0
- package/dist/templates/seed/squads/intelligence/SQUAD.md +38 -0
- package/dist/templates/seed/squads/intelligence/intel-critic.md +36 -0
- package/dist/templates/seed/squads/intelligence/intel-eval.md +31 -0
- package/dist/templates/seed/squads/intelligence/intel-lead.md +71 -0
- package/dist/templates/seed/squads/marketing/SQUAD.md +47 -0
- package/dist/templates/seed/squads/marketing/content-drafter.md +71 -0
- package/dist/templates/seed/squads/marketing/growth-analyst.md +49 -0
- package/dist/templates/seed/squads/marketing/social-poster.md +44 -0
- package/dist/templates/seed/squads/operations/SQUAD.md +45 -0
- package/dist/templates/seed/squads/operations/finance-tracker.md +47 -0
- package/dist/templates/seed/squads/operations/goal-tracker.md +48 -0
- package/dist/templates/seed/squads/operations/ops-lead.md +58 -0
- package/dist/templates/seed/squads/product/SQUAD.md +41 -0
- package/dist/templates/seed/squads/product/lead.md +56 -0
- package/dist/templates/seed/squads/product/scanner.md +50 -0
- package/dist/templates/seed/squads/product/worker.md +55 -0
- package/dist/templates/seed/squads/research/SQUAD.md +38 -0
- package/dist/templates/seed/squads/research/analyst.md +50 -0
- package/dist/templates/seed/squads/research/lead.md +52 -0
- package/dist/templates/seed/squads/research/synthesizer.md +59 -0
- package/dist/templates/skills/squads-learn/SKILL.md +86 -0
- package/dist/templates/skills/squads-workflow/instruction.md +70 -0
- package/dist/terminal-FBQFQTKZ.js +55 -0
- package/dist/terminal-FBQFQTKZ.js.map +1 -0
- package/dist/update-D7CGIZ3M.js +18 -0
- package/dist/update-D7CGIZ3M.js.map +1 -0
- package/dist/update-STU276HR.js +83 -0
- package/dist/update-STU276HR.js.map +1 -0
- package/package.json +31 -13
- package/templates/core/AGENTS.md.template +51 -0
- package/templates/core/BUSINESS_BRIEF.md.template +29 -0
- package/templates/core/CLAUDE.md.template +48 -0
- package/templates/core/provider.yaml.template +5 -0
- package/templates/first-squad/SQUAD.md.template +23 -0
- package/templates/first-squad/lead.md.template +44 -0
- package/templates/memory/getting-started/state.md.template +19 -0
- package/templates/seed/BUSINESS_BRIEF.md.template +27 -0
- package/templates/seed/CLAUDE.md.template +119 -0
- package/templates/seed/README.md.template +42 -0
- package/templates/seed/config/SYSTEM.md +52 -0
- package/templates/seed/config/provider.yaml +4 -0
- package/templates/seed/hooks/settings.json.template +31 -0
- package/templates/seed/memory/company/directives.md +37 -0
- package/templates/seed/memory/company/manager/state.md +16 -0
- package/templates/seed/memory/engineering/issue-solver/state.md +12 -0
- package/templates/seed/memory/intelligence/intel-lead/state.md +9 -0
- package/templates/seed/memory/marketing/content-drafter/state.md +12 -0
- package/templates/seed/memory/operations/ops-lead/state.md +12 -0
- package/templates/seed/memory/product/lead/state.md +14 -0
- package/templates/seed/memory/research/lead/state.md +14 -0
- package/templates/seed/skills/gh/SKILL.md +57 -0
- package/templates/seed/skills/squads-cli/SKILL.md +84 -0
- package/templates/seed/squads/company/SQUAD.md +51 -0
- package/templates/seed/squads/company/company-critic.md +49 -0
- package/templates/seed/squads/company/company-eval.md +49 -0
- package/templates/seed/squads/company/event-dispatcher.md +43 -0
- package/templates/seed/squads/company/goal-tracker.md +43 -0
- package/templates/seed/squads/company/manager.md +54 -0
- package/templates/seed/squads/engineering/SQUAD.md +48 -0
- package/templates/seed/squads/engineering/code-reviewer.md +57 -0
- package/templates/seed/squads/engineering/issue-solver.md +58 -0
- package/templates/seed/squads/engineering/test-writer.md +50 -0
- package/templates/seed/squads/intelligence/SQUAD.md +38 -0
- package/templates/seed/squads/intelligence/intel-critic.md +36 -0
- package/templates/seed/squads/intelligence/intel-eval.md +31 -0
- package/templates/seed/squads/intelligence/intel-lead.md +71 -0
- package/templates/seed/squads/marketing/SQUAD.md +47 -0
- package/templates/seed/squads/marketing/content-drafter.md +71 -0
- package/templates/seed/squads/marketing/growth-analyst.md +49 -0
- package/templates/seed/squads/marketing/social-poster.md +44 -0
- package/templates/seed/squads/operations/SQUAD.md +45 -0
- package/templates/seed/squads/operations/finance-tracker.md +47 -0
- package/templates/seed/squads/operations/goal-tracker.md +48 -0
- package/templates/seed/squads/operations/ops-lead.md +58 -0
- package/templates/seed/squads/product/SQUAD.md +41 -0
- package/templates/seed/squads/product/lead.md +56 -0
- package/templates/seed/squads/product/scanner.md +50 -0
- package/templates/seed/squads/product/worker.md +55 -0
- package/templates/seed/squads/research/SQUAD.md +38 -0
- package/templates/seed/squads/research/analyst.md +50 -0
- package/templates/seed/squads/research/lead.md +52 -0
- package/templates/seed/squads/research/synthesizer.md +59 -0
- package/templates/skills/squads-learn/SKILL.md +86 -0
- package/templates/skills/squads-workflow/instruction.md +70 -0
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
cleanupStaleSessions,
|
|
4
|
+
detectSquad,
|
|
5
|
+
startSession,
|
|
6
|
+
stopSession,
|
|
7
|
+
updateHeartbeat
|
|
8
|
+
} from "./chunk-BODLDQY7.js";
|
|
9
|
+
import {
|
|
10
|
+
RESET,
|
|
11
|
+
colors,
|
|
12
|
+
icons,
|
|
13
|
+
writeLine
|
|
14
|
+
} from "./chunk-M5FXNY6Y.js";
|
|
15
|
+
import "./chunk-7OCVIDC7.js";
|
|
16
|
+
|
|
17
|
+
// src/commands/session.ts
|
|
18
|
+
async function sessionStartCommand(options = {}) {
|
|
19
|
+
cleanupStaleSessions();
|
|
20
|
+
const session = startSession(options.squad);
|
|
21
|
+
if (!options.quiet) {
|
|
22
|
+
if (session) {
|
|
23
|
+
writeLine(`${icons.active} Session started: ${colors.cyan}${session.sessionId}${RESET}`);
|
|
24
|
+
if (session.squad) {
|
|
25
|
+
writeLine(` ${colors.dim}Squad: ${session.squad}${RESET}`);
|
|
26
|
+
}
|
|
27
|
+
} else {
|
|
28
|
+
writeLine(`${colors.yellow}Could not start session (no .agents directory)${RESET}`);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
async function sessionStopCommand(options = {}) {
|
|
33
|
+
const stopped = stopSession();
|
|
34
|
+
if (!options.quiet) {
|
|
35
|
+
if (stopped) {
|
|
36
|
+
writeLine(`${icons.progress} Session stopped`);
|
|
37
|
+
} else {
|
|
38
|
+
writeLine(`${colors.dim}No active session to stop${RESET}`);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
async function sessionHeartbeatCommand(options = {}) {
|
|
43
|
+
const updated = updateHeartbeat();
|
|
44
|
+
if (!options.quiet) {
|
|
45
|
+
if (updated) {
|
|
46
|
+
writeLine(`${icons.active} Heartbeat updated`);
|
|
47
|
+
} else {
|
|
48
|
+
writeLine(`${colors.dim}No session to update${RESET}`);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
async function detectSquadCommand() {
|
|
53
|
+
const squad = detectSquad();
|
|
54
|
+
if (squad) {
|
|
55
|
+
process.stdout.write(squad);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
export {
|
|
59
|
+
detectSquadCommand,
|
|
60
|
+
sessionHeartbeatCommand,
|
|
61
|
+
sessionStartCommand,
|
|
62
|
+
sessionStopCommand
|
|
63
|
+
};
|
|
64
|
+
//# sourceMappingURL=session-HBU6KZOD.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/commands/session.ts"],"sourcesContent":["/**\n * Session lifecycle commands: start, stop, heartbeat\n * Used by Claude Code hooks for session tracking\n */\n\nimport {\n startSession,\n stopSession,\n updateHeartbeat,\n detectSquad,\n cleanupStaleSessions,\n} from '../lib/sessions.js';\nimport {\n colors,\n RESET,\n icons,\n writeLine,\n} from '../lib/terminal.js';\n\ninterface SessionStartOptions {\n squad?: string;\n quiet?: boolean;\n}\n\ninterface SessionStopOptions {\n quiet?: boolean;\n}\n\ninterface SessionHeartbeatOptions {\n quiet?: boolean;\n}\n\n/**\n * Start a new session\n */\nexport async function sessionStartCommand(\n options: SessionStartOptions = {}\n): Promise<void> {\n // Clean up stale sessions first\n cleanupStaleSessions();\n\n const session = startSession(options.squad);\n\n if (!options.quiet) {\n if (session) {\n writeLine(`${icons.active} Session started: ${colors.cyan}${session.sessionId}${RESET}`);\n if (session.squad) {\n writeLine(` ${colors.dim}Squad: ${session.squad}${RESET}`);\n }\n } else {\n writeLine(`${colors.yellow}Could not start session (no .agents directory)${RESET}`);\n }\n }\n}\n\n/**\n * Stop current session\n */\nexport async function sessionStopCommand(\n options: SessionStopOptions = {}\n): Promise<void> {\n const stopped = stopSession();\n\n if (!options.quiet) {\n if (stopped) {\n writeLine(`${icons.progress} Session stopped`);\n } else {\n writeLine(`${colors.dim}No active session to stop${RESET}`);\n }\n }\n}\n\n/**\n * Update heartbeat for current session\n */\nexport async function sessionHeartbeatCommand(\n options: SessionHeartbeatOptions = {}\n): Promise<void> {\n const updated = updateHeartbeat();\n\n if (!options.quiet) {\n if (updated) {\n writeLine(`${icons.active} Heartbeat updated`);\n } else {\n writeLine(`${colors.dim}No session to update${RESET}`);\n }\n }\n}\n\n/**\n * Detect current squad based on cwd\n */\nexport async function detectSquadCommand(): Promise<void> {\n const squad = detectSquad();\n\n if (squad) {\n // Output just the squad name for use in shell scripts\n process.stdout.write(squad);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAmCA,eAAsB,oBACpB,UAA+B,CAAC,GACjB;AAEf,uBAAqB;AAErB,QAAM,UAAU,aAAa,QAAQ,KAAK;AAE1C,MAAI,CAAC,QAAQ,OAAO;AAClB,QAAI,SAAS;AACX,gBAAU,GAAG,MAAM,MAAM,qBAAqB,OAAO,IAAI,GAAG,QAAQ,SAAS,GAAG,KAAK,EAAE;AACvF,UAAI,QAAQ,OAAO;AACjB,kBAAU,KAAK,OAAO,GAAG,UAAU,QAAQ,KAAK,GAAG,KAAK,EAAE;AAAA,MAC5D;AAAA,IACF,OAAO;AACL,gBAAU,GAAG,OAAO,MAAM,iDAAiD,KAAK,EAAE;AAAA,IACpF;AAAA,EACF;AACF;AAKA,eAAsB,mBACpB,UAA8B,CAAC,GAChB;AACf,QAAM,UAAU,YAAY;AAE5B,MAAI,CAAC,QAAQ,OAAO;AAClB,QAAI,SAAS;AACX,gBAAU,GAAG,MAAM,QAAQ,kBAAkB;AAAA,IAC/C,OAAO;AACL,gBAAU,GAAG,OAAO,GAAG,4BAA4B,KAAK,EAAE;AAAA,IAC5D;AAAA,EACF;AACF;AAKA,eAAsB,wBACpB,UAAmC,CAAC,GACrB;AACf,QAAM,UAAU,gBAAgB;AAEhC,MAAI,CAAC,QAAQ,OAAO;AAClB,QAAI,SAAS;AACX,gBAAU,GAAG,MAAM,MAAM,oBAAoB;AAAA,IAC/C,OAAO;AACL,gBAAU,GAAG,OAAO,GAAG,uBAAuB,KAAK,EAAE;AAAA,IACvD;AAAA,EACF;AACF;AAKA,eAAsB,qBAAoC;AACxD,QAAM,QAAQ,YAAY;AAE1B,MAAI,OAAO;AAET,YAAQ,OAAO,MAAM,KAAK;AAAA,EAC5B;AACF;","names":[]}
|
|
@@ -0,0 +1,333 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
cleanupStaleSessions,
|
|
4
|
+
getActiveSessions,
|
|
5
|
+
getRecentSessions,
|
|
6
|
+
getSessionHistoryStats,
|
|
7
|
+
getSessionSummary
|
|
8
|
+
} from "./chunk-BODLDQY7.js";
|
|
9
|
+
import {
|
|
10
|
+
RESET,
|
|
11
|
+
bold,
|
|
12
|
+
box,
|
|
13
|
+
colors,
|
|
14
|
+
gradient,
|
|
15
|
+
icons,
|
|
16
|
+
padEnd,
|
|
17
|
+
writeLine
|
|
18
|
+
} from "./chunk-M5FXNY6Y.js";
|
|
19
|
+
import "./chunk-7OCVIDC7.js";
|
|
20
|
+
|
|
21
|
+
// src/commands/sessions.ts
|
|
22
|
+
async function sessionsCommand(options = {}) {
|
|
23
|
+
cleanupStaleSessions();
|
|
24
|
+
const sessions = getActiveSessions();
|
|
25
|
+
const summary = getSessionSummary();
|
|
26
|
+
if (options.json) {
|
|
27
|
+
console.log(JSON.stringify({ sessions, summary }, null, 2));
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
writeLine();
|
|
31
|
+
writeLine(` ${gradient("squads")} ${colors.dim}sessions${RESET}`);
|
|
32
|
+
writeLine();
|
|
33
|
+
if (sessions.length === 0) {
|
|
34
|
+
writeLine(` ${colors.dim}No active sessions${RESET}`);
|
|
35
|
+
writeLine();
|
|
36
|
+
writeLine(` ${colors.dim}Sessions are tracked automatically when Claude Code runs.${RESET}`);
|
|
37
|
+
writeLine(` ${colors.dim}Each session updates its heartbeat via squads CLI commands.${RESET}`);
|
|
38
|
+
writeLine();
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
const squadText = summary.squadCount === 1 ? "squad" : "squads";
|
|
42
|
+
const sessionText = summary.totalSessions === 1 ? "session" : "sessions";
|
|
43
|
+
writeLine(` ${colors.green}${summary.totalSessions}${RESET} active ${sessionText} ${colors.dim}across${RESET} ${colors.cyan}${summary.squadCount}${RESET} ${squadText}`);
|
|
44
|
+
writeLine();
|
|
45
|
+
const bySquad = {};
|
|
46
|
+
for (const session of sessions) {
|
|
47
|
+
const squad = session.squad || "unknown";
|
|
48
|
+
if (!bySquad[squad]) bySquad[squad] = [];
|
|
49
|
+
bySquad[squad].push(session);
|
|
50
|
+
}
|
|
51
|
+
const w = { squad: 16, sessions: 10, activity: 14 };
|
|
52
|
+
const tableWidth = w.squad + w.sessions + w.activity + 4;
|
|
53
|
+
writeLine(` ${colors.purple}${box.topLeft}${colors.dim}${box.horizontal.repeat(tableWidth)}${colors.purple}${box.topRight}${RESET}`);
|
|
54
|
+
const header = ` ${colors.purple}${box.vertical}${RESET} ${bold}${padEnd("SQUAD", w.squad)}${RESET}${bold}${padEnd("SESSIONS", w.sessions)}${RESET}${bold}LAST ACTIVITY${RESET} ${colors.purple}${box.vertical}${RESET}`;
|
|
55
|
+
writeLine(header);
|
|
56
|
+
writeLine(` ${colors.purple}${box.teeRight}${colors.dim}${box.horizontal.repeat(tableWidth)}${colors.purple}${box.teeLeft}${RESET}`);
|
|
57
|
+
for (const [squad, squadSessions] of Object.entries(bySquad).sort()) {
|
|
58
|
+
let mostRecent = 0;
|
|
59
|
+
for (const session of squadSessions) {
|
|
60
|
+
const ts = new Date(session.lastHeartbeat).getTime();
|
|
61
|
+
if (ts > mostRecent) mostRecent = ts;
|
|
62
|
+
}
|
|
63
|
+
const lastActivity = formatTimeAgo(mostRecent);
|
|
64
|
+
const activityColor = getActivityColor(mostRecent);
|
|
65
|
+
const row = ` ${colors.purple}${box.vertical}${RESET} ${colors.cyan}${padEnd(squad, w.squad)}${RESET}${padEnd(String(squadSessions.length), w.sessions)}${padEnd(`${activityColor}${lastActivity}${RESET}`, w.activity)}${colors.purple}${box.vertical}${RESET}`;
|
|
66
|
+
writeLine(row);
|
|
67
|
+
}
|
|
68
|
+
writeLine(` ${colors.purple}${box.bottomLeft}${colors.dim}${box.horizontal.repeat(tableWidth)}${colors.purple}${box.bottomRight}${RESET}`);
|
|
69
|
+
if (options.verbose) {
|
|
70
|
+
writeLine();
|
|
71
|
+
writeLine(` ${bold}Session Details${RESET}`);
|
|
72
|
+
writeLine();
|
|
73
|
+
for (const session of sessions) {
|
|
74
|
+
const squad = session.squad || "unknown";
|
|
75
|
+
const ago = formatTimeAgo(new Date(session.lastHeartbeat).getTime());
|
|
76
|
+
writeLine(` ${icons.active} ${colors.white}${session.sessionId}${RESET}`);
|
|
77
|
+
writeLine(` ${colors.dim}squad: ${squad} | pid: ${session.pid} | heartbeat: ${ago}${RESET}`);
|
|
78
|
+
writeLine(` ${colors.dim}cwd: ${session.cwd}${RESET}`);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
writeLine();
|
|
82
|
+
writeLine(` ${colors.dim}$${RESET} squads sessions -v ${colors.dim}Show session details${RESET}`);
|
|
83
|
+
writeLine();
|
|
84
|
+
}
|
|
85
|
+
function formatTimeAgo(timestamp) {
|
|
86
|
+
const now = Date.now();
|
|
87
|
+
const diff = now - timestamp;
|
|
88
|
+
const seconds = Math.floor(diff / 1e3);
|
|
89
|
+
const minutes = Math.floor(seconds / 60);
|
|
90
|
+
if (minutes >= 1) {
|
|
91
|
+
return `${minutes}m ago`;
|
|
92
|
+
}
|
|
93
|
+
return `${seconds}s ago`;
|
|
94
|
+
}
|
|
95
|
+
function getActivityColor(timestamp) {
|
|
96
|
+
const now = Date.now();
|
|
97
|
+
const diff = now - timestamp;
|
|
98
|
+
const minutes = Math.floor(diff / (1e3 * 60));
|
|
99
|
+
if (minutes < 1) return colors.green;
|
|
100
|
+
if (minutes < 3) return colors.yellow;
|
|
101
|
+
return colors.dim;
|
|
102
|
+
}
|
|
103
|
+
async function sessionsSummaryCommand(data, options = {}) {
|
|
104
|
+
if (options.json) {
|
|
105
|
+
console.log(JSON.stringify(data, null, 2));
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
writeLine();
|
|
109
|
+
writeLine(` ${gradient("squads")} ${colors.dim}session summary${RESET}`);
|
|
110
|
+
writeLine();
|
|
111
|
+
if (data.squads.length > 0) {
|
|
112
|
+
const w = { squad: 14, actions: 26, outputs: 36 };
|
|
113
|
+
const tableWidth = w.squad + w.actions + w.outputs + 6;
|
|
114
|
+
const truncate = (text, max) => text.length > max ? text.substring(0, max - 1) + "\u2026" : text;
|
|
115
|
+
writeLine(` ${colors.green}${icons.active}${RESET} ${bold}${data.squads.length} Squads Active${RESET}`);
|
|
116
|
+
writeLine();
|
|
117
|
+
writeLine(` ${colors.purple}${box.topLeft}${colors.dim}${box.horizontal.repeat(tableWidth)}${colors.purple}${box.topRight}${RESET}`);
|
|
118
|
+
const header = ` ${colors.purple}${box.vertical}${RESET} ${bold}${padEnd("SQUAD", w.squad)}${RESET}${bold}${padEnd("ACTIONS", w.actions)}${RESET}${bold}${padEnd("KEY OUTPUTS", w.outputs)}${RESET}${colors.purple}${box.vertical}${RESET}`;
|
|
119
|
+
writeLine(header);
|
|
120
|
+
writeLine(` ${colors.purple}${box.teeRight}${colors.dim}${box.horizontal.repeat(tableWidth)}${colors.purple}${box.teeLeft}${RESET}`);
|
|
121
|
+
for (const squad of data.squads) {
|
|
122
|
+
const row = ` ${colors.purple}${box.vertical}${RESET} ${colors.cyan}${padEnd(truncate(squad.name, w.squad - 1), w.squad)}${RESET}${padEnd(truncate(squad.actions, w.actions - 1), w.actions)}${padEnd(truncate(squad.outputs, w.outputs - 1), w.outputs)}${colors.purple}${box.vertical}${RESET}`;
|
|
123
|
+
writeLine(row);
|
|
124
|
+
}
|
|
125
|
+
writeLine(` ${colors.purple}${box.bottomLeft}${colors.dim}${box.horizontal.repeat(tableWidth)}${colors.purple}${box.bottomRight}${RESET}`);
|
|
126
|
+
}
|
|
127
|
+
if (data.decisions && data.decisions.length > 0) {
|
|
128
|
+
writeLine();
|
|
129
|
+
writeLine(` ${bold}Strategic Decisions${RESET}`);
|
|
130
|
+
writeLine();
|
|
131
|
+
const w = { question: 16, answer: 50 };
|
|
132
|
+
const tableWidth = w.question + w.answer + 4;
|
|
133
|
+
writeLine(` ${colors.purple}${box.topLeft}${colors.dim}${box.horizontal.repeat(tableWidth)}${colors.purple}${box.topRight}${RESET}`);
|
|
134
|
+
for (const decision of data.decisions) {
|
|
135
|
+
const row = ` ${colors.purple}${box.vertical}${RESET} ${colors.yellow}${padEnd(decision.question, w.question)}${RESET}${padEnd(decision.answer, w.answer)}${colors.purple}${box.vertical}${RESET}`;
|
|
136
|
+
writeLine(row);
|
|
137
|
+
}
|
|
138
|
+
writeLine(` ${colors.purple}${box.bottomLeft}${colors.dim}${box.horizontal.repeat(tableWidth)}${colors.purple}${box.bottomRight}${RESET}`);
|
|
139
|
+
}
|
|
140
|
+
if (data.customer) {
|
|
141
|
+
writeLine();
|
|
142
|
+
writeLine(` ${bold}Target Customer${RESET}`);
|
|
143
|
+
writeLine();
|
|
144
|
+
writeLine(` ${colors.dim}Vertical:${RESET} ${colors.cyan}${data.customer.vertical}${RESET}`);
|
|
145
|
+
writeLine(` ${colors.dim}Persona:${RESET} ${colors.white}${data.customer.persona}${RESET}`);
|
|
146
|
+
writeLine(` ${colors.dim}Pain:${RESET} ${data.customer.painPoints.join(", ")}`);
|
|
147
|
+
}
|
|
148
|
+
if (data.nextActions && data.nextActions.length > 0) {
|
|
149
|
+
writeLine();
|
|
150
|
+
writeLine(` ${bold}Next Actions${RESET}`);
|
|
151
|
+
writeLine();
|
|
152
|
+
for (const action of data.nextActions) {
|
|
153
|
+
writeLine(` ${colors.cyan}${padEnd(action.squad, 14)}${RESET}${colors.dim}\u2192${RESET} ${action.action}`);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
if (data.targets && data.targets.length > 0) {
|
|
157
|
+
writeLine();
|
|
158
|
+
writeLine(` ${bold}Q1 Targets${RESET}`);
|
|
159
|
+
writeLine();
|
|
160
|
+
for (const target of data.targets) {
|
|
161
|
+
writeLine(` ${colors.dim}\u2022${RESET} ${target.metric}: ${colors.green}${target.value}${RESET}`);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
if (data.filesUpdated && data.filesUpdated.length > 0) {
|
|
165
|
+
writeLine();
|
|
166
|
+
writeLine(` ${colors.dim}Files updated:${RESET}`);
|
|
167
|
+
for (const file of data.filesUpdated) {
|
|
168
|
+
writeLine(` ${colors.dim} \u2022${RESET} ${colors.cyan}${file}${RESET}`);
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
writeLine();
|
|
172
|
+
const modelText = data.model ? data.model : "Claude";
|
|
173
|
+
const durationText = data.duration ? ` ${colors.dim}(${data.duration})${RESET}` : "";
|
|
174
|
+
writeLine(` ${colors.dim}Generated by${RESET} ${colors.purple}${modelText}${RESET}${durationText}`);
|
|
175
|
+
writeLine();
|
|
176
|
+
}
|
|
177
|
+
async function buildCurrentSessionSummary() {
|
|
178
|
+
const { existsSync, readdirSync, statSync, readFileSync } = await import("fs");
|
|
179
|
+
const { join } = await import("path");
|
|
180
|
+
const { findMemoryDir } = await import("./memory-VNF2VFRB.js");
|
|
181
|
+
const memoryDir = findMemoryDir();
|
|
182
|
+
const squads = [];
|
|
183
|
+
const filesUpdated = [];
|
|
184
|
+
const sessionWindow = 2 * 60 * 60 * 1e3;
|
|
185
|
+
const now = Date.now();
|
|
186
|
+
if (memoryDir && existsSync(memoryDir)) {
|
|
187
|
+
const squadDirs = readdirSync(memoryDir, { withFileTypes: true }).filter((d) => d.isDirectory());
|
|
188
|
+
for (const squadDir of squadDirs) {
|
|
189
|
+
const squadPath = join(memoryDir, squadDir.name);
|
|
190
|
+
let squadModified = false;
|
|
191
|
+
let stateContent = "";
|
|
192
|
+
let executionContent = "";
|
|
193
|
+
try {
|
|
194
|
+
const agentDirs = readdirSync(squadPath, { withFileTypes: true }).filter((d) => d.isDirectory());
|
|
195
|
+
for (const agentDir of agentDirs) {
|
|
196
|
+
const agentPath = join(squadPath, agentDir.name);
|
|
197
|
+
const files = readdirSync(agentPath).filter((f) => f.endsWith(".md"));
|
|
198
|
+
for (const file of files) {
|
|
199
|
+
const filePath = join(agentPath, file);
|
|
200
|
+
const stats = statSync(filePath);
|
|
201
|
+
if (now - stats.mtimeMs < sessionWindow) {
|
|
202
|
+
squadModified = true;
|
|
203
|
+
const relativePath = `${squadDir.name}/${agentDir.name}/${file}`;
|
|
204
|
+
filesUpdated.push(relativePath);
|
|
205
|
+
if (file === "state.md") {
|
|
206
|
+
stateContent = readFileSync(filePath, "utf-8");
|
|
207
|
+
} else if (file === "executions.md") {
|
|
208
|
+
executionContent = readFileSync(filePath, "utf-8");
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
if (squadModified) {
|
|
214
|
+
let actions = "State updated";
|
|
215
|
+
let outputs = "Memory refreshed";
|
|
216
|
+
if (executionContent) {
|
|
217
|
+
const lines = executionContent.split("\n").filter((l) => l.trim());
|
|
218
|
+
const recentEntry = lines.slice(-10).join(" ");
|
|
219
|
+
if (recentEntry.includes("completed")) {
|
|
220
|
+
actions = "Execution completed";
|
|
221
|
+
}
|
|
222
|
+
const keyMatch = recentEntry.match(/Key (?:findings|decisions|outputs)?:?\s*([^.]+)/i);
|
|
223
|
+
if (keyMatch) {
|
|
224
|
+
outputs = keyMatch[1].substring(0, 50);
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
if (stateContent) {
|
|
228
|
+
const updatedMatch = stateContent.match(/Updated:\s*([^\n]+)/);
|
|
229
|
+
if (updatedMatch) {
|
|
230
|
+
actions = `Updated ${updatedMatch[1]}`;
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
squads.push({
|
|
234
|
+
name: squadDir.name.charAt(0).toUpperCase() + squadDir.name.slice(1),
|
|
235
|
+
actions,
|
|
236
|
+
outputs: outputs.length > 44 ? outputs.substring(0, 41) + "..." : outputs
|
|
237
|
+
});
|
|
238
|
+
}
|
|
239
|
+
} catch {
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
if (squads.length === 0) {
|
|
244
|
+
squads.push({
|
|
245
|
+
name: "No recent activity",
|
|
246
|
+
actions: "\u2014",
|
|
247
|
+
outputs: "Run squads to see activity here"
|
|
248
|
+
});
|
|
249
|
+
}
|
|
250
|
+
return {
|
|
251
|
+
squads,
|
|
252
|
+
filesUpdated: filesUpdated.length > 0 ? filesUpdated : void 0,
|
|
253
|
+
model: process.env.ANTHROPIC_MODEL || "Claude"
|
|
254
|
+
};
|
|
255
|
+
}
|
|
256
|
+
async function sessionsHistoryCommand(options = {}) {
|
|
257
|
+
const days = options.days || 7;
|
|
258
|
+
const since = new Date(Date.now() - days * 24 * 60 * 60 * 1e3);
|
|
259
|
+
const stats = await getSessionHistoryStats({
|
|
260
|
+
since,
|
|
261
|
+
squad: options.squad
|
|
262
|
+
});
|
|
263
|
+
const recentSessions = await getRecentSessions(10);
|
|
264
|
+
if (options.json) {
|
|
265
|
+
console.log(JSON.stringify({ stats, recentSessions }, null, 2));
|
|
266
|
+
return;
|
|
267
|
+
}
|
|
268
|
+
writeLine();
|
|
269
|
+
writeLine(` ${gradient("squads")} ${colors.dim}sessions history${RESET} ${colors.dim}(${days}d)${RESET}`);
|
|
270
|
+
writeLine();
|
|
271
|
+
if (stats.totalSessions === 0) {
|
|
272
|
+
writeLine(` ${colors.dim}No session history found${RESET}`);
|
|
273
|
+
writeLine();
|
|
274
|
+
writeLine(` ${colors.dim}Session events are logged to .agents/sessions/history.jsonl${RESET}`);
|
|
275
|
+
writeLine();
|
|
276
|
+
return;
|
|
277
|
+
}
|
|
278
|
+
const avgMinutes = Math.round(stats.avgDurationMs / 6e4);
|
|
279
|
+
const totalHours = Math.round(stats.totalDurationMs / 36e5 * 10) / 10;
|
|
280
|
+
writeLine(` ${bold}Summary${RESET}`);
|
|
281
|
+
writeLine(` ${colors.cyan}${stats.totalSessions}${RESET} sessions ${colors.dim}\u2502${RESET} ${colors.green}${totalHours}h${RESET} total ${colors.dim}\u2502${RESET} ${colors.yellow}${avgMinutes}m${RESET} avg ${colors.dim}\u2502${RESET} ${colors.purple}${stats.peakConcurrent}${RESET} peak`);
|
|
282
|
+
writeLine();
|
|
283
|
+
const squads = Object.entries(stats.bySquad).sort((a, b) => b[1].count - a[1].count);
|
|
284
|
+
if (squads.length > 0) {
|
|
285
|
+
const w = { squad: 16, sessions: 10, duration: 12 };
|
|
286
|
+
const tableWidth = w.squad + w.sessions + w.duration + 4;
|
|
287
|
+
writeLine(` ${bold}By Squad${RESET}`);
|
|
288
|
+
writeLine();
|
|
289
|
+
writeLine(` ${colors.purple}${box.topLeft}${colors.dim}${box.horizontal.repeat(tableWidth)}${colors.purple}${box.topRight}${RESET}`);
|
|
290
|
+
const header = ` ${colors.purple}${box.vertical}${RESET} ${bold}${padEnd("SQUAD", w.squad)}${RESET}${bold}${padEnd("SESSIONS", w.sessions)}${RESET}${bold}DURATION${RESET} ${colors.purple}${box.vertical}${RESET}`;
|
|
291
|
+
writeLine(header);
|
|
292
|
+
writeLine(` ${colors.purple}${box.teeRight}${colors.dim}${box.horizontal.repeat(tableWidth)}${colors.purple}${box.teeLeft}${RESET}`);
|
|
293
|
+
for (const [squad, data] of squads) {
|
|
294
|
+
const hours = Math.round(data.durationMs / 36e5 * 10) / 10;
|
|
295
|
+
const row = ` ${colors.purple}${box.vertical}${RESET} ${colors.cyan}${padEnd(squad, w.squad)}${RESET}${padEnd(String(data.count), w.sessions)}${padEnd(`${hours}h`, w.duration)}${colors.purple}${box.vertical}${RESET}`;
|
|
296
|
+
writeLine(row);
|
|
297
|
+
}
|
|
298
|
+
writeLine(` ${colors.purple}${box.bottomLeft}${colors.dim}${box.horizontal.repeat(tableWidth)}${colors.purple}${box.bottomRight}${RESET}`);
|
|
299
|
+
}
|
|
300
|
+
if (recentSessions.length > 0) {
|
|
301
|
+
writeLine();
|
|
302
|
+
writeLine(` ${bold}Recent Sessions${RESET}`);
|
|
303
|
+
writeLine();
|
|
304
|
+
for (const event of recentSessions.slice(0, 5)) {
|
|
305
|
+
const squad = event.squad || "unknown";
|
|
306
|
+
const date = new Date(event.ts);
|
|
307
|
+
const timeStr = date.toLocaleTimeString("en-US", { hour: "2-digit", minute: "2-digit" });
|
|
308
|
+
const dateStr = date.toLocaleDateString("en-US", { month: "short", day: "numeric" });
|
|
309
|
+
writeLine(` ${colors.dim}${dateStr} ${timeStr}${RESET} ${colors.cyan}${squad}${RESET} ${colors.dim}${event.sessionId.slice(0, 8)}${RESET}`);
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
const dates = Object.entries(stats.byDate).sort((a, b) => b[0].localeCompare(a[0])).slice(0, 7);
|
|
313
|
+
if (dates.length > 1) {
|
|
314
|
+
writeLine();
|
|
315
|
+
writeLine(` ${bold}Daily Activity${RESET}`);
|
|
316
|
+
writeLine();
|
|
317
|
+
for (const [date, count] of dates) {
|
|
318
|
+
const bar = "\u2588".repeat(Math.min(count, 20));
|
|
319
|
+
writeLine(` ${colors.dim}${date}${RESET} ${colors.green}${bar}${RESET} ${count}`);
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
writeLine();
|
|
323
|
+
writeLine(` ${colors.dim}$${RESET} squads sessions history --days 30 ${colors.dim}Longer history${RESET}`);
|
|
324
|
+
writeLine(` ${colors.dim}$${RESET} squads sessions history -s website ${colors.dim}Filter by squad${RESET}`);
|
|
325
|
+
writeLine();
|
|
326
|
+
}
|
|
327
|
+
export {
|
|
328
|
+
buildCurrentSessionSummary,
|
|
329
|
+
sessionsCommand,
|
|
330
|
+
sessionsHistoryCommand,
|
|
331
|
+
sessionsSummaryCommand
|
|
332
|
+
};
|
|
333
|
+
//# sourceMappingURL=sessions-CK25VGPL.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/commands/sessions.ts"],"sourcesContent":["/**\n * List active Claude Code sessions across squads\n */\n\nimport {\n getActiveSessions,\n getSessionSummary,\n cleanupStaleSessions,\n getSessionHistoryStats,\n getRecentSessions,\n SessionState,\n} from '../lib/sessions.js';\nimport {\n colors,\n bold,\n RESET,\n gradient,\n box,\n padEnd,\n icons,\n writeLine,\n} from '../lib/terminal.js';\n\ninterface SessionsOptions {\n verbose?: boolean;\n json?: boolean;\n}\n\nexport async function sessionsCommand(\n options: SessionsOptions = {}\n): Promise<void> {\n // Clean up stale sessions first\n cleanupStaleSessions();\n\n const sessions = getActiveSessions();\n const summary = getSessionSummary();\n\n // JSON output for scripts\n if (options.json) {\n console.log(JSON.stringify({ sessions, summary }, null, 2));\n return;\n }\n\n writeLine();\n writeLine(` ${gradient('squads')} ${colors.dim}sessions${RESET}`);\n writeLine();\n\n if (sessions.length === 0) {\n writeLine(` ${colors.dim}No active sessions${RESET}`);\n writeLine();\n writeLine(` ${colors.dim}Sessions are tracked automatically when Claude Code runs.${RESET}`);\n writeLine(` ${colors.dim}Each session updates its heartbeat via squads CLI commands.${RESET}`);\n writeLine();\n return;\n }\n\n // Summary line\n const squadText = summary.squadCount === 1 ? 'squad' : 'squads';\n const sessionText = summary.totalSessions === 1 ? 'session' : 'sessions';\n writeLine(` ${colors.green}${summary.totalSessions}${RESET} active ${sessionText} ${colors.dim}across${RESET} ${colors.cyan}${summary.squadCount}${RESET} ${squadText}`);\n writeLine();\n\n // Group by squad\n const bySquad: Record<string, SessionState[]> = {};\n for (const session of sessions) {\n const squad = session.squad || 'unknown';\n if (!bySquad[squad]) bySquad[squad] = [];\n bySquad[squad].push(session);\n }\n\n // Table\n const w = { squad: 16, sessions: 10, activity: 14 };\n const tableWidth = w.squad + w.sessions + w.activity + 4;\n\n writeLine(` ${colors.purple}${box.topLeft}${colors.dim}${box.horizontal.repeat(tableWidth)}${colors.purple}${box.topRight}${RESET}`);\n\n const header = ` ${colors.purple}${box.vertical}${RESET} ` +\n `${bold}${padEnd('SQUAD', w.squad)}${RESET}` +\n `${bold}${padEnd('SESSIONS', w.sessions)}${RESET}` +\n `${bold}LAST ACTIVITY${RESET}` +\n ` ${colors.purple}${box.vertical}${RESET}`;\n writeLine(header);\n\n writeLine(` ${colors.purple}${box.teeRight}${colors.dim}${box.horizontal.repeat(tableWidth)}${colors.purple}${box.teeLeft}${RESET}`);\n\n for (const [squad, squadSessions] of Object.entries(bySquad).sort()) {\n // Find most recent activity\n let mostRecent = 0;\n for (const session of squadSessions) {\n const ts = new Date(session.lastHeartbeat).getTime();\n if (ts > mostRecent) mostRecent = ts;\n }\n\n const lastActivity = formatTimeAgo(mostRecent);\n const activityColor = getActivityColor(mostRecent);\n\n const row = ` ${colors.purple}${box.vertical}${RESET} ` +\n `${colors.cyan}${padEnd(squad, w.squad)}${RESET}` +\n `${padEnd(String(squadSessions.length), w.sessions)}` +\n `${padEnd(`${activityColor}${lastActivity}${RESET}`, w.activity)}` +\n `${colors.purple}${box.vertical}${RESET}`;\n\n writeLine(row);\n }\n\n writeLine(` ${colors.purple}${box.bottomLeft}${colors.dim}${box.horizontal.repeat(tableWidth)}${colors.purple}${box.bottomRight}${RESET}`);\n\n // Verbose: show individual sessions\n if (options.verbose) {\n writeLine();\n writeLine(` ${bold}Session Details${RESET}`);\n writeLine();\n\n for (const session of sessions) {\n const squad = session.squad || 'unknown';\n const ago = formatTimeAgo(new Date(session.lastHeartbeat).getTime());\n\n writeLine(` ${icons.active} ${colors.white}${session.sessionId}${RESET}`);\n writeLine(` ${colors.dim}squad: ${squad} | pid: ${session.pid} | heartbeat: ${ago}${RESET}`);\n writeLine(` ${colors.dim}cwd: ${session.cwd}${RESET}`);\n }\n }\n\n writeLine();\n writeLine(` ${colors.dim}$${RESET} squads sessions -v ${colors.dim}Show session details${RESET}`);\n writeLine();\n}\n\n/**\n * Format timestamp as \"Xm ago\" or \"Xs ago\"\n */\nfunction formatTimeAgo(timestamp: number): string {\n const now = Date.now();\n const diff = now - timestamp;\n\n const seconds = Math.floor(diff / 1000);\n const minutes = Math.floor(seconds / 60);\n\n if (minutes >= 1) {\n return `${minutes}m ago`;\n }\n return `${seconds}s ago`;\n}\n\n/**\n * Get color based on how recent the activity is\n */\nfunction getActivityColor(timestamp: number): string {\n const now = Date.now();\n const diff = now - timestamp;\n\n const minutes = Math.floor(diff / (1000 * 60));\n\n if (minutes < 1) return colors.green;\n if (minutes < 3) return colors.yellow;\n return colors.dim;\n}\n\ninterface HistoryOptions {\n days?: number;\n squad?: string;\n json?: boolean;\n}\n\ninterface SummaryOptions {\n json?: boolean;\n}\n\nexport interface SessionSummaryData {\n squads: Array<{\n name: string;\n actions: string;\n outputs: string;\n }>;\n decisions?: Array<{\n question: string;\n answer: string;\n }>;\n customer?: {\n vertical: string;\n persona: string;\n painPoints: string[];\n };\n nextActions?: Array<{\n squad: string;\n action: string;\n }>;\n filesUpdated?: string[];\n targets?: {\n metric: string;\n value: string;\n }[];\n model?: string; // e.g., \"Claude Opus 4.5\"\n duration?: string; // e.g., \"45m\"\n}\n\n/**\n * Show a pretty summary of session work\n */\nexport async function sessionsSummaryCommand(\n data: SessionSummaryData,\n options: SummaryOptions = {}\n): Promise<void> {\n if (options.json) {\n console.log(JSON.stringify(data, null, 2));\n return;\n }\n\n writeLine();\n writeLine(` ${gradient('squads')} ${colors.dim}session summary${RESET}`);\n writeLine();\n\n // Squads table\n if (data.squads.length > 0) {\n const w = { squad: 14, actions: 26, outputs: 36 };\n const tableWidth = w.squad + w.actions + w.outputs + 6;\n\n // Helper to truncate text\n const truncate = (text: string, max: number) =>\n text.length > max ? text.substring(0, max - 1) + '…' : text;\n\n writeLine(` ${colors.green}${icons.active}${RESET} ${bold}${data.squads.length} Squads Active${RESET}`);\n writeLine();\n\n writeLine(` ${colors.purple}${box.topLeft}${colors.dim}${box.horizontal.repeat(tableWidth)}${colors.purple}${box.topRight}${RESET}`);\n\n const header = ` ${colors.purple}${box.vertical}${RESET} ` +\n `${bold}${padEnd('SQUAD', w.squad)}${RESET}` +\n `${bold}${padEnd('ACTIONS', w.actions)}${RESET}` +\n `${bold}${padEnd('KEY OUTPUTS', w.outputs)}${RESET}` +\n `${colors.purple}${box.vertical}${RESET}`;\n writeLine(header);\n\n writeLine(` ${colors.purple}${box.teeRight}${colors.dim}${box.horizontal.repeat(tableWidth)}${colors.purple}${box.teeLeft}${RESET}`);\n\n for (const squad of data.squads) {\n const row = ` ${colors.purple}${box.vertical}${RESET} ` +\n `${colors.cyan}${padEnd(truncate(squad.name, w.squad - 1), w.squad)}${RESET}` +\n `${padEnd(truncate(squad.actions, w.actions - 1), w.actions)}` +\n `${padEnd(truncate(squad.outputs, w.outputs - 1), w.outputs)}` +\n `${colors.purple}${box.vertical}${RESET}`;\n writeLine(row);\n }\n\n writeLine(` ${colors.purple}${box.bottomLeft}${colors.dim}${box.horizontal.repeat(tableWidth)}${colors.purple}${box.bottomRight}${RESET}`);\n }\n\n // Decisions\n if (data.decisions && data.decisions.length > 0) {\n writeLine();\n writeLine(` ${bold}Strategic Decisions${RESET}`);\n writeLine();\n\n const w = { question: 16, answer: 50 };\n const tableWidth = w.question + w.answer + 4;\n\n writeLine(` ${colors.purple}${box.topLeft}${colors.dim}${box.horizontal.repeat(tableWidth)}${colors.purple}${box.topRight}${RESET}`);\n\n for (const decision of data.decisions) {\n const row = ` ${colors.purple}${box.vertical}${RESET} ` +\n `${colors.yellow}${padEnd(decision.question, w.question)}${RESET}` +\n `${padEnd(decision.answer, w.answer)}` +\n `${colors.purple}${box.vertical}${RESET}`;\n writeLine(row);\n }\n\n writeLine(` ${colors.purple}${box.bottomLeft}${colors.dim}${box.horizontal.repeat(tableWidth)}${colors.purple}${box.bottomRight}${RESET}`);\n }\n\n // Target customer\n if (data.customer) {\n writeLine();\n writeLine(` ${bold}Target Customer${RESET}`);\n writeLine();\n writeLine(` ${colors.dim}Vertical:${RESET} ${colors.cyan}${data.customer.vertical}${RESET}`);\n writeLine(` ${colors.dim}Persona:${RESET} ${colors.white}${data.customer.persona}${RESET}`);\n writeLine(` ${colors.dim}Pain:${RESET} ${data.customer.painPoints.join(', ')}`);\n }\n\n // Next actions\n if (data.nextActions && data.nextActions.length > 0) {\n writeLine();\n writeLine(` ${bold}Next Actions${RESET}`);\n writeLine();\n\n for (const action of data.nextActions) {\n writeLine(` ${colors.cyan}${padEnd(action.squad, 14)}${RESET}${colors.dim}→${RESET} ${action.action}`);\n }\n }\n\n // Q1 Targets\n if (data.targets && data.targets.length > 0) {\n writeLine();\n writeLine(` ${bold}Q1 Targets${RESET}`);\n writeLine();\n\n for (const target of data.targets) {\n writeLine(` ${colors.dim}•${RESET} ${target.metric}: ${colors.green}${target.value}${RESET}`);\n }\n }\n\n // Files updated\n if (data.filesUpdated && data.filesUpdated.length > 0) {\n writeLine();\n writeLine(` ${colors.dim}Files updated:${RESET}`);\n for (const file of data.filesUpdated) {\n writeLine(` ${colors.dim} •${RESET} ${colors.cyan}${file}${RESET}`);\n }\n }\n\n writeLine();\n\n // Footer with model attribution\n const modelText = data.model ? data.model : 'Claude';\n const durationText = data.duration ? ` ${colors.dim}(${data.duration})${RESET}` : '';\n writeLine(` ${colors.dim}Generated by${RESET} ${colors.purple}${modelText}${RESET}${durationText}`);\n writeLine();\n}\n\n/**\n * Build summary from current session by detecting recent activity\n */\nexport async function buildCurrentSessionSummary(): Promise<SessionSummaryData> {\n const { existsSync, readdirSync, statSync, readFileSync } = await import('fs');\n const { join } = await import('path');\n const { findMemoryDir } = await import('../lib/memory.js');\n\n const memoryDir = findMemoryDir();\n const squads: SessionSummaryData['squads'] = [];\n const filesUpdated: string[] = [];\n\n // Look for files modified in last 2 hours (current session window)\n const sessionWindow = 2 * 60 * 60 * 1000; // 2 hours\n const now = Date.now();\n\n if (memoryDir && existsSync(memoryDir)) {\n const squadDirs = readdirSync(memoryDir, { withFileTypes: true })\n .filter(d => d.isDirectory());\n\n for (const squadDir of squadDirs) {\n const squadPath = join(memoryDir, squadDir.name);\n let squadModified = false;\n let stateContent = '';\n let executionContent = '';\n\n try {\n const agentDirs = readdirSync(squadPath, { withFileTypes: true })\n .filter(d => d.isDirectory());\n\n for (const agentDir of agentDirs) {\n const agentPath = join(squadPath, agentDir.name);\n const files = readdirSync(agentPath).filter(f => f.endsWith('.md'));\n\n for (const file of files) {\n const filePath = join(agentPath, file);\n const stats = statSync(filePath);\n\n if (now - stats.mtimeMs < sessionWindow) {\n squadModified = true;\n const relativePath = `${squadDir.name}/${agentDir.name}/${file}`;\n filesUpdated.push(relativePath);\n\n // Read content for summary\n if (file === 'state.md') {\n stateContent = readFileSync(filePath, 'utf-8');\n } else if (file === 'executions.md') {\n executionContent = readFileSync(filePath, 'utf-8');\n }\n }\n }\n }\n\n if (squadModified) {\n // Extract summary from state/execution content\n let actions = 'State updated';\n let outputs = 'Memory refreshed';\n\n // Try to extract info from execution log\n if (executionContent) {\n const lines = executionContent.split('\\n').filter(l => l.trim());\n const recentEntry = lines.slice(-10).join(' ');\n if (recentEntry.includes('completed')) {\n actions = 'Execution completed';\n }\n // Extract key points\n const keyMatch = recentEntry.match(/Key (?:findings|decisions|outputs)?:?\\s*([^.]+)/i);\n if (keyMatch) {\n outputs = keyMatch[1].substring(0, 50);\n }\n }\n\n // Try to extract from state header\n if (stateContent) {\n const updatedMatch = stateContent.match(/Updated:\\s*([^\\n]+)/);\n if (updatedMatch) {\n actions = `Updated ${updatedMatch[1]}`;\n }\n }\n\n squads.push({\n name: squadDir.name.charAt(0).toUpperCase() + squadDir.name.slice(1),\n actions,\n outputs: outputs.length > 44 ? outputs.substring(0, 41) + '...' : outputs,\n });\n }\n } catch {\n // Skip if can't read\n }\n }\n }\n\n // If no recent activity found\n if (squads.length === 0) {\n squads.push({\n name: 'No recent activity',\n actions: '—',\n outputs: 'Run squads to see activity here',\n });\n }\n\n return {\n squads,\n filesUpdated: filesUpdated.length > 0 ? filesUpdated : undefined,\n model: process.env.ANTHROPIC_MODEL || 'Claude',\n };\n}\n\n/**\n * Show session history and statistics\n */\nexport async function sessionsHistoryCommand(\n options: HistoryOptions = {}\n): Promise<void> {\n const days = options.days || 7;\n const since = new Date(Date.now() - days * 24 * 60 * 60 * 1000);\n\n const stats = await getSessionHistoryStats({\n since,\n squad: options.squad,\n });\n\n const recentSessions = await getRecentSessions(10);\n\n // JSON output\n if (options.json) {\n console.log(JSON.stringify({ stats, recentSessions }, null, 2));\n return;\n }\n\n writeLine();\n writeLine(` ${gradient('squads')} ${colors.dim}sessions history${RESET} ${colors.dim}(${days}d)${RESET}`);\n writeLine();\n\n if (stats.totalSessions === 0) {\n writeLine(` ${colors.dim}No session history found${RESET}`);\n writeLine();\n writeLine(` ${colors.dim}Session events are logged to .agents/sessions/history.jsonl${RESET}`);\n writeLine();\n return;\n }\n\n // Summary stats\n const avgMinutes = Math.round(stats.avgDurationMs / 60000);\n const totalHours = Math.round(stats.totalDurationMs / 3600000 * 10) / 10;\n\n writeLine(` ${bold}Summary${RESET}`);\n writeLine(` ${colors.cyan}${stats.totalSessions}${RESET} sessions ${colors.dim}│${RESET} ${colors.green}${totalHours}h${RESET} total ${colors.dim}│${RESET} ${colors.yellow}${avgMinutes}m${RESET} avg ${colors.dim}│${RESET} ${colors.purple}${stats.peakConcurrent}${RESET} peak`);\n writeLine();\n\n // By squad table\n const squads = Object.entries(stats.bySquad).sort((a, b) => b[1].count - a[1].count);\n\n if (squads.length > 0) {\n const w = { squad: 16, sessions: 10, duration: 12 };\n const tableWidth = w.squad + w.sessions + w.duration + 4;\n\n writeLine(` ${bold}By Squad${RESET}`);\n writeLine();\n writeLine(` ${colors.purple}${box.topLeft}${colors.dim}${box.horizontal.repeat(tableWidth)}${colors.purple}${box.topRight}${RESET}`);\n\n const header = ` ${colors.purple}${box.vertical}${RESET} ` +\n `${bold}${padEnd('SQUAD', w.squad)}${RESET}` +\n `${bold}${padEnd('SESSIONS', w.sessions)}${RESET}` +\n `${bold}DURATION${RESET}` +\n ` ${colors.purple}${box.vertical}${RESET}`;\n writeLine(header);\n\n writeLine(` ${colors.purple}${box.teeRight}${colors.dim}${box.horizontal.repeat(tableWidth)}${colors.purple}${box.teeLeft}${RESET}`);\n\n for (const [squad, data] of squads) {\n const hours = Math.round(data.durationMs / 3600000 * 10) / 10;\n\n const row = ` ${colors.purple}${box.vertical}${RESET} ` +\n `${colors.cyan}${padEnd(squad, w.squad)}${RESET}` +\n `${padEnd(String(data.count), w.sessions)}` +\n `${padEnd(`${hours}h`, w.duration)}` +\n `${colors.purple}${box.vertical}${RESET}`;\n\n writeLine(row);\n }\n\n writeLine(` ${colors.purple}${box.bottomLeft}${colors.dim}${box.horizontal.repeat(tableWidth)}${colors.purple}${box.bottomRight}${RESET}`);\n }\n\n // Recent sessions\n if (recentSessions.length > 0) {\n writeLine();\n writeLine(` ${bold}Recent Sessions${RESET}`);\n writeLine();\n\n for (const event of recentSessions.slice(0, 5)) {\n const squad = event.squad || 'unknown';\n const date = new Date(event.ts);\n const timeStr = date.toLocaleTimeString('en-US', { hour: '2-digit', minute: '2-digit' });\n const dateStr = date.toLocaleDateString('en-US', { month: 'short', day: 'numeric' });\n\n writeLine(` ${colors.dim}${dateStr} ${timeStr}${RESET} ${colors.cyan}${squad}${RESET} ${colors.dim}${event.sessionId.slice(0, 8)}${RESET}`);\n }\n }\n\n // By date (last 7 days)\n const dates = Object.entries(stats.byDate)\n .sort((a, b) => b[0].localeCompare(a[0]))\n .slice(0, 7);\n\n if (dates.length > 1) {\n writeLine();\n writeLine(` ${bold}Daily Activity${RESET}`);\n writeLine();\n\n for (const [date, count] of dates) {\n const bar = '█'.repeat(Math.min(count, 20));\n writeLine(` ${colors.dim}${date}${RESET} ${colors.green}${bar}${RESET} ${count}`);\n }\n }\n\n writeLine();\n writeLine(` ${colors.dim}$${RESET} squads sessions history --days 30 ${colors.dim}Longer history${RESET}`);\n writeLine(` ${colors.dim}$${RESET} squads sessions history -s website ${colors.dim}Filter by squad${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AAE,cAAc,EAAE,CAAC,CAAC,CAAC,EACvC,MAAM,GAAG,CAAC;AAEb,MAAI,MAAM,SAAS,GAAG;AACpB,cAAU;AACV,cAAU,KAAK,IAAI,iBAAiB,KAAK,EAAE;AAC3C,cAAU;AAEV,eAAW,CAAC,MAAM,KAAK,KAAK,OAAO;AACjC,YAAM,MAAM,SAAI,OAAO,KAAK,IAAI,OAAO,EAAE,CAAC;AAC1C,gBAAU,KAAK,OAAO,GAAG,GAAG,IAAI,GAAG,KAAK,KAAK,OAAO,KAAK,GAAG,GAAG,GAAG,KAAK,IAAI,KAAK,EAAE;AAAA,IACpF;AAAA,EACF;AAEA,YAAU;AACV,YAAU,KAAK,OAAO,GAAG,IAAI,KAAK,wCAAwC,OAAO,GAAG,iBAAiB,KAAK,EAAE;AAC5G,YAAU,KAAK,OAAO,GAAG,IAAI,KAAK,wCAAwC,OAAO,GAAG,kBAAkB,KAAK,EAAE;AAC7G,YAAU;AACZ;","names":[]}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
addGoalToSquad,
|
|
4
|
+
findProjectRoot,
|
|
5
|
+
findSimilarSquads,
|
|
6
|
+
findSquadsDir,
|
|
7
|
+
getSquadLocalSkills,
|
|
8
|
+
hasLocalInfraConfig,
|
|
9
|
+
listAgents,
|
|
10
|
+
listSquads,
|
|
11
|
+
loadAgentDefinition,
|
|
12
|
+
loadSquad,
|
|
13
|
+
parseAgentProvider,
|
|
14
|
+
parseSquadFile,
|
|
15
|
+
resolveExecutionContext,
|
|
16
|
+
updateGoalInSquad
|
|
17
|
+
} from "./chunk-TYFTF53O.js";
|
|
18
|
+
import "./chunk-7OCVIDC7.js";
|
|
19
|
+
export {
|
|
20
|
+
addGoalToSquad,
|
|
21
|
+
findProjectRoot,
|
|
22
|
+
findSimilarSquads,
|
|
23
|
+
findSquadsDir,
|
|
24
|
+
getSquadLocalSkills,
|
|
25
|
+
hasLocalInfraConfig,
|
|
26
|
+
listAgents,
|
|
27
|
+
listSquads,
|
|
28
|
+
loadAgentDefinition,
|
|
29
|
+
loadSquad,
|
|
30
|
+
parseAgentProvider,
|
|
31
|
+
parseSquadFile,
|
|
32
|
+
resolveExecutionContext,
|
|
33
|
+
updateGoalInSquad
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=squad-parser-DCG65BJS.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|