squads-cli 0.1.2 → 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 +551 -177
- 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 +2506 -4475
- 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,223 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
formatDuration,
|
|
4
|
+
formatRelativeTime,
|
|
5
|
+
getExecutionStats,
|
|
6
|
+
listExecutions
|
|
7
|
+
} from "./chunk-67RO2HKR.js";
|
|
8
|
+
import {
|
|
9
|
+
Events,
|
|
10
|
+
track
|
|
11
|
+
} from "./chunk-QJ7C7CMB.js";
|
|
12
|
+
import "./chunk-ZTQ7ISUR.js";
|
|
13
|
+
import {
|
|
14
|
+
RESET,
|
|
15
|
+
bold,
|
|
16
|
+
box,
|
|
17
|
+
colors,
|
|
18
|
+
gradient,
|
|
19
|
+
icons,
|
|
20
|
+
padEnd,
|
|
21
|
+
writeLine
|
|
22
|
+
} from "./chunk-M5FXNY6Y.js";
|
|
23
|
+
import "./chunk-7OCVIDC7.js";
|
|
24
|
+
|
|
25
|
+
// src/commands/exec.ts
|
|
26
|
+
async function execListCommand(options = {}) {
|
|
27
|
+
await track(Events.CLI_EXEC, { action: "list", squad: options.squad });
|
|
28
|
+
const listOptions = {
|
|
29
|
+
squad: options.squad,
|
|
30
|
+
agent: options.agent,
|
|
31
|
+
limit: options.limit || 20
|
|
32
|
+
};
|
|
33
|
+
if (options.status) {
|
|
34
|
+
listOptions.status = options.status;
|
|
35
|
+
}
|
|
36
|
+
const executions = listExecutions(listOptions);
|
|
37
|
+
if (options.json) {
|
|
38
|
+
console.log(JSON.stringify(executions, null, 2));
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
writeLine();
|
|
42
|
+
writeLine(` ${gradient("squads")} ${colors.dim}exec list${RESET}${options.squad ? ` ${colors.cyan}${options.squad}${RESET}` : ""}`);
|
|
43
|
+
writeLine();
|
|
44
|
+
if (executions.length === 0) {
|
|
45
|
+
writeLine(` ${colors.dim}No executions found${RESET}`);
|
|
46
|
+
writeLine();
|
|
47
|
+
writeLine(` ${colors.dim}Executions are logged when running agents:${RESET}`);
|
|
48
|
+
writeLine(` ${colors.dim}$${RESET} squads run ${colors.cyan}<squad>${RESET} --execute`);
|
|
49
|
+
writeLine();
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
const w = { agent: 22, status: 12, duration: 10, time: 14, id: 18 };
|
|
53
|
+
const tableWidth = w.agent + w.status + w.duration + w.time + w.id + 8;
|
|
54
|
+
writeLine(` ${colors.purple}${box.topLeft}${colors.dim}${box.horizontal.repeat(tableWidth)}${colors.purple}${box.topRight}${RESET}`);
|
|
55
|
+
const header = ` ${colors.purple}${box.vertical}${RESET} ${bold}${padEnd("AGENT", w.agent)}${RESET}${bold}${padEnd("STATUS", w.status)}${RESET}${bold}${padEnd("DURATION", w.duration)}${RESET}${bold}${padEnd("TIME", w.time)}${RESET}${bold}ID${RESET} ${colors.purple}${box.vertical}${RESET}`;
|
|
56
|
+
writeLine(header);
|
|
57
|
+
writeLine(` ${colors.purple}${box.teeRight}${colors.dim}${box.horizontal.repeat(tableWidth)}${colors.purple}${box.teeLeft}${RESET}`);
|
|
58
|
+
const STALE_THRESHOLD_MS = 60 * 60 * 1e3;
|
|
59
|
+
let staleCount = 0;
|
|
60
|
+
for (const exec of executions) {
|
|
61
|
+
const agentName = `${exec.squad}/${exec.agent}`;
|
|
62
|
+
const truncatedAgent = agentName.length > w.agent - 1 ? agentName.slice(0, w.agent - 4) + "..." : agentName;
|
|
63
|
+
const ageMs = Date.now() - new Date(exec.startTime).getTime();
|
|
64
|
+
const isStale = exec.status === "running" && ageMs > STALE_THRESHOLD_MS;
|
|
65
|
+
if (isStale) staleCount++;
|
|
66
|
+
let statusIcon;
|
|
67
|
+
let statusColor;
|
|
68
|
+
let statusLabel;
|
|
69
|
+
if (isStale) {
|
|
70
|
+
const staleHours = Math.floor(ageMs / (60 * 60 * 1e3));
|
|
71
|
+
statusIcon = icons.warning;
|
|
72
|
+
statusColor = colors.yellow;
|
|
73
|
+
statusLabel = `stale (${staleHours}h)`;
|
|
74
|
+
} else if (exec.status === "running") {
|
|
75
|
+
statusIcon = icons.running;
|
|
76
|
+
statusColor = colors.yellow;
|
|
77
|
+
statusLabel = "running";
|
|
78
|
+
} else if (exec.status === "completed") {
|
|
79
|
+
statusIcon = icons.success;
|
|
80
|
+
statusColor = colors.green;
|
|
81
|
+
statusLabel = "completed";
|
|
82
|
+
} else {
|
|
83
|
+
statusIcon = icons.error;
|
|
84
|
+
statusColor = colors.red;
|
|
85
|
+
statusLabel = exec.status;
|
|
86
|
+
}
|
|
87
|
+
const statusStr = `${statusColor}${statusIcon} ${statusLabel}${RESET}`;
|
|
88
|
+
const durationStr = formatDuration(exec.durationMs);
|
|
89
|
+
const timeStr = formatRelativeTime(exec.startTime);
|
|
90
|
+
const shortId = exec.id.slice(0, 16);
|
|
91
|
+
const row = ` ${colors.purple}${box.vertical}${RESET} ${colors.cyan}${padEnd(truncatedAgent, w.agent)}${RESET}${padEnd(statusStr, w.status + 10)}${padEnd(durationStr, w.duration)}${colors.dim}${padEnd(timeStr, w.time)}${RESET}${colors.dim}${shortId}${RESET} ${colors.purple}${box.vertical}${RESET}`;
|
|
92
|
+
writeLine(row);
|
|
93
|
+
}
|
|
94
|
+
writeLine(` ${colors.purple}${box.bottomLeft}${colors.dim}${box.horizontal.repeat(tableWidth)}${colors.purple}${box.bottomRight}${RESET}`);
|
|
95
|
+
writeLine();
|
|
96
|
+
const stats = getExecutionStats(listOptions);
|
|
97
|
+
const liveRunning = stats.running - staleCount;
|
|
98
|
+
const parts = [];
|
|
99
|
+
if (liveRunning > 0) parts.push(`${colors.yellow}${liveRunning} running${RESET}`);
|
|
100
|
+
if (staleCount > 0) parts.push(`${colors.yellow}${staleCount} stale${RESET}`);
|
|
101
|
+
if (stats.completed > 0) parts.push(`${colors.green}${stats.completed} completed${RESET}`);
|
|
102
|
+
if (stats.failed > 0) parts.push(`${colors.red}${stats.failed} failed${RESET}`);
|
|
103
|
+
if (parts.length > 0) {
|
|
104
|
+
writeLine(` ${parts.join(` ${colors.dim}|${RESET} `)}`);
|
|
105
|
+
if (stats.avgDurationMs) {
|
|
106
|
+
writeLine(` ${colors.dim}Avg duration: ${formatDuration(stats.avgDurationMs)}${RESET}`);
|
|
107
|
+
}
|
|
108
|
+
writeLine();
|
|
109
|
+
}
|
|
110
|
+
writeLine(` ${colors.dim}$${RESET} squads exec show ${colors.cyan}<id>${RESET} ${colors.dim}Execution details${RESET}`);
|
|
111
|
+
writeLine(` ${colors.dim}$${RESET} squads exec --json ${colors.dim}JSON output${RESET}`);
|
|
112
|
+
writeLine();
|
|
113
|
+
}
|
|
114
|
+
async function execShowCommand(executionId, options = {}) {
|
|
115
|
+
await track(Events.CLI_EXEC, { action: "show", id: executionId });
|
|
116
|
+
const executions = listExecutions();
|
|
117
|
+
const matches = executions.filter(
|
|
118
|
+
(e) => e.id === executionId || e.id.startsWith(executionId)
|
|
119
|
+
);
|
|
120
|
+
if (matches.length === 0) {
|
|
121
|
+
writeLine();
|
|
122
|
+
writeLine(` ${colors.red}Execution not found: ${executionId}${RESET}`);
|
|
123
|
+
writeLine();
|
|
124
|
+
writeLine(` ${colors.dim}List recent executions:${RESET}`);
|
|
125
|
+
writeLine(` ${colors.dim}$${RESET} squads exec list`);
|
|
126
|
+
writeLine();
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
if (matches.length > 1) {
|
|
130
|
+
writeLine();
|
|
131
|
+
writeLine(` ${colors.yellow}Multiple matches for "${executionId}":${RESET}`);
|
|
132
|
+
for (const m of matches.slice(0, 5)) {
|
|
133
|
+
writeLine(` ${colors.dim}${m.id}${RESET} - ${m.squad}/${m.agent}`);
|
|
134
|
+
}
|
|
135
|
+
writeLine();
|
|
136
|
+
writeLine(` ${colors.dim}Provide a more specific ID${RESET}`);
|
|
137
|
+
writeLine();
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
const exec = matches[0];
|
|
141
|
+
if (options.json) {
|
|
142
|
+
console.log(JSON.stringify(exec, null, 2));
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
writeLine();
|
|
146
|
+
writeLine(` ${gradient("squads")} ${colors.dim}exec show${RESET}`);
|
|
147
|
+
writeLine();
|
|
148
|
+
writeLine(` ${bold}${exec.squad}/${exec.agent}${RESET}`);
|
|
149
|
+
writeLine(` ${colors.dim}${exec.id}${RESET}`);
|
|
150
|
+
writeLine();
|
|
151
|
+
const statusIcon = exec.status === "running" ? icons.running : exec.status === "completed" ? icons.success : icons.error;
|
|
152
|
+
const statusColor = exec.status === "running" ? colors.yellow : exec.status === "completed" ? colors.green : colors.red;
|
|
153
|
+
writeLine(` ${bold}Status${RESET} ${statusColor}${statusIcon} ${exec.status}${RESET}`);
|
|
154
|
+
writeLine(` ${bold}Task Type${RESET} ${exec.taskType}`);
|
|
155
|
+
writeLine(` ${bold}Trigger${RESET} ${exec.trigger}`);
|
|
156
|
+
writeLine();
|
|
157
|
+
writeLine(` ${bold}Started${RESET} ${exec.startTime}`);
|
|
158
|
+
if (exec.endTime) {
|
|
159
|
+
writeLine(` ${bold}Completed${RESET} ${exec.endTime}`);
|
|
160
|
+
}
|
|
161
|
+
if (exec.durationMs) {
|
|
162
|
+
writeLine(` ${bold}Duration${RESET} ${formatDuration(exec.durationMs)}`);
|
|
163
|
+
}
|
|
164
|
+
writeLine();
|
|
165
|
+
if (exec.outcome) {
|
|
166
|
+
writeLine(` ${bold}Outcome${RESET}`);
|
|
167
|
+
writeLine(` ${colors.dim}${exec.outcome}${RESET}`);
|
|
168
|
+
writeLine();
|
|
169
|
+
}
|
|
170
|
+
if (exec.error) {
|
|
171
|
+
writeLine(` ${bold}Error${RESET}`);
|
|
172
|
+
writeLine(` ${colors.red}${exec.error}${RESET}`);
|
|
173
|
+
writeLine();
|
|
174
|
+
}
|
|
175
|
+
writeLine(` ${colors.dim}$${RESET} squads memory show ${colors.cyan}${exec.squad}${RESET} ${colors.dim}Squad memory${RESET}`);
|
|
176
|
+
writeLine(` ${colors.dim}$${RESET} squads exec list --squad ${colors.cyan}${exec.squad}${RESET} ${colors.dim}Squad history${RESET}`);
|
|
177
|
+
writeLine();
|
|
178
|
+
}
|
|
179
|
+
async function execStatsCommand(options = {}) {
|
|
180
|
+
await track(Events.CLI_EXEC, { action: "stats", squad: options.squad });
|
|
181
|
+
const listOptions = {
|
|
182
|
+
squad: options.squad
|
|
183
|
+
};
|
|
184
|
+
const stats = getExecutionStats(listOptions);
|
|
185
|
+
if (options.json) {
|
|
186
|
+
console.log(JSON.stringify(stats, null, 2));
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
189
|
+
writeLine();
|
|
190
|
+
writeLine(` ${gradient("squads")} ${colors.dim}exec stats${RESET}${options.squad ? ` ${colors.cyan}${options.squad}${RESET}` : ""}`);
|
|
191
|
+
writeLine();
|
|
192
|
+
writeLine(` ${bold}Total${RESET} ${stats.total}`);
|
|
193
|
+
writeLine(` ${colors.yellow}Running${RESET} ${stats.running}`);
|
|
194
|
+
writeLine(` ${colors.green}Completed${RESET} ${stats.completed}`);
|
|
195
|
+
writeLine(` ${colors.red}Failed${RESET} ${stats.failed}`);
|
|
196
|
+
writeLine();
|
|
197
|
+
if (stats.avgDurationMs) {
|
|
198
|
+
writeLine(` ${bold}Avg Duration${RESET} ${formatDuration(stats.avgDurationMs)}`);
|
|
199
|
+
writeLine();
|
|
200
|
+
}
|
|
201
|
+
const squadEntries = Object.entries(stats.bySquad).sort((a, b) => b[1] - a[1]).slice(0, 5);
|
|
202
|
+
if (squadEntries.length > 0) {
|
|
203
|
+
writeLine(` ${bold}By Squad${RESET}`);
|
|
204
|
+
for (const [squad, count] of squadEntries) {
|
|
205
|
+
writeLine(` ${colors.cyan}${squad}${RESET}: ${count}`);
|
|
206
|
+
}
|
|
207
|
+
writeLine();
|
|
208
|
+
}
|
|
209
|
+
const agentEntries = Object.entries(stats.byAgent).sort((a, b) => b[1] - a[1]).slice(0, 5);
|
|
210
|
+
if (agentEntries.length > 0) {
|
|
211
|
+
writeLine(` ${bold}Top Agents${RESET}`);
|
|
212
|
+
for (const [agent, count] of agentEntries) {
|
|
213
|
+
writeLine(` ${colors.cyan}${agent}${RESET}: ${count}`);
|
|
214
|
+
}
|
|
215
|
+
writeLine();
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
export {
|
|
219
|
+
execListCommand,
|
|
220
|
+
execShowCommand,
|
|
221
|
+
execStatsCommand
|
|
222
|
+
};
|
|
223
|
+
//# sourceMappingURL=exec-OUXM7JBF.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/commands/exec.ts"],"sourcesContent":["/**\n * squads exec - Execution history commands\n *\n * Enables agents to introspect past executions for self-improvement.\n * Part of RFC #110 Phase 2.\n */\n\nimport { track, Events } from '../lib/telemetry.js';\nimport {\n listExecutions,\n getExecutionStats,\n formatDuration,\n formatRelativeTime,\n Execution,\n ExecutionListOptions,\n} from '../lib/executions.js';\nimport {\n colors,\n bold,\n RESET,\n gradient,\n box,\n padEnd,\n writeLine,\n icons,\n} from '../lib/terminal.js';\n\ninterface ListOptions {\n squad?: string;\n agent?: string;\n status?: string;\n limit?: number;\n json?: boolean;\n}\n\ninterface ShowOptions {\n json?: boolean;\n}\n\n/**\n * squads exec list - List recent executions\n */\nexport async function execListCommand(options: ListOptions = {}): Promise<void> {\n await track(Events.CLI_EXEC, { action: 'list', squad: options.squad });\n\n const listOptions: ExecutionListOptions = {\n squad: options.squad,\n agent: options.agent,\n limit: options.limit || 20,\n };\n\n if (options.status) {\n listOptions.status = options.status as Execution['status'];\n }\n\n const executions = listExecutions(listOptions);\n\n if (options.json) {\n console.log(JSON.stringify(executions, null, 2));\n return;\n }\n\n writeLine();\n writeLine(` ${gradient('squads')} ${colors.dim}exec list${RESET}${options.squad ? ` ${colors.cyan}${options.squad}${RESET}` : ''}`);\n writeLine();\n\n if (executions.length === 0) {\n writeLine(` ${colors.dim}No executions found${RESET}`);\n writeLine();\n writeLine(` ${colors.dim}Executions are logged when running agents:${RESET}`);\n writeLine(` ${colors.dim}$${RESET} squads run ${colors.cyan}<squad>${RESET} --execute`);\n writeLine();\n return;\n }\n\n // Table header\n const w = { agent: 22, status: 12, duration: 10, time: 14, id: 18 };\n const tableWidth = w.agent + w.status + w.duration + w.time + w.id + 8;\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('AGENT', w.agent)}${RESET}` +\n `${bold}${padEnd('STATUS', w.status)}${RESET}` +\n `${bold}${padEnd('DURATION', w.duration)}${RESET}` +\n `${bold}${padEnd('TIME', w.time)}${RESET}` +\n `${bold}ID${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 const STALE_THRESHOLD_MS = 60 * 60 * 1000; // 1 hour\n let staleCount = 0;\n\n for (const exec of executions) {\n const agentName = `${exec.squad}/${exec.agent}`;\n const truncatedAgent = agentName.length > w.agent - 1\n ? agentName.slice(0, w.agent - 4) + '...'\n : agentName;\n\n const ageMs = Date.now() - new Date(exec.startTime).getTime();\n const isStale = exec.status === 'running' && ageMs > STALE_THRESHOLD_MS;\n if (isStale) staleCount++;\n\n let statusIcon: string;\n let statusColor: string;\n let statusLabel: string;\n\n if (isStale) {\n const staleHours = Math.floor(ageMs / (60 * 60 * 1000));\n statusIcon = icons.warning;\n statusColor = colors.yellow;\n statusLabel = `stale (${staleHours}h)`;\n } else if (exec.status === 'running') {\n statusIcon = icons.running;\n statusColor = colors.yellow;\n statusLabel = 'running';\n } else if (exec.status === 'completed') {\n statusIcon = icons.success;\n statusColor = colors.green;\n statusLabel = 'completed';\n } else {\n statusIcon = icons.error;\n statusColor = colors.red;\n statusLabel = exec.status;\n }\n\n const statusStr = `${statusColor}${statusIcon} ${statusLabel}${RESET}`;\n const durationStr = formatDuration(exec.durationMs);\n const timeStr = formatRelativeTime(exec.startTime);\n const shortId = exec.id.slice(0, 16);\n\n const row = ` ${colors.purple}${box.vertical}${RESET} ` +\n `${colors.cyan}${padEnd(truncatedAgent, w.agent)}${RESET}` +\n `${padEnd(statusStr, w.status + 10)}` + // +10 for ANSI codes\n `${padEnd(durationStr, w.duration)}` +\n `${colors.dim}${padEnd(timeStr, w.time)}${RESET}` +\n `${colors.dim}${shortId}${RESET}` +\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 writeLine();\n\n // Show stats summary\n const stats = getExecutionStats(listOptions);\n const liveRunning = stats.running - staleCount;\n const parts: string[] = [];\n if (liveRunning > 0) parts.push(`${colors.yellow}${liveRunning} running${RESET}`);\n if (staleCount > 0) parts.push(`${colors.yellow}${staleCount} stale${RESET}`);\n if (stats.completed > 0) parts.push(`${colors.green}${stats.completed} completed${RESET}`);\n if (stats.failed > 0) parts.push(`${colors.red}${stats.failed} failed${RESET}`);\n\n if (parts.length > 0) {\n writeLine(` ${parts.join(` ${colors.dim}|${RESET} `)}`);\n if (stats.avgDurationMs) {\n writeLine(` ${colors.dim}Avg duration: ${formatDuration(stats.avgDurationMs)}${RESET}`);\n }\n writeLine();\n }\n\n // Show commands\n writeLine(` ${colors.dim}$${RESET} squads exec show ${colors.cyan}<id>${RESET} ${colors.dim}Execution details${RESET}`);\n writeLine(` ${colors.dim}$${RESET} squads exec --json ${colors.dim}JSON output${RESET}`);\n writeLine();\n}\n\n/**\n * squads exec show <id> - Show execution details\n */\nexport async function execShowCommand(executionId: string, options: ShowOptions = {}): Promise<void> {\n await track(Events.CLI_EXEC, { action: 'show', id: executionId });\n\n // Support partial ID matching\n const executions = listExecutions();\n const matches = executions.filter(e =>\n e.id === executionId || e.id.startsWith(executionId)\n );\n\n if (matches.length === 0) {\n writeLine();\n writeLine(` ${colors.red}Execution not found: ${executionId}${RESET}`);\n writeLine();\n writeLine(` ${colors.dim}List recent executions:${RESET}`);\n writeLine(` ${colors.dim}$${RESET} squads exec list`);\n writeLine();\n return;\n }\n\n if (matches.length > 1) {\n writeLine();\n writeLine(` ${colors.yellow}Multiple matches for \"${executionId}\":${RESET}`);\n for (const m of matches.slice(0, 5)) {\n writeLine(` ${colors.dim}${m.id}${RESET} - ${m.squad}/${m.agent}`);\n }\n writeLine();\n writeLine(` ${colors.dim}Provide a more specific ID${RESET}`);\n writeLine();\n return;\n }\n\n const exec = matches[0];\n\n if (options.json) {\n console.log(JSON.stringify(exec, null, 2));\n return;\n }\n\n writeLine();\n writeLine(` ${gradient('squads')} ${colors.dim}exec show${RESET}`);\n writeLine();\n\n // Header\n writeLine(` ${bold}${exec.squad}/${exec.agent}${RESET}`);\n writeLine(` ${colors.dim}${exec.id}${RESET}`);\n writeLine();\n\n // Status with icon\n const statusIcon = exec.status === 'running' ? icons.running :\n exec.status === 'completed' ? icons.success : icons.error;\n const statusColor = exec.status === 'running' ? colors.yellow :\n exec.status === 'completed' ? colors.green : colors.red;\n\n writeLine(` ${bold}Status${RESET} ${statusColor}${statusIcon} ${exec.status}${RESET}`);\n writeLine(` ${bold}Task Type${RESET} ${exec.taskType}`);\n writeLine(` ${bold}Trigger${RESET} ${exec.trigger}`);\n writeLine();\n\n // Timing\n writeLine(` ${bold}Started${RESET} ${exec.startTime}`);\n if (exec.endTime) {\n writeLine(` ${bold}Completed${RESET} ${exec.endTime}`);\n }\n if (exec.durationMs) {\n writeLine(` ${bold}Duration${RESET} ${formatDuration(exec.durationMs)}`);\n }\n writeLine();\n\n // Outcome/Error\n if (exec.outcome) {\n writeLine(` ${bold}Outcome${RESET}`);\n writeLine(` ${colors.dim}${exec.outcome}${RESET}`);\n writeLine();\n }\n\n if (exec.error) {\n writeLine(` ${bold}Error${RESET}`);\n writeLine(` ${colors.red}${exec.error}${RESET}`);\n writeLine();\n }\n\n // Commands\n writeLine(` ${colors.dim}$${RESET} squads memory show ${colors.cyan}${exec.squad}${RESET} ${colors.dim}Squad memory${RESET}`);\n writeLine(` ${colors.dim}$${RESET} squads exec list --squad ${colors.cyan}${exec.squad}${RESET} ${colors.dim}Squad history${RESET}`);\n writeLine();\n}\n\n/**\n * squads exec stats - Show execution statistics\n */\nexport async function execStatsCommand(options: ListOptions = {}): Promise<void> {\n await track(Events.CLI_EXEC, { action: 'stats', squad: options.squad });\n\n const listOptions: ExecutionListOptions = {\n squad: options.squad,\n };\n\n const stats = getExecutionStats(listOptions);\n\n if (options.json) {\n console.log(JSON.stringify(stats, null, 2));\n return;\n }\n\n writeLine();\n writeLine(` ${gradient('squads')} ${colors.dim}exec stats${RESET}${options.squad ? ` ${colors.cyan}${options.squad}${RESET}` : ''}`);\n writeLine();\n\n writeLine(` ${bold}Total${RESET} ${stats.total}`);\n writeLine(` ${colors.yellow}Running${RESET} ${stats.running}`);\n writeLine(` ${colors.green}Completed${RESET} ${stats.completed}`);\n writeLine(` ${colors.red}Failed${RESET} ${stats.failed}`);\n writeLine();\n\n if (stats.avgDurationMs) {\n writeLine(` ${bold}Avg Duration${RESET} ${formatDuration(stats.avgDurationMs)}`);\n writeLine();\n }\n\n // Top squads by execution count\n const squadEntries = Object.entries(stats.bySquad).sort((a, b) => b[1] - a[1]).slice(0, 5);\n if (squadEntries.length > 0) {\n writeLine(` ${bold}By Squad${RESET}`);\n for (const [squad, count] of squadEntries) {\n writeLine(` ${colors.cyan}${squad}${RESET}: ${count}`);\n }\n writeLine();\n }\n\n // Top agents by execution count\n const agentEntries = Object.entries(stats.byAgent).sort((a, b) => b[1] - a[1]).slice(0, 5);\n if (agentEntries.length > 0) {\n writeLine(` ${bold}Top Agents${RESET}`);\n for (const [agent, count] of agentEntries) {\n writeLine(` ${colors.cyan}${agent}${RESET}: ${count}`);\n }\n writeLine();\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AA0CA,eAAsB,gBAAgB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js";
|
|
13
|
+
import {
|
|
14
|
+
RESET,
|
|
15
|
+
bold,
|
|
16
|
+
box,
|
|
17
|
+
colors,
|
|
18
|
+
gradient,
|
|
19
|
+
icons,
|
|
20
|
+
padEnd,
|
|
21
|
+
writeLine
|
|
22
|
+
} from "./chunk-M5FXNY6Y.js";
|
|
23
|
+
import "./chunk-7OCVIDC7.js";
|
|
24
|
+
|
|
25
|
+
// src/commands/feedback.ts
|
|
26
|
+
import { readFileSync, writeFileSync, existsSync, mkdirSync, readdirSync } from "fs";
|
|
27
|
+
import { join, dirname } from "path";
|
|
28
|
+
function getFeedbackPath(squadName) {
|
|
29
|
+
const memoryDir = findMemoryDir();
|
|
30
|
+
if (!memoryDir) return null;
|
|
31
|
+
const squad = loadSquad(squadName);
|
|
32
|
+
const agentName = squad?.agents[0]?.name || `${squadName}-lead`;
|
|
33
|
+
return join(memoryDir, squadName, agentName, "feedback.md");
|
|
34
|
+
}
|
|
35
|
+
function getOutputPath(squadName) {
|
|
36
|
+
const memoryDir = findMemoryDir();
|
|
37
|
+
if (!memoryDir) return null;
|
|
38
|
+
const squad = loadSquad(squadName);
|
|
39
|
+
const agentName = squad?.agents[0]?.name || `${squadName}-lead`;
|
|
40
|
+
return join(memoryDir, squadName, agentName, "output.md");
|
|
41
|
+
}
|
|
42
|
+
function getLastExecution(squadName) {
|
|
43
|
+
const outputPath = getOutputPath(squadName);
|
|
44
|
+
if (!outputPath || !existsSync(outputPath)) {
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
47
|
+
const content = readFileSync(outputPath, "utf-8");
|
|
48
|
+
const lines = content.split("\n");
|
|
49
|
+
let date = "unknown";
|
|
50
|
+
let summary = lines.slice(0, 5).join("\n");
|
|
51
|
+
const dateMatch = content.match(/(\d{4}-\d{2}-\d{2})/);
|
|
52
|
+
if (dateMatch) {
|
|
53
|
+
date = dateMatch[1];
|
|
54
|
+
}
|
|
55
|
+
const titleMatch = content.match(/^#\s+(.+)$/m);
|
|
56
|
+
if (titleMatch) {
|
|
57
|
+
summary = titleMatch[1];
|
|
58
|
+
}
|
|
59
|
+
return { date, summary };
|
|
60
|
+
}
|
|
61
|
+
function parseFeedbackHistory(content) {
|
|
62
|
+
const entries = [];
|
|
63
|
+
const sections = content.split(/---\n/).filter((s) => s.trim());
|
|
64
|
+
for (const section of sections) {
|
|
65
|
+
const dateMatch = section.match(/_Date:\s*(.+)_/);
|
|
66
|
+
const ratingMatch = section.match(/\*\*Rating\*\*:\s*(\d)\/5/);
|
|
67
|
+
const feedbackMatch = section.match(/\*\*Feedback\*\*:\s*(.+)/);
|
|
68
|
+
const executionMatch = section.match(/\*\*Execution\*\*:\s*(.+)/);
|
|
69
|
+
if (dateMatch && ratingMatch) {
|
|
70
|
+
const entry = {
|
|
71
|
+
date: dateMatch[1],
|
|
72
|
+
execution: executionMatch?.[1] || "unknown",
|
|
73
|
+
rating: parseInt(ratingMatch[1]),
|
|
74
|
+
feedback: feedbackMatch?.[1] || "",
|
|
75
|
+
learnings: []
|
|
76
|
+
};
|
|
77
|
+
const learningsMatch = section.match(/\*\*Learnings\*\*:\n((?:- .+\n?)+)/);
|
|
78
|
+
if (learningsMatch) {
|
|
79
|
+
entry.learnings = learningsMatch[1].split("\n").filter((l) => l.startsWith("- ")).map((l) => l.replace(/^- /, ""));
|
|
80
|
+
}
|
|
81
|
+
entries.push(entry);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
return entries;
|
|
85
|
+
}
|
|
86
|
+
async function feedbackAddCommand(squadName, rating, feedback, options) {
|
|
87
|
+
await track(Events.CLI_FEEDBACK_ADD, { squad: squadName, rating: parseInt(rating) });
|
|
88
|
+
const feedbackPath = getFeedbackPath(squadName);
|
|
89
|
+
if (!feedbackPath) {
|
|
90
|
+
writeLine(` ${colors.red}Could not find memory directory${RESET}`);
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
const ratingNum = parseInt(rating);
|
|
94
|
+
if (isNaN(ratingNum) || ratingNum < 1 || ratingNum > 5) {
|
|
95
|
+
writeLine(` ${colors.red}Rating must be 1-5${RESET}`);
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
const lastExec = getLastExecution(squadName);
|
|
99
|
+
const dir = dirname(feedbackPath);
|
|
100
|
+
if (!existsSync(dir)) {
|
|
101
|
+
mkdirSync(dir, { recursive: true });
|
|
102
|
+
}
|
|
103
|
+
const date = (/* @__PURE__ */ new Date()).toISOString().split("T")[0];
|
|
104
|
+
let entry = `
|
|
105
|
+
---
|
|
106
|
+
_Date: ${date}_
|
|
107
|
+
|
|
108
|
+
`;
|
|
109
|
+
entry += `**Execution**: ${lastExec?.summary || "Manual feedback"}
|
|
110
|
+
`;
|
|
111
|
+
entry += `**Rating**: ${ratingNum}/5 ${"\u2605".repeat(ratingNum)}${"\u2606".repeat(5 - ratingNum)}
|
|
112
|
+
`;
|
|
113
|
+
entry += `**Feedback**: ${feedback}
|
|
114
|
+
`;
|
|
115
|
+
if (options.learning && options.learning.length > 0) {
|
|
116
|
+
entry += `**Learnings**:
|
|
117
|
+
`;
|
|
118
|
+
for (const learning of options.learning) {
|
|
119
|
+
entry += `- ${learning}
|
|
120
|
+
`;
|
|
121
|
+
}
|
|
122
|
+
const squad = loadSquad(squadName);
|
|
123
|
+
const agentName = squad?.agents[0]?.name || `${squadName}-lead`;
|
|
124
|
+
for (const learning of options.learning) {
|
|
125
|
+
await appendToMemory(squadName, agentName, "learnings", `From feedback (${date}): ${learning}`);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
let existing = "";
|
|
129
|
+
if (existsSync(feedbackPath)) {
|
|
130
|
+
existing = readFileSync(feedbackPath, "utf-8");
|
|
131
|
+
} else {
|
|
132
|
+
existing = `# ${squadName} - Feedback Log
|
|
133
|
+
|
|
134
|
+
> Execution feedback and learnings
|
|
135
|
+
`;
|
|
136
|
+
}
|
|
137
|
+
writeFileSync(feedbackPath, existing + entry);
|
|
138
|
+
const stars = `${colors.yellow}${"\u2605".repeat(ratingNum)}${"\u2606".repeat(5 - ratingNum)}${RESET}`;
|
|
139
|
+
writeLine();
|
|
140
|
+
writeLine(` ${icons.success} Feedback recorded for ${colors.cyan}${squadName}${RESET}`);
|
|
141
|
+
writeLine(` Rating: ${stars}`);
|
|
142
|
+
writeLine(` ${feedback}`);
|
|
143
|
+
if (options.learning && options.learning.length > 0) {
|
|
144
|
+
writeLine(` ${colors.dim}+ ${options.learning.length} learning(s) added${RESET}`);
|
|
145
|
+
}
|
|
146
|
+
writeLine();
|
|
147
|
+
}
|
|
148
|
+
async function feedbackShowCommand(squadName, options) {
|
|
149
|
+
await track(Events.CLI_FEEDBACK_SHOW, { squad: squadName });
|
|
150
|
+
const feedbackPath = getFeedbackPath(squadName);
|
|
151
|
+
if (!feedbackPath || !existsSync(feedbackPath)) {
|
|
152
|
+
writeLine(` ${colors.yellow}No feedback recorded for ${squadName}${RESET}`);
|
|
153
|
+
return;
|
|
154
|
+
}
|
|
155
|
+
const content = readFileSync(feedbackPath, "utf-8");
|
|
156
|
+
const entries = parseFeedbackHistory(content);
|
|
157
|
+
const limit = options.limit ? parseInt(options.limit) : 5;
|
|
158
|
+
const recent = entries.slice(-limit).reverse();
|
|
159
|
+
writeLine();
|
|
160
|
+
writeLine(` ${gradient("squads")} ${colors.dim}feedback${RESET} ${colors.cyan}${squadName}${RESET}`);
|
|
161
|
+
writeLine();
|
|
162
|
+
if (recent.length === 0) {
|
|
163
|
+
writeLine(` ${colors.dim}No feedback entries yet${RESET}`);
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
166
|
+
const avgRating = entries.reduce((sum, e) => sum + e.rating, 0) / entries.length;
|
|
167
|
+
writeLine(` ${colors.dim}Average: ${avgRating.toFixed(1)}/5 (${entries.length} entries)${RESET}`);
|
|
168
|
+
writeLine();
|
|
169
|
+
for (const entry of recent) {
|
|
170
|
+
const stars = `${colors.yellow}${"\u2605".repeat(entry.rating)}${"\u2606".repeat(5 - entry.rating)}${RESET}`;
|
|
171
|
+
writeLine(` ${colors.dim}${entry.date}${RESET} ${stars}`);
|
|
172
|
+
writeLine(` ${entry.feedback}`);
|
|
173
|
+
if (entry.learnings && entry.learnings.length > 0) {
|
|
174
|
+
for (const learning of entry.learnings) {
|
|
175
|
+
writeLine(` ${colors.green}\u2192 ${learning}${RESET}`);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
writeLine();
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
async function feedbackStatsCommand() {
|
|
182
|
+
await track(Events.CLI_FEEDBACK_STATS);
|
|
183
|
+
const memoryDir = findMemoryDir();
|
|
184
|
+
if (!memoryDir) {
|
|
185
|
+
writeLine(` ${colors.red}Could not find memory directory${RESET}`);
|
|
186
|
+
return;
|
|
187
|
+
}
|
|
188
|
+
writeLine();
|
|
189
|
+
writeLine(` ${gradient("squads")} ${colors.dim}feedback stats${RESET}`);
|
|
190
|
+
writeLine();
|
|
191
|
+
const squads = readdirSync(memoryDir, { withFileTypes: true }).filter((e) => e.isDirectory()).map((e) => e.name);
|
|
192
|
+
const w = { squad: 18, avg: 12, count: 8, trend: 6 };
|
|
193
|
+
const tableWidth = w.squad + w.avg + w.count + w.trend + 4;
|
|
194
|
+
writeLine(` ${colors.purple}${box.topLeft}${colors.dim}${box.horizontal.repeat(tableWidth)}${colors.purple}${box.topRight}${RESET}`);
|
|
195
|
+
const header = ` ${colors.purple}${box.vertical}${RESET} ${bold}${padEnd("SQUAD", w.squad)}${RESET}${bold}${padEnd("AVG", w.avg)}${RESET}${bold}${padEnd("COUNT", w.count)}${RESET}${bold}TREND${RESET} ${colors.purple}${box.vertical}${RESET}`;
|
|
196
|
+
writeLine(header);
|
|
197
|
+
writeLine(` ${colors.purple}${box.teeRight}${colors.dim}${box.horizontal.repeat(tableWidth)}${colors.purple}${box.teeLeft}${RESET}`);
|
|
198
|
+
for (const squad of squads) {
|
|
199
|
+
const feedbackPath = getFeedbackPath(squad);
|
|
200
|
+
if (!feedbackPath || !existsSync(feedbackPath)) {
|
|
201
|
+
continue;
|
|
202
|
+
}
|
|
203
|
+
const content = readFileSync(feedbackPath, "utf-8");
|
|
204
|
+
const entries = parseFeedbackHistory(content);
|
|
205
|
+
if (entries.length === 0) continue;
|
|
206
|
+
const avgRating = entries.reduce((sum, e) => sum + e.rating, 0) / entries.length;
|
|
207
|
+
let trend = `${colors.dim}\u2192${RESET}`;
|
|
208
|
+
if (entries.length >= 4) {
|
|
209
|
+
const recent = entries.slice(-3).reduce((s, e) => s + e.rating, 0) / 3;
|
|
210
|
+
const older = entries.slice(-6, -3).reduce((s, e) => s + e.rating, 0) / Math.min(3, entries.slice(-6, -3).length);
|
|
211
|
+
if (recent > older + 0.3) trend = `${colors.green}\u2191${RESET}`;
|
|
212
|
+
else if (recent < older - 0.3) trend = `${colors.red}\u2193${RESET}`;
|
|
213
|
+
}
|
|
214
|
+
const stars = `${colors.yellow}${"\u2605".repeat(Math.round(avgRating))}${"\u2606".repeat(5 - Math.round(avgRating))}${RESET}`;
|
|
215
|
+
const row = ` ${colors.purple}${box.vertical}${RESET} ${colors.cyan}${padEnd(squad, w.squad)}${RESET}${padEnd(stars, w.avg + 20)}${padEnd(String(entries.length), w.count)}${trend} ${colors.purple}${box.vertical}${RESET}`;
|
|
216
|
+
writeLine(row);
|
|
217
|
+
}
|
|
218
|
+
writeLine(` ${colors.purple}${box.bottomLeft}${colors.dim}${box.horizontal.repeat(tableWidth)}${colors.purple}${box.bottomRight}${RESET}`);
|
|
219
|
+
writeLine();
|
|
220
|
+
writeLine(` ${colors.dim}$${RESET} squads feedback show ${colors.cyan}<squad>${RESET} ${colors.dim}View squad feedback${RESET}`);
|
|
221
|
+
writeLine(` ${colors.dim}$${RESET} squads feedback add ${colors.cyan}<squad>${RESET} ${colors.dim}Add new feedback${RESET}`);
|
|
222
|
+
writeLine();
|
|
223
|
+
}
|
|
224
|
+
export {
|
|
225
|
+
feedbackAddCommand,
|
|
226
|
+
feedbackShowCommand,
|
|
227
|
+
feedbackStatsCommand
|
|
228
|
+
};
|
|
229
|
+
//# sourceMappingURL=feedback-KNAOG5QK.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/commands/feedback.ts"],"sourcesContent":["import { readFileSync, writeFileSync, existsSync, mkdirSync, readdirSync } from 'fs';\nimport { join, dirname } from 'path';\nimport { findMemoryDir, appendToMemory } from '../lib/memory.js';\nimport { loadSquad } from '../lib/squad-parser.js';\nimport {\n colors,\n bold,\n RESET,\n gradient,\n box,\n padEnd,\n icons,\n writeLine,\n} from '../lib/terminal.js';\nimport { track, Events } from '../lib/telemetry.js';\n\nexport interface FeedbackEntry {\n date: string;\n execution: string;\n rating: number; // 1-5\n feedback: string;\n learnings?: string[];\n}\n\nfunction getFeedbackPath(squadName: string): string | null {\n const memoryDir = findMemoryDir();\n if (!memoryDir) return null;\n\n // Find the lead agent for this squad\n const squad = loadSquad(squadName);\n const agentName = squad?.agents[0]?.name || `${squadName}-lead`;\n\n return join(memoryDir, squadName, agentName, 'feedback.md');\n}\n\nfunction getOutputPath(squadName: string): string | null {\n const memoryDir = findMemoryDir();\n if (!memoryDir) return null;\n\n const squad = loadSquad(squadName);\n const agentName = squad?.agents[0]?.name || `${squadName}-lead`;\n\n return join(memoryDir, squadName, agentName, 'output.md');\n}\n\nfunction getLastExecution(squadName: string): { date: string; summary: string } | null {\n const outputPath = getOutputPath(squadName);\n if (!outputPath || !existsSync(outputPath)) {\n return null;\n }\n\n const content = readFileSync(outputPath, 'utf-8');\n const lines = content.split('\\n');\n\n // Try to extract date from content\n let date = 'unknown';\n let summary = lines.slice(0, 5).join('\\n');\n\n // Look for date patterns\n const dateMatch = content.match(/(\\d{4}-\\d{2}-\\d{2})/);\n if (dateMatch) {\n date = dateMatch[1];\n }\n\n // Look for title\n const titleMatch = content.match(/^#\\s+(.+)$/m);\n if (titleMatch) {\n summary = titleMatch[1];\n }\n\n return { date, summary };\n}\n\nfunction parseFeedbackHistory(content: string): FeedbackEntry[] {\n const entries: FeedbackEntry[] = [];\n const sections = content.split(/---\\n/).filter(s => s.trim());\n\n for (const section of sections) {\n const dateMatch = section.match(/_Date:\\s*(.+)_/);\n const ratingMatch = section.match(/\\*\\*Rating\\*\\*:\\s*(\\d)\\/5/);\n const feedbackMatch = section.match(/\\*\\*Feedback\\*\\*:\\s*(.+)/);\n const executionMatch = section.match(/\\*\\*Execution\\*\\*:\\s*(.+)/);\n\n if (dateMatch && ratingMatch) {\n const entry: FeedbackEntry = {\n date: dateMatch[1],\n execution: executionMatch?.[1] || 'unknown',\n rating: parseInt(ratingMatch[1]),\n feedback: feedbackMatch?.[1] || '',\n learnings: [],\n };\n\n // Extract learnings\n const learningsMatch = section.match(/\\*\\*Learnings\\*\\*:\\n((?:- .+\\n?)+)/);\n if (learningsMatch) {\n entry.learnings = learningsMatch[1]\n .split('\\n')\n .filter(l => l.startsWith('- '))\n .map(l => l.replace(/^- /, ''));\n }\n\n entries.push(entry);\n }\n }\n\n return entries;\n}\n\nexport async function feedbackAddCommand(\n squadName: string,\n rating: string,\n feedback: string,\n options: { learning?: string[] }\n): Promise<void> {\n await track(Events.CLI_FEEDBACK_ADD, { squad: squadName, rating: parseInt(rating) });\n const feedbackPath = getFeedbackPath(squadName);\n if (!feedbackPath) {\n writeLine(` ${colors.red}Could not find memory directory${RESET}`);\n return;\n }\n\n const ratingNum = parseInt(rating);\n if (isNaN(ratingNum) || ratingNum < 1 || ratingNum > 5) {\n writeLine(` ${colors.red}Rating must be 1-5${RESET}`);\n return;\n }\n\n // Get last execution for context\n const lastExec = getLastExecution(squadName);\n\n // Ensure directory exists\n const dir = dirname(feedbackPath);\n if (!existsSync(dir)) {\n mkdirSync(dir, { recursive: true });\n }\n\n // Build feedback entry\n const date = new Date().toISOString().split('T')[0];\n let entry = `\\n---\\n_Date: ${date}_\\n\\n`;\n entry += `**Execution**: ${lastExec?.summary || 'Manual feedback'}\\n`;\n entry += `**Rating**: ${ratingNum}/5 ${'★'.repeat(ratingNum)}${'☆'.repeat(5 - ratingNum)}\\n`;\n entry += `**Feedback**: ${feedback}\\n`;\n\n if (options.learning && options.learning.length > 0) {\n entry += `**Learnings**:\\n`;\n for (const learning of options.learning) {\n entry += `- ${learning}\\n`;\n }\n\n // Also add learnings to the learnings file\n const squad = loadSquad(squadName);\n const agentName = squad?.agents[0]?.name || `${squadName}-lead`;\n\n for (const learning of options.learning) {\n await appendToMemory(squadName, agentName, 'learnings', `From feedback (${date}): ${learning}`);\n }\n }\n\n // Append to feedback file\n let existing = '';\n if (existsSync(feedbackPath)) {\n existing = readFileSync(feedbackPath, 'utf-8');\n } else {\n existing = `# ${squadName} - Feedback Log\\n\\n> Execution feedback and learnings\\n`;\n }\n\n writeFileSync(feedbackPath, existing + entry);\n\n // Display\n const stars = `${colors.yellow}${'★'.repeat(ratingNum)}${'☆'.repeat(5 - ratingNum)}${RESET}`;\n\n writeLine();\n writeLine(` ${icons.success} Feedback recorded for ${colors.cyan}${squadName}${RESET}`);\n writeLine(` Rating: ${stars}`);\n writeLine(` ${feedback}`);\n if (options.learning && options.learning.length > 0) {\n writeLine(` ${colors.dim}+ ${options.learning.length} learning(s) added${RESET}`);\n }\n writeLine();\n}\n\nexport async function feedbackShowCommand(\n squadName: string,\n options: { limit?: string }\n): Promise<void> {\n await track(Events.CLI_FEEDBACK_SHOW, { squad: squadName });\n const feedbackPath = getFeedbackPath(squadName);\n if (!feedbackPath || !existsSync(feedbackPath)) {\n writeLine(` ${colors.yellow}No feedback recorded for ${squadName}${RESET}`);\n return;\n }\n\n const content = readFileSync(feedbackPath, 'utf-8');\n const entries = parseFeedbackHistory(content);\n\n const limit = options.limit ? parseInt(options.limit) : 5;\n const recent = entries.slice(-limit).reverse();\n\n writeLine();\n writeLine(` ${gradient('squads')} ${colors.dim}feedback${RESET} ${colors.cyan}${squadName}${RESET}`);\n writeLine();\n\n if (recent.length === 0) {\n writeLine(` ${colors.dim}No feedback entries yet${RESET}`);\n return;\n }\n\n // Calculate average rating\n const avgRating = entries.reduce((sum, e) => sum + e.rating, 0) / entries.length;\n\n writeLine(` ${colors.dim}Average: ${avgRating.toFixed(1)}/5 (${entries.length} entries)${RESET}`);\n writeLine();\n\n for (const entry of recent) {\n const stars = `${colors.yellow}${'★'.repeat(entry.rating)}${'☆'.repeat(5 - entry.rating)}${RESET}`;\n writeLine(` ${colors.dim}${entry.date}${RESET} ${stars}`);\n writeLine(` ${entry.feedback}`);\n if (entry.learnings && entry.learnings.length > 0) {\n for (const learning of entry.learnings) {\n writeLine(` ${colors.green}→ ${learning}${RESET}`);\n }\n }\n writeLine();\n }\n}\n\nexport async function feedbackStatsCommand(): Promise<void> {\n await track(Events.CLI_FEEDBACK_STATS);\n const memoryDir = findMemoryDir();\n if (!memoryDir) {\n writeLine(` ${colors.red}Could not find memory directory${RESET}`);\n return;\n }\n\n writeLine();\n writeLine(` ${gradient('squads')} ${colors.dim}feedback stats${RESET}`);\n writeLine();\n\n const squads = readdirSync(memoryDir, { withFileTypes: true })\n .filter(e => e.isDirectory())\n .map(e => e.name);\n\n // Table\n const w = { squad: 18, avg: 12, count: 8, trend: 6 };\n const tableWidth = w.squad + w.avg + w.count + w.trend + 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('AVG', w.avg)}${RESET}` +\n `${bold}${padEnd('COUNT', w.count)}${RESET}` +\n `${bold}TREND${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 squads) {\n const feedbackPath = getFeedbackPath(squad);\n if (!feedbackPath || !existsSync(feedbackPath)) {\n continue;\n }\n\n const content = readFileSync(feedbackPath, 'utf-8');\n const entries = parseFeedbackHistory(content);\n\n if (entries.length === 0) continue;\n\n const avgRating = entries.reduce((sum, e) => sum + e.rating, 0) / entries.length;\n\n // Calculate trend (last 3 vs previous)\n let trend = `${colors.dim}→${RESET}`;\n if (entries.length >= 4) {\n const recent = entries.slice(-3).reduce((s, e) => s + e.rating, 0) / 3;\n const older = entries.slice(-6, -3).reduce((s, e) => s + e.rating, 0) / Math.min(3, entries.slice(-6, -3).length);\n if (recent > older + 0.3) trend = `${colors.green}↑${RESET}`;\n else if (recent < older - 0.3) trend = `${colors.red}↓${RESET}`;\n }\n\n const stars = `${colors.yellow}${'★'.repeat(Math.round(avgRating))}${'☆'.repeat(5 - Math.round(avgRating))}${RESET}`;\n\n const row = ` ${colors.purple}${box.vertical}${RESET} ` +\n `${colors.cyan}${padEnd(squad, w.squad)}${RESET}` +\n `${padEnd(stars, w.avg + 20)}` + // extra for color codes\n `${padEnd(String(entries.length), w.count)}` +\n `${trend}` +\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 writeLine();\n\n // Commands\n writeLine(` ${colors.dim}$${RESET} squads feedback show ${colors.cyan}<squad>${RESET} ${colors.dim}View squad feedback${RESET}`);\n writeLine(` ${colors.dim}$${RESET} squads feedback add ${colors.cyan}<squad>${RESET} ${colors.dim}Add new feedback${RESET}`);\n writeLine();\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,cAAc,eAAe,YAAY,WAAW,mBAAmB;AAChF,SAAS,MAAM,eAAe;AAuB9B,SAAS,gBAAgB,WAAkC;AACzD,QAAM,YAAY,cAAc;AAChC,MAAI,CAAC,UAAW,QAAO;AAGvB,QAAM,QAAQ,UAAU,SAAS;AACjC,QAAM,YAAY,OAAO,OAAO,CAAC,GAAG,QAAQ,GAAG,SAAS;AAExD,SAAO,KAAK,WAAW,WAAW,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I,YAAU;AAGV,YAAU,KAAK,OAAO,GAAG,IAAI,KAAK,yBAAyB,OAAO,IAAI,UAAU,KAAK,MAAM,OAAO,GAAG,sBAAsB,KAAK,EAAE;AAClI,YAAU,KAAK,OAAO,GAAG,IAAI,KAAK,wBAAwB,OAAO,IAAI,UAAU,KAAK,OAAO,OAAO,GAAG,mBAAmB,KAAK,EAAE;AAC/H,YAAU;AACZ;","names":[]}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
createGitHubRepo,
|
|
4
|
+
detectGitHubOrg,
|
|
5
|
+
detectGitHubRepo,
|
|
6
|
+
getBotGhEnv,
|
|
7
|
+
getBotGitEnv,
|
|
8
|
+
getBotPushUrl,
|
|
9
|
+
getCoAuthorTrailer,
|
|
10
|
+
getGitHubAppToken
|
|
11
|
+
} from "./chunk-FIWT2NMM.js";
|
|
12
|
+
import "./chunk-7OCVIDC7.js";
|
|
13
|
+
export {
|
|
14
|
+
createGitHubRepo,
|
|
15
|
+
detectGitHubOrg,
|
|
16
|
+
detectGitHubRepo,
|
|
17
|
+
getBotGhEnv,
|
|
18
|
+
getBotGitEnv,
|
|
19
|
+
getBotPushUrl,
|
|
20
|
+
getCoAuthorTrailer,
|
|
21
|
+
getGitHubAppToken
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=github-UQTM5KMS.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|