@bradygaster/squad-cli 0.8.4 → 0.8.16
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 +2 -2
- package/dist/cli/commands/aspire.d.ts.map +1 -1
- package/dist/cli/commands/aspire.js +7 -8
- package/dist/cli/commands/aspire.js.map +1 -1
- package/dist/cli/commands/copilot-bridge.d.ts +42 -0
- package/dist/cli/commands/copilot-bridge.d.ts.map +1 -0
- package/dist/cli/commands/copilot-bridge.js +191 -0
- package/dist/cli/commands/copilot-bridge.js.map +1 -0
- package/dist/cli/commands/import.js.map +1 -1
- package/dist/cli/commands/rc-tunnel.d.ts +30 -0
- package/dist/cli/commands/rc-tunnel.d.ts.map +1 -0
- package/dist/cli/commands/rc-tunnel.js +107 -0
- package/dist/cli/commands/rc-tunnel.js.map +1 -0
- package/dist/cli/commands/rc.d.ts +13 -0
- package/dist/cli/commands/rc.d.ts.map +1 -0
- package/dist/cli/commands/rc.js +270 -0
- package/dist/cli/commands/rc.js.map +1 -0
- package/dist/cli/commands/start.d.ts +18 -0
- package/dist/cli/commands/start.d.ts.map +1 -0
- package/dist/cli/commands/start.js +219 -0
- package/dist/cli/commands/start.js.map +1 -0
- package/dist/cli/commands/upstream.js.map +1 -1
- package/dist/cli/commands/watch.d.ts +10 -0
- package/dist/cli/commands/watch.d.ts.map +1 -1
- package/dist/cli/commands/watch.js +181 -65
- package/dist/cli/commands/watch.js.map +1 -1
- package/dist/cli/core/cast.d.ts +40 -0
- package/dist/cli/core/cast.d.ts.map +1 -0
- package/dist/cli/core/cast.js +442 -0
- package/dist/cli/core/cast.js.map +1 -0
- package/dist/cli/core/gh-cli.d.ts +25 -0
- package/dist/cli/core/gh-cli.d.ts.map +1 -1
- package/dist/cli/core/gh-cli.js +15 -1
- package/dist/cli/core/gh-cli.js.map +1 -1
- package/dist/cli/core/init.d.ts +9 -1
- package/dist/cli/core/init.d.ts.map +1 -1
- package/dist/cli/core/init.js +108 -13
- package/dist/cli/core/init.js.map +1 -1
- package/dist/cli/core/migrations.js.map +1 -1
- package/dist/cli/core/nap.d.ts +37 -0
- package/dist/cli/core/nap.d.ts.map +1 -0
- package/dist/cli/core/nap.js +528 -0
- package/dist/cli/core/nap.js.map +1 -0
- package/dist/cli/core/output.d.ts +5 -0
- package/dist/cli/core/output.d.ts.map +1 -1
- package/dist/cli/core/output.js +7 -0
- package/dist/cli/core/output.js.map +1 -1
- package/dist/cli/core/upgrade.d.ts +0 -1
- package/dist/cli/core/upgrade.d.ts.map +1 -1
- package/dist/cli/core/upgrade.js.map +1 -1
- package/dist/cli/core/version.js.map +1 -1
- package/dist/cli/shell/agent-status.d.ts +11 -0
- package/dist/cli/shell/agent-status.d.ts.map +1 -0
- package/dist/cli/shell/agent-status.js +26 -0
- package/dist/cli/shell/agent-status.js.map +1 -0
- package/dist/cli/shell/commands.d.ts +10 -0
- package/dist/cli/shell/commands.d.ts.map +1 -1
- package/dist/cli/shell/commands.js +143 -29
- package/dist/cli/shell/commands.js.map +1 -1
- package/dist/cli/shell/components/AgentPanel.d.ts +1 -4
- package/dist/cli/shell/components/AgentPanel.d.ts.map +1 -1
- package/dist/cli/shell/components/AgentPanel.js +88 -6
- package/dist/cli/shell/components/AgentPanel.js.map +1 -1
- package/dist/cli/shell/components/App.d.ts +11 -6
- package/dist/cli/shell/components/App.d.ts.map +1 -1
- package/dist/cli/shell/components/App.js +212 -35
- package/dist/cli/shell/components/App.js.map +1 -1
- package/dist/cli/shell/components/ErrorBoundary.d.ts +22 -0
- package/dist/cli/shell/components/ErrorBoundary.d.ts.map +1 -0
- package/dist/cli/shell/components/ErrorBoundary.js +31 -0
- package/dist/cli/shell/components/ErrorBoundary.js.map +1 -0
- package/dist/cli/shell/components/InputPrompt.d.ts +3 -0
- package/dist/cli/shell/components/InputPrompt.d.ts.map +1 -1
- package/dist/cli/shell/components/InputPrompt.js +155 -13
- package/dist/cli/shell/components/InputPrompt.js.map +1 -1
- package/dist/cli/shell/components/MessageStream.d.ts +17 -4
- package/dist/cli/shell/components/MessageStream.d.ts.map +1 -1
- package/dist/cli/shell/components/MessageStream.js +215 -23
- package/dist/cli/shell/components/MessageStream.js.map +1 -1
- package/dist/cli/shell/components/Separator.d.ts +17 -0
- package/dist/cli/shell/components/Separator.d.ts.map +1 -0
- package/dist/cli/shell/components/Separator.js +10 -0
- package/dist/cli/shell/components/Separator.js.map +1 -0
- package/dist/cli/shell/components/ThinkingIndicator.d.ts +21 -0
- package/dist/cli/shell/components/ThinkingIndicator.d.ts.map +1 -0
- package/dist/cli/shell/components/ThinkingIndicator.js +102 -0
- package/dist/cli/shell/components/ThinkingIndicator.js.map +1 -0
- package/dist/cli/shell/components/index.d.ts +3 -0
- package/dist/cli/shell/components/index.d.ts.map +1 -1
- package/dist/cli/shell/components/index.js +2 -0
- package/dist/cli/shell/components/index.js.map +1 -1
- package/dist/cli/shell/coordinator.d.ts +10 -0
- package/dist/cli/shell/coordinator.d.ts.map +1 -1
- package/dist/cli/shell/coordinator.js +99 -4
- package/dist/cli/shell/coordinator.js.map +1 -1
- package/dist/cli/shell/error-messages.d.ts +21 -0
- package/dist/cli/shell/error-messages.d.ts.map +1 -0
- package/dist/cli/shell/error-messages.js +61 -0
- package/dist/cli/shell/error-messages.js.map +1 -0
- package/dist/cli/shell/index.d.ts +24 -3
- package/dist/cli/shell/index.d.ts.map +1 -1
- package/dist/cli/shell/index.js +949 -29
- package/dist/cli/shell/index.js.map +1 -1
- package/dist/cli/shell/lifecycle.d.ts +2 -0
- package/dist/cli/shell/lifecycle.d.ts.map +1 -1
- package/dist/cli/shell/lifecycle.js +59 -6
- package/dist/cli/shell/lifecycle.js.map +1 -1
- package/dist/cli/shell/memory.d.ts +6 -1
- package/dist/cli/shell/memory.d.ts.map +1 -1
- package/dist/cli/shell/memory.js +12 -1
- package/dist/cli/shell/memory.js.map +1 -1
- package/dist/cli/shell/router.d.ts +16 -0
- package/dist/cli/shell/router.d.ts.map +1 -1
- package/dist/cli/shell/router.js +27 -0
- package/dist/cli/shell/router.js.map +1 -1
- package/dist/cli/shell/session-store.d.ts +47 -0
- package/dist/cli/shell/session-store.d.ts.map +1 -0
- package/dist/cli/shell/session-store.js +125 -0
- package/dist/cli/shell/session-store.js.map +1 -0
- package/dist/cli/shell/sessions.d.ts +2 -0
- package/dist/cli/shell/sessions.d.ts.map +1 -1
- package/dist/cli/shell/sessions.js +19 -5
- package/dist/cli/shell/sessions.js.map +1 -1
- package/dist/cli/shell/shell-metrics.d.ts +34 -0
- package/dist/cli/shell/shell-metrics.d.ts.map +1 -0
- package/dist/cli/shell/shell-metrics.js +98 -0
- package/dist/cli/shell/shell-metrics.js.map +1 -0
- package/dist/cli/shell/spawn.d.ts.map +1 -1
- package/dist/cli/shell/spawn.js +20 -6
- package/dist/cli/shell/spawn.js.map +1 -1
- package/dist/cli/shell/terminal.d.ts +26 -0
- package/dist/cli/shell/terminal.d.ts.map +1 -1
- package/dist/cli/shell/terminal.js +65 -2
- package/dist/cli/shell/terminal.js.map +1 -1
- package/dist/cli/shell/theme-colors.d.ts +39 -0
- package/dist/cli/shell/theme-colors.d.ts.map +1 -0
- package/dist/cli/shell/theme-colors.js +39 -0
- package/dist/cli/shell/theme-colors.js.map +1 -0
- package/dist/cli/shell/types.d.ts +2 -0
- package/dist/cli/shell/types.d.ts.map +1 -1
- package/dist/cli/shell/useAnimation.d.ts +42 -0
- package/dist/cli/shell/useAnimation.d.ts.map +1 -0
- package/dist/cli/shell/useAnimation.js +139 -0
- package/dist/cli/shell/useAnimation.js.map +1 -0
- package/dist/cli-entry.d.ts +0 -7
- package/dist/cli-entry.d.ts.map +1 -1
- package/dist/cli-entry.js +701 -96
- package/dist/cli-entry.js.map +1 -1
- package/package.json +156 -140
- package/templates/orchestration-log.md +1 -1
- package/templates/package.json +3 -0
- package/templates/ralph-triage.js +543 -0
- package/templates/scribe-charter.md +1 -1
- package/templates/squad.agent.md +10 -10
- package/templates/workflows/squad-heartbeat.yml +52 -196
- package/templates/workflows/squad-insider-release.yml +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sessions.d.ts","sourceRoot":"","sources":["../../../src/cli/shell/sessions.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE1C,qBAAa,eAAe;IAC1B,OAAO,CAAC,QAAQ,CAAmC;IAEnD,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,YAAY;IAWlD,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY,GAAG,SAAS;IAI3C,MAAM,IAAI,YAAY,EAAE;IAIxB,SAAS,IAAI,YAAY,EAAE;IAI3B,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,CAAC,QAAQ,CAAC,GAAG,IAAI;IAKhE,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAI7B,KAAK,IAAI,IAAI;CAGd"}
|
|
1
|
+
{"version":3,"file":"sessions.d.ts","sourceRoot":"","sources":["../../../src/cli/shell/sessions.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE1C,qBAAa,eAAe;IAC1B,OAAO,CAAC,QAAQ,CAAmC;IAEnD,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,YAAY;IAWlD,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY,GAAG,SAAS;IAI3C,MAAM,IAAI,YAAY,EAAE;IAIxB,SAAS,IAAI,YAAY,EAAE;IAI3B,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,CAAC,QAAQ,CAAC,GAAG,IAAI;IAShE,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI;IAKhE,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI;IAK1D,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAI7B,KAAK,IAAI,IAAI;CAGd"}
|
|
@@ -10,11 +10,11 @@ export class SessionRegistry {
|
|
|
10
10
|
status: 'idle',
|
|
11
11
|
startedAt: new Date(),
|
|
12
12
|
};
|
|
13
|
-
this.sessions.set(name, session);
|
|
13
|
+
this.sessions.set(name.toLowerCase(), session);
|
|
14
14
|
return session;
|
|
15
15
|
}
|
|
16
16
|
get(name) {
|
|
17
|
-
return this.sessions.get(name);
|
|
17
|
+
return this.sessions.get(name.toLowerCase());
|
|
18
18
|
}
|
|
19
19
|
getAll() {
|
|
20
20
|
return Array.from(this.sessions.values());
|
|
@@ -23,12 +23,26 @@ export class SessionRegistry {
|
|
|
23
23
|
return this.getAll().filter(s => s.status === 'working' || s.status === 'streaming');
|
|
24
24
|
}
|
|
25
25
|
updateStatus(name, status) {
|
|
26
|
-
const session = this.sessions.get(name);
|
|
27
|
-
if (session)
|
|
26
|
+
const session = this.sessions.get(name.toLowerCase());
|
|
27
|
+
if (session) {
|
|
28
28
|
session.status = status;
|
|
29
|
+
// Clear activity hint when agent goes idle or errors
|
|
30
|
+
if (status === 'idle' || status === 'error')
|
|
31
|
+
session.activityHint = undefined;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
updateActivityHint(name, hint) {
|
|
35
|
+
const session = this.sessions.get(name.toLowerCase());
|
|
36
|
+
if (session)
|
|
37
|
+
session.activityHint = hint;
|
|
38
|
+
}
|
|
39
|
+
updateModel(name, model) {
|
|
40
|
+
const session = this.sessions.get(name.toLowerCase());
|
|
41
|
+
if (session)
|
|
42
|
+
session.model = model;
|
|
29
43
|
}
|
|
30
44
|
remove(name) {
|
|
31
|
-
return this.sessions.delete(name);
|
|
45
|
+
return this.sessions.delete(name.toLowerCase());
|
|
32
46
|
}
|
|
33
47
|
clear() {
|
|
34
48
|
this.sessions.clear();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sessions.js","sourceRoot":"","sources":["../../../src/cli/shell/sessions.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,MAAM,OAAO,eAAe;IAClB,QAAQ,GAAG,IAAI,GAAG,EAAwB,CAAC;IAEnD,QAAQ,CAAC,IAAY,EAAE,IAAY;QACjC,MAAM,OAAO,GAAiB;YAC5B,IAAI;YACJ,IAAI;YACJ,MAAM,EAAE,MAAM;YACd,SAAS,EAAE,IAAI,IAAI,EAAE;SACtB,CAAC;QACF,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"sessions.js","sourceRoot":"","sources":["../../../src/cli/shell/sessions.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,MAAM,OAAO,eAAe;IAClB,QAAQ,GAAG,IAAI,GAAG,EAAwB,CAAC;IAEnD,QAAQ,CAAC,IAAY,EAAE,IAAY;QACjC,MAAM,OAAO,GAAiB;YAC5B,IAAI;YACJ,IAAI;YACJ,MAAM,EAAE,MAAM;YACd,SAAS,EAAE,IAAI,IAAI,EAAE;SACtB,CAAC;QACF,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,OAAO,CAAC,CAAC;QAC/C,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,GAAG,CAAC,IAAY;QACd,OAAO,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC;IAC/C,CAAC;IAED,MAAM;QACJ,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC;IAC5C,CAAC;IAED,SAAS;QACP,OAAO,IAAI,CAAC,MAAM,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,SAAS,IAAI,CAAC,CAAC,MAAM,KAAK,WAAW,CAAC,CAAC;IACvF,CAAC;IAED,YAAY,CAAC,IAAY,EAAE,MAA8B;QACvD,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC;QACtD,IAAI,OAAO,EAAE,CAAC;YACZ,OAAO,CAAC,MAAM,GAAG,MAAM,CAAC;YACxB,qDAAqD;YACrD,IAAI,MAAM,KAAK,MAAM,IAAI,MAAM,KAAK,OAAO;gBAAE,OAAO,CAAC,YAAY,GAAG,SAAS,CAAC;QAChF,CAAC;IACH,CAAC;IAED,kBAAkB,CAAC,IAAY,EAAE,IAAwB;QACvD,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC;QACtD,IAAI,OAAO;YAAE,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC;IAC3C,CAAC;IAED,WAAW,CAAC,IAAY,EAAE,KAAyB;QACjD,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC;QACtD,IAAI,OAAO;YAAE,OAAO,CAAC,KAAK,GAAG,KAAK,CAAC;IACrC,CAAC;IAED,MAAM,CAAC,IAAY;QACjB,OAAO,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC;IAClD,CAAC;IAED,KAAK;QACH,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC;IACxB,CAAC;CACF"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shell Observability Metrics (Issues #508, #520, #526, #530, #531)
|
|
3
|
+
*
|
|
4
|
+
* Provides user-facing shell metrics: session lifetime, agent response
|
|
5
|
+
* latency (time to first visible token), error rate, and session count.
|
|
6
|
+
* No-op when SQUAD_TELEMETRY !== '1' or OTel is not configured.
|
|
7
|
+
*
|
|
8
|
+
* Privacy-first: opt-in via SQUAD_TELEMETRY=1 env var. No PII collected.
|
|
9
|
+
*
|
|
10
|
+
* @module shell/shell-metrics
|
|
11
|
+
*/
|
|
12
|
+
/** Check if shell telemetry is opt-in enabled via SQUAD_TELEMETRY=1. */
|
|
13
|
+
export declare function isShellTelemetryEnabled(): boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Enable shell metrics collection. Call once at shell startup.
|
|
16
|
+
* Always enabled when OTel is configured; SQUAD_TELEMETRY=1 also enables.
|
|
17
|
+
* Returns true if metrics were enabled.
|
|
18
|
+
*/
|
|
19
|
+
export declare function enableShellMetrics(): boolean;
|
|
20
|
+
/** Record the final session duration when the shell exits. */
|
|
21
|
+
export declare function recordShellSessionDuration(durationMs: number): void;
|
|
22
|
+
/**
|
|
23
|
+
* Record agent response latency — time from message dispatch to first
|
|
24
|
+
* visible response token. Attributes include agent name and dispatch type.
|
|
25
|
+
*/
|
|
26
|
+
export declare function recordAgentResponseLatency(agentName: string, latencyMs: number, dispatchType?: 'direct' | 'coordinator'): void;
|
|
27
|
+
/**
|
|
28
|
+
* Record an error encountered during the shell session.
|
|
29
|
+
* Attributes include error source context.
|
|
30
|
+
*/
|
|
31
|
+
export declare function recordShellError(source: string, errorType?: string): void;
|
|
32
|
+
/** Reset all cached metric instances and state. Used in tests only. */
|
|
33
|
+
export declare function _resetShellMetrics(): void;
|
|
34
|
+
//# sourceMappingURL=shell-metrics.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shell-metrics.d.ts","sourceRoot":"","sources":["../../../src/cli/shell/shell-metrics.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AA0BH,wEAAwE;AACxE,wBAAgB,uBAAuB,IAAI,OAAO,CAEjD;AA8BD;;;;GAIG;AACH,wBAAgB,kBAAkB,IAAI,OAAO,CAO5C;AAED,8DAA8D;AAC9D,wBAAgB,0BAA0B,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAEnE;AAED;;;GAGG;AACH,wBAAgB,0BAA0B,CACxC,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,YAAY,GAAE,QAAQ,GAAG,aAAwB,GAChD,IAAI,CAKN;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAKzE;AAMD,uEAAuE;AACvE,wBAAgB,kBAAkB,IAAI,IAAI,CAGzC"}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shell Observability Metrics (Issues #508, #520, #526, #530, #531)
|
|
3
|
+
*
|
|
4
|
+
* Provides user-facing shell metrics: session lifetime, agent response
|
|
5
|
+
* latency (time to first visible token), error rate, and session count.
|
|
6
|
+
* No-op when SQUAD_TELEMETRY !== '1' or OTel is not configured.
|
|
7
|
+
*
|
|
8
|
+
* Privacy-first: opt-in via SQUAD_TELEMETRY=1 env var. No PII collected.
|
|
9
|
+
*
|
|
10
|
+
* @module shell/shell-metrics
|
|
11
|
+
*/
|
|
12
|
+
import { getMeter } from '@bradygaster/squad-sdk';
|
|
13
|
+
// ============================================================================
|
|
14
|
+
// Internal state
|
|
15
|
+
// ============================================================================
|
|
16
|
+
let _metrics;
|
|
17
|
+
let _enabled = false;
|
|
18
|
+
// ============================================================================
|
|
19
|
+
// Opt-in gate
|
|
20
|
+
// ============================================================================
|
|
21
|
+
/** Check if shell telemetry is opt-in enabled via SQUAD_TELEMETRY=1. */
|
|
22
|
+
export function isShellTelemetryEnabled() {
|
|
23
|
+
return process.env['SQUAD_TELEMETRY'] === '1';
|
|
24
|
+
}
|
|
25
|
+
function ensureMetrics() {
|
|
26
|
+
if (!_enabled)
|
|
27
|
+
return undefined;
|
|
28
|
+
if (!_metrics) {
|
|
29
|
+
const meter = getMeter('squad-shell');
|
|
30
|
+
_metrics = {
|
|
31
|
+
sessionDuration: meter.createHistogram('squad.shell.session_duration_ms', {
|
|
32
|
+
description: 'Shell session duration in milliseconds',
|
|
33
|
+
unit: 'ms',
|
|
34
|
+
}),
|
|
35
|
+
agentLatency: meter.createHistogram('squad.shell.agent_response_latency_ms', {
|
|
36
|
+
description: 'Time from message send to first response token in milliseconds',
|
|
37
|
+
unit: 'ms',
|
|
38
|
+
}),
|
|
39
|
+
errorCount: meter.createCounter('squad.shell.error_count', {
|
|
40
|
+
description: 'Total errors during shell session',
|
|
41
|
+
}),
|
|
42
|
+
sessionCount: meter.createCounter('squad.shell.session_count', {
|
|
43
|
+
description: 'Total shell sessions started',
|
|
44
|
+
}),
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
return _metrics;
|
|
48
|
+
}
|
|
49
|
+
// ============================================================================
|
|
50
|
+
// Public API
|
|
51
|
+
// ============================================================================
|
|
52
|
+
/**
|
|
53
|
+
* Enable shell metrics collection. Call once at shell startup.
|
|
54
|
+
* Always enabled when OTel is configured; SQUAD_TELEMETRY=1 also enables.
|
|
55
|
+
* Returns true if metrics were enabled.
|
|
56
|
+
*/
|
|
57
|
+
export function enableShellMetrics() {
|
|
58
|
+
const hasOTel = !!process.env['OTEL_EXPORTER_OTLP_ENDPOINT'];
|
|
59
|
+
if (!hasOTel && !isShellTelemetryEnabled())
|
|
60
|
+
return false;
|
|
61
|
+
_enabled = true;
|
|
62
|
+
const m = ensureMetrics();
|
|
63
|
+
m?.sessionCount.add(1);
|
|
64
|
+
return true;
|
|
65
|
+
}
|
|
66
|
+
/** Record the final session duration when the shell exits. */
|
|
67
|
+
export function recordShellSessionDuration(durationMs) {
|
|
68
|
+
ensureMetrics()?.sessionDuration.record(durationMs);
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Record agent response latency — time from message dispatch to first
|
|
72
|
+
* visible response token. Attributes include agent name and dispatch type.
|
|
73
|
+
*/
|
|
74
|
+
export function recordAgentResponseLatency(agentName, latencyMs, dispatchType = 'direct') {
|
|
75
|
+
ensureMetrics()?.agentLatency.record(latencyMs, {
|
|
76
|
+
'agent.name': agentName,
|
|
77
|
+
'dispatch.type': dispatchType,
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Record an error encountered during the shell session.
|
|
82
|
+
* Attributes include error source context.
|
|
83
|
+
*/
|
|
84
|
+
export function recordShellError(source, errorType) {
|
|
85
|
+
ensureMetrics()?.errorCount.add(1, {
|
|
86
|
+
'error.source': source,
|
|
87
|
+
...(errorType ? { 'error.type': errorType } : {}),
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
// ============================================================================
|
|
91
|
+
// Reset (for testing)
|
|
92
|
+
// ============================================================================
|
|
93
|
+
/** Reset all cached metric instances and state. Used in tests only. */
|
|
94
|
+
export function _resetShellMetrics() {
|
|
95
|
+
_metrics = undefined;
|
|
96
|
+
_enabled = false;
|
|
97
|
+
}
|
|
98
|
+
//# sourceMappingURL=shell-metrics.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shell-metrics.js","sourceRoot":"","sources":["../../../src/cli/shell/shell-metrics.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAalD,+EAA+E;AAC/E,iBAAiB;AACjB,+EAA+E;AAE/E,IAAI,QAAkC,CAAC;AACvC,IAAI,QAAQ,GAAG,KAAK,CAAC;AAErB,+EAA+E;AAC/E,cAAc;AACd,+EAA+E;AAE/E,wEAAwE;AACxE,MAAM,UAAU,uBAAuB;IACrC,OAAO,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,KAAK,GAAG,CAAC;AAChD,CAAC;AAED,SAAS,aAAa;IACpB,IAAI,CAAC,QAAQ;QAAE,OAAO,SAAS,CAAC;IAChC,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,MAAM,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,CAAC;QACtC,QA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E,YAAY;KAC9B,CAAC,CAAC;AACL,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,gBAAgB,CAAC,MAAc,EAAE,SAAkB;IACjE,aAAa,EAAE,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC,EAAE;QACjC,cAAc,EAAE,MAAM;QACtB,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAClD,CAAC,CAAC;AACL,CAAC;AAED,+EAA+E;AAC/E,sBAAsB;AACtB,+EAA+E;AAE/E,uEAAuE;AACvE,MAAM,UAAU,kBAAkB;IAChC,QAAQ,GAAG,SAAS,CAAC;IACrB,QAAQ,GAAG,KAAK,CAAC;AACnB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spawn.d.ts","sourceRoot":"","sources":["../../../src/cli/shell/spawn.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAE5D,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"spawn.d.ts","sourceRoot":"","sources":["../../../src/cli/shell/spawn.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAE5D,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAWhD,MAAM,WAAW,YAAY;IAC3B,gEAAgE;IAChE,IAAI,EAAE,MAAM,GAAG,YAAY,CAAC;IAC5B,uCAAuC;IACvC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,mCAAmC;IACnC,KAAK,CAAC,EAAE,cAAc,EAAE,CAAC;IACzB,oDAAoD;IACpD,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,wCAAwC;IACxC,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACrC;AAED,MAAM,WAAW,WAAW;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,WAAW,GAAG,WAAW,GAAG,OAAO,CAAC;IAC5C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAa7E;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;IAAE,aAAa,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAM9F;AAED;;;;;;GAMG;AACH,wBAAsB,UAAU,CAC9B,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,eAAe,EACzB,OAAO,GAAE,YAA+B,GACvC,OAAO,CAAC,WAAW,CAAC,CA6DtB"}
|
package/dist/cli/shell/spawn.js
CHANGED
|
@@ -6,20 +6,28 @@
|
|
|
6
6
|
import { resolveSquad } from '@bradygaster/squad-sdk/resolution';
|
|
7
7
|
import { readFileSync } from 'node:fs';
|
|
8
8
|
import { join } from 'node:path';
|
|
9
|
+
/** Debug logger — writes to stderr only when SQUAD_DEBUG=1. */
|
|
10
|
+
function debugLog(...args) {
|
|
11
|
+
if (process.env['SQUAD_DEBUG'] === '1') {
|
|
12
|
+
console.error('[SQUAD_DEBUG]', ...args);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
9
15
|
/**
|
|
10
16
|
* Load agent charter from .squad/agents/{name}/charter.md
|
|
11
17
|
*/
|
|
12
18
|
export function loadAgentCharter(agentName, teamRoot) {
|
|
13
19
|
const squadDir = teamRoot ? join(teamRoot, '.squad') : resolveSquad();
|
|
14
20
|
if (!squadDir) {
|
|
15
|
-
|
|
21
|
+
debugLog('loadAgentCharter: no .squad/ directory found');
|
|
22
|
+
throw new Error('No team found. Run `squad init` to set up your project.');
|
|
16
23
|
}
|
|
17
24
|
const charterPath = join(squadDir, 'agents', agentName.toLowerCase(), 'charter.md');
|
|
18
25
|
try {
|
|
19
26
|
return readFileSync(charterPath, 'utf-8');
|
|
20
27
|
}
|
|
21
|
-
catch {
|
|
22
|
-
|
|
28
|
+
catch (err) {
|
|
29
|
+
debugLog('loadAgentCharter: failed to read charter at', charterPath, err);
|
|
30
|
+
throw new Error(`No charter found for "${agentName}". Check that .squad/agents/${agentName.toLowerCase()}/charter.md exists.`);
|
|
23
31
|
}
|
|
24
32
|
}
|
|
25
33
|
/**
|
|
@@ -77,12 +85,16 @@ export async function spawnAgent(name, task, registry, options = { mode: 'sync'
|
|
|
77
85
|
try {
|
|
78
86
|
session.off('message_delta', onDelta);
|
|
79
87
|
}
|
|
80
|
-
catch {
|
|
88
|
+
catch (err) {
|
|
89
|
+
debugLog('spawnAgent: failed to remove delta listener:', err);
|
|
90
|
+
}
|
|
81
91
|
}
|
|
82
92
|
try {
|
|
83
93
|
await session.close();
|
|
84
94
|
}
|
|
85
|
-
catch {
|
|
95
|
+
catch (err) {
|
|
96
|
+
debugLog('spawnAgent: failed to close session for', name, err);
|
|
97
|
+
}
|
|
86
98
|
registry.updateStatus(name, 'idle');
|
|
87
99
|
return {
|
|
88
100
|
agentName: name,
|
|
@@ -91,11 +103,13 @@ export async function spawnAgent(name, task, registry, options = { mode: 'sync'
|
|
|
91
103
|
};
|
|
92
104
|
}
|
|
93
105
|
catch (error) {
|
|
106
|
+
debugLog('spawnAgent: spawn failed for', name, error);
|
|
94
107
|
registry.updateStatus(name, 'error');
|
|
108
|
+
const msg = error instanceof Error ? error.message : String(error);
|
|
95
109
|
return {
|
|
96
110
|
agentName: name,
|
|
97
111
|
status: 'error',
|
|
98
|
-
error:
|
|
112
|
+
error: `Failed to spawn ${name}: ${msg.replace(/^Error:\s*/i, '')}. Try again or run \`squad doctor\`.`,
|
|
99
113
|
};
|
|
100
114
|
}
|
|
101
115
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spawn.js","sourceRoot":"","sources":["../../../src/cli/shell/spawn.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AAIjE,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"spawn.js","sourceRoot":"","sources":["../../../src/cli/shell/spawn.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AAIjE,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,+DAA+D;AAC/D,SAAS,QAAQ,CAAC,GAAG,IAAe;IAClC,IAAI,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,KAAK,GAAG,EAAE,CAAC;QACvC,OAAO,CAAC,KAAK,CAAC,eAAe,EAAE,GAAG,IAAI,CAAC,CAAC;IAC1C,CAAC;AACH,CAAC;AA4BD;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAAC,SAAiB,EAAE,QAAiB;IACnE,MAAM,QAAQ,GAAG,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,YAAY,EAAE,CAAC;IACtE,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,QAAQ,CAAC,8CAA8C,CAAC,CAAC;QACzD,MAAM,IAAI,KAAK,CAAC,yDAAyD,CAAC,CAAC;IAC7E,CAAC;IACD,MAAM,WAAW,GAAG,IAAI,CAAC,QAAQ,E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EAAE,CAAC;QAAC,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YAAC,QAAQ,CAAC,yCAAyC,EAAE,IAAI,EAAE,GAAG,CAAC,CAAC;QAAC,CAAC;QAE9G,QAAQ,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QACpC,OAAO;YACL,SAAS,EAAE,IAAI;YACf,MAAM,EAAE,WAAW;YACnB,QAAQ,EAAE,WAAW,IAAI,SAAS;SACnC,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,QAAQ,CAAC,8BAA8B,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;QACtD,QAAQ,CAAC,YAAY,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QACrC,MAAM,GAAG,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACnE,OAAO;YACL,SAAS,EAAE,IAAI;YACf,MAAM,EAAE,OAAO;YACf,KAAK,EAAE,mBAAmB,IAAI,KAAK,GAAG,CAAC,OAAO,CAAC,aAAa,EAAE,EAAE,CAAC,sCAAsC;SACxG,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -6,10 +6,25 @@ export interface TerminalCapabilities {
|
|
|
6
6
|
platform: NodeJS.Platform;
|
|
7
7
|
isWindows: boolean;
|
|
8
8
|
isTTY: boolean;
|
|
9
|
+
/** True when NO_COLOR=1, TERM=dumb, or color is otherwise suppressed. */
|
|
10
|
+
noColor: boolean;
|
|
9
11
|
}
|
|
12
|
+
/** Current terminal width, clamped to a minimum of 40. */
|
|
13
|
+
export declare function getTerminalWidth(): number;
|
|
14
|
+
/** React hook — returns live terminal width, updates on resize. */
|
|
15
|
+
export declare function useTerminalWidth(): number;
|
|
16
|
+
/** Current terminal height, clamped to a minimum of 10. */
|
|
17
|
+
export declare function getTerminalHeight(): number;
|
|
18
|
+
/** React hook — returns live terminal height, updates on resize. */
|
|
19
|
+
export declare function useTerminalHeight(): number;
|
|
10
20
|
/**
|
|
11
21
|
* Detect terminal capabilities for cross-platform compatibility.
|
|
12
22
|
*/
|
|
23
|
+
/**
|
|
24
|
+
* Returns true when the environment requests no color output.
|
|
25
|
+
* Respects the NO_COLOR standard (https://no-color.org/) and TERM=dumb.
|
|
26
|
+
*/
|
|
27
|
+
export declare function isNoColor(): boolean;
|
|
13
28
|
export declare function detectTerminal(): TerminalCapabilities;
|
|
14
29
|
/**
|
|
15
30
|
* Get a safe character for the platform.
|
|
@@ -27,4 +42,15 @@ export declare function boxChars(caps: TerminalCapabilities): {
|
|
|
27
42
|
h: string;
|
|
28
43
|
v: string;
|
|
29
44
|
};
|
|
45
|
+
/**
|
|
46
|
+
* Terminal layout tier based on width.
|
|
47
|
+
* - **wide** (120+ cols): Full layout — complete tables, full separators, all chrome
|
|
48
|
+
* - **normal** (80-119 cols): Compact tables, shorter separators, abbreviated labels
|
|
49
|
+
* - **narrow** (<80 cols): Card/stacked layout for tables, minimal chrome, no borders
|
|
50
|
+
*/
|
|
51
|
+
export type LayoutTier = 'wide' | 'normal' | 'narrow';
|
|
52
|
+
/** Determine layout tier from terminal width. */
|
|
53
|
+
export declare function getLayoutTier(width: number): LayoutTier;
|
|
54
|
+
/** React hook — returns current layout tier, updates on resize. */
|
|
55
|
+
export declare function useLayoutTier(): LayoutTier;
|
|
30
56
|
//# sourceMappingURL=terminal.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"terminal.d.ts","sourceRoot":"","sources":["../../../src/cli/shell/terminal.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"terminal.d.ts","sourceRoot":"","sources":["../../../src/cli/shell/terminal.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,oBAAoB;IACnC,aAAa,EAAE,OAAO,CAAC;IACvB,eAAe,EAAE,OAAO,CAAC;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC,QAAQ,CAAC;IAC1B,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,OAAO,CAAC;IACf,yEAAyE;IACzE,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,0DAA0D;AAC1D,wBAAgB,gBAAgB,IAAI,MAAM,CAEzC;AAED,mEAAmE;AACnE,wBAAgB,gBAAgB,IAAI,MAAM,CAezC;AAED,2DAA2D;AAC3D,wBAAgB,iBAAiB,IAAI,MAAM,CAE1C;AAED,oEAAoE;AACpE,wBAAgB,iBAAiB,IAAI,MAAM,CAc1C;AAED;;GAEG;AACH;;;GAGG;AACH,wBAAgB,SAAS,IAAI,OAAO,CAKnC;AAED,wBAAgB,cAAc,IAAI,oBAAoB,CAerD;AAED;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,oBAAoB,GAAG,MAAM,CAE3F;AAED;;GAEG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,oBAAoB;;;;;;;EAKlD;AAED;;;;;GAKG;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAEtD,iDAAiD;AACjD,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,UAAU,CAIvD;AAED,mEAAmE;AACnE,wBAAgB,aAAa,IAAI,UAAU,CAG1C"}
|
|
@@ -1,18 +1,68 @@
|
|
|
1
1
|
import { platform } from 'node:os';
|
|
2
|
+
import { useState, useEffect } from 'react';
|
|
3
|
+
/** Current terminal width, clamped to a minimum of 40. */
|
|
4
|
+
export function getTerminalWidth() {
|
|
5
|
+
return Math.max(process.stdout.columns || 80, 40);
|
|
6
|
+
}
|
|
7
|
+
/** React hook — returns live terminal width, updates on resize. */
|
|
8
|
+
export function useTerminalWidth() {
|
|
9
|
+
const [width, setWidth] = useState(getTerminalWidth());
|
|
10
|
+
useEffect(() => {
|
|
11
|
+
const onResize = () => setWidth(getTerminalWidth());
|
|
12
|
+
// Avoid MaxListenersExceededWarning in test environments with many renders
|
|
13
|
+
const prev = process.stdout.getMaxListeners?.() ?? 10;
|
|
14
|
+
if (prev <= 20)
|
|
15
|
+
process.stdout.setMaxListeners?.(prev + 10);
|
|
16
|
+
process.stdout.on('resize', onResize);
|
|
17
|
+
return () => {
|
|
18
|
+
process.stdout.off('resize', onResize);
|
|
19
|
+
};
|
|
20
|
+
}, []);
|
|
21
|
+
return width;
|
|
22
|
+
}
|
|
23
|
+
/** Current terminal height, clamped to a minimum of 10. */
|
|
24
|
+
export function getTerminalHeight() {
|
|
25
|
+
return Math.max(process.stdout.rows || 24, 10);
|
|
26
|
+
}
|
|
27
|
+
/** React hook — returns live terminal height, updates on resize. */
|
|
28
|
+
export function useTerminalHeight() {
|
|
29
|
+
const [height, setHeight] = useState(getTerminalHeight());
|
|
30
|
+
useEffect(() => {
|
|
31
|
+
const onResize = () => setHeight(getTerminalHeight());
|
|
32
|
+
const prev = process.stdout.getMaxListeners?.() ?? 10;
|
|
33
|
+
if (prev <= 20)
|
|
34
|
+
process.stdout.setMaxListeners?.(prev + 10);
|
|
35
|
+
process.stdout.on('resize', onResize);
|
|
36
|
+
return () => {
|
|
37
|
+
process.stdout.off('resize', onResize);
|
|
38
|
+
};
|
|
39
|
+
}, []);
|
|
40
|
+
return height;
|
|
41
|
+
}
|
|
2
42
|
/**
|
|
3
43
|
* Detect terminal capabilities for cross-platform compatibility.
|
|
4
44
|
*/
|
|
45
|
+
/**
|
|
46
|
+
* Returns true when the environment requests no color output.
|
|
47
|
+
* Respects the NO_COLOR standard (https://no-color.org/) and TERM=dumb.
|
|
48
|
+
*/
|
|
49
|
+
export function isNoColor() {
|
|
50
|
+
return (process.env['NO_COLOR'] != null && process.env['NO_COLOR'] !== '' ||
|
|
51
|
+
process.env['TERM'] === 'dumb');
|
|
52
|
+
}
|
|
5
53
|
export function detectTerminal() {
|
|
6
54
|
const plat = platform();
|
|
7
55
|
const isTTY = Boolean(process.stdout.isTTY);
|
|
56
|
+
const noColor = isNoColor();
|
|
8
57
|
return {
|
|
9
|
-
supportsColor: isTTY && (process.env['FORCE_COLOR'] !== '0'),
|
|
10
|
-
supportsUnicode: plat !== 'win32' || Boolean(process.env['WT_SESSION']),
|
|
58
|
+
supportsColor: !noColor && isTTY && (process.env['FORCE_COLOR'] !== '0'),
|
|
59
|
+
supportsUnicode: plat !== 'win32' || Boolean(process.env['WT_SESSION']),
|
|
11
60
|
columns: process.stdout.columns || 80,
|
|
12
61
|
rows: process.stdout.rows || 24,
|
|
13
62
|
platform: plat,
|
|
14
63
|
isWindows: plat === 'win32',
|
|
15
64
|
isTTY,
|
|
65
|
+
noColor,
|
|
16
66
|
};
|
|
17
67
|
}
|
|
18
68
|
/**
|
|
@@ -31,4 +81,17 @@ export function boxChars(caps) {
|
|
|
31
81
|
}
|
|
32
82
|
return { tl: '+', tr: '+', bl: '+', br: '+', h: '-', v: '|' };
|
|
33
83
|
}
|
|
84
|
+
/** Determine layout tier from terminal width. */
|
|
85
|
+
export function getLayoutTier(width) {
|
|
86
|
+
if (width >= 120)
|
|
87
|
+
return 'wide';
|
|
88
|
+
if (width >= 80)
|
|
89
|
+
return 'normal';
|
|
90
|
+
return 'narrow';
|
|
91
|
+
}
|
|
92
|
+
/** React hook — returns current layout tier, updates on resize. */
|
|
93
|
+
export function useLayoutTier() {
|
|
94
|
+
const width = useTerminalWidth();
|
|
95
|
+
return getLayoutTier(width);
|
|
96
|
+
}
|
|
34
97
|
//# sourceMappingURL=terminal.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"terminal.js","sourceRoot":"","sources":["../../../src/cli/shell/terminal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"terminal.js","sourceRoot":"","sources":["../../../src/cli/shell/terminal.ts"],"names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-0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Squad CLI — Semantic Color System
|
|
3
|
+
*
|
|
4
|
+
* Consistent color roles for all CLI components.
|
|
5
|
+
* All colors target ≥4.5:1 contrast ratio on standard dark terminals.
|
|
6
|
+
*
|
|
7
|
+
* Import:
|
|
8
|
+
* import { colors } from '../theme-colors.js';
|
|
9
|
+
*
|
|
10
|
+
* Usage:
|
|
11
|
+
* <Text color={noColor ? undefined : colors.info}>...</Text>
|
|
12
|
+
*
|
|
13
|
+
* Color roles:
|
|
14
|
+
* cyan (info) — user input, prompts, neutral informational text
|
|
15
|
+
* green (success) — agent ready, task complete, confirmations
|
|
16
|
+
* yellow (warning) — experimental flags, caution, in-progress attention
|
|
17
|
+
* red (error) — error states, failures, crash messages
|
|
18
|
+
* gray (secondary) — hints, timestamps, metadata — readable, never dim
|
|
19
|
+
*
|
|
20
|
+
* Contrast guidance:
|
|
21
|
+
* - Use `colors.secondary` ("gray") for readable secondary text.
|
|
22
|
+
* ANSI dim (SGR 2) drops below 4.5:1 on many terminals — avoid for text.
|
|
23
|
+
* - Reserve `dimColor` ONLY for decorative elements (separators, box rules).
|
|
24
|
+
* - "gray" (ANSI 90 / bright-black) holds ~5:1 contrast on dark backgrounds.
|
|
25
|
+
*/
|
|
26
|
+
/** Ink-compatible color values for the semantic color system. */
|
|
27
|
+
export declare const colors: {
|
|
28
|
+
/** Info / neutral — user input, prompts, informational highlights */
|
|
29
|
+
readonly info: "cyan";
|
|
30
|
+
/** Success / completion — agent ready, task done, confirmations */
|
|
31
|
+
readonly success: "green";
|
|
32
|
+
/** Warning / caution — experimental flags, in-progress work */
|
|
33
|
+
readonly warning: "yellow";
|
|
34
|
+
/** Error / failure — error states, crashes */
|
|
35
|
+
readonly error: "red";
|
|
36
|
+
/** Secondary text — hints, timestamps, metadata. Readable, not dim. */
|
|
37
|
+
readonly secondary: "gray";
|
|
38
|
+
};
|
|
39
|
+
//# sourceMappingURL=theme-colors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme-colors.d.ts","sourceRoot":"","sources":["../../../src/cli/shell/theme-colors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,iEAAiE;AACjE,eAAO,MAAM,MAAM;IACjB,qEAAqE;;IAErE,mEAAmE;;IAEnE,+DAA+D;;IAE/D,8CAA8C;;IAE9C,uEAAuE;;CAE/D,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Squad CLI — Semantic Color System
|
|
3
|
+
*
|
|
4
|
+
* Consistent color roles for all CLI components.
|
|
5
|
+
* All colors target ≥4.5:1 contrast ratio on standard dark terminals.
|
|
6
|
+
*
|
|
7
|
+
* Import:
|
|
8
|
+
* import { colors } from '../theme-colors.js';
|
|
9
|
+
*
|
|
10
|
+
* Usage:
|
|
11
|
+
* <Text color={noColor ? undefined : colors.info}>...</Text>
|
|
12
|
+
*
|
|
13
|
+
* Color roles:
|
|
14
|
+
* cyan (info) — user input, prompts, neutral informational text
|
|
15
|
+
* green (success) — agent ready, task complete, confirmations
|
|
16
|
+
* yellow (warning) — experimental flags, caution, in-progress attention
|
|
17
|
+
* red (error) — error states, failures, crash messages
|
|
18
|
+
* gray (secondary) — hints, timestamps, metadata — readable, never dim
|
|
19
|
+
*
|
|
20
|
+
* Contrast guidance:
|
|
21
|
+
* - Use `colors.secondary` ("gray") for readable secondary text.
|
|
22
|
+
* ANSI dim (SGR 2) drops below 4.5:1 on many terminals — avoid for text.
|
|
23
|
+
* - Reserve `dimColor` ONLY for decorative elements (separators, box rules).
|
|
24
|
+
* - "gray" (ANSI 90 / bright-black) holds ~5:1 contrast on dark backgrounds.
|
|
25
|
+
*/
|
|
26
|
+
/** Ink-compatible color values for the semantic color system. */
|
|
27
|
+
export const colors = {
|
|
28
|
+
/** Info / neutral — user input, prompts, informational highlights */
|
|
29
|
+
info: 'cyan',
|
|
30
|
+
/** Success / completion — agent ready, task done, confirmations */
|
|
31
|
+
success: 'green',
|
|
32
|
+
/** Warning / caution — experimental flags, in-progress work */
|
|
33
|
+
warning: 'yellow',
|
|
34
|
+
/** Error / failure — error states, crashes */
|
|
35
|
+
error: 'red',
|
|
36
|
+
/** Secondary text — hints, timestamps, metadata. Readable, not dim. */
|
|
37
|
+
secondary: 'gray',
|
|
38
|
+
};
|
|
39
|
+
//# sourceMappingURL=theme-colors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme-colors.js","sourceRoot":"","sources":["../../../src/cli/shell/theme-colors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,iEAAiE;AACjE,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,qEAAqE;IACrE,IAAI,EAAE,MAAM;IACZ,mEAAmE;IACnE,OAAO,EAAE,OAAO;IAChB,+DAA+D;IAC/D,OAAO,EAAE,QAAQ;IACjB,8CAA8C;IAC9C,KAAK,EAAE,KAAK;IACZ,uEAAuE;IACvE,SAAS,EAAE,MAAM;CACT,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/cli/shell/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,cAAc,GAAG,OAAO,GAAG,YAAY,GAAG,OAAO,CAAC;IAC1D,YAAY,EAAE,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;IACxC,cAAc,EAAE,YAAY,EAAE,CAAC;CAChC;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAC;IAClC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,IAAI,CAAC;CACjB;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,WAAW,GAAG,OAAO,CAAC;IACnD,SAAS,EAAE,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/cli/shell/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,cAAc,GAAG,OAAO,GAAG,YAAY,GAAG,OAAO,CAAC;IAC1D,YAAY,EAAE,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;IACxC,cAAc,EAAE,YAAY,EAAE,CAAC;CAChC;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAC;IAClC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,IAAI,CAAC;CACjB;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,WAAW,GAAG,OAAO,CAAC;IACnD,SAAS,EAAE,IAAI,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Animation hooks for tasteful CLI transitions.
|
|
3
|
+
*
|
|
4
|
+
* All hooks respect NO_COLOR — when isNoColor() is true, animations are
|
|
5
|
+
* skipped and static content is returned immediately.
|
|
6
|
+
*
|
|
7
|
+
* Frame rate capped at ~15fps (67ms intervals) to stay GPU-friendly in Ink.
|
|
8
|
+
*
|
|
9
|
+
* Owned by Cheritto (TUI Engineer).
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* Typewriter: reveals text character by character over durationMs.
|
|
13
|
+
* NO_COLOR: returns full text immediately.
|
|
14
|
+
*/
|
|
15
|
+
export declare function useTypewriter(text: string, durationMs?: number): string;
|
|
16
|
+
/**
|
|
17
|
+
* Fade-in: starts dim, becomes normal after durationMs.
|
|
18
|
+
* Returns true while still fading (content should be dim).
|
|
19
|
+
* Triggers when `active` becomes true.
|
|
20
|
+
* NO_COLOR: always returns false (no fade).
|
|
21
|
+
*/
|
|
22
|
+
export declare function useFadeIn(active: boolean, durationMs?: number): boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Completion flash: detects when agents transition working/streaming → idle.
|
|
25
|
+
* Returns Set of agent names currently showing "✓ Done" flash.
|
|
26
|
+
* Flash lasts flashMs (default 1500ms).
|
|
27
|
+
* NO_COLOR: returns empty set.
|
|
28
|
+
*
|
|
29
|
+
* Uses React's setState-during-render pattern for synchronous detection,
|
|
30
|
+
* so the flash is visible on the same render that triggers the transition.
|
|
31
|
+
*/
|
|
32
|
+
export declare function useCompletionFlash(agents: Array<{
|
|
33
|
+
name: string;
|
|
34
|
+
status: string;
|
|
35
|
+
}>, flashMs?: number): Set<string>;
|
|
36
|
+
/**
|
|
37
|
+
* Message fade: tracks new messages and returns count of "fading" messages
|
|
38
|
+
* from the end of the visible list.
|
|
39
|
+
* NO_COLOR: always returns 0.
|
|
40
|
+
*/
|
|
41
|
+
export declare function useMessageFade(totalCount: number, fadeMs?: number): number;
|
|
42
|
+
//# sourceMappingURL=useAnimation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAnimation.d.ts","sourceRoot":"","sources":["../../../src/cli/shell/useAnimation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAQH;;;GAGG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,GAAE,MAAY,GAAG,MAAM,CAsB5E;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,OAAO,EAAE,UAAU,GAAE,MAAY,GAAG,OAAO,CAY5E;AAED;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC,EAC/C,OAAO,GAAE,MAAa,GACrB,GAAG,CAAC,MAAM,CAAC,CAqDb;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,GAAE,MAAY,GAAG,MAAM,CAsB/E"}
|