@bradygaster/squad-sdk 0.7.0 → 0.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +296 -296
- package/dist/adapter/client.d.ts +243 -0
- package/dist/adapter/client.d.ts.map +1 -0
- package/dist/adapter/client.js +567 -0
- package/dist/adapter/client.js.map +1 -0
- package/dist/adapter/errors.d.ts +260 -0
- package/dist/adapter/errors.d.ts.map +1 -0
- package/dist/adapter/errors.js +362 -0
- package/dist/adapter/errors.js.map +1 -0
- package/dist/adapter/types.d.ts +779 -0
- package/dist/adapter/types.d.ts.map +1 -0
- package/dist/adapter/types.js +11 -0
- package/dist/adapter/types.js.map +1 -0
- package/dist/agents/charter-compiler.d.ts +102 -0
- package/dist/agents/charter-compiler.d.ts.map +1 -0
- package/dist/agents/charter-compiler.js +157 -0
- package/dist/agents/charter-compiler.js.map +1 -0
- package/dist/agents/history-shadow.d.ts +80 -0
- package/dist/agents/history-shadow.d.ts.map +1 -0
- package/dist/agents/history-shadow.js +239 -0
- package/dist/agents/history-shadow.js.map +1 -0
- package/dist/agents/index.d.ts +71 -0
- package/dist/agents/index.d.ts.map +1 -0
- package/dist/agents/index.js +183 -0
- package/dist/agents/index.js.map +1 -0
- package/dist/agents/lifecycle.d.ts +138 -0
- package/dist/agents/lifecycle.d.ts.map +1 -0
- package/dist/agents/lifecycle.js +284 -0
- package/dist/agents/lifecycle.js.map +1 -0
- package/dist/agents/model-selector.d.ts +80 -0
- package/dist/agents/model-selector.d.ts.map +1 -0
- package/dist/agents/model-selector.js +171 -0
- package/dist/agents/model-selector.js.map +1 -0
- package/dist/agents/onboarding.d.ts +65 -0
- package/dist/agents/onboarding.d.ts.map +1 -0
- package/dist/agents/onboarding.js +373 -0
- package/dist/agents/onboarding.js.map +1 -0
- package/dist/build/bundle.d.ts +32 -0
- package/dist/build/bundle.d.ts.map +1 -0
- package/dist/build/bundle.js +97 -0
- package/dist/build/bundle.js.map +1 -0
- package/dist/build/ci-pipeline.d.ts +51 -0
- package/dist/build/ci-pipeline.d.ts.map +1 -0
- package/dist/build/ci-pipeline.js +180 -0
- package/dist/build/ci-pipeline.js.map +1 -0
- package/dist/build/github-dist.d.ts +37 -0
- package/dist/build/github-dist.d.ts.map +1 -0
- package/dist/build/github-dist.js +117 -0
- package/dist/build/github-dist.js.map +1 -0
- package/dist/build/index.d.ts +11 -0
- package/dist/build/index.d.ts.map +1 -0
- package/dist/build/index.js +11 -0
- package/dist/build/index.js.map +1 -0
- package/dist/build/install-migration.d.ts +28 -0
- package/dist/build/install-migration.d.ts.map +1 -0
- package/dist/build/install-migration.js +103 -0
- package/dist/build/install-migration.js.map +1 -0
- package/dist/build/npm-package.d.ts +54 -0
- package/dist/build/npm-package.d.ts.map +1 -0
- package/dist/build/npm-package.js +128 -0
- package/dist/build/npm-package.js.map +1 -0
- package/dist/build/release.d.ts +108 -0
- package/dist/build/release.d.ts.map +1 -0
- package/dist/build/release.js +295 -0
- package/dist/build/release.js.map +1 -0
- package/dist/build/versioning.d.ts +38 -0
- package/dist/build/versioning.d.ts.map +1 -0
- package/dist/build/versioning.js +113 -0
- package/dist/build/versioning.js.map +1 -0
- package/dist/casting/casting-engine.d.ts +60 -0
- package/dist/casting/casting-engine.d.ts.map +1 -0
- package/dist/casting/casting-engine.js +223 -0
- package/dist/casting/casting-engine.js.map +1 -0
- package/dist/casting/casting-history.d.ts +54 -0
- package/dist/casting/casting-history.d.ts.map +1 -0
- package/dist/casting/casting-history.js +63 -0
- package/dist/casting/casting-history.js.map +1 -0
- package/dist/casting/index.d.ts +46 -0
- package/dist/casting/index.d.ts.map +1 -0
- package/dist/casting/index.js +45 -0
- package/dist/casting/index.js.map +1 -0
- package/dist/client/event-bus.d.ts +29 -0
- package/dist/client/event-bus.d.ts.map +1 -0
- package/dist/client/event-bus.js +52 -0
- package/dist/client/event-bus.js.map +1 -0
- package/dist/client/index.d.ts +100 -0
- package/dist/client/index.d.ts.map +1 -0
- package/dist/client/index.js +170 -0
- package/dist/client/index.js.map +1 -0
- package/dist/client/session-pool.d.ts +66 -0
- package/dist/client/session-pool.d.ts.map +1 -0
- package/dist/client/session-pool.js +145 -0
- package/dist/client/session-pool.js.map +1 -0
- package/dist/config/agent-doc.d.ts +43 -0
- package/dist/config/agent-doc.d.ts.map +1 -0
- package/dist/config/agent-doc.js +158 -0
- package/dist/config/agent-doc.js.map +1 -0
- package/dist/config/agent-source.d.ts +95 -0
- package/dist/config/agent-source.d.ts.map +1 -0
- package/dist/config/agent-source.js +274 -0
- package/dist/config/agent-source.js.map +1 -0
- package/dist/config/doc-sync.d.ts +66 -0
- package/dist/config/doc-sync.d.ts.map +1 -0
- package/dist/config/doc-sync.js +270 -0
- package/dist/config/doc-sync.js.map +1 -0
- package/dist/config/feature-audit.d.ts +49 -0
- package/dist/config/feature-audit.d.ts.map +1 -0
- package/dist/config/feature-audit.js +148 -0
- package/dist/config/feature-audit.js.map +1 -0
- package/dist/config/index.d.ts +15 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +15 -0
- package/dist/config/index.js.map +1 -0
- package/dist/config/init.d.ts +61 -0
- package/dist/config/init.d.ts.map +1 -0
- package/dist/config/init.js +376 -0
- package/dist/config/init.js.map +1 -0
- package/dist/config/legacy-fallback.d.ts +83 -0
- package/dist/config/legacy-fallback.d.ts.map +1 -0
- package/dist/config/legacy-fallback.js +212 -0
- package/dist/config/legacy-fallback.js.map +1 -0
- package/dist/config/markdown-migration.d.ts +157 -0
- package/dist/config/markdown-migration.d.ts.map +1 -0
- package/dist/config/markdown-migration.js +434 -0
- package/dist/config/markdown-migration.js.map +1 -0
- package/dist/config/migration.d.ts +123 -0
- package/dist/config/migration.d.ts.map +1 -0
- package/dist/config/migration.js +273 -0
- package/dist/config/migration.js.map +1 -0
- package/dist/config/migrations/index.d.ts +36 -0
- package/dist/config/migrations/index.d.ts.map +1 -0
- package/dist/config/migrations/index.js +216 -0
- package/dist/config/migrations/index.js.map +1 -0
- package/dist/config/models.d.ts +134 -0
- package/dist/config/models.d.ts.map +1 -0
- package/dist/config/models.js +354 -0
- package/dist/config/models.js.map +1 -0
- package/dist/config/routing.d.ts +118 -0
- package/dist/config/routing.d.ts.map +1 -0
- package/dist/config/routing.js +247 -0
- package/dist/config/routing.js.map +1 -0
- package/dist/config/schema.d.ts +72 -0
- package/dist/config/schema.d.ts.map +1 -0
- package/dist/config/schema.js +63 -0
- package/dist/config/schema.js.map +1 -0
- package/dist/coordinator/coordinator.d.ts +82 -0
- package/dist/coordinator/coordinator.d.ts.map +1 -0
- package/dist/coordinator/coordinator.js +192 -0
- package/dist/coordinator/coordinator.js.map +1 -0
- package/dist/coordinator/direct-response.d.ts +83 -0
- package/dist/coordinator/direct-response.d.ts.map +1 -0
- package/dist/coordinator/direct-response.js +187 -0
- package/dist/coordinator/direct-response.js.map +1 -0
- package/dist/coordinator/fan-out.d.ts +83 -0
- package/dist/coordinator/fan-out.d.ts.map +1 -0
- package/dist/coordinator/fan-out.js +161 -0
- package/dist/coordinator/fan-out.js.map +1 -0
- package/dist/coordinator/index.d.ts +62 -0
- package/dist/coordinator/index.d.ts.map +1 -0
- package/dist/coordinator/index.js +171 -0
- package/dist/coordinator/index.js.map +1 -0
- package/dist/coordinator/response-tiers.d.ts +49 -0
- package/dist/coordinator/response-tiers.d.ts.map +1 -0
- package/dist/coordinator/response-tiers.js +149 -0
- package/dist/coordinator/response-tiers.js.map +1 -0
- package/dist/hooks/index.d.ts +103 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/index.js +279 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/index.d.ts +33 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +33 -3
- package/dist/index.js.map +1 -1
- package/dist/marketplace/backend.d.ts +35 -0
- package/dist/marketplace/backend.d.ts.map +1 -0
- package/dist/marketplace/backend.js +99 -0
- package/dist/marketplace/backend.js.map +1 -0
- package/dist/marketplace/browser.d.ts +33 -0
- package/dist/marketplace/browser.d.ts.map +1 -0
- package/dist/marketplace/browser.js +97 -0
- package/dist/marketplace/browser.js.map +1 -0
- package/dist/marketplace/extension-adapter.d.ts +51 -0
- package/dist/marketplace/extension-adapter.d.ts.map +1 -0
- package/dist/marketplace/extension-adapter.js +81 -0
- package/dist/marketplace/extension-adapter.js.map +1 -0
- package/dist/marketplace/index.d.ts +51 -0
- package/dist/marketplace/index.d.ts.map +1 -0
- package/dist/marketplace/index.js +108 -0
- package/dist/marketplace/index.js.map +1 -0
- package/dist/marketplace/packaging.d.ts +25 -0
- package/dist/marketplace/packaging.d.ts.map +1 -0
- package/dist/marketplace/packaging.js +117 -0
- package/dist/marketplace/packaging.js.map +1 -0
- package/dist/marketplace/schema.d.ts +50 -0
- package/dist/marketplace/schema.d.ts.map +1 -0
- package/dist/marketplace/schema.js +120 -0
- package/dist/marketplace/schema.js.map +1 -0
- package/dist/marketplace/security.d.ts +26 -0
- package/dist/marketplace/security.d.ts.map +1 -0
- package/dist/marketplace/security.js +199 -0
- package/dist/marketplace/security.js.map +1 -0
- package/dist/parsers.d.ts +15 -0
- package/dist/parsers.d.ts.map +1 -0
- package/dist/parsers.js +15 -0
- package/dist/parsers.js.map +1 -0
- package/dist/ralph/index.d.ts +58 -0
- package/dist/ralph/index.d.ts.map +1 -0
- package/dist/ralph/index.js +128 -0
- package/dist/ralph/index.js.map +1 -0
- package/dist/resolution.d.ts +47 -0
- package/dist/resolution.d.ts.map +1 -0
- package/dist/resolution.js +106 -0
- package/dist/resolution.js.map +1 -0
- package/dist/runtime/benchmarks.d.ts +121 -0
- package/dist/runtime/benchmarks.d.ts.map +1 -0
- package/dist/runtime/benchmarks.js +251 -0
- package/dist/runtime/benchmarks.js.map +1 -0
- package/dist/runtime/config.d.ts +314 -0
- package/dist/runtime/config.d.ts.map +1 -0
- package/dist/runtime/config.js +467 -0
- package/dist/runtime/config.js.map +1 -0
- package/dist/runtime/constants.d.ts +35 -0
- package/dist/runtime/constants.d.ts.map +1 -0
- package/dist/runtime/constants.js +58 -0
- package/dist/runtime/constants.js.map +1 -0
- package/dist/runtime/cost-tracker.d.ts +73 -0
- package/dist/runtime/cost-tracker.d.ts.map +1 -0
- package/dist/runtime/cost-tracker.js +157 -0
- package/dist/runtime/cost-tracker.js.map +1 -0
- package/dist/runtime/event-bus-otel-bridge.d.ts +19 -0
- package/dist/runtime/event-bus-otel-bridge.d.ts.map +1 -0
- package/dist/runtime/event-bus-otel-bridge.js +61 -0
- package/dist/runtime/event-bus-otel-bridge.js.map +1 -0
- package/dist/runtime/event-bus-ws-bridge.d.ts +35 -0
- package/dist/runtime/event-bus-ws-bridge.d.ts.map +1 -0
- package/dist/runtime/event-bus-ws-bridge.js +55 -0
- package/dist/runtime/event-bus-ws-bridge.js.map +1 -0
- package/dist/runtime/event-bus.d.ts +190 -0
- package/dist/runtime/event-bus.d.ts.map +1 -0
- package/dist/runtime/event-bus.js +218 -0
- package/dist/runtime/event-bus.js.map +1 -0
- package/dist/runtime/event-payloads.d.ts +108 -0
- package/dist/runtime/event-payloads.d.ts.map +1 -0
- package/dist/runtime/event-payloads.js +28 -0
- package/dist/runtime/event-payloads.js.map +1 -0
- package/dist/runtime/health.d.ts +66 -0
- package/dist/runtime/health.d.ts.map +1 -0
- package/dist/runtime/health.js +112 -0
- package/dist/runtime/health.js.map +1 -0
- package/dist/runtime/i18n.d.ts +54 -0
- package/dist/runtime/i18n.d.ts.map +1 -0
- package/dist/runtime/i18n.js +126 -0
- package/dist/runtime/i18n.js.map +1 -0
- package/dist/runtime/offline.d.ts +64 -0
- package/dist/runtime/offline.d.ts.map +1 -0
- package/dist/runtime/offline.js +108 -0
- package/dist/runtime/offline.js.map +1 -0
- package/dist/runtime/otel-bridge.d.ts +52 -0
- package/dist/runtime/otel-bridge.d.ts.map +1 -0
- package/dist/runtime/otel-bridge.js +132 -0
- package/dist/runtime/otel-bridge.js.map +1 -0
- package/dist/runtime/otel-init.d.ts +72 -0
- package/dist/runtime/otel-init.d.ts.map +1 -0
- package/dist/runtime/otel-init.js +68 -0
- package/dist/runtime/otel-init.js.map +1 -0
- package/dist/runtime/otel-metrics.d.ts +42 -0
- package/dist/runtime/otel-metrics.d.ts.map +1 -0
- package/dist/runtime/otel-metrics.js +196 -0
- package/dist/runtime/otel-metrics.js.map +1 -0
- package/dist/runtime/otel.d.ts +53 -0
- package/dist/runtime/otel.d.ts.map +1 -0
- package/dist/runtime/otel.js +127 -0
- package/dist/runtime/otel.js.map +1 -0
- package/dist/runtime/squad-observer.d.ts +75 -0
- package/dist/runtime/squad-observer.d.ts.map +1 -0
- package/dist/runtime/squad-observer.js +190 -0
- package/dist/runtime/squad-observer.js.map +1 -0
- package/dist/runtime/streaming.d.ts +106 -0
- package/dist/runtime/streaming.d.ts.map +1 -0
- package/dist/runtime/streaming.js +192 -0
- package/dist/runtime/streaming.js.map +1 -0
- package/dist/runtime/telemetry.d.ts +82 -0
- package/dist/runtime/telemetry.d.ts.map +1 -0
- package/dist/runtime/telemetry.js +120 -0
- package/dist/runtime/telemetry.js.map +1 -0
- package/dist/sharing/agent-repo.d.ts +33 -0
- package/dist/sharing/agent-repo.d.ts.map +1 -0
- package/dist/sharing/agent-repo.js +79 -0
- package/dist/sharing/agent-repo.js.map +1 -0
- package/dist/sharing/cache.d.ts +36 -0
- package/dist/sharing/cache.d.ts.map +1 -0
- package/dist/sharing/cache.js +85 -0
- package/dist/sharing/cache.js.map +1 -0
- package/dist/sharing/conflicts.d.ts +32 -0
- package/dist/sharing/conflicts.d.ts.map +1 -0
- package/dist/sharing/conflicts.js +121 -0
- package/dist/sharing/conflicts.js.map +1 -0
- package/dist/sharing/export.d.ts +50 -0
- package/dist/sharing/export.d.ts.map +1 -0
- package/dist/sharing/export.js +156 -0
- package/dist/sharing/export.js.map +1 -0
- package/dist/sharing/history-split.d.ts +34 -0
- package/dist/sharing/history-split.d.ts.map +1 -0
- package/dist/sharing/history-split.js +101 -0
- package/dist/sharing/history-split.js.map +1 -0
- package/dist/sharing/import.d.ts +37 -0
- package/dist/sharing/import.d.ts.map +1 -0
- package/dist/sharing/import.js +138 -0
- package/dist/sharing/import.js.map +1 -0
- package/dist/sharing/index.d.ts +11 -0
- package/dist/sharing/index.d.ts.map +1 -0
- package/dist/sharing/index.js +11 -0
- package/dist/sharing/index.js.map +1 -0
- package/dist/sharing/versioning.d.ts +32 -0
- package/dist/sharing/versioning.d.ts.map +1 -0
- package/dist/sharing/versioning.js +64 -0
- package/dist/sharing/versioning.js.map +1 -0
- package/dist/skills/index.d.ts +49 -0
- package/dist/skills/index.d.ts.map +1 -0
- package/dist/skills/index.js +85 -0
- package/dist/skills/index.js.map +1 -0
- package/dist/skills/skill-loader.d.ts +56 -0
- package/dist/skills/skill-loader.d.ts.map +1 -0
- package/dist/skills/skill-loader.js +106 -0
- package/dist/skills/skill-loader.js.map +1 -0
- package/dist/skills/skill-source.d.ts +63 -0
- package/dist/skills/skill-source.d.ts.map +1 -0
- package/dist/skills/skill-source.js +199 -0
- package/dist/skills/skill-source.js.map +1 -0
- package/dist/tools/index.d.ts +95 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +475 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/types.d.ts +43 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +8 -0
- package/dist/types.js.map +1 -0
- package/dist/upstream/index.d.ts +8 -0
- package/dist/upstream/index.d.ts.map +1 -0
- package/dist/upstream/index.js +7 -0
- package/dist/upstream/index.js.map +1 -0
- package/dist/upstream/resolver.d.ts +37 -0
- package/dist/upstream/resolver.d.ts.map +1 -0
- package/dist/upstream/resolver.js +234 -0
- package/dist/upstream/resolver.js.map +1 -0
- package/dist/upstream/types.d.ts +55 -0
- package/dist/upstream/types.d.ts.map +1 -0
- package/dist/upstream/types.js +11 -0
- package/dist/upstream/types.js.map +1 -0
- package/dist/utils/normalize-eol.d.ts +6 -0
- package/dist/utils/normalize-eol.d.ts.map +1 -0
- package/dist/utils/normalize-eol.js +8 -0
- package/dist/utils/normalize-eol.js.map +1 -0
- package/package.json +197 -63
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cross-Session Event Bus (M0-5, Issue #77)
|
|
3
|
+
*
|
|
4
|
+
* Pub/sub event bus for session lifecycle events with cross-session aggregation.
|
|
5
|
+
* Enables the coordinator to observe all agent sessions from a single subscription point.
|
|
6
|
+
* Decouples event producers (sessions) from consumers (coordinator, Ralph, UI).
|
|
7
|
+
*
|
|
8
|
+
* @module runtime/event-bus
|
|
9
|
+
*/
|
|
10
|
+
// ============================================================================
|
|
11
|
+
// Event Bus Implementation
|
|
12
|
+
// ============================================================================
|
|
13
|
+
/**
|
|
14
|
+
* Cross-session event aggregation bus.
|
|
15
|
+
*
|
|
16
|
+
* Key features:
|
|
17
|
+
* - Subscribe to specific event types or all events
|
|
18
|
+
* - Async/sync handler support with error isolation
|
|
19
|
+
* - No race conditions — handlers run in subscription order
|
|
20
|
+
* - Lifecycle events: session:created, session:idle, session:error, session:destroyed
|
|
21
|
+
* - Cross-session aggregation — single subscription point for all sessions
|
|
22
|
+
*
|
|
23
|
+
* Usage:
|
|
24
|
+
* ```typescript
|
|
25
|
+
* const bus = new EventBus();
|
|
26
|
+
*
|
|
27
|
+
* // Subscribe to specific event
|
|
28
|
+
* const unsubscribe = bus.subscribe('session:created', (event) => {
|
|
29
|
+
* console.log('New session:', event.sessionId);
|
|
30
|
+
* });
|
|
31
|
+
*
|
|
32
|
+
* // Subscribe to all events
|
|
33
|
+
* const unsubscribeAll = bus.subscribeAll((event) => {
|
|
34
|
+
* console.log('Event:', event.type);
|
|
35
|
+
* });
|
|
36
|
+
*
|
|
37
|
+
* // Emit event
|
|
38
|
+
* await bus.emit({
|
|
39
|
+
* type: 'session:created',
|
|
40
|
+
* sessionId: 'abc-123',
|
|
41
|
+
* agentName: 'Ralph',
|
|
42
|
+
* payload: { model: 'claude-sonnet-4.5' },
|
|
43
|
+
* timestamp: new Date()
|
|
44
|
+
* });
|
|
45
|
+
*
|
|
46
|
+
* // Clean up
|
|
47
|
+
* unsubscribe();
|
|
48
|
+
* unsubscribeAll();
|
|
49
|
+
* ```
|
|
50
|
+
*/
|
|
51
|
+
export class EventBus {
|
|
52
|
+
handlers = new Map();
|
|
53
|
+
allHandlers = new Set();
|
|
54
|
+
errorHandlers = new Set();
|
|
55
|
+
/**
|
|
56
|
+
* Subscribe to a specific event type.
|
|
57
|
+
*
|
|
58
|
+
* @param type - Event type to listen for
|
|
59
|
+
* @param handler - Handler function to call when event occurs
|
|
60
|
+
* @returns Unsubscribe function to remove this handler
|
|
61
|
+
*
|
|
62
|
+
* @example
|
|
63
|
+
* ```typescript
|
|
64
|
+
* const bus = new EventBus();
|
|
65
|
+
* const unsubscribe = bus.subscribe('session:created', (event) => {
|
|
66
|
+
* console.log('Session created:', event.sessionId);
|
|
67
|
+
* });
|
|
68
|
+
*
|
|
69
|
+
* // Later, remove subscription
|
|
70
|
+
* unsubscribe();
|
|
71
|
+
* ```
|
|
72
|
+
*/
|
|
73
|
+
subscribe(type, handler) {
|
|
74
|
+
if (!this.handlers.has(type)) {
|
|
75
|
+
this.handlers.set(type, new Set());
|
|
76
|
+
}
|
|
77
|
+
this.handlers.get(type).add(handler);
|
|
78
|
+
return () => this.unsubscribe(type, handler);
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Subscribe to all events regardless of type.
|
|
82
|
+
* Useful for logging, monitoring, or debugging.
|
|
83
|
+
*
|
|
84
|
+
* @param handler - Handler function to call for every event
|
|
85
|
+
* @returns Unsubscribe function to remove this handler
|
|
86
|
+
*
|
|
87
|
+
* @example
|
|
88
|
+
* ```typescript
|
|
89
|
+
* const bus = new EventBus();
|
|
90
|
+
* const unsubscribe = bus.subscribeAll((event) => {
|
|
91
|
+
* console.log(`[${event.type}] ${event.sessionId || 'global'}`);
|
|
92
|
+
* });
|
|
93
|
+
* ```
|
|
94
|
+
*/
|
|
95
|
+
subscribeAll(handler) {
|
|
96
|
+
this.allHandlers.add(handler);
|
|
97
|
+
return () => this.allHandlers.delete(handler);
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Unsubscribe a handler from a specific event type.
|
|
101
|
+
*
|
|
102
|
+
* @param type - Event type to unsubscribe from
|
|
103
|
+
* @param handler - Handler function to remove
|
|
104
|
+
*/
|
|
105
|
+
unsubscribe(type, handler) {
|
|
106
|
+
this.handlers.get(type)?.delete(handler);
|
|
107
|
+
// Clean up empty handler sets
|
|
108
|
+
if (this.handlers.get(type)?.size === 0) {
|
|
109
|
+
this.handlers.delete(type);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Register an error handler for handler execution failures.
|
|
114
|
+
* Error handlers are called when a subscribed handler throws an error.
|
|
115
|
+
*
|
|
116
|
+
* @param handler - Error handler function
|
|
117
|
+
* @returns Unsubscribe function to remove this error handler
|
|
118
|
+
*/
|
|
119
|
+
onError(handler) {
|
|
120
|
+
this.errorHandlers.add(handler);
|
|
121
|
+
return () => this.errorHandlers.delete(handler);
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Emit an event to all matching subscribers.
|
|
125
|
+
* Handlers are called in subscription order with error isolation.
|
|
126
|
+
* One handler failure does not prevent other handlers from executing.
|
|
127
|
+
*
|
|
128
|
+
* @param event - Event to emit
|
|
129
|
+
* @returns Promise that resolves when all handlers complete
|
|
130
|
+
*
|
|
131
|
+
* @example
|
|
132
|
+
* ```typescript
|
|
133
|
+
* await bus.emit({
|
|
134
|
+
* type: 'session:created',
|
|
135
|
+
* sessionId: 'abc-123',
|
|
136
|
+
* agentName: 'Ralph',
|
|
137
|
+
* payload: { model: 'claude-sonnet-4.5' },
|
|
138
|
+
* timestamp: new Date()
|
|
139
|
+
* });
|
|
140
|
+
* ```
|
|
141
|
+
*/
|
|
142
|
+
async emit(event) {
|
|
143
|
+
const typeHandlers = this.handlers.get(event.type) ?? new Set();
|
|
144
|
+
const allPromises = [];
|
|
145
|
+
// Execute type-specific handlers
|
|
146
|
+
for (const handler of typeHandlers) {
|
|
147
|
+
allPromises.push(this.executeHandler(handler, event));
|
|
148
|
+
}
|
|
149
|
+
// Execute wildcard handlers
|
|
150
|
+
for (const handler of this.allHandlers) {
|
|
151
|
+
allPromises.push(this.executeHandler(handler, event));
|
|
152
|
+
}
|
|
153
|
+
// Wait for all handlers to complete
|
|
154
|
+
// Errors are isolated and won't throw from here
|
|
155
|
+
await Promise.all(allPromises);
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Execute a single handler with error isolation.
|
|
159
|
+
* Catches and reports handler errors without propagating them.
|
|
160
|
+
*
|
|
161
|
+
* @param handler - Handler function to execute
|
|
162
|
+
* @param event - Event to pass to handler
|
|
163
|
+
*/
|
|
164
|
+
async executeHandler(handler, event) {
|
|
165
|
+
try {
|
|
166
|
+
const result = handler(event);
|
|
167
|
+
if (result instanceof Promise) {
|
|
168
|
+
await result;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
catch (error) {
|
|
172
|
+
// Isolate handler errors — one failure shouldn't crash others
|
|
173
|
+
const wrappedError = error instanceof Error ? error : new Error(String(error));
|
|
174
|
+
// Notify error handlers
|
|
175
|
+
for (const errorHandler of this.errorHandlers) {
|
|
176
|
+
try {
|
|
177
|
+
errorHandler(wrappedError, event);
|
|
178
|
+
}
|
|
179
|
+
catch (errorHandlerError) {
|
|
180
|
+
// Error handler itself failed — log to console as last resort
|
|
181
|
+
console.error('EventBus error handler failed:', errorHandlerError);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
// If no error handlers registered, log to console
|
|
185
|
+
if (this.errorHandlers.size === 0) {
|
|
186
|
+
console.error(`EventBus handler error for ${event.type}:`, wrappedError);
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Remove all handlers and reset the event bus.
|
|
192
|
+
* Useful for cleanup in tests or when shutting down.
|
|
193
|
+
*/
|
|
194
|
+
clear() {
|
|
195
|
+
this.handlers.clear();
|
|
196
|
+
this.allHandlers.clear();
|
|
197
|
+
this.errorHandlers.clear();
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* Get count of handlers for a specific event type.
|
|
201
|
+
* Useful for debugging and testing.
|
|
202
|
+
*
|
|
203
|
+
* @param type - Event type to count handlers for
|
|
204
|
+
* @returns Number of handlers subscribed to this event type
|
|
205
|
+
*/
|
|
206
|
+
getHandlerCount(type) {
|
|
207
|
+
return this.handlers.get(type)?.size ?? 0;
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* Get count of wildcard handlers.
|
|
211
|
+
*
|
|
212
|
+
* @returns Number of handlers subscribed to all events
|
|
213
|
+
*/
|
|
214
|
+
getAllHandlerCount() {
|
|
215
|
+
return this.allHandlers.size;
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
//# sourceMappingURL=event-bus.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event-bus.js","sourceRoot":"","sources":["../../src/runtime/event-bus.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AA6DH,+EAA+E;AAC/E,2BAA2B;AAC3B,+EAA+E;AAE/E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,MAAM,OAAO,QAAQ;IACX,QAAQ,GAA2C,IAAI,GAAG,EAAE,CAAC;IAC7D,WAAW,GAAsB,IAAI,GAAG,EAAE,CAAC;IAC3C,aAAa,GAAmD,IAAI,GAAG,EAAE,CAAC;IAElF;;;;;;;;;;;;;;;;;OAiBG;IACH,SAAS,CAAC,IAAoB,EAAE,OAAqB;QACnD,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;YAC7B,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,EAAE,IAAI,GAAG,EAAE,CAAC,CAAC;QACrC,CAAC;QACD,IAAI,CAAC,QAAQ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;QACH,CAAC;IACH,CAAC;IAED;;;OAGG;IACH,KAAK;QACH,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC;QACtB,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,CAAC;QACzB,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE,CAAC;IAC7B,CAAC;IAED;;;;;;OAMG;IACH,eAAe,CAAC,IAAoB;QAClC,OAAO,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,IAAI,IAAI,CAAC,CAAC;IAC5C,CAAC;IAED;;;;OAIG;IACH,kBAAkB;QAChB,OAAO,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC;IAC/B,CAAC;CACF"}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Typed Event Payloads for SquadEventType (Issue #304)
|
|
3
|
+
*
|
|
4
|
+
* Canonical payload types for every EventBus event type.
|
|
5
|
+
* These are the SDK-owned contracts that downstream consumers
|
|
6
|
+
* (e.g., SquadOffice visualization) depend on.
|
|
7
|
+
*
|
|
8
|
+
* @module runtime/event-payloads
|
|
9
|
+
*/
|
|
10
|
+
import type { SquadEventType, SquadEvent } from './event-bus.js';
|
|
11
|
+
export interface SessionCreatedPayload {
|
|
12
|
+
agentName: string;
|
|
13
|
+
priority: 'low' | 'normal' | 'high' | 'critical';
|
|
14
|
+
}
|
|
15
|
+
export interface SessionIdlePayload {
|
|
16
|
+
agentName: string;
|
|
17
|
+
idleSince?: number;
|
|
18
|
+
}
|
|
19
|
+
export interface SessionErrorPayload {
|
|
20
|
+
agentName: string;
|
|
21
|
+
error: string;
|
|
22
|
+
}
|
|
23
|
+
export interface SessionDestroyedPayload {
|
|
24
|
+
agentName: string;
|
|
25
|
+
reason?: 'complete' | 'error' | 'abort' | 'timeout' | 'user_exit';
|
|
26
|
+
}
|
|
27
|
+
export interface SessionMessagePayload {
|
|
28
|
+
message: string;
|
|
29
|
+
role?: string;
|
|
30
|
+
content?: string;
|
|
31
|
+
}
|
|
32
|
+
export interface SessionToolCallPayload {
|
|
33
|
+
toolName: string;
|
|
34
|
+
toolArgs: Record<string, unknown>;
|
|
35
|
+
resultType?: 'success' | 'failure' | 'rejected' | 'denied';
|
|
36
|
+
}
|
|
37
|
+
/** Multi-phase coordinator routing - discriminated by `phase`. */
|
|
38
|
+
export type CoordinatorRoutingPayload = {
|
|
39
|
+
phase: 'start';
|
|
40
|
+
messageLength: number;
|
|
41
|
+
} | {
|
|
42
|
+
phase: 'routed';
|
|
43
|
+
agents: string[];
|
|
44
|
+
confidence: 'high' | 'medium' | 'low';
|
|
45
|
+
reason: string;
|
|
46
|
+
} | {
|
|
47
|
+
phase: 'spawning';
|
|
48
|
+
strategy: 'direct' | 'single' | 'multi' | 'fallback';
|
|
49
|
+
agentCount: number;
|
|
50
|
+
} | {
|
|
51
|
+
phase: 'complete';
|
|
52
|
+
strategy: string;
|
|
53
|
+
spawnCount: number;
|
|
54
|
+
successCount: number;
|
|
55
|
+
};
|
|
56
|
+
export type AgentMilestonePayload = {
|
|
57
|
+
event: 'model.fallback';
|
|
58
|
+
agentName: string;
|
|
59
|
+
failedModel: string;
|
|
60
|
+
failedTier: 'premium' | 'standard' | 'fast';
|
|
61
|
+
error: string;
|
|
62
|
+
attemptNumber: number;
|
|
63
|
+
} | {
|
|
64
|
+
event: 'model.exhausted';
|
|
65
|
+
agentName: string;
|
|
66
|
+
originalModel: string;
|
|
67
|
+
originalTier: string;
|
|
68
|
+
totalAttempts: number;
|
|
69
|
+
};
|
|
70
|
+
export interface PoolHealthPayload {
|
|
71
|
+
activeSessions: number;
|
|
72
|
+
availableSlots: number;
|
|
73
|
+
queuedRequests: number;
|
|
74
|
+
}
|
|
75
|
+
export interface SquadEventPayloadMap {
|
|
76
|
+
'session:created': SessionCreatedPayload;
|
|
77
|
+
'session:idle': SessionIdlePayload;
|
|
78
|
+
'session:error': SessionErrorPayload;
|
|
79
|
+
'session:destroyed': SessionDestroyedPayload;
|
|
80
|
+
'session:message': SessionMessagePayload;
|
|
81
|
+
'session:tool_call': SessionToolCallPayload;
|
|
82
|
+
'agent:milestone': AgentMilestonePayload;
|
|
83
|
+
'coordinator:routing': CoordinatorRoutingPayload;
|
|
84
|
+
'pool:health': PoolHealthPayload;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* A strongly-typed SquadEvent where the payload type is inferred from the
|
|
88
|
+
* event type discriminant. Use this for type-safe event construction.
|
|
89
|
+
*/
|
|
90
|
+
export interface TypedSquadEvent<T extends SquadEventType = SquadEventType> {
|
|
91
|
+
type: T;
|
|
92
|
+
sessionId?: string;
|
|
93
|
+
agentName?: string;
|
|
94
|
+
payload: T extends keyof SquadEventPayloadMap ? SquadEventPayloadMap[T] : unknown;
|
|
95
|
+
timestamp: Date;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Type guard: narrows a SquadEvent to a specific typed event.
|
|
99
|
+
*/
|
|
100
|
+
export declare function isSquadEventOfType<T extends SquadEventType>(event: SquadEvent, type: T): event is TypedSquadEvent<T>;
|
|
101
|
+
/**
|
|
102
|
+
* Helper to construct a typed SquadEvent with payload validation at compile time.
|
|
103
|
+
*/
|
|
104
|
+
export declare function createSquadEvent<T extends SquadEventType>(type: T, payload: T extends keyof SquadEventPayloadMap ? SquadEventPayloadMap[T] : unknown, options?: {
|
|
105
|
+
sessionId?: string;
|
|
106
|
+
agentName?: string;
|
|
107
|
+
}): TypedSquadEvent<T>;
|
|
108
|
+
//# sourceMappingURL=event-payloads.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event-payloads.d.ts","sourceRoot":"","sources":["../../src/runtime/event-payloads.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAMjE,MAAM,WAAW,qBAAqB;IACpC,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EA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;CACjB;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,SAAS,cAAc,EACzD,KAAK,EAAE,UAAU,EACjB,IAAI,EAAE,CAAC,GACN,KAAK,IAAI,eAAe,CAAC,CAAC,CAAC,CAE7B;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,cAAc,EACvD,IAAI,EAAE,CAAC,EACP,OAAO,EAAE,CAAC,SAAS,MAAM,oBAAoB,GAAG,oBAAoB,CAAC,CAAC,CAAC,GAAG,OAAO,EACjF,OAAO,CAAC,EAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,GACnD,eAAe,CAAC,CAAC,CAAC,CAQpB"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Typed Event Payloads for SquadEventType (Issue #304)
|
|
3
|
+
*
|
|
4
|
+
* Canonical payload types for every EventBus event type.
|
|
5
|
+
* These are the SDK-owned contracts that downstream consumers
|
|
6
|
+
* (e.g., SquadOffice visualization) depend on.
|
|
7
|
+
*
|
|
8
|
+
* @module runtime/event-payloads
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Type guard: narrows a SquadEvent to a specific typed event.
|
|
12
|
+
*/
|
|
13
|
+
export function isSquadEventOfType(event, type) {
|
|
14
|
+
return event.type === type;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Helper to construct a typed SquadEvent with payload validation at compile time.
|
|
18
|
+
*/
|
|
19
|
+
export function createSquadEvent(type, payload, options) {
|
|
20
|
+
return {
|
|
21
|
+
type,
|
|
22
|
+
sessionId: options?.sessionId,
|
|
23
|
+
agentName: options?.agentName,
|
|
24
|
+
payload,
|
|
25
|
+
timestamp: new Date(),
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=event-payloads.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event-payloads.js","sourceRoot":"","sources":["../../src/runtime/event-payloads.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAsHH;;GAEG;AACH,MAAM,UAAU,kBAAkB,CAChC,KAAiB,EACjB,IAAO;IAEP,OAAO,KAAK,CAAC,IAAI,KAAK,IAAI,CAAC;AAC7B,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAC9B,IAAO,EACP,OAAiF,EACjF,OAAoD;IAEpD,OAAO;QACL,IAAI;QACJ,SAAS,EAAE,OAAO,EAAE,SAAS;QAC7B,SAAS,EAAE,OAAO,EAAE,SAAS;QAC7B,OAAO;QACP,SAAS,EAAE,IAAI,IAAI,EAAE;KACtB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Health Monitor (M0-8 #83)
|
|
3
|
+
*
|
|
4
|
+
* Monitors the health of SquadClient connections and provides diagnostics.
|
|
5
|
+
* Exposes health status for external monitoring and startup validation.
|
|
6
|
+
*/
|
|
7
|
+
import type { SquadClient } from '../adapter/client.js';
|
|
8
|
+
export interface HealthCheckResult {
|
|
9
|
+
/** Overall health status */
|
|
10
|
+
status: 'healthy' | 'degraded' | 'unhealthy';
|
|
11
|
+
/** Connection state */
|
|
12
|
+
connectionState: string;
|
|
13
|
+
/** Whether the client is connected */
|
|
14
|
+
connected: boolean;
|
|
15
|
+
/** Error message if unhealthy */
|
|
16
|
+
error?: string;
|
|
17
|
+
/** Protocol version if available */
|
|
18
|
+
protocolVersion?: number;
|
|
19
|
+
/** Timestamp of the check */
|
|
20
|
+
timestamp: Date;
|
|
21
|
+
/** Response time in milliseconds */
|
|
22
|
+
responseTimeMs?: number;
|
|
23
|
+
}
|
|
24
|
+
export interface HealthMonitorConfig {
|
|
25
|
+
/** Client to monitor */
|
|
26
|
+
client: SquadClient;
|
|
27
|
+
/** Timeout for health checks in milliseconds (default: 5000) */
|
|
28
|
+
timeout?: number;
|
|
29
|
+
/** Log diagnostic information on failures */
|
|
30
|
+
logDiagnostics?: boolean;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Health Monitor for SquadClient connections.
|
|
34
|
+
*
|
|
35
|
+
* Provides health checks, diagnostics logging, and external health status.
|
|
36
|
+
* Use check() for startup validation before creating sessions.
|
|
37
|
+
*/
|
|
38
|
+
export declare class HealthMonitor {
|
|
39
|
+
private client;
|
|
40
|
+
private timeout;
|
|
41
|
+
private logDiagnostics;
|
|
42
|
+
constructor(config: HealthMonitorConfig);
|
|
43
|
+
/**
|
|
44
|
+
* Perform a health check on the client connection.
|
|
45
|
+
*
|
|
46
|
+
* This method:
|
|
47
|
+
* 1. Checks connection state
|
|
48
|
+
* 2. Attempts a ping if connected
|
|
49
|
+
* 3. Validates protocol version
|
|
50
|
+
* 4. Logs diagnostics on failure
|
|
51
|
+
*
|
|
52
|
+
* @returns Health check result with status and diagnostics
|
|
53
|
+
*/
|
|
54
|
+
check(): Promise<HealthCheckResult>;
|
|
55
|
+
/**
|
|
56
|
+
* Get current status without performing a health check.
|
|
57
|
+
*
|
|
58
|
+
* @returns Basic health status based on connection state
|
|
59
|
+
*/
|
|
60
|
+
getStatus(): Pick<HealthCheckResult, 'status' | 'connectionState' | 'connected' | 'timestamp'>;
|
|
61
|
+
/**
|
|
62
|
+
* Log diagnostic information on connection failures.
|
|
63
|
+
*/
|
|
64
|
+
private logDiagnostic;
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=health.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"health.d.ts","sourceRoot":"","sources":["../../src/runtime/health.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAGxD,MAAM,WAAW,iBAAiB;IAChC,4BAA4B;IAC5B,MAAM,EAAE,SAAS,GAAG,UAAU,GAAG,WAAW,CAAC;IAE7C,uBAAuB;IACvB,eAAe,EAAE,MAAM,CAAC;IAExB,sCAAsC;IACtC,SAAS,EAAE,OAAO,CAAC;IAEnB,iCAAiC;IACjC,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,oCAAoC;IACpC,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB,6BAA6B;IAC7B,SAAS,EAAE,IAAI,CAAC;IAEhB,oCAAoC;IACpC,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,mBAAmB;IAClC,wBAAwB;IACxB,MAAM,EAAE,WAAW,CAAC;IAEpB,gEAAgE;IAChE,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,6CAA6C;IAC7C,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED;;;;;GAKG;AACH,qBAAa,aAAa;IACxB,OAAO,CAAC,MAAM,CAAc;IAC5B,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,cAAc,CAAU;gBAEpB,MAAM,EAAE,mBAAmB;IAMvC;;;;;;;;;;OAUG;IACG,KAAK,IAAI,OAAO,CAAC,iBAAiB,CAAC;IAgDzC;;;;OAIG;IACH,SAAS,IAAI,IAAI,CAAC,iBAAiB,EAAE,QAAQ,GAAG,iBAAiB,GAAG,WAAW,GAAG,WAAW,CAAC;IAqB9F;;OAEG;IACH,OAAO,CAAC,aAAa;CAQtB"}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Health Monitor (M0-8 #83)
|
|
3
|
+
*
|
|
4
|
+
* Monitors the health of SquadClient connections and provides diagnostics.
|
|
5
|
+
* Exposes health status for external monitoring and startup validation.
|
|
6
|
+
*/
|
|
7
|
+
import { TIMEOUTS } from './constants.js';
|
|
8
|
+
/**
|
|
9
|
+
* Health Monitor for SquadClient connections.
|
|
10
|
+
*
|
|
11
|
+
* Provides health checks, diagnostics logging, and external health status.
|
|
12
|
+
* Use check() for startup validation before creating sessions.
|
|
13
|
+
*/
|
|
14
|
+
export class HealthMonitor {
|
|
15
|
+
client;
|
|
16
|
+
timeout;
|
|
17
|
+
logDiagnostics;
|
|
18
|
+
constructor(config) {
|
|
19
|
+
this.client = config.client;
|
|
20
|
+
this.timeout = config.timeout ?? TIMEOUTS.HEALTH_CHECK_MS;
|
|
21
|
+
this.logDiagnostics = config.logDiagnostics ?? true;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Perform a health check on the client connection.
|
|
25
|
+
*
|
|
26
|
+
* This method:
|
|
27
|
+
* 1. Checks connection state
|
|
28
|
+
* 2. Attempts a ping if connected
|
|
29
|
+
* 3. Validates protocol version
|
|
30
|
+
* 4. Logs diagnostics on failure
|
|
31
|
+
*
|
|
32
|
+
* @returns Health check result with status and diagnostics
|
|
33
|
+
*/
|
|
34
|
+
async check() {
|
|
35
|
+
const startTime = Date.now();
|
|
36
|
+
const result = {
|
|
37
|
+
status: 'unhealthy',
|
|
38
|
+
connectionState: this.client.getState(),
|
|
39
|
+
connected: this.client.isConnected(),
|
|
40
|
+
timestamp: new Date(),
|
|
41
|
+
};
|
|
42
|
+
try {
|
|
43
|
+
// Check connection state
|
|
44
|
+
if (!this.client.isConnected()) {
|
|
45
|
+
result.error = 'Client not connected';
|
|
46
|
+
result.status = 'unhealthy';
|
|
47
|
+
this.logDiagnostic('Connection check failed', result.error);
|
|
48
|
+
return result;
|
|
49
|
+
}
|
|
50
|
+
// Attempt ping
|
|
51
|
+
const pingPromise = this.client.ping('health-check');
|
|
52
|
+
const timeoutPromise = new Promise((_, reject) => setTimeout(() => reject(new Error('Health check timeout')), this.timeout));
|
|
53
|
+
const pingResult = await Promise.race([pingPromise, timeoutPromise]);
|
|
54
|
+
result.responseTimeMs = Date.now() - startTime;
|
|
55
|
+
result.protocolVersion = pingResult.protocolVersion;
|
|
56
|
+
// Validate response time
|
|
57
|
+
if (result.responseTimeMs > this.timeout * 0.8) {
|
|
58
|
+
result.status = 'degraded';
|
|
59
|
+
result.error = `Slow response: ${result.responseTimeMs}ms`;
|
|
60
|
+
this.logDiagnostic('Health check degraded', result.error);
|
|
61
|
+
}
|
|
62
|
+
else {
|
|
63
|
+
result.status = 'healthy';
|
|
64
|
+
}
|
|
65
|
+
return result;
|
|
66
|
+
}
|
|
67
|
+
catch (error) {
|
|
68
|
+
result.status = 'unhealthy';
|
|
69
|
+
result.error = error instanceof Error ? error.message : String(error);
|
|
70
|
+
result.responseTimeMs = Date.now() - startTime;
|
|
71
|
+
this.logDiagnostic('Health check failed', result.error, error);
|
|
72
|
+
return result;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Get current status without performing a health check.
|
|
77
|
+
*
|
|
78
|
+
* @returns Basic health status based on connection state
|
|
79
|
+
*/
|
|
80
|
+
getStatus() {
|
|
81
|
+
const connected = this.client.isConnected();
|
|
82
|
+
const connectionState = this.client.getState();
|
|
83
|
+
let status;
|
|
84
|
+
if (connected && connectionState === 'connected') {
|
|
85
|
+
status = 'healthy';
|
|
86
|
+
}
|
|
87
|
+
else if (connectionState === 'reconnecting') {
|
|
88
|
+
status = 'degraded';
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
91
|
+
status = 'unhealthy';
|
|
92
|
+
}
|
|
93
|
+
return {
|
|
94
|
+
status,
|
|
95
|
+
connectionState,
|
|
96
|
+
connected,
|
|
97
|
+
timestamp: new Date(),
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Log diagnostic information on connection failures.
|
|
102
|
+
*/
|
|
103
|
+
logDiagnostic(message, details, error) {
|
|
104
|
+
if (!this.logDiagnostics)
|
|
105
|
+
return;
|
|
106
|
+
console.error(`[HealthMonitor] ${message}: ${details}`);
|
|
107
|
+
if (error instanceof Error && error.stack) {
|
|
108
|
+
console.error(`[HealthMonitor] Stack trace:`, error.stack);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
//# sourceMappingURL=health.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"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,CAAC,WAAW,EAAE,CAAC;QAC5C,MAAM,eAAe,GAAG,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC;QAE/C,IAAI,MAA4C,CAAC;QACjD,IAAI,SAAS,IAAI,eAAe,KAAK,WAAW,EAAE,CAAC;YACjD,MAAM,GAAG,SAAS,CAAC;QACrB,CAAC;aAAM,IAAI,eAAe,KAAK,cAAc,EAAE,CAAC;YAC9C,MAAM,GAAG,UAAU,CAAC;QACtB,CAAC;aAAM,CAAC;YACN,MAAM,GAAG,WAAW,CAAC;QACvB,CAAC;QAED,OAAO;YACL,MAAM;YACN,eAAe;YACf,SAAS;YACT,SAAS,EAAE,IAAI,IAAI,EAAE;SACtB,CAAC;IACJ,CAAC;IAED;;OAEG;IACK,aAAa,CAAC,OAAe,EAAE,OAAe,EAAE,KAAe;QACrE,IAAI,CAAC,IAAI,CAAC,cAAc;YAAE,OAAO;QAEjC,OAAO,CAAC,KAAK,CAAC,mBAAmB,OAAO,KAAK,OAAO,EAAE,CAAC,CAAC;QACxD,IAAI,KAAK,YAAY,KAAK,IAAI,KAAK,CAAC,KAAK,EAAE,CAAC;YAC1C,OAAO,CAAC,KAAK,CAAC,8BAA8B,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;QAC7D,CAAC;IACH,CAAC;CACF"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internationalization & Accessibility Support
|
|
3
|
+
*
|
|
4
|
+
* String externalization for CLI output with locale switching
|
|
5
|
+
* and accessibility auditing utilities.
|
|
6
|
+
*
|
|
7
|
+
* @module runtime/i18n
|
|
8
|
+
*/
|
|
9
|
+
import type { SquadConfig } from '../config/schema.js';
|
|
10
|
+
/**
|
|
11
|
+
* Map of message keys to localized strings.
|
|
12
|
+
* Supports `{param}` interpolation placeholders.
|
|
13
|
+
*/
|
|
14
|
+
export type MessageCatalog = Record<string, string>;
|
|
15
|
+
/** Accessibility audit finding. */
|
|
16
|
+
export interface AccessibilityFinding {
|
|
17
|
+
category: 'color-contrast' | 'screen-reader' | 'verbose-mode' | 'keyboard-nav';
|
|
18
|
+
severity: 'info' | 'warning' | 'error';
|
|
19
|
+
message: string;
|
|
20
|
+
}
|
|
21
|
+
/** Result of an accessibility audit against a Squad config. */
|
|
22
|
+
export interface AccessibilityReport {
|
|
23
|
+
passed: boolean;
|
|
24
|
+
findings: AccessibilityFinding[];
|
|
25
|
+
}
|
|
26
|
+
export declare const defaultCatalog: MessageCatalog;
|
|
27
|
+
/**
|
|
28
|
+
* Manages locale-specific message catalogs and string formatting.
|
|
29
|
+
*/
|
|
30
|
+
export declare class I18nManager {
|
|
31
|
+
private locale;
|
|
32
|
+
private catalogs;
|
|
33
|
+
constructor(locale?: string);
|
|
34
|
+
/** Register a catalog for a locale. */
|
|
35
|
+
registerCatalog(locale: string, catalog: MessageCatalog): void;
|
|
36
|
+
/** Switch the active locale. Throws if no catalog is registered. */
|
|
37
|
+
setLocale(locale: string): void;
|
|
38
|
+
/** Return the active locale. */
|
|
39
|
+
getLocale(): string;
|
|
40
|
+
/** Return all locales that have a registered catalog. */
|
|
41
|
+
getAvailableLocales(): string[];
|
|
42
|
+
/**
|
|
43
|
+
* Format a message by key, interpolating `{param}` placeholders.
|
|
44
|
+
* Falls back to 'en' if the key is missing in the active locale.
|
|
45
|
+
* Returns the raw key if no catalog contains it.
|
|
46
|
+
*/
|
|
47
|
+
formatMessage(key: string, params?: Record<string, string>): string;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Audit a Squad configuration for accessibility concerns.
|
|
51
|
+
* Returns findings with severity levels; `passed` is true when no errors exist.
|
|
52
|
+
*/
|
|
53
|
+
export declare function auditAccessibility(config: SquadConfig): AccessibilityReport;
|
|
54
|
+
//# sourceMappingURL=i18n.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"i18n.d.ts","sourceRoot":"","sources":["../../src/runtime/i18n.ts"],"names":[],"mappings":"AAAA;;;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