@wrongstack/core 0.285.0 → 0.287.0
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/dist/autophase/phase-orchestrator.d.ts.map +1 -1
- package/dist/boot.d.ts.map +1 -1
- package/dist/coordination/agent-monitor.d.ts +29 -0
- package/dist/coordination/agent-monitor.d.ts.map +1 -1
- package/dist/coordination/autonomous-brain.d.ts +0 -2
- package/dist/coordination/autonomous-brain.d.ts.map +1 -1
- package/dist/coordination/autonomous-coordinator.d.ts +4 -0
- package/dist/coordination/autonomous-coordinator.d.ts.map +1 -1
- package/dist/coordination/brain-ledger.d.ts +142 -0
- package/dist/coordination/brain-ledger.d.ts.map +1 -0
- package/dist/coordination/brain-monitor.d.ts +46 -2
- package/dist/coordination/brain-monitor.d.ts.map +1 -1
- package/dist/coordination/brain.d.ts +43 -0
- package/dist/coordination/brain.d.ts.map +1 -1
- package/dist/coordination/delegate-tool.d.ts +8 -14
- package/dist/coordination/delegate-tool.d.ts.map +1 -1
- package/dist/coordination/director/director-btw-notes.d.ts +20 -0
- package/dist/coordination/director/director-btw-notes.d.ts.map +1 -0
- package/dist/coordination/director/director-collab.d.ts +40 -0
- package/dist/coordination/director/director-collab.d.ts.map +1 -0
- package/dist/coordination/director.d.ts +28 -9
- package/dist/coordination/director.d.ts.map +1 -1
- package/dist/coordination/fleet-manager.d.ts +21 -0
- package/dist/coordination/fleet-manager.d.ts.map +1 -1
- package/dist/coordination/fleet.d.ts +6 -7
- package/dist/coordination/fleet.d.ts.map +1 -1
- package/dist/coordination/global-mailbox.d.ts +96 -21
- package/dist/coordination/global-mailbox.d.ts.map +1 -1
- package/dist/coordination/icoordinator.d.ts +1 -3
- package/dist/coordination/icoordinator.d.ts.map +1 -1
- package/dist/coordination/index.d.ts +2 -1
- package/dist/coordination/index.d.ts.map +1 -1
- package/dist/coordination/index.js +2176 -806
- package/dist/coordination/index.js.map +4 -4
- package/dist/coordination/knowledge-graph.d.ts +13 -1
- package/dist/coordination/knowledge-graph.d.ts.map +1 -1
- package/dist/coordination/mail-tools.d.ts.map +1 -1
- package/dist/coordination/mailbox-actions.d.ts +12 -13
- package/dist/coordination/mailbox-actions.d.ts.map +1 -1
- package/dist/coordination/mailbox-constants.d.ts +64 -0
- package/dist/coordination/mailbox-constants.d.ts.map +1 -0
- package/dist/coordination/mailbox-events.d.ts +32 -0
- package/dist/coordination/mailbox-events.d.ts.map +1 -0
- package/dist/coordination/mailbox-message-codec.d.ts +28 -0
- package/dist/coordination/mailbox-message-codec.d.ts.map +1 -0
- package/dist/coordination/mailbox-types.d.ts +130 -5
- package/dist/coordination/mailbox-types.d.ts.map +1 -1
- package/dist/coordination/mailbox.d.ts +21 -2
- package/dist/coordination/mailbox.d.ts.map +1 -1
- package/dist/coordination/package-author-tracker.d.ts.map +1 -1
- package/dist/coordination/subagent-result-tool.d.ts.map +1 -1
- package/dist/core/agent-loop.d.ts.map +1 -1
- package/dist/core/agent-response.d.ts +10 -1
- package/dist/core/agent-response.d.ts.map +1 -1
- package/dist/core/agent-tools.d.ts.map +1 -1
- package/dist/core/agent.d.ts +8 -0
- package/dist/core/agent.d.ts.map +1 -1
- package/dist/core/context.d.ts +25 -0
- package/dist/core/context.d.ts.map +1 -1
- package/dist/core/conversation-state.d.ts +6 -0
- package/dist/core/conversation-state.d.ts.map +1 -1
- package/dist/core/fallback-model.d.ts.map +1 -1
- package/dist/core/mailbox-loop.d.ts +12 -5
- package/dist/core/mailbox-loop.d.ts.map +1 -1
- package/dist/core/system-prompt-builder.d.ts +14 -6
- package/dist/core/system-prompt-builder.d.ts.map +1 -1
- package/dist/defaults/index.d.ts +0 -1
- package/dist/defaults/index.d.ts.map +1 -1
- package/dist/defaults/index.js +1690 -1998
- package/dist/defaults/index.js.map +4 -4
- package/dist/execution/auto-compaction-middleware.d.ts +8 -1
- package/dist/execution/auto-compaction-middleware.d.ts.map +1 -1
- package/dist/execution/autonomous-runner.d.ts +7 -1
- package/dist/execution/autonomous-runner.d.ts.map +1 -1
- package/dist/execution/autonomy-brain.d.ts +72 -11
- package/dist/execution/autonomy-brain.d.ts.map +1 -1
- package/dist/execution/brain-chain.d.ts +53 -0
- package/dist/execution/brain-chain.d.ts.map +1 -0
- package/dist/execution/brain-evaluation.d.ts +66 -0
- package/dist/execution/brain-evaluation.d.ts.map +1 -0
- package/dist/execution/brain-runtime.d.ts +171 -0
- package/dist/execution/brain-runtime.d.ts.map +1 -0
- package/dist/execution/compaction-core.d.ts.map +1 -1
- package/dist/execution/council-brain.d.ts +79 -0
- package/dist/execution/council-brain.d.ts.map +1 -0
- package/dist/execution/council-orchestrator.d.ts +32 -0
- package/dist/execution/council-orchestrator.d.ts.map +1 -0
- package/dist/execution/council-personas.d.ts +19 -0
- package/dist/execution/council-personas.d.ts.map +1 -0
- package/dist/execution/council-profiles.d.ts +34 -0
- package/dist/execution/council-profiles.d.ts.map +1 -0
- package/dist/execution/council-prompts.d.ts +21 -0
- package/dist/execution/council-prompts.d.ts.map +1 -0
- package/dist/execution/council-resolution.d.ts +57 -0
- package/dist/execution/council-resolution.d.ts.map +1 -0
- package/dist/execution/design-kit-loader.d.ts.map +1 -1
- package/dist/execution/enhance-recovery.d.ts +35 -0
- package/dist/execution/enhance-recovery.d.ts.map +1 -0
- package/dist/execution/error-handler.d.ts.map +1 -1
- package/dist/execution/eternal-autonomy.d.ts +12 -0
- package/dist/execution/eternal-autonomy.d.ts.map +1 -1
- package/dist/execution/index.d.ts +11 -1
- package/dist/execution/index.d.ts.map +1 -1
- package/dist/execution/index.js +3076 -526
- package/dist/execution/index.js.map +4 -4
- package/dist/execution/intelligent-compactor.d.ts +18 -7
- package/dist/execution/intelligent-compactor.d.ts.map +1 -1
- package/dist/execution/one-shot-llm.d.ts +52 -0
- package/dist/execution/one-shot-llm.d.ts.map +1 -0
- package/dist/execution/parallel-eternal-engine.d.ts +12 -0
- package/dist/execution/parallel-eternal-engine.d.ts.map +1 -1
- package/dist/execution/prompt-enhancer.d.ts +23 -4
- package/dist/execution/prompt-enhancer.d.ts.map +1 -1
- package/dist/execution/prompt-enhancer.js +24 -6
- package/dist/execution/prompt-enhancer.js.map +2 -2
- package/dist/execution/selective-compactor.d.ts +4 -4
- package/dist/execution/strategy-compactor.d.ts +7 -0
- package/dist/execution/strategy-compactor.d.ts.map +1 -1
- package/dist/execution/tool-executor.d.ts +19 -5
- package/dist/execution/tool-executor.d.ts.map +1 -1
- package/dist/hooks/registry.d.ts.map +1 -1
- package/dist/hooks/runner.d.ts.map +1 -1
- package/dist/hooks/shell-executor.d.ts.map +1 -1
- package/dist/hq/alerts.d.ts +5 -0
- package/dist/hq/alerts.d.ts.map +1 -1
- package/dist/hq/auth-store.d.ts +38 -10
- package/dist/hq/auth-store.d.ts.map +1 -1
- package/dist/hq/commands.d.ts +8 -4
- package/dist/hq/commands.d.ts.map +1 -1
- package/dist/hq/cost-bridge.d.ts +5 -3
- package/dist/hq/cost-bridge.d.ts.map +1 -1
- package/dist/hq/factory.d.ts +3 -0
- package/dist/hq/factory.d.ts.map +1 -1
- package/dist/hq/fleet-bridge.d.ts.map +1 -1
- package/dist/hq/index.d.ts +0 -1
- package/dist/hq/index.d.ts.map +1 -1
- package/dist/hq/index.js +1016 -283
- package/dist/hq/index.js.map +4 -4
- package/dist/hq/persistence.d.ts +42 -0
- package/dist/hq/persistence.d.ts.map +1 -1
- package/dist/hq/protocol/brain.d.ts +24 -0
- package/dist/hq/protocol/brain.d.ts.map +1 -0
- package/dist/hq/protocol/browser.d.ts +12 -0
- package/dist/hq/protocol/browser.d.ts.map +1 -0
- package/dist/hq/protocol/client.d.ts +69 -0
- package/dist/hq/protocol/client.d.ts.map +1 -0
- package/dist/hq/protocol/core.d.ts +130 -0
- package/dist/hq/protocol/core.d.ts.map +1 -0
- package/dist/hq/protocol/fleet.d.ts +73 -0
- package/dist/hq/protocol/fleet.d.ts.map +1 -0
- package/dist/hq/protocol/mailbox.d.ts +76 -0
- package/dist/hq/protocol/mailbox.d.ts.map +1 -0
- package/dist/hq/protocol/mcp.d.ts +51 -0
- package/dist/hq/protocol/mcp.d.ts.map +1 -0
- package/dist/hq/protocol/project.d.ts +26 -0
- package/dist/hq/protocol/project.d.ts.map +1 -0
- package/dist/hq/protocol/session.d.ts +153 -0
- package/dist/hq/protocol/session.d.ts.map +1 -0
- package/dist/hq/protocol/tool.d.ts +31 -0
- package/dist/hq/protocol/tool.d.ts.map +1 -0
- package/dist/hq/protocol.d.ts +10 -559
- package/dist/hq/protocol.d.ts.map +1 -1
- package/dist/hq/publisher.d.ts +4 -0
- package/dist/hq/publisher.d.ts.map +1 -1
- package/dist/index.d.ts +24 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7676 -3432
- package/dist/index.js.map +4 -4
- package/dist/infrastructure/index.js +13 -11
- package/dist/infrastructure/index.js.map +2 -2
- package/dist/infrastructure/token-counter.d.ts.map +1 -1
- package/dist/kernel/events/agent-events.d.ts +283 -0
- package/dist/kernel/events/agent-events.d.ts.map +1 -0
- package/dist/kernel/events/brain-events.d.ts +176 -0
- package/dist/kernel/events/brain-events.d.ts.map +1 -0
- package/dist/kernel/events/fleet-events.d.ts +39 -0
- package/dist/kernel/events/fleet-events.d.ts.map +1 -0
- package/dist/kernel/events/memory-events.d.ts +165 -0
- package/dist/kernel/events/memory-events.d.ts.map +1 -0
- package/dist/kernel/events/provider-events.d.ts +98 -0
- package/dist/kernel/events/provider-events.d.ts.map +1 -0
- package/dist/kernel/events/sdd-events.d.ts +118 -0
- package/dist/kernel/events/sdd-events.d.ts.map +1 -0
- package/dist/kernel/events/session-events.d.ts +227 -0
- package/dist/kernel/events/session-events.d.ts.map +1 -0
- package/dist/kernel/events/tool-events.d.ts +185 -0
- package/dist/kernel/events/tool-events.d.ts.map +1 -0
- package/dist/kernel/events/worktree-events.d.ts +58 -0
- package/dist/kernel/events/worktree-events.d.ts.map +1 -0
- package/dist/kernel/events.d.ts +12 -1282
- package/dist/kernel/events.d.ts.map +1 -1
- package/dist/kernel/index.js +22 -2
- package/dist/kernel/index.js.map +2 -2
- package/dist/kernel/run-controller.d.ts +15 -0
- package/dist/kernel/run-controller.d.ts.map +1 -1
- package/dist/mailbox-attach.d.ts.map +1 -1
- package/dist/models/index.js +19 -6
- package/dist/models/index.js.map +2 -2
- package/dist/models/llm-selector.d.ts +7 -0
- package/dist/models/llm-selector.d.ts.map +1 -1
- package/dist/observability/index.js +16 -15
- package/dist/observability/index.js.map +2 -2
- package/dist/plugins/auto-review-plugin.d.ts +36 -0
- package/dist/plugins/auto-review-plugin.d.ts.map +1 -0
- package/dist/plugins/chimera-plugin.d.ts +8 -0
- package/dist/plugins/chimera-plugin.d.ts.map +1 -1
- package/dist/security/index.d.ts +1 -0
- package/dist/security/index.d.ts.map +1 -1
- package/dist/security/index.js +260 -23
- package/dist/security/index.js.map +4 -4
- package/dist/security/permission-policy-schema.d.ts +77 -0
- package/dist/security/permission-policy-schema.d.ts.map +1 -0
- package/dist/security/permission-policy.d.ts +5 -0
- package/dist/security/permission-policy.d.ts.map +1 -1
- package/dist/security/secret-scrubber.d.ts.map +1 -1
- package/dist/security/secret-vault.d.ts +9 -0
- package/dist/security/secret-vault.d.ts.map +1 -1
- package/dist/session-registry.d.ts.map +1 -1
- package/dist/skills/index.js.map +2 -2
- package/dist/storage/config-loader.d.ts +10 -0
- package/dist/storage/config-loader.d.ts.map +1 -1
- package/dist/storage/goal-kanban.d.ts +69 -0
- package/dist/storage/goal-kanban.d.ts.map +1 -0
- package/dist/storage/goal-store.d.ts +1 -1
- package/dist/storage/goal-store.d.ts.map +1 -1
- package/dist/storage/index.d.ts +1 -1
- package/dist/storage/index.d.ts.map +1 -1
- package/dist/storage/index.js +572 -879
- package/dist/storage/index.js.map +4 -4
- package/dist/storage/memory-consolidator.d.ts +9 -1
- package/dist/storage/memory-consolidator.d.ts.map +1 -1
- package/dist/storage/plan-store.d.ts +1 -1
- package/dist/storage/plan-store.d.ts.map +1 -1
- package/dist/storage/queue-store.d.ts +4 -0
- package/dist/storage/queue-store.d.ts.map +1 -1
- package/dist/storage/session-store.d.ts +9 -0
- package/dist/storage/session-store.d.ts.map +1 -1
- package/dist/storage/task-store.d.ts +1 -1
- package/dist/storage/task-store.d.ts.map +1 -1
- package/dist/storage/todos-checkpoint.d.ts +2 -2
- package/dist/storage/todos-checkpoint.d.ts.map +1 -1
- package/dist/tools/council-tool.d.ts +25 -0
- package/dist/tools/council-tool.d.ts.map +1 -0
- package/dist/tools/index.d.ts +2 -0
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +1884 -12
- package/dist/tools/index.js.map +4 -4
- package/dist/tools/one-shot-llm-tool.d.ts +51 -0
- package/dist/tools/one-shot-llm-tool.d.ts.map +1 -0
- package/dist/types/config.d.ts +236 -4
- package/dist/types/config.d.ts.map +1 -1
- package/dist/types/context-window.d.ts.map +1 -1
- package/dist/types/council.d.ts +134 -0
- package/dist/types/council.d.ts.map +1 -0
- package/dist/types/default-config.d.ts +3 -3
- package/dist/types/hooks.d.ts +14 -0
- package/dist/types/hooks.d.ts.map +1 -1
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +40 -8
- package/dist/types/index.js.map +3 -3
- package/dist/types/multi-agent.d.ts +8 -0
- package/dist/types/multi-agent.d.ts.map +1 -1
- package/dist/types/observability.d.ts +5 -0
- package/dist/types/observability.d.ts.map +1 -1
- package/dist/types/one-shot-llm.d.ts +128 -0
- package/dist/types/one-shot-llm.d.ts.map +1 -0
- package/dist/types/plugin.d.ts +6 -0
- package/dist/types/plugin.d.ts.map +1 -1
- package/dist/types/provider.d.ts +17 -0
- package/dist/types/provider.d.ts.map +1 -1
- package/dist/types/system-prompt.d.ts +2 -1
- package/dist/types/system-prompt.d.ts.map +1 -1
- package/dist/types/tool-executor.d.ts +10 -0
- package/dist/types/tool-executor.d.ts.map +1 -1
- package/dist/types/tool.d.ts +7 -0
- package/dist/types/tool.d.ts.map +1 -1
- package/dist/utils/atomic-write.d.ts.map +1 -1
- package/dist/utils/glob-expand.d.ts.map +1 -1
- package/dist/utils/incoming-images.d.ts +39 -0
- package/dist/utils/incoming-images.d.ts.map +1 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +156 -11
- package/dist/utils/index.js.map +4 -4
- package/dist/utils/tool-wire-compact.d.ts +1 -0
- package/dist/utils/tool-wire-compact.d.ts.map +1 -1
- package/dist/utils/wstack-paths.d.ts +20 -4
- package/dist/utils/wstack-paths.d.ts.map +1 -1
- package/dist/worktree/worktree-manager.d.ts +13 -4
- package/dist/worktree/worktree-manager.d.ts.map +1 -1
- package/instructions/agents/browser.md +25 -16
- package/instructions/cli/next-task-predictor.md +5 -3
- package/instructions/coordination/subagent-baseline.md +17 -2
- package/instructions/leader-after-task.md +19 -8
- package/instructions/llm/council-judge.md +19 -0
- package/instructions/llm/council-voter.md +22 -0
- package/instructions/modes/architect.md +14 -9
- package/instructions/modes/audit-lite.md +9 -7
- package/instructions/modes/brief-system.md +12 -12
- package/instructions/modes/brief.md +7 -5
- package/instructions/modes/code-auditor.md +13 -8
- package/instructions/modes/code-reviewer.md +13 -8
- package/instructions/modes/debug-lite.md +7 -6
- package/instructions/modes/debugger.md +13 -9
- package/instructions/modes/devops.md +13 -9
- package/instructions/modes/plan-lite.md +7 -6
- package/instructions/modes/refactor-lite.md +7 -6
- package/instructions/modes/refactorer.md +14 -9
- package/instructions/modes/research-lite.md +8 -6
- package/instructions/modes/research-web.md +18 -55
- package/instructions/modes/review-lite.md +7 -6
- package/instructions/modes/teach-system.md +15 -15
- package/instructions/modes/teach.md +13 -12
- package/instructions/modes/test-lite.md +6 -5
- package/instructions/modes/tester.md +13 -9
- package/instructions/modes/ui-design.md +14 -8
- package/instructions/sections/tool/commit-hygiene.md +1 -7
- package/instructions/sections/tool/common-patterns.md +7 -1
- package/instructions/sections/tool/delegation-full.md +3 -31
- package/instructions/sections/tool/mailbox-compact.md +1 -1
- package/instructions/sections/tool/mailbox-full.md +6 -22
- package/instructions/system.md +294 -8
- package/package.json +2 -2
- package/skills/docker-deploy/SKILL.md +1 -1
- package/skills/mailbox-bridge/SKILL.md +16 -7
- package/skills/output-standards/SKILL.md +16 -16
- package/skills/wrongstack-mailbox/SKILL.md +57 -12
- package/dist/coordination/director-construction.d.ts +0 -90
- package/dist/coordination/director-construction.d.ts.map +0 -1
- package/dist/hq/agent-bridge.d.ts +0 -27
- package/dist/hq/agent-bridge.d.ts.map +0 -1
- package/dist/plugins/git-plugin.d.ts +0 -15
- package/dist/plugins/git-plugin.d.ts.map +0 -1
- package/dist/plugins/observability-plugin.d.ts +0 -19
- package/dist/plugins/observability-plugin.d.ts.map +0 -1
- package/dist/plugins/plan-plugin.d.ts +0 -16
- package/dist/plugins/plan-plugin.d.ts.map +0 -1
- package/dist/storage/memory-store.d.ts +0 -119
- package/dist/storage/memory-store.d.ts.map +0 -1
package/dist/hq/persistence.d.ts
CHANGED
|
@@ -68,6 +68,22 @@ export interface HqTimeseriesSample {
|
|
|
68
68
|
toolCalls: number;
|
|
69
69
|
/** Snapshot of active agents at bucket close (last-write per bucket). */
|
|
70
70
|
activeAgents?: number;
|
|
71
|
+
/** Per-dimension cost/token breakdowns for richer trend charts. */
|
|
72
|
+
byModel?: Record<string, HqTimeseriesBreakdownEntry>;
|
|
73
|
+
byProvider?: Record<string, HqTimeseriesBreakdownEntry>;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* One row of a per-dimension breakdown inside a {@link HqTimeseriesSample}
|
|
77
|
+
* (e.g. the cost + tokens attributed to a single model or provider within the
|
|
78
|
+
* bucket). Sums of these across a dimension equal the bucket's totals when
|
|
79
|
+
* every cost signal carried that dimension.
|
|
80
|
+
*/
|
|
81
|
+
export interface HqTimeseriesBreakdownEntry {
|
|
82
|
+
costUsd: number;
|
|
83
|
+
inputTokens: number;
|
|
84
|
+
outputTokens: number;
|
|
85
|
+
cacheRead?: number | undefined;
|
|
86
|
+
cacheWrite?: number | undefined;
|
|
71
87
|
}
|
|
72
88
|
export interface HqTimeseriesStoreOptions {
|
|
73
89
|
dataDir: string;
|
|
@@ -101,6 +117,12 @@ export declare class HqTimeseriesStore {
|
|
|
101
117
|
outputTokens?: number;
|
|
102
118
|
toolCalls?: number;
|
|
103
119
|
activeAgents?: number;
|
|
120
|
+
/** When present, this signal is also attributed to a model dimension. */
|
|
121
|
+
model?: string;
|
|
122
|
+
/** When present, this signal is also attributed to a provider dimension. */
|
|
123
|
+
provider?: string;
|
|
124
|
+
cacheRead?: number;
|
|
125
|
+
cacheWrite?: number;
|
|
104
126
|
}): void;
|
|
105
127
|
/** Persist accumulated buckets to disk (append under lock), prune to maxBuckets. */
|
|
106
128
|
flush(): void;
|
|
@@ -112,10 +134,30 @@ export declare class HqTimeseriesStore {
|
|
|
112
134
|
/** Rehydrate buckets from disk (deduped, latest-per-bucket wins). */
|
|
113
135
|
load(): Promise<void>;
|
|
114
136
|
}
|
|
137
|
+
/**
|
|
138
|
+
* A minimal append-only JSONL log used for records that don't need rotation
|
|
139
|
+
* compaction — command-audit entries and fired alerts. Each record is one
|
|
140
|
+
* JSON line appended under a FIFO write chain; {@link readAll} parses them
|
|
141
|
+
* oldest-first. Best-effort: a rejected append resolves (never rejects) so the
|
|
142
|
+
* HQ server hot path is never broken.
|
|
143
|
+
*/
|
|
144
|
+
export declare class HqSimpleLog<T> {
|
|
145
|
+
private readonly filePath;
|
|
146
|
+
private writeChain;
|
|
147
|
+
constructor(dataDir: string, filename: string);
|
|
148
|
+
/** Append one record as a JSON line. Best-effort, never rejects. */
|
|
149
|
+
append(record: T): void;
|
|
150
|
+
/** Resolves once all queued appends have settled. For tests. */
|
|
151
|
+
drain(): Promise<void>;
|
|
152
|
+
/** Read all records oldest-first. Returns `[]` if the file doesn't exist. */
|
|
153
|
+
readAll(): Promise<T[]>;
|
|
154
|
+
}
|
|
115
155
|
export interface HqPersistence {
|
|
116
156
|
eventLog: HqEventLog;
|
|
117
157
|
snapshotStore: HqSnapshotStore;
|
|
118
158
|
timeseries: HqTimeseriesStore;
|
|
159
|
+
commandLog: HqSimpleLog<unknown>;
|
|
160
|
+
alertLog: HqSimpleLog<unknown>;
|
|
119
161
|
}
|
|
120
162
|
export declare function createHqPersistence(dataDir: string): HqPersistence;
|
|
121
163
|
//# sourceMappingURL=persistence.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"persistence.d.ts","sourceRoot":"","sources":["../../src/hq/persistence.ts"],"names":[],"mappings":"AA4BA,OAAO,KAAK,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AASjE,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;;;GAQG;AACH,qBAAa,UAAU;IACrB,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAS;IAClC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAS;IAClC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAS;IACpC,OAAO,CAAC,UAAU,CAAoC;IACtD,OAAO,CAAC,SAAS,CAAK;IACtB,OAAO,CAAC,OAAO,CAAS;IAExB,YAAY,IAAI,EAAE,iBAAiB,EAIlC;IAED,6EAA6E;IAC7E,MAAM,CAAC,KAAK,EAAE,eAAe,GAAG,IAAI,CAMnC;IAED,gEAAgE;IAC1D,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAI3B;YAEa,cAAc;YAad,MAAM;YAkBN,UAAU;IASxB;;;OAGG;IACG,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC,CAqB3E;IAED,qEAAqE;IAC/D,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAG7B;CACF;AAID,MAAM,WAAW,sBAAsB;IAC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P;IAED,oFAAoF;IACpF,KAAK,IAAI,IAAI,CAQZ;IAED,gEAAgE;IAC1D,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAI3B;YAEa,aAAa;IAc3B,wDAAwD;IAClD,IAAI,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAO1D;IAED,qEAAqE;IAC/D,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAyB1B;CACF;AAoCD;;;;;;GAMG;AACH,qBAAa,WAAW,CAAC,CAAC;IACxB,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAS;IAClC,OAAO,CAAC,UAAU,CAAoC;IAEtD,YAAY,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAE5C;IAED,oEAAoE;IACpE,MAAM,CAAC,MAAM,EAAE,CAAC,GAAG,IAAI,CAMtB;IAED,gEAAgE;IAC1D,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAI3B;IAED,6EAA6E;IACvE,OAAO,IAAI,OAAO,CAAC,CAAC,EAAE,CAAC,CAkB5B;CACF;AAID,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,UAAU,CAAC;IACrB,aAAa,EAAE,eAAe,CAAC;IAC/B,UAAU,EAAE,iBAAiB,CAAC;IAC9B,UAAU,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IACjC,QAAQ,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;CAChC;AAED,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,aAAa,CAQlE"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export type HqBrainEventKind = 'decision_requested' | 'decision_answered' | 'decision_ask_human' | 'human_answered' | 'decision_denied' | 'intervention';
|
|
2
|
+
export interface HqBrainEventPayload {
|
|
3
|
+
/** Which brain lifecycle event this is (mirrors the EventBus `brain.*` name suffix). */
|
|
4
|
+
kind: HqBrainEventKind;
|
|
5
|
+
/** The decision request id, when present (decision_request/answer/deny). */
|
|
6
|
+
requestId?: string;
|
|
7
|
+
/** Short human-readable question the brain was asked. */
|
|
8
|
+
question?: string;
|
|
9
|
+
/** The source that triggered the decision (e.g. 'autonomy', 'system'). */
|
|
10
|
+
source?: string;
|
|
11
|
+
/** Resolved risk tier, when known (e.g. 'low' | 'medium' | 'high'). */
|
|
12
|
+
risk?: string;
|
|
13
|
+
/** The chosen decision kind, when answered/denied (e.g. 'answer' | 'ask_human' | 'deny'). */
|
|
14
|
+
decision?: string;
|
|
15
|
+
/** Free-text rationale or answer payload, when present. */
|
|
16
|
+
detail?: string;
|
|
17
|
+
/** For `intervention`: the watched signal that engaged the brain. */
|
|
18
|
+
interventionKind?: 'tool_failure_streak' | 'error_storm' | 'agent_stall' | 'file_churn';
|
|
19
|
+
/** For `intervention`: true when a steer was actually delivered to the agent. */
|
|
20
|
+
intervened?: boolean;
|
|
21
|
+
/** Epoch milliseconds at which the event occurred. */
|
|
22
|
+
at: number;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=brain.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"brain.d.ts","sourceRoot":"","sources":["../../../src/hq/protocol/brain.ts"],"names":[],"mappings":"AASA,MAAM,MAAM,gBAAgB,GACxB,oBAAoB,GACpB,mBAAmB,GACnB,oBAAoB,GACpB,gBAAgB,GAChB,iBAAiB,GACjB,cAAc,CAAC;AAEnB,MAAM,WAAW,mBAAmB;IAClC,wFAAwF;IACxF,IAAI,EAAE,gBAAgB,CAAC;IACvB,4EAA4E;IAC5E,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,yDAAyD;IACzD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,0EAA0E;IAC1E,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,uEAAuE;IACvE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,6FAA6F;IAC7F,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,2DAA2D;IAC3D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,qEAAqE;IACrE,gBAAgB,CAAC,EAAE,qBAAqB,GAAG,aAAa,GAAG,aAAa,GAAG,YAAY,CAAC;IACxF,iFAAiF;IACjF,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,sDAAsD;IACtD,EAAE,EAAE,MAAM,CAAC;CACZ"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { HqAlertMessage, HqEventEnvelope, HqHeartbeatMessage } from './core.js';
|
|
2
|
+
import type { HqSnapshot } from './session.js';
|
|
3
|
+
export interface HqBrowserSnapshotMessage {
|
|
4
|
+
type: 'hq.snapshot';
|
|
5
|
+
snapshot: HqSnapshot;
|
|
6
|
+
}
|
|
7
|
+
export interface HqBrowserEventMessage<TPayload = unknown> {
|
|
8
|
+
type: 'hq.event';
|
|
9
|
+
event: HqEventEnvelope<TPayload>;
|
|
10
|
+
}
|
|
11
|
+
export type HqBrowserMessage = HqBrowserSnapshotMessage | HqBrowserEventMessage | HqAlertMessage | HqHeartbeatMessage;
|
|
12
|
+
//# sourceMappingURL=browser.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../../../src/hq/protocol/browser.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AACrF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C,MAAM,WAAW,wBAAwB;IACvC,IAAI,EAAE,aAAa,CAAC;IACpB,QAAQ,EAAE,UAAU,CAAC;CACtB;AAED,MAAM,WAAW,qBAAqB,CAAC,QAAQ,GAAG,OAAO;IACvD,IAAI,EAAE,UAAU,CAAC;IACjB,KAAK,EAAE,eAAe,CAAC,QAAQ,CAAC,CAAC;CAClC;AAED,MAAM,MAAM,gBAAgB,GACxB,wBAAwB,GACxB,qBAAqB,GACrB,cAAc,GACd,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import type { HqEventEnvelope, HqProtocolVersion } from './core.js';
|
|
2
|
+
import type { HqProjectIdentity, HqProjectStatus } from './project.js';
|
|
3
|
+
import type { HqRedactionPolicy } from './tool.js';
|
|
4
|
+
export type HqClientKind = 'tui' | 'repl' | 'webui' | 'cli' | 'unknown';
|
|
5
|
+
export type HqClientCapability = 'telemetry.publish' | 'session.summary' | 'fleet.summary' | 'mailbox.summary' | 'control.receive';
|
|
6
|
+
export interface HqClientIdentity {
|
|
7
|
+
clientId: string;
|
|
8
|
+
kind: HqClientKind;
|
|
9
|
+
version?: string;
|
|
10
|
+
machineId: string;
|
|
11
|
+
hostname?: string;
|
|
12
|
+
pid?: number;
|
|
13
|
+
startedAt: string;
|
|
14
|
+
}
|
|
15
|
+
export interface HqClientHelloPayload {
|
|
16
|
+
protocolVersion: HqProtocolVersion;
|
|
17
|
+
client: HqClientIdentity;
|
|
18
|
+
project: HqProjectIdentity;
|
|
19
|
+
capabilities: readonly HqClientCapability[];
|
|
20
|
+
/** Publisher-side policy already applied before telemetry leaves the client. */
|
|
21
|
+
redactionPolicy?: HqRedactionPolicy;
|
|
22
|
+
}
|
|
23
|
+
export interface HqClientHeartbeatPayload {
|
|
24
|
+
uptimeMs: number;
|
|
25
|
+
activeSessionId?: string;
|
|
26
|
+
activeRunId?: string;
|
|
27
|
+
status: HqProjectStatus;
|
|
28
|
+
activeSubagents?: number;
|
|
29
|
+
queuedTasks?: number;
|
|
30
|
+
}
|
|
31
|
+
export interface HqClientRecord {
|
|
32
|
+
clientId: string;
|
|
33
|
+
kind: HqClientKind;
|
|
34
|
+
machineId: string;
|
|
35
|
+
hostname?: string;
|
|
36
|
+
pid?: number;
|
|
37
|
+
version?: string;
|
|
38
|
+
connected: boolean;
|
|
39
|
+
connectedAt?: string;
|
|
40
|
+
lastSeenAt: string;
|
|
41
|
+
projectId: string;
|
|
42
|
+
sessionId?: string;
|
|
43
|
+
capabilities: readonly HqClientCapability[];
|
|
44
|
+
}
|
|
45
|
+
export interface HqClientHelloMessage {
|
|
46
|
+
type: 'client.hello';
|
|
47
|
+
payload: HqClientHelloPayload;
|
|
48
|
+
}
|
|
49
|
+
export interface HqClientEventMessage<TPayload = unknown> {
|
|
50
|
+
type: 'client.event';
|
|
51
|
+
event: HqEventEnvelope<TPayload>;
|
|
52
|
+
}
|
|
53
|
+
export interface HqClientCommandPollMessage {
|
|
54
|
+
type: 'client.command_poll';
|
|
55
|
+
clientId: string;
|
|
56
|
+
projectId: string;
|
|
57
|
+
afterCommandId?: string;
|
|
58
|
+
limit?: number;
|
|
59
|
+
}
|
|
60
|
+
export interface HqClientCommandAckMessage {
|
|
61
|
+
type: 'client.command_ack';
|
|
62
|
+
clientId: string;
|
|
63
|
+
projectId: string;
|
|
64
|
+
commandId: string;
|
|
65
|
+
status: 'accepted' | 'completed' | 'failed' | 'rejected';
|
|
66
|
+
message?: string;
|
|
67
|
+
}
|
|
68
|
+
export type HqClientMessage = HqClientHelloMessage | HqClientEventMessage | HqClientCommandPollMessage | HqClientCommandAckMessage;
|
|
69
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/hq/protocol/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AACpE,OAAO,KAAK,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACvE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAEnD,MAAM,MAAM,YAAY,GAAG,KAAK,GAAG,MAAM,GAAG,OAAO,GAAG,KAAK,GAAG,SAAS,CAAC;AAExE,MAAM,MAAM,kBAAkB,GAC1B,mBAAmB,GACnB,iBAAiB,GACjB,eAAe,GACf,iBAAiB,GACjB,iBAA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;IACrB,OAAO,EAAE,oBAAoB,CAAC;CAC/B;AAED,MAAM,WAAW,oBAAoB,CAAC,QAAQ,GAAG,OAAO;IACtD,IAAI,EAAE,cAAc,CAAC;IACrB,KAAK,EAAE,eAAe,CAAC,QAAQ,CAAC,CAAC;CAClC;AAED,MAAM,WAAW,0BAA0B;IACzC,IAAI,EAAE,qBAAqB,CAAC;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,yBAAyB;IACxC,IAAI,EAAE,oBAAoB,CAAC;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,UAAU,GAAG,WAAW,GAAG,QAAQ,GAAG,UAAU,CAAC;IACzD,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,MAAM,eAAe,GACvB,oBAAoB,GACpB,oBAAoB,GACpB,0BAA0B,GAC1B,yBAAyB,CAAC"}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import type { HqClientCapability, HqClientMessage } from './client.js';
|
|
2
|
+
import type { HqQueuedCommand } from './fleet.js';
|
|
3
|
+
import type { HqRedactionPolicy } from './tool.js';
|
|
4
|
+
export declare const HQ_PROTOCOL_VERSION: 1;
|
|
5
|
+
export type HqProtocolVersion = typeof HQ_PROTOCOL_VERSION;
|
|
6
|
+
export interface HqWelcomePayload {
|
|
7
|
+
type: 'hq.welcome';
|
|
8
|
+
protocolVersion: HqProtocolVersion;
|
|
9
|
+
serverTime: string;
|
|
10
|
+
acceptedCapabilities: readonly HqClientCapability[];
|
|
11
|
+
redactionPolicy: HqRedactionPolicy;
|
|
12
|
+
}
|
|
13
|
+
export interface HqEventEnvelope<TPayload = unknown> {
|
|
14
|
+
id: string;
|
|
15
|
+
type: HqEventType | (string & {});
|
|
16
|
+
schemaVersion: HqProtocolVersion;
|
|
17
|
+
timestamp: string;
|
|
18
|
+
clientId: string;
|
|
19
|
+
projectId: string;
|
|
20
|
+
sessionId?: string;
|
|
21
|
+
runId?: string;
|
|
22
|
+
seq: number;
|
|
23
|
+
payload: TPayload;
|
|
24
|
+
}
|
|
25
|
+
export type HqEventType = 'client.hello' | 'client.heartbeat' | 'session.started' | 'session.status' | 'session.usage' | 'tool.started' | 'tool.completed' | 'fleet.snapshot' | 'fleet.event' | 'mailbox.snapshot' | 'mailbox.event' | 'worklist.snapshot' | 'git.snapshot' | 'agent.message' | 'agent.status' | 'session.snapshot' | 'session.transcript' | 'session.ended' | 'brain.event' | 'worktree.event' | 'mcp.health.snapshot' | 'mcp.operation';
|
|
26
|
+
export interface HqUsagePayload {
|
|
27
|
+
inputTokens?: number;
|
|
28
|
+
outputTokens?: number;
|
|
29
|
+
totalTokens?: number;
|
|
30
|
+
costUsd?: number;
|
|
31
|
+
durationMs?: number;
|
|
32
|
+
/** Provider id that produced this usage (e.g. 'anthropic'), when known. */
|
|
33
|
+
provider?: string;
|
|
34
|
+
/** Model id the cost was priced against, when known. */
|
|
35
|
+
model?: string;
|
|
36
|
+
/** Cache-read (prompt-cache hit) tokens, when reported. */
|
|
37
|
+
cacheRead?: number;
|
|
38
|
+
/** Cache-write tokens, when reported. */
|
|
39
|
+
cacheWrite?: number;
|
|
40
|
+
}
|
|
41
|
+
/** A physical machine, aggregated by HQ from connected clients' machineId. */
|
|
42
|
+
export interface HqMachineRecord {
|
|
43
|
+
machineId: string;
|
|
44
|
+
hostname?: string;
|
|
45
|
+
clientCount: number;
|
|
46
|
+
sessionCount: number;
|
|
47
|
+
agentCount: number;
|
|
48
|
+
projectIds: readonly string[];
|
|
49
|
+
lastActivityAt: string;
|
|
50
|
+
}
|
|
51
|
+
export interface HqGitSnapshotPayload {
|
|
52
|
+
branch?: string;
|
|
53
|
+
dirtyFiles?: number;
|
|
54
|
+
stagedFiles?: number;
|
|
55
|
+
ahead?: number;
|
|
56
|
+
behind?: number;
|
|
57
|
+
}
|
|
58
|
+
export interface HqAlertMessage {
|
|
59
|
+
type: 'hq.alert';
|
|
60
|
+
severity: 'info' | 'warn' | 'error';
|
|
61
|
+
message: string;
|
|
62
|
+
timestamp: string;
|
|
63
|
+
}
|
|
64
|
+
export interface HqHeartbeatMessage {
|
|
65
|
+
type: 'hq.heartbeat';
|
|
66
|
+
serverTime: string;
|
|
67
|
+
}
|
|
68
|
+
export interface HqServerCommandBatchMessage {
|
|
69
|
+
type: 'hq.command_batch';
|
|
70
|
+
commands: readonly HqQueuedCommand[];
|
|
71
|
+
}
|
|
72
|
+
export type HqServerMessage = HqServerCommandBatchMessage | HqWelcomePayload;
|
|
73
|
+
/**
|
|
74
|
+
* Discriminated parse result for {@link parseHqFrame}. The `reason` field
|
|
75
|
+
* is only present when `ok` is `false`; consumers should narrow on `ok`
|
|
76
|
+
* before accessing `frame` or `reason`.
|
|
77
|
+
*/
|
|
78
|
+
export type HqParseResult = {
|
|
79
|
+
ok: true;
|
|
80
|
+
frame: HqClientMessage;
|
|
81
|
+
} | {
|
|
82
|
+
ok: false;
|
|
83
|
+
reason: 'invalid-json' | 'unknown-type' | 'malformed';
|
|
84
|
+
};
|
|
85
|
+
/**
|
|
86
|
+
* Strictly parse a raw client → server frame into a {@link HqParseResult}.
|
|
87
|
+
*
|
|
88
|
+
* Validates, in order:
|
|
89
|
+
* 1. JSON syntax (`invalid-json` on failure)
|
|
90
|
+
* 2. Top-level object with string `type` discriminator
|
|
91
|
+
* 3. `type` is one of {@link HqClientMessage} union members (`unknown-type`)
|
|
92
|
+
* 4. Per-type field-shape presence checks (`malformed` on failure)
|
|
93
|
+
*
|
|
94
|
+
* On success, `frame` is narrowed to {@link HqClientMessage} and consumers
|
|
95
|
+
* can switch on `frame.type` for type-safe access to per-union-member
|
|
96
|
+
* fields without `as` casts.
|
|
97
|
+
*/
|
|
98
|
+
export declare function parseHqFrame(raw: string | Buffer): HqParseResult;
|
|
99
|
+
/**
|
|
100
|
+
* Validate the `payload` field of a {@link HqEventEnvelope} for known
|
|
101
|
+
* event types. Returns `{ ok: true, payload }` with a narrowed payload
|
|
102
|
+
* type when the event type has a registered shape guard and the payload
|
|
103
|
+
* matches it; `{ ok: true, payload: unknown }` for event types that the
|
|
104
|
+
* server does not yet validate; or `{ ok: false, reason }` when the
|
|
105
|
+
* payload fails the registered guard.
|
|
106
|
+
*
|
|
107
|
+
* Use this after {@link parseHqFrame} has produced a valid frame, when
|
|
108
|
+
* the frame is `client.event` and the server is about to consume the
|
|
109
|
+
* event payload.
|
|
110
|
+
*/
|
|
111
|
+
export type HqEventPayloadResult<T> = {
|
|
112
|
+
ok: true;
|
|
113
|
+
payload: T;
|
|
114
|
+
} | {
|
|
115
|
+
ok: false;
|
|
116
|
+
reason: 'unknown-event-type' | 'malformed-payload';
|
|
117
|
+
};
|
|
118
|
+
export declare function parseHqEventPayload(eventType: string, payload: unknown): HqEventPayloadResult<unknown>;
|
|
119
|
+
export declare function createHqEventEnvelope<TPayload>(input: {
|
|
120
|
+
id: string;
|
|
121
|
+
type: HqEventType | (string & {});
|
|
122
|
+
timestamp: string;
|
|
123
|
+
clientId: string;
|
|
124
|
+
projectId: string;
|
|
125
|
+
seq: number;
|
|
126
|
+
payload: TPayload;
|
|
127
|
+
sessionId?: string;
|
|
128
|
+
runId?: string;
|
|
129
|
+
}): HqEventEnvelope<TPayload>;
|
|
130
|
+
//# sourceMappingURL=core.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../../src/hq/protocol/core.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,kBAAkB,EAOlB,eAAe,EAChB,MAAM,aAAa,CAAC;AAErB,OAAO,KAAK,EAGV,eAAe,EAEhB,MAAM,YAAY,CAAC;AAwBpB,OAAO,KAAK,EACV,iBAAiB,EAGlB,MAAM,WA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Ae,CAAA;CAAE,GACpC;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,cAAc,GAAG,cAAc,GAAG,WAAW,CAAA;CAAE,CAAC;AA+HzE;;;;;;;;;;;;GAYG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,aAAa,CAoEhE;AAqaD;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,oBAAoB,CAAC,CAAC,IAC9B;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,OAAO,EAAE,CAAC,CAAA;CAAE,GACxB;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,oBAAoB,GAAG,mBAAmB,CAAA;CAAE,CAAC;AAEtE,wBAAgB,mBAAmB,CACjC,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,OAAO,GACf,oBAAoB,CAAC,OAAO,CAAC,CAyE/B;AAED,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,KAAK,EAAE;IACrD,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,WAAW,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;IAClC,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,QAAQ,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,GAAG,eAAe,CAAC,QAAQ,CAAC,CAa5B"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import type { HqSubagentSummary } from './session.js';
|
|
2
|
+
export interface HqFleetSnapshotPayload {
|
|
3
|
+
runId: string;
|
|
4
|
+
activeSubagents: number;
|
|
5
|
+
queuedTasks: number;
|
|
6
|
+
completedTasks: number;
|
|
7
|
+
failedTasks: number;
|
|
8
|
+
totalCostUsd?: number;
|
|
9
|
+
subagents: readonly HqSubagentSummary[];
|
|
10
|
+
}
|
|
11
|
+
export interface HqFleetEventPayload {
|
|
12
|
+
runId: string;
|
|
13
|
+
subagentId?: string;
|
|
14
|
+
event: string;
|
|
15
|
+
summary?: string;
|
|
16
|
+
data?: unknown;
|
|
17
|
+
}
|
|
18
|
+
export type HqWorktreeEventKind = 'allocated' | 'committed' | 'merged' | 'conflict' | 'released' | 'failed';
|
|
19
|
+
export interface HqWorktreeEventPayload {
|
|
20
|
+
/** Which worktree lifecycle event this is (mirrors `worktree.<kind>`). */
|
|
21
|
+
kind: HqWorktreeEventKind;
|
|
22
|
+
handleId: string;
|
|
23
|
+
ownerId: string;
|
|
24
|
+
ownerLabel?: string;
|
|
25
|
+
slug?: string;
|
|
26
|
+
branch?: string;
|
|
27
|
+
baseBranch?: string;
|
|
28
|
+
/** For `committed`: diff stats. */
|
|
29
|
+
insertions?: number;
|
|
30
|
+
deletions?: number;
|
|
31
|
+
files?: number;
|
|
32
|
+
sha?: string;
|
|
33
|
+
/** For `merged`: whether the merge was a squash. */
|
|
34
|
+
squash?: boolean;
|
|
35
|
+
/** For `conflict`: the list of conflicting files. */
|
|
36
|
+
conflictFiles?: readonly string[];
|
|
37
|
+
/** For `released`: whether the worktree was kept (true) or pruned (false). */
|
|
38
|
+
kept?: boolean;
|
|
39
|
+
/** For `failed`: the error message. */
|
|
40
|
+
error?: string;
|
|
41
|
+
}
|
|
42
|
+
export interface HqWorklistSnapshotPayload {
|
|
43
|
+
todos?: HqWorklistCounts;
|
|
44
|
+
tasks?: HqWorklistCounts;
|
|
45
|
+
plans?: HqWorklistCounts;
|
|
46
|
+
activeItem?: string;
|
|
47
|
+
}
|
|
48
|
+
export interface HqWorklistCounts {
|
|
49
|
+
total: number;
|
|
50
|
+
pending: number;
|
|
51
|
+
inProgress: number;
|
|
52
|
+
completed: number;
|
|
53
|
+
failed?: number;
|
|
54
|
+
}
|
|
55
|
+
export interface HqFleetSummary {
|
|
56
|
+
runId: string;
|
|
57
|
+
projectId: string;
|
|
58
|
+
clientId: string;
|
|
59
|
+
activeSubagents: number;
|
|
60
|
+
queuedTasks: number;
|
|
61
|
+
completedTasks: number;
|
|
62
|
+
failedTasks: number;
|
|
63
|
+
totalCostUsd?: number;
|
|
64
|
+
lastActivityAt: string;
|
|
65
|
+
}
|
|
66
|
+
export interface HqQueuedCommand {
|
|
67
|
+
commandId: string;
|
|
68
|
+
type: string;
|
|
69
|
+
createdAt: string;
|
|
70
|
+
payload: unknown;
|
|
71
|
+
requiresAck?: boolean;
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=fleet.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fleet.d.ts","sourceRoot":"","sources":["../../../src/hq/protocol/fleet.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAEtD,MAAM,WAAW,sBAAsB;IACrC,KAAK,EAAE,MAAM,CAAC;IACd,eAAe,EAAE,MAAM,CAAC;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,SAAS,iBAAiB,EAAE,CAAC;CACzC;AAED,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAUD,MAAM,MAAM,mBAAmB,GAC3B,WAAW,GACX,WAAW,GACX,QAAQ,GACR,UAAU,GACV,UAAU,GACV,QAAQ,CAAC;AAEb,MAAM,WAAW,sBAAsB;IACrC,0EAA0E;IAC1E,IAAI,EAAE,mBAAmB,CAAC;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,O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AAW,eAAe;IAC9B,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
export type HqMailboxMessageType = 'note' | 'ask' | 'assign' | 'steer' | 'btw' | 'broadcast' | 'status' | 'result' | 'review' | 'control';
|
|
2
|
+
export type HqMailboxPriority = 'low' | 'normal' | 'high';
|
|
3
|
+
export type HqMailboxAgentStatus = 'idle' | 'running' | 'streaming' | 'waiting_user' | 'error' | 'offline';
|
|
4
|
+
export interface HqMailboxMessageSummary {
|
|
5
|
+
mailId: string;
|
|
6
|
+
messageId: string;
|
|
7
|
+
from: string;
|
|
8
|
+
to: string;
|
|
9
|
+
type: HqMailboxMessageType;
|
|
10
|
+
subject: string;
|
|
11
|
+
priority: HqMailboxPriority;
|
|
12
|
+
timestamp: string;
|
|
13
|
+
replyTo?: string;
|
|
14
|
+
senderSessionId?: string;
|
|
15
|
+
completed: boolean;
|
|
16
|
+
completedBy?: string;
|
|
17
|
+
completedAt?: string;
|
|
18
|
+
unreadCount?: number;
|
|
19
|
+
readCount?: number;
|
|
20
|
+
hasBody: boolean;
|
|
21
|
+
bodyPreview?: string;
|
|
22
|
+
outcomePreview?: string;
|
|
23
|
+
task?: {
|
|
24
|
+
taskId?: string;
|
|
25
|
+
agentRole?: string;
|
|
26
|
+
agentName?: string;
|
|
27
|
+
status?: 'pending' | 'in_progress' | 'completed' | 'failed';
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
export interface HqMailboxAgentSummary {
|
|
31
|
+
agentId: string;
|
|
32
|
+
name: string;
|
|
33
|
+
role?: string;
|
|
34
|
+
sessionId: string;
|
|
35
|
+
status: HqMailboxAgentStatus;
|
|
36
|
+
currentTool?: string;
|
|
37
|
+
currentTask?: string;
|
|
38
|
+
iterations: number;
|
|
39
|
+
toolCalls: number;
|
|
40
|
+
lastActivityAt: string;
|
|
41
|
+
lastSeenAt: string;
|
|
42
|
+
online: boolean;
|
|
43
|
+
source?: 'cli' | 'webui' | 'mcp' | 'acp' | 'http';
|
|
44
|
+
}
|
|
45
|
+
export interface HqMailboxSnapshotPayload {
|
|
46
|
+
mailboxId: string;
|
|
47
|
+
scope: 'project' | 'global';
|
|
48
|
+
messages: readonly HqMailboxMessageSummary[];
|
|
49
|
+
agents: readonly HqMailboxAgentSummary[];
|
|
50
|
+
totals: {
|
|
51
|
+
messages: number;
|
|
52
|
+
unread: number;
|
|
53
|
+
incomplete: number;
|
|
54
|
+
highPriority: number;
|
|
55
|
+
onlineAgents: number;
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
export interface HqMailboxEventPayload {
|
|
59
|
+
mailboxId: string;
|
|
60
|
+
action: 'message.sent' | 'message.read' | 'message.completed' | 'message.updated' | 'agent.registered' | 'agent.heartbeat' | 'agent.offline' | 'agent.deregistered';
|
|
61
|
+
message?: HqMailboxMessageSummary;
|
|
62
|
+
agent?: HqMailboxAgentSummary;
|
|
63
|
+
summary?: string;
|
|
64
|
+
}
|
|
65
|
+
export interface HqMailboxSummary {
|
|
66
|
+
mailboxId: string;
|
|
67
|
+
projectId: string;
|
|
68
|
+
scope: 'project' | 'global';
|
|
69
|
+
messageCount: number;
|
|
70
|
+
unreadCount: number;
|
|
71
|
+
incompleteCount: number;
|
|
72
|
+
highPriorityCount: number;
|
|
73
|
+
onlineAgentCount: number;
|
|
74
|
+
lastActivityAt: string;
|
|
75
|
+
}
|
|
76
|
+
//# sourceMappingURL=mailbox.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mailbox.d.ts","sourceRoot":"","sources":["../../../src/hq/protocol/mailbox.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,oBAAoB,GAC5B,MAAM,GACN,KAAK,GACL,QAAQ,GACR,OAAO,GACP,KAAK,GACL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IACxB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,gBAAgB,EAAE,MAAM,CAAC;IACzB,cAAc,EAAE,MAAM,CAAC;CACxB"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
export interface HqMcpLatencySummary {
|
|
2
|
+
count: number;
|
|
3
|
+
lastMs?: number | undefined;
|
|
4
|
+
minMs?: number | undefined;
|
|
5
|
+
maxMs?: number | undefined;
|
|
6
|
+
p50Ms?: number | undefined;
|
|
7
|
+
p95Ms?: number | undefined;
|
|
8
|
+
}
|
|
9
|
+
export interface HqMcpFailureCounts {
|
|
10
|
+
transport: number;
|
|
11
|
+
protocol: number;
|
|
12
|
+
tool: number;
|
|
13
|
+
}
|
|
14
|
+
export interface HqMcpHealthCheck {
|
|
15
|
+
name: string;
|
|
16
|
+
passed: boolean;
|
|
17
|
+
value?: number | undefined;
|
|
18
|
+
threshold?: number | undefined;
|
|
19
|
+
}
|
|
20
|
+
export type HqMcpHealthState = 'disabled' | 'dormant' | 'connecting' | 'healthy' | 'degraded' | 'failed';
|
|
21
|
+
export type HqMcpConnectionState = 'idle' | 'dormant' | 'connecting' | 'connected' | 'reconnecting' | 'disconnected' | 'failed';
|
|
22
|
+
export interface HqMcpServerHealth {
|
|
23
|
+
name: string;
|
|
24
|
+
projectId: string;
|
|
25
|
+
clientId: string;
|
|
26
|
+
connectionState: HqMcpConnectionState;
|
|
27
|
+
healthState: HqMcpHealthState;
|
|
28
|
+
lastSuccessAt?: string | undefined;
|
|
29
|
+
lastFailureAt?: string | undefined;
|
|
30
|
+
lastFailureKind?: 'transport' | 'protocol' | 'tool' | undefined;
|
|
31
|
+
consecutiveFailures: number;
|
|
32
|
+
failures: HqMcpFailureCounts;
|
|
33
|
+
reconnectCount: number;
|
|
34
|
+
wakeCount: number;
|
|
35
|
+
sleepCount: number;
|
|
36
|
+
restartCount: number;
|
|
37
|
+
connectionLatency: HqMcpLatencySummary;
|
|
38
|
+
discoveryLatency: HqMcpLatencySummary;
|
|
39
|
+
callLatency: HqMcpLatencySummary;
|
|
40
|
+
inFlightCalls: number;
|
|
41
|
+
peakInFlightCalls: number;
|
|
42
|
+
healthChecks: HqMcpHealthCheck[];
|
|
43
|
+
}
|
|
44
|
+
export interface HqMcpHealthSnapshotPayload {
|
|
45
|
+
servers: HqMcpServerHealth[];
|
|
46
|
+
}
|
|
47
|
+
export interface HqMcpOperationPayload {
|
|
48
|
+
operation: Record<string, unknown>;
|
|
49
|
+
servers: HqMcpServerHealth[];
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=mcp.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp.d.ts","sourceRoot":"","sources":["../../../src/hq/protocol/mcp.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC5B;AAED,MAAM,WAAW,kBAAkB;IACjC,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,OAAO,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAChC;AAED,MAAM,MAAM,gBAAgB,GACxB,UAAU,GACV,SAAS,GACT,YAAY,GACZ,SAAS,GACT,UAAU,GACV,QAAQ,CAAC;AAEb,MAAM,MAAM,oBAAoB,GAC5B,MAAM,GACN,SAAS,GACT,YAAY,GACZ,WAAW,GACX,cAAc,GACd,cAAc,GACd,QAAQ,CAAC;AAEb,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe,EAAE,oBAAoB,CAAC;IACtC,WAAW,EAAE,gBAAgB,CAAC;IAC9B,aAAa,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC,aAAa,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC,eAAe,CAAC,EAAE,WAAW,GAAG,UAAU,GAAG,MAAM,GAAG,SAAS,CAAC;IAChE,mBAAmB,EAAE,MAAM,CAAC;IAC5B,QAAQ,EAAE,kBAAkB,CAAC;IAC7B,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,iBAAiB,EAAE,mBAAmB,CAAC;IACvC,gBAAgB,EAAE,mBAAmB,CAAC;IACtC,WAAW,EAAE,mBAAmB,CAAC;IACjC,aAAa,EAAE,MAAM,CAAC;IACtB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,YAAY,EAAE,gBAAgB,EAAE,CAAC;CAClC;AAED,MAAM,WAAW,0BAA0B;IACzC,OAAO,EAAE,iBAAiB,EAAE,CAAC;CAC9B;AAED,MAAM,WAAW,qBAAqB;IACpC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC,OAAO,EAAE,iBAAiB,EAAE,CAAC;CAC9B"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export type HqWorkspaceKind = 'git' | 'directory' | 'unknown';
|
|
2
|
+
export type HqProjectStatus = 'active' | 'idle' | 'stale' | 'error';
|
|
3
|
+
export type HqPathPolicy = 'none' | 'project-relative' | 'redacted' | 'full';
|
|
4
|
+
export interface HqProjectIdentity {
|
|
5
|
+
projectId: string;
|
|
6
|
+
projectRoot: string;
|
|
7
|
+
projectName: string;
|
|
8
|
+
gitRemote?: string;
|
|
9
|
+
gitBranch?: string;
|
|
10
|
+
machineId: string;
|
|
11
|
+
workspaceKind: HqWorkspaceKind;
|
|
12
|
+
}
|
|
13
|
+
export interface HqProjectRecord {
|
|
14
|
+
projectId: string;
|
|
15
|
+
projectName: string;
|
|
16
|
+
projectRootDisplay: string;
|
|
17
|
+
machineIds: readonly string[];
|
|
18
|
+
gitBranch?: string;
|
|
19
|
+
activeClients: number;
|
|
20
|
+
activeSessions: number;
|
|
21
|
+
activeSubagents: number;
|
|
22
|
+
totalCostUsd: number;
|
|
23
|
+
lastActivityAt: string;
|
|
24
|
+
status: HqProjectStatus;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=project.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project.d.ts","sourceRoot":"","sources":["../../../src/hq/protocol/project.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,eAAe,GAAG,KAAK,GAAG,WAAW,GAAG,SAAS,CAAC;AAE9D,MAAM,MAAM,eAAe,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,CAAC;AAEpE,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,kBAAkB,GAAG,UAAU,GAAG,MAAM,CAAC;AAE7E,MAAM,WAAW,iBAAiB;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,eAAe,CAAC;CAChC;AAED,MAAM,WAAW,eAAe;IAC9B,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,UAAU,EAAE,SAAS,MAAM,EAAE,CAAC;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe,EAAE,MAAM,CAAC;IACxB,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,eAAe,CAAC;CACzB"}
|