@wrongstack/core 0.284.0 → 0.285.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/agent-status-tracker.d.ts +74 -0
- package/dist/agent-status-tracker.d.ts.map +1 -0
- package/dist/autophase/auto-phase-planner.d.ts +79 -0
- package/dist/autophase/auto-phase-planner.d.ts.map +1 -0
- package/dist/autophase/auto-phase-runner.d.ts +79 -0
- package/dist/autophase/auto-phase-runner.d.ts.map +1 -0
- package/dist/autophase/checkpoint.d.ts +49 -0
- package/dist/autophase/checkpoint.d.ts.map +1 -0
- package/dist/autophase/index.d.ts +9 -0
- package/dist/autophase/index.d.ts.map +1 -0
- package/dist/autophase/phase-graph-builder.d.ts +46 -0
- package/dist/autophase/phase-graph-builder.d.ts.map +1 -0
- package/dist/autophase/phase-orchestrator.d.ts +150 -0
- package/dist/autophase/phase-orchestrator.d.ts.map +1 -0
- package/dist/autophase/phase-store.d.ts +29 -0
- package/dist/autophase/phase-store.d.ts.map +1 -0
- package/dist/autophase/types.d.ts +329 -0
- package/dist/autophase/types.d.ts.map +1 -0
- package/dist/boot.d.ts +73 -0
- package/dist/boot.d.ts.map +1 -0
- package/dist/coordination/adaptive-concurrency.d.ts +63 -0
- package/dist/coordination/adaptive-concurrency.d.ts.map +1 -0
- package/dist/coordination/agent-bridge.d.ts +24 -0
- package/dist/coordination/agent-bridge.d.ts.map +1 -0
- package/dist/coordination/agent-monitor.d.ts +100 -0
- package/dist/coordination/agent-monitor.d.ts.map +1 -0
- package/dist/coordination/agent-subagent-runner.d.ts +74 -0
- package/dist/coordination/agent-subagent-runner.d.ts.map +1 -0
- package/dist/coordination/agents/agent-prompts.d.ts +2 -0
- package/dist/coordination/agents/agent-prompts.d.ts.map +1 -0
- package/dist/coordination/agents/index.d.ts +35 -0
- package/dist/coordination/agents/index.d.ts.map +1 -0
- package/dist/coordination/agents/phase1-discovery.d.ts +4 -0
- package/dist/coordination/agents/phase1-discovery.d.ts.map +1 -0
- package/dist/coordination/agents/phase2-planning.d.ts +4 -0
- package/dist/coordination/agents/phase2-planning.d.ts.map +1 -0
- package/dist/coordination/agents/phase3-build.d.ts +4 -0
- package/dist/coordination/agents/phase3-build.d.ts.map +1 -0
- package/dist/coordination/agents/phase3-techstack.d.ts +13 -0
- package/dist/coordination/agents/phase3-techstack.d.ts.map +1 -0
- package/dist/coordination/agents/phase4-verify.d.ts +4 -0
- package/dist/coordination/agents/phase4-verify.d.ts.map +1 -0
- package/dist/coordination/agents/phase5-review.d.ts +4 -0
- package/dist/coordination/agents/phase5-review.d.ts.map +1 -0
- package/dist/coordination/agents/phase6-domain.d.ts +4 -0
- package/dist/coordination/agents/phase6-domain.d.ts.map +1 -0
- package/dist/coordination/agents/phase7-knowledge.d.ts +4 -0
- package/dist/coordination/agents/phase7-knowledge.d.ts.map +1 -0
- package/dist/coordination/agents/phase8-delivery.d.ts +4 -0
- package/dist/coordination/agents/phase8-delivery.d.ts.map +1 -0
- package/dist/coordination/agents/phase9-meta.d.ts +4 -0
- package/dist/coordination/agents/phase9-meta.d.ts.map +1 -0
- package/dist/coordination/agents/types.d.ts +79 -0
- package/dist/coordination/agents/types.d.ts.map +1 -0
- package/dist/coordination/agents.d.ts +8 -0
- package/dist/coordination/agents.d.ts.map +1 -0
- package/dist/coordination/auto-extend.d.ts +46 -0
- package/dist/coordination/auto-extend.d.ts.map +1 -0
- package/dist/coordination/autonomous-brain.d.ts +154 -0
- package/dist/coordination/autonomous-brain.d.ts.map +1 -0
- package/dist/coordination/autonomous-coordinator.d.ts +239 -0
- package/dist/coordination/autonomous-coordinator.d.ts.map +1 -0
- package/dist/coordination/brain-monitor.d.ts +74 -0
- package/dist/coordination/brain-monitor.d.ts.map +1 -0
- package/dist/coordination/brain.d.ts +104 -0
- package/dist/coordination/brain.d.ts.map +1 -0
- package/dist/coordination/change-manager.d.ts +151 -0
- package/dist/coordination/change-manager.d.ts.map +1 -0
- package/dist/coordination/checkpoint-wiring.d.ts +61 -0
- package/dist/coordination/checkpoint-wiring.d.ts.map +1 -0
- package/dist/coordination/collab-bus.d.ts +132 -0
- package/dist/coordination/collab-bus.d.ts.map +1 -0
- package/dist/coordination/collab-debug.d.ts +302 -0
- package/dist/coordination/collab-debug.d.ts.map +1 -0
- package/dist/coordination/commit-safety.d.ts +72 -0
- package/dist/coordination/commit-safety.d.ts.map +1 -0
- package/dist/coordination/consensus-protocol.d.ts +106 -0
- package/dist/coordination/consensus-protocol.d.ts.map +1 -0
- package/dist/coordination/coordinator/error-classifier.d.ts +15 -0
- package/dist/coordination/coordinator/error-classifier.d.ts.map +1 -0
- package/dist/coordination/delegate-tool.d.ts +101 -0
- package/dist/coordination/delegate-tool.d.ts.map +1 -0
- package/dist/coordination/dep-watcher-bridge.d.ts +47 -0
- package/dist/coordination/dep-watcher-bridge.d.ts.map +1 -0
- package/dist/coordination/dep-watcher.d.ts +74 -0
- package/dist/coordination/dep-watcher.d.ts.map +1 -0
- package/dist/coordination/director/director-errors.d.ts +29 -0
- package/dist/coordination/director/director-errors.d.ts.map +1 -0
- package/dist/coordination/director-construction.d.ts +90 -0
- package/dist/coordination/director-construction.d.ts.map +1 -0
- package/dist/coordination/director-prompts.d.ts +119 -0
- package/dist/coordination/director-prompts.d.ts.map +1 -0
- package/dist/coordination/director-session.d.ts +68 -0
- package/dist/coordination/director-session.d.ts.map +1 -0
- package/dist/coordination/director-tools.d.ts +65 -0
- package/dist/coordination/director-tools.d.ts.map +1 -0
- package/dist/coordination/director.d.ts +802 -0
- package/dist/coordination/director.d.ts.map +1 -0
- package/dist/coordination/dispatcher.d.ts +82 -0
- package/dist/coordination/dispatcher.d.ts.map +1 -0
- package/dist/coordination/file-author-tracker.d.ts +76 -0
- package/dist/coordination/file-author-tracker.d.ts.map +1 -0
- package/dist/coordination/fleet-bus.d.ts +122 -0
- package/dist/coordination/fleet-bus.d.ts.map +1 -0
- package/dist/coordination/fleet-event-validation.d.ts +10 -0
- package/dist/coordination/fleet-event-validation.d.ts.map +1 -0
- package/dist/coordination/fleet-manager.d.ts +234 -0
- package/dist/coordination/fleet-manager.d.ts.map +1 -0
- package/dist/coordination/fleet-spawn.d.ts +102 -0
- package/dist/coordination/fleet-spawn.d.ts.map +1 -0
- package/dist/coordination/fleet-status-tool.d.ts +36 -0
- package/dist/coordination/fleet-status-tool.d.ts.map +1 -0
- package/dist/coordination/fleet-supervisor.d.ts +157 -0
- package/dist/coordination/fleet-supervisor.d.ts.map +1 -0
- package/dist/coordination/fleet.d.ts +96 -0
- package/dist/coordination/fleet.d.ts.map +1 -0
- package/dist/coordination/global-mailbox.d.ts +234 -0
- package/dist/coordination/global-mailbox.d.ts.map +1 -0
- package/dist/coordination/icoordinator.d.ts +97 -0
- package/dist/coordination/icoordinator.d.ts.map +1 -0
- package/dist/coordination/ifleet-manager.d.ts +177 -0
- package/dist/coordination/ifleet-manager.d.ts.map +1 -0
- package/dist/coordination/in-memory-transport.d.ts +12 -0
- package/dist/coordination/in-memory-transport.d.ts.map +1 -0
- package/dist/coordination/index.d.ts +78 -2587
- package/dist/coordination/index.d.ts.map +1 -0
- package/dist/coordination/index.js +739 -254
- package/dist/coordination/index.js.map +7 -1
- package/dist/coordination/knowledge-graph.d.ts +217 -0
- package/dist/coordination/knowledge-graph.d.ts.map +1 -0
- package/dist/coordination/large-answer-store.d.ts +61 -0
- package/dist/coordination/large-answer-store.d.ts.map +1 -0
- package/dist/coordination/mail-tools.d.ts +34 -0
- package/dist/coordination/mail-tools.d.ts.map +1 -0
- package/dist/coordination/mailbox-actions.d.ts +68 -0
- package/dist/coordination/mailbox-actions.d.ts.map +1 -0
- package/dist/coordination/mailbox-health.d.ts +131 -0
- package/dist/coordination/mailbox-health.d.ts.map +1 -0
- package/dist/coordination/mailbox-hooks.d.ts +55 -0
- package/dist/coordination/mailbox-hooks.d.ts.map +1 -0
- package/dist/coordination/mailbox-tool.d.ts +75 -0
- package/dist/coordination/mailbox-tool.d.ts.map +1 -0
- package/dist/{mailbox-types-BGZWrYTJ.d.ts → coordination/mailbox-types.d.ts} +37 -22
- package/dist/coordination/mailbox-types.d.ts.map +1 -0
- package/dist/coordination/mailbox.d.ts +69 -0
- package/dist/coordination/mailbox.d.ts.map +1 -0
- package/dist/coordination/model-matrix.d.ts +98 -0
- package/dist/coordination/model-matrix.d.ts.map +1 -0
- package/dist/coordination/multi-agent-coordinator.d.ts +202 -0
- package/dist/coordination/multi-agent-coordinator.d.ts.map +1 -0
- package/dist/coordination/null-fleet-bus.d.ts +10 -0
- package/dist/coordination/null-fleet-bus.d.ts.map +1 -0
- package/dist/coordination/package-author-tracker.d.ts +87 -0
- package/dist/coordination/package-author-tracker.d.ts.map +1 -0
- package/dist/coordination/package-outdated-watcher.d.ts +83 -0
- package/dist/coordination/package-outdated-watcher.d.ts.map +1 -0
- package/dist/coordination/single-instance-mailbox.d.ts +154 -0
- package/dist/coordination/single-instance-mailbox.d.ts.map +1 -0
- package/dist/coordination/spawn-budget.d.ts +6 -0
- package/dist/coordination/spawn-budget.d.ts.map +1 -0
- package/dist/coordination/subagent-budget.d.ts +323 -0
- package/dist/coordination/subagent-budget.d.ts.map +1 -0
- package/dist/coordination/subagent-nicknames.d.ts +42 -0
- package/dist/coordination/subagent-nicknames.d.ts.map +1 -0
- package/dist/coordination/subagent-result-tool.d.ts +20 -0
- package/dist/coordination/subagent-result-tool.d.ts.map +1 -0
- package/dist/coordination/task-auctioneer.d.ts +143 -0
- package/dist/coordination/task-auctioneer.d.ts.map +1 -0
- package/dist/coordination/task-dag.d.ts +147 -0
- package/dist/coordination/task-dag.d.ts.map +1 -0
- package/dist/coordination/techstack-mailbox-consumer.d.ts +50 -0
- package/dist/coordination/techstack-mailbox-consumer.d.ts.map +1 -0
- package/dist/coordination/transport.d.ts +2 -0
- package/dist/coordination/transport.d.ts.map +1 -0
- package/dist/coordination/worktree-task-runner.d.ts +45 -0
- package/dist/coordination/worktree-task-runner.d.ts.map +1 -0
- package/dist/core/agent-internals.d.ts +41 -0
- package/dist/core/agent-internals.d.ts.map +1 -0
- package/dist/core/agent-loop.d.ts +18 -0
- package/dist/core/agent-loop.d.ts.map +1 -0
- package/dist/core/agent-response.d.ts +21 -0
- package/dist/core/agent-response.d.ts.map +1 -0
- package/dist/core/agent-tools.d.ts +21 -0
- package/dist/core/agent-tools.d.ts.map +1 -0
- package/dist/core/agent-types.d.ts +95 -0
- package/dist/core/agent-types.d.ts.map +1 -0
- package/dist/core/agent.d.ts +54 -0
- package/dist/core/agent.d.ts.map +1 -0
- package/dist/core/btw.d.ts +40 -0
- package/dist/core/btw.d.ts.map +1 -0
- package/dist/core/context.d.ts +269 -0
- package/dist/core/context.d.ts.map +1 -0
- package/dist/core/continue-intent.d.ts +92 -0
- package/dist/core/continue-intent.d.ts.map +1 -0
- package/dist/core/continue-to-next-iteration.d.ts +96 -0
- package/dist/core/continue-to-next-iteration.d.ts.map +1 -0
- package/dist/core/conversation-state.d.ts +96 -0
- package/dist/core/conversation-state.d.ts.map +1 -0
- package/dist/core/fallback-model.d.ts +94 -0
- package/dist/core/fallback-model.d.ts.map +1 -0
- package/dist/core/fleet-pulse.d.ts +42 -0
- package/dist/core/fleet-pulse.d.ts.map +1 -0
- package/dist/core/input-builder.d.ts +95 -0
- package/dist/core/input-builder.d.ts.map +1 -0
- package/dist/core/instruction-bundle.d.ts +22 -0
- package/dist/core/instruction-bundle.d.ts.map +1 -0
- package/dist/core/iteration-limit.d.ts +35 -0
- package/dist/core/iteration-limit.d.ts.map +1 -0
- package/dist/core/mailbox-loop.d.ts +63 -0
- package/dist/core/mailbox-loop.d.ts.map +1 -0
- package/dist/core/modes/brief.d.ts +2 -0
- package/dist/core/modes/brief.d.ts.map +1 -0
- package/dist/core/modes/default.d.ts +8 -0
- package/dist/core/modes/default.d.ts.map +1 -0
- package/dist/core/modes/teach.d.ts +2 -0
- package/dist/core/modes/teach.d.ts.map +1 -0
- package/dist/core/provider-runner.d.ts +24 -0
- package/dist/core/provider-runner.d.ts.map +1 -0
- package/dist/core/queued-messages.d.ts +55 -0
- package/dist/core/queued-messages.d.ts.map +1 -0
- package/dist/core/run-env.d.ts +49 -0
- package/dist/core/run-env.d.ts.map +1 -0
- package/dist/core/streaming-response-builder.d.ts +78 -0
- package/dist/core/streaming-response-builder.d.ts.map +1 -0
- package/dist/core/system-prompt-builder.d.ts +213 -0
- package/dist/core/system-prompt-builder.d.ts.map +1 -0
- package/dist/defaults/index.d.ts +68 -158
- package/dist/defaults/index.d.ts.map +1 -0
- package/dist/defaults/index.js +1257 -819
- package/dist/defaults/index.js.map +7 -1
- package/dist/execution/auto-compaction-middleware.d.ts +123 -0
- package/dist/execution/auto-compaction-middleware.d.ts.map +1 -0
- package/dist/execution/autonomous-runner.d.ts +55 -0
- package/dist/execution/autonomous-runner.d.ts.map +1 -0
- package/dist/execution/autonomy-brain.d.ts +90 -0
- package/dist/execution/autonomy-brain.d.ts.map +1 -0
- package/dist/execution/autonomy-prompt-contributor.d.ts +39 -0
- package/dist/execution/autonomy-prompt-contributor.d.ts.map +1 -0
- package/dist/execution/compaction-core.d.ts +103 -0
- package/dist/execution/compaction-core.d.ts.map +1 -0
- package/dist/execution/compactor.d.ts +56 -0
- package/dist/execution/compactor.d.ts.map +1 -0
- package/dist/execution/design-color.d.ts +31 -0
- package/dist/execution/design-color.d.ts.map +1 -0
- package/dist/execution/design-detect.d.ts +96 -0
- package/dist/execution/design-detect.d.ts.map +1 -0
- package/dist/execution/design-kit-loader.d.ts +53 -0
- package/dist/execution/design-kit-loader.d.ts.map +1 -0
- package/dist/execution/design-materialize.d.ts +32 -0
- package/dist/execution/design-materialize.d.ts.map +1 -0
- package/dist/execution/design-project-store.d.ts +57 -0
- package/dist/execution/design-project-store.d.ts.map +1 -0
- package/dist/execution/design-verify.d.ts +44 -0
- package/dist/execution/design-verify.d.ts.map +1 -0
- package/dist/execution/error-handler.d.ts +34 -0
- package/dist/execution/error-handler.d.ts.map +1 -0
- package/dist/{parallel-eternal-engine-HUrtePLd.d.ts → execution/eternal-autonomy.d.ts} +10 -225
- package/dist/execution/eternal-autonomy.d.ts.map +1 -0
- package/dist/execution/goal-preamble.d.ts +2 -0
- package/dist/execution/goal-preamble.d.ts.map +1 -0
- package/dist/execution/index.d.ts +21 -180
- package/dist/execution/index.d.ts.map +1 -0
- package/dist/execution/index.js +465 -180
- package/dist/execution/index.js.map +7 -1
- package/dist/execution/intelligent-compactor.d.ts +85 -0
- package/dist/execution/intelligent-compactor.d.ts.map +1 -0
- package/dist/execution/model-runtime.d.ts +75 -0
- package/dist/execution/model-runtime.d.ts.map +1 -0
- package/dist/execution/parallel-eternal-engine.d.ts +130 -0
- package/dist/execution/parallel-eternal-engine.d.ts.map +1 -0
- package/dist/execution/prompt-enhancer.d.ts +12 -13
- package/dist/execution/prompt-enhancer.d.ts.map +1 -0
- package/dist/execution/prompt-enhancer.js +13 -7
- package/dist/execution/prompt-enhancer.js.map +7 -1
- package/dist/execution/prompt-loader.d.ts +52 -0
- package/dist/execution/prompt-loader.d.ts.map +1 -0
- package/dist/execution/provider-runner-impl.d.ts +14 -0
- package/dist/execution/provider-runner-impl.d.ts.map +1 -0
- package/dist/execution/regex-patterns.d.ts +7 -0
- package/dist/execution/regex-patterns.d.ts.map +1 -0
- package/dist/execution/retry-policy.d.ts +35 -0
- package/dist/execution/retry-policy.d.ts.map +1 -0
- package/dist/execution/selective-compactor.d.ts +94 -0
- package/dist/execution/selective-compactor.d.ts.map +1 -0
- package/dist/execution/skill-loader.d.ts +43 -0
- package/dist/execution/skill-loader.d.ts.map +1 -0
- package/dist/execution/strategy-compactor.d.ts +43 -0
- package/dist/execution/strategy-compactor.d.ts.map +1 -0
- package/dist/execution/tool-executor.d.ts +112 -0
- package/dist/execution/tool-executor.d.ts.map +1 -0
- package/dist/extension/extension-points.d.ts +121 -0
- package/dist/extension/extension-points.d.ts.map +1 -0
- package/dist/extension/index.d.ts +3 -10
- package/dist/extension/index.d.ts.map +1 -0
- package/dist/extension/index.js +59 -5
- package/dist/extension/index.js.map +7 -1
- package/dist/extension/registry.d.ts +86 -0
- package/dist/extension/registry.d.ts.map +1 -0
- package/dist/fleet-notifier.d.ts +28 -0
- package/dist/fleet-notifier.d.ts.map +1 -0
- package/dist/hooks/http-executor.d.ts +11 -0
- package/dist/hooks/http-executor.d.ts.map +1 -0
- package/dist/hooks/index.d.ts +10 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/registry.d.ts +71 -0
- package/dist/hooks/registry.d.ts.map +1 -0
- package/dist/hooks/runner.d.ts +65 -0
- package/dist/hooks/runner.d.ts.map +1 -0
- package/dist/hooks/shell-executor.d.ts +33 -0
- package/dist/hooks/shell-executor.d.ts.map +1 -0
- package/dist/hooks/shell-hooks-equal.d.ts +15 -0
- package/dist/hooks/shell-hooks-equal.d.ts.map +1 -0
- package/dist/hq/agent-bridge.d.ts +27 -0
- package/dist/hq/agent-bridge.d.ts.map +1 -0
- package/dist/hq/alerts.d.ts +67 -0
- package/dist/hq/alerts.d.ts.map +1 -0
- package/dist/hq/auth-store.d.ts +161 -0
- package/dist/hq/auth-store.d.ts.map +1 -0
- package/dist/hq/brain-bridge.d.ts +37 -0
- package/dist/hq/brain-bridge.d.ts.map +1 -0
- package/dist/hq/commands.d.ts +122 -0
- package/dist/hq/commands.d.ts.map +1 -0
- package/dist/hq/cost-bridge.d.ts +36 -0
- package/dist/hq/cost-bridge.d.ts.map +1 -0
- package/dist/hq/factory.d.ts +66 -0
- package/dist/hq/factory.d.ts.map +1 -0
- package/dist/hq/fleet-bridge.d.ts +39 -0
- package/dist/hq/fleet-bridge.d.ts.map +1 -0
- package/dist/hq/index.d.ts +18 -816
- package/dist/hq/index.d.ts.map +1 -0
- package/dist/hq/index.js +417 -122
- package/dist/hq/index.js.map +7 -1
- package/dist/hq/mailbox-mapper.d.ts +27 -0
- package/dist/hq/mailbox-mapper.d.ts.map +1 -0
- package/dist/hq/persistence.d.ts +121 -0
- package/dist/hq/persistence.d.ts.map +1 -0
- package/dist/hq/protocol.d.ts +560 -0
- package/dist/hq/protocol.d.ts.map +1 -0
- package/dist/hq/publisher.d.ts +177 -0
- package/dist/hq/publisher.d.ts.map +1 -0
- package/dist/hq/redaction.d.ts +30 -0
- package/dist/hq/redaction.d.ts.map +1 -0
- package/dist/hq/session-bridge.d.ts +29 -0
- package/dist/hq/session-bridge.d.ts.map +1 -0
- package/dist/hq/tool-bridge.d.ts +41 -0
- package/dist/hq/tool-bridge.d.ts.map +1 -0
- package/dist/hq/transcript-mapper.d.ts +36 -0
- package/dist/hq/transcript-mapper.d.ts.map +1 -0
- package/dist/hq/worktree-bridge.d.ts +34 -0
- package/dist/hq/worktree-bridge.d.ts.map +1 -0
- package/dist/index.d.ts +108 -2872
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2724 -1344
- package/dist/index.js.map +7 -1
- package/dist/infrastructure/context-manager.d.ts +92 -0
- package/dist/infrastructure/context-manager.d.ts.map +1 -0
- package/dist/infrastructure/index.d.ts +6 -64
- package/dist/infrastructure/index.d.ts.map +1 -0
- package/dist/infrastructure/index.js +39 -12
- package/dist/infrastructure/index.js.map +7 -1
- package/dist/infrastructure/logger.d.ts +99 -0
- package/dist/infrastructure/logger.d.ts.map +1 -0
- package/dist/infrastructure/mcp-servers.d.ts +83 -0
- package/dist/infrastructure/mcp-servers.d.ts.map +1 -0
- package/dist/{path-resolver-CMS5307d.d.ts → infrastructure/path-resolver.d.ts} +3 -5
- package/dist/infrastructure/path-resolver.d.ts.map +1 -0
- package/dist/infrastructure/token-counter.d.ts +57 -0
- package/dist/infrastructure/token-counter.d.ts.map +1 -0
- package/dist/kernel/container.d.ts +84 -0
- package/dist/kernel/container.d.ts.map +1 -0
- package/dist/{events-Bgnh43r9.d.ts → kernel/events.d.ts} +112 -206
- package/dist/kernel/events.d.ts.map +1 -0
- package/dist/kernel/index.d.ts +6 -107
- package/dist/kernel/index.d.ts.map +1 -0
- package/dist/kernel/index.js +56 -4
- package/dist/kernel/index.js.map +7 -1
- package/dist/kernel/pipeline.d.ts +105 -0
- package/dist/kernel/pipeline.d.ts.map +1 -0
- package/dist/kernel/run-controller.d.ts +55 -0
- package/dist/kernel/run-controller.d.ts.map +1 -0
- package/dist/kernel/tokens.d.ts +53 -0
- package/dist/kernel/tokens.d.ts.map +1 -0
- package/dist/mailbox-attach.d.ts +27 -0
- package/dist/mailbox-attach.d.ts.map +1 -0
- package/dist/middleware/collab-pause.d.ts +73 -0
- package/dist/middleware/collab-pause.d.ts.map +1 -0
- package/dist/models/codex-catalog.d.ts +41 -0
- package/dist/models/codex-catalog.d.ts.map +1 -0
- package/dist/models/index.d.ts +8 -163
- package/dist/models/index.d.ts.map +1 -0
- package/dist/models/index.js +150 -51
- package/dist/models/index.js.map +7 -1
- package/dist/models/llm-selector.d.ts +47 -0
- package/dist/models/llm-selector.d.ts.map +1 -0
- package/dist/models/mode-store.d.ts +22 -0
- package/dist/models/mode-store.d.ts.map +1 -0
- package/dist/models/model-intelligence.d.ts +56 -0
- package/dist/models/model-intelligence.d.ts.map +1 -0
- package/dist/models/model-router.d.ts +100 -0
- package/dist/models/model-router.d.ts.map +1 -0
- package/dist/models/models-registry.d.ts +106 -0
- package/dist/models/models-registry.d.ts.map +1 -0
- package/dist/models/provider-model-resolve.d.ts +69 -0
- package/dist/models/provider-model-resolve.d.ts.map +1 -0
- package/dist/observability/event-bridge.d.ts +10 -0
- package/dist/observability/event-bridge.d.ts.map +1 -0
- package/dist/observability/health.d.ts +18 -0
- package/dist/observability/health.d.ts.map +1 -0
- package/dist/observability/index.d.ts +9 -354
- package/dist/observability/index.d.ts.map +1 -0
- package/dist/observability/index.js +21 -8
- package/dist/observability/index.js.map +7 -1
- package/dist/observability/metrics.d.ts +26 -0
- package/dist/observability/metrics.d.ts.map +1 -0
- package/dist/observability/otel-tracer.d.ts +41 -0
- package/dist/observability/otel-tracer.d.ts.map +1 -0
- package/dist/observability/otlp-metrics.d.ts +111 -0
- package/dist/observability/otlp-metrics.d.ts.map +1 -0
- package/dist/observability/otlp-traces.d.ts +95 -0
- package/dist/observability/otlp-traces.d.ts.map +1 -0
- package/dist/observability/prometheus.d.ts +49 -0
- package/dist/observability/prometheus.d.ts.map +1 -0
- package/dist/observability/tracer.d.ts +9 -0
- package/dist/observability/tracer.d.ts.map +1 -0
- package/dist/plugin/api.d.ts +226 -0
- package/dist/plugin/api.d.ts.map +1 -0
- package/dist/plugin/loader.d.ts +73 -0
- package/dist/plugin/loader.d.ts.map +1 -0
- package/dist/plugins/chimera-plugin.d.ts +37 -0
- package/dist/plugins/chimera-plugin.d.ts.map +1 -0
- package/dist/plugins/git-plugin.d.ts +15 -0
- package/dist/plugins/git-plugin.d.ts.map +1 -0
- package/dist/plugins/observability-plugin.d.ts +19 -0
- package/dist/plugins/observability-plugin.d.ts.map +1 -0
- package/dist/plugins/plan-plugin.d.ts +16 -0
- package/dist/plugins/plan-plugin.d.ts.map +1 -0
- package/dist/plugins/prompts-plugin.d.ts +26 -0
- package/dist/plugins/prompts-plugin.d.ts.map +1 -0
- package/dist/plugins/security-plugin.d.ts +19 -0
- package/dist/plugins/security-plugin.d.ts.map +1 -0
- package/dist/plugins/skills-plugin.d.ts +42 -0
- package/dist/plugins/skills-plugin.d.ts.map +1 -0
- package/dist/plugins/sync-plugin.d.ts +22 -0
- package/dist/plugins/sync-plugin.d.ts.map +1 -0
- package/dist/prompts/index.d.ts +3 -0
- package/dist/prompts/index.d.ts.map +1 -0
- package/dist/prompts/prompt-installer.d.ts +50 -0
- package/dist/prompts/prompt-installer.d.ts.map +1 -0
- package/dist/prompts/prompt-manifest-store.d.ts +18 -0
- package/dist/prompts/prompt-manifest-store.d.ts.map +1 -0
- package/dist/registry/provider-registry.d.ts +51 -0
- package/dist/registry/provider-registry.d.ts.map +1 -0
- package/dist/registry/slash-command-registry.d.ts +61 -0
- package/dist/registry/slash-command-registry.d.ts.map +1 -0
- package/dist/registry/tool-registry.d.ts +154 -0
- package/dist/registry/tool-registry.d.ts.map +1 -0
- package/dist/replay/hash.d.ts +31 -0
- package/dist/replay/hash.d.ts.map +1 -0
- package/dist/replay/replay-provider-runner.d.ts +53 -0
- package/dist/replay/replay-provider-runner.d.ts.map +1 -0
- package/dist/{index-CbyuOE5y.d.ts → security/capabilities.d.ts} +31 -34
- package/dist/security/capabilities.d.ts.map +1 -0
- package/dist/security/config-secrets.d.ts +25 -0
- package/dist/security/config-secrets.d.ts.map +1 -0
- package/dist/security/index.d.ts +6 -8
- package/dist/security/index.d.ts.map +1 -0
- package/dist/security/index.js +102 -381
- package/dist/security/index.js.map +7 -1
- package/dist/security/permission-policy.d.ts +153 -0
- package/dist/security/permission-policy.d.ts.map +1 -0
- package/dist/security/secret-scrubber.d.ts +14 -0
- package/dist/security/secret-scrubber.d.ts.map +1 -0
- package/dist/security/secret-vault.d.ts +87 -0
- package/dist/security/secret-vault.d.ts.map +1 -0
- package/dist/security/yolo-risk.d.ts +11 -0
- package/dist/security/yolo-risk.d.ts.map +1 -0
- package/dist/{session-registry-Dvg7i_IA.d.ts → session-registry.d.ts} +8 -9
- package/dist/session-registry.d.ts.map +1 -0
- package/dist/skills/foreign-sources.d.ts +59 -0
- package/dist/skills/foreign-sources.d.ts.map +1 -0
- package/dist/skills/frontmatter.d.ts +44 -0
- package/dist/skills/frontmatter.d.ts.map +1 -0
- package/dist/skills/github-fetcher.d.ts +38 -0
- package/dist/skills/github-fetcher.d.ts.map +1 -0
- package/dist/skills/index.d.ts +11 -582
- package/dist/skills/index.d.ts.map +1 -0
- package/dist/skills/index.js +81 -43
- package/dist/skills/index.js.map +7 -1
- package/dist/skills/limits.d.ts +92 -0
- package/dist/skills/limits.d.ts.map +1 -0
- package/dist/skills/manifest-store.d.ts +42 -0
- package/dist/skills/manifest-store.d.ts.map +1 -0
- package/dist/skills/registry/github-direct-adapter.d.ts +17 -0
- package/dist/skills/registry/github-direct-adapter.d.ts.map +1 -0
- package/dist/skills/registry/registry-adapter.d.ts +84 -0
- package/dist/skills/registry/registry-adapter.d.ts.map +1 -0
- package/dist/skills/registry/skills-sh-adapter.d.ts +13 -0
- package/dist/skills/registry/skills-sh-adapter.d.ts.map +1 -0
- package/dist/skills/skill-generator.d.ts +82 -0
- package/dist/skills/skill-generator.d.ts.map +1 -0
- package/dist/skills/skill-installer.d.ts +124 -0
- package/dist/skills/skill-installer.d.ts.map +1 -0
- package/dist/storage/annotations-store.d.ts +118 -0
- package/dist/storage/annotations-store.d.ts.map +1 -0
- package/dist/storage/attachment-store.d.ts +31 -0
- package/dist/storage/attachment-store.d.ts.map +1 -0
- package/dist/storage/cloud-sync.d.ts +44 -0
- package/dist/storage/cloud-sync.d.ts.map +1 -0
- package/dist/storage/completed-work-checkpoint.d.ts +11 -0
- package/dist/storage/completed-work-checkpoint.d.ts.map +1 -0
- package/dist/storage/config-loader.d.ts +104 -0
- package/dist/storage/config-loader.d.ts.map +1 -0
- package/dist/storage/config-migration.d.ts +87 -0
- package/dist/storage/config-migration.d.ts.map +1 -0
- package/dist/storage/config-store.d.ts +22 -0
- package/dist/storage/config-store.d.ts.map +1 -0
- package/dist/{director-state-CMS_bMs4.d.ts → storage/director-state.d.ts} +28 -8
- package/dist/storage/director-state.d.ts.map +1 -0
- package/dist/storage/file-session-writer.d.ts +169 -0
- package/dist/storage/file-session-writer.d.ts.map +1 -0
- package/dist/{goal-store-Datpp-ar.d.ts → storage/goal-store.d.ts} +26 -19
- package/dist/storage/goal-store.d.ts.map +1 -0
- package/dist/storage/index.d.ts +39 -1031
- package/dist/storage/index.d.ts.map +1 -0
- package/dist/storage/index.js +655 -300
- package/dist/storage/index.js.map +7 -1
- package/dist/storage/input-history-store.d.ts +56 -0
- package/dist/storage/input-history-store.d.ts.map +1 -0
- package/dist/storage/memory-backend.d.ts +66 -0
- package/dist/storage/memory-backend.d.ts.map +1 -0
- package/dist/storage/memory-consolidator.d.ts +50 -0
- package/dist/storage/memory-consolidator.d.ts.map +1 -0
- package/dist/storage/memory-graph-backend.d.ts +117 -0
- package/dist/storage/memory-graph-backend.d.ts.map +1 -0
- package/dist/storage/memory-store.d.ts +119 -0
- package/dist/storage/memory-store.d.ts.map +1 -0
- package/dist/storage/plan-store.d.ts +78 -0
- package/dist/storage/plan-store.d.ts.map +1 -0
- package/dist/storage/plan-templates.d.ts +21 -0
- package/dist/storage/plan-templates.d.ts.map +1 -0
- package/dist/storage/prompt-store.d.ts +37 -0
- package/dist/storage/prompt-store.d.ts.map +1 -0
- package/dist/storage/prompt-usage-store.d.ts +29 -0
- package/dist/storage/prompt-usage-store.d.ts.map +1 -0
- package/dist/storage/provider-config-watcher.d.ts +34 -0
- package/dist/storage/provider-config-watcher.d.ts.map +1 -0
- package/dist/storage/queue-store.d.ts +37 -0
- package/dist/storage/queue-store.d.ts.map +1 -0
- package/dist/storage/recovery-lock.d.ts +79 -0
- package/dist/storage/recovery-lock.d.ts.map +1 -0
- package/dist/storage/replay-log-store.d.ts +97 -0
- package/dist/storage/replay-log-store.d.ts.map +1 -0
- package/dist/storage/session-analyzer.d.ts +48 -0
- package/dist/storage/session-analyzer.d.ts.map +1 -0
- package/dist/storage/session-checkpoint-cas.d.ts +37 -0
- package/dist/storage/session-checkpoint-cas.d.ts.map +1 -0
- package/dist/{session-event-bridge-D_z_mBwk.d.ts → storage/session-event-bridge.d.ts} +14 -15
- package/dist/storage/session-event-bridge.d.ts.map +1 -0
- package/dist/storage/session-helpers.d.ts +9 -0
- package/dist/storage/session-helpers.d.ts.map +1 -0
- package/dist/storage/session-id.d.ts +18 -0
- package/dist/storage/session-id.d.ts.map +1 -0
- package/dist/storage/session-reader.d.ts +21 -0
- package/dist/storage/session-reader.d.ts.map +1 -0
- package/dist/storage/session-recovery.d.ts +93 -0
- package/dist/storage/session-recovery.d.ts.map +1 -0
- package/dist/storage/session-resume-validation.d.ts +6 -0
- package/dist/storage/session-resume-validation.d.ts.map +1 -0
- package/dist/storage/session-rewinder.d.ts +21 -0
- package/dist/storage/session-rewinder.d.ts.map +1 -0
- package/dist/storage/session-store.d.ts +210 -0
- package/dist/storage/session-store.d.ts.map +1 -0
- package/dist/storage/session-summary.d.ts +12 -0
- package/dist/storage/session-summary.d.ts.map +1 -0
- package/dist/storage/session-tool-call-ends.d.ts +5 -0
- package/dist/storage/session-tool-call-ends.d.ts.map +1 -0
- package/dist/storage/storage-concurrency.d.ts +2 -0
- package/dist/storage/storage-concurrency.d.ts.map +1 -0
- package/dist/storage/task-store.d.ts +33 -0
- package/dist/storage/task-store.d.ts.map +1 -0
- package/dist/storage/todos-checkpoint.d.ts +39 -0
- package/dist/storage/todos-checkpoint.d.ts.map +1 -0
- package/dist/storage/tool-audit-log.d.ts +141 -0
- package/dist/storage/tool-audit-log.d.ts.map +1 -0
- package/dist/tasking/index.d.ts +3 -124
- package/dist/tasking/index.d.ts.map +1 -0
- package/dist/tasking/index.js +57 -4
- package/dist/tasking/index.js.map +7 -1
- package/dist/tasking/task-store.d.ts +22 -0
- package/dist/tasking/task-store.d.ts.map +1 -0
- package/dist/tasking/task-tracker.d.ts +102 -0
- package/dist/tasking/task-tracker.d.ts.map +1 -0
- package/dist/tools/index.d.ts +2 -59
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +93 -14
- package/dist/tools/index.js.map +7 -1
- package/dist/tools/mcp-control.d.ts +53 -0
- package/dist/tools/mcp-control.d.ts.map +1 -0
- package/dist/tools/mcp-use.d.ts +24 -0
- package/dist/tools/mcp-use.d.ts.map +1 -0
- package/dist/types/agent-bridge.d.ts +42 -0
- package/dist/types/agent-bridge.d.ts.map +1 -0
- package/dist/types/attachment.d.ts +54 -0
- package/dist/types/attachment.d.ts.map +1 -0
- package/dist/types/autonomy.d.ts +5 -0
- package/dist/types/autonomy.d.ts.map +1 -0
- package/dist/types/blocks.d.ts +76 -0
- package/dist/types/blocks.d.ts.map +1 -0
- package/dist/{compactor-DQLL4HTo.d.ts → types/compactor.d.ts} +5 -7
- package/dist/types/compactor.d.ts.map +1 -0
- package/dist/{config-MRqn1V-u.d.ts → types/config.d.ts} +135 -354
- package/dist/types/config.d.ts.map +1 -0
- package/dist/types/context-evidence.d.ts +68 -0
- package/dist/types/context-evidence.d.ts.map +1 -0
- package/dist/types/context-window.d.ts +35 -0
- package/dist/types/context-window.d.ts.map +1 -0
- package/dist/{default-config-B79_gJYv.d.ts → types/default-config.d.ts} +10 -11
- package/dist/types/default-config.d.ts.map +1 -0
- package/dist/types/design-kit.d.ts +91 -0
- package/dist/types/design-kit.d.ts.map +1 -0
- package/dist/{retry-policy-CQ7KwXJa.d.ts → types/error-handler.d.ts} +5 -12
- package/dist/types/error-handler.d.ts.map +1 -0
- package/dist/types/errors.d.ts +277 -0
- package/dist/types/errors.d.ts.map +1 -0
- package/dist/types/hooks.d.ts +167 -0
- package/dist/types/hooks.d.ts.map +1 -0
- package/dist/types/index.d.ts +40 -244
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +90 -12
- package/dist/types/index.js.map +7 -1
- package/dist/{input-reader-E-ffP2ee.d.ts → types/input-reader.d.ts} +3 -4
- package/dist/types/input-reader.d.ts.map +1 -0
- package/dist/{logger-B63L5bTg.d.ts → types/logger.d.ts} +3 -4
- package/dist/types/logger.d.ts.map +1 -0
- package/dist/types/memory.d.ts +89 -0
- package/dist/types/memory.d.ts.map +1 -0
- package/dist/types/messages.d.ts +24 -0
- package/dist/types/messages.d.ts.map +1 -0
- package/dist/types/mode-prompts.d.ts +2 -0
- package/dist/types/mode-prompts.d.ts.map +1 -0
- package/dist/{mode-CZlO9iU1.d.ts → types/mode.d.ts} +6 -7
- package/dist/types/mode.d.ts.map +1 -0
- package/dist/types/models-registry.d.ts +105 -0
- package/dist/types/models-registry.d.ts.map +1 -0
- package/dist/types/multi-agent.d.ts +435 -0
- package/dist/types/multi-agent.d.ts.map +1 -0
- package/dist/{observability-D-HZN_mF.d.ts → types/observability.d.ts} +12 -13
- package/dist/types/observability.d.ts.map +1 -0
- package/dist/{path-resolver-CPRj4bFY.d.ts → types/path-resolver.d.ts} +2 -3
- package/dist/types/path-resolver.d.ts.map +1 -0
- package/dist/{permission-ByDKXEcG.d.ts → types/permission.d.ts} +8 -9
- package/dist/types/permission.d.ts.map +1 -0
- package/dist/types/plugin.d.ts +385 -0
- package/dist/types/plugin.d.ts.map +1 -0
- package/dist/types/prompt-registry.d.ts +81 -0
- package/dist/types/prompt-registry.d.ts.map +1 -0
- package/dist/{prompt-DLd35n4Q.d.ts → types/prompt.d.ts} +14 -15
- package/dist/types/prompt.d.ts.map +1 -0
- package/dist/{provider-runner-ChL-kVg6.d.ts → types/provider-runner.d.ts} +9 -10
- package/dist/types/provider-runner.d.ts.map +1 -0
- package/dist/types/provider.d.ts +387 -0
- package/dist/types/provider.d.ts.map +1 -0
- package/dist/types/renderer.d.ts +23 -0
- package/dist/types/renderer.d.ts.map +1 -0
- package/dist/types/retry-policy.d.ts +7 -0
- package/dist/types/retry-policy.d.ts.map +1 -0
- package/dist/types/secret-scrubber.d.ts +5 -0
- package/dist/types/secret-scrubber.d.ts.map +1 -0
- package/dist/{secret-vault-BAKpgFw_.d.ts → types/secret-vault.d.ts} +13 -7
- package/dist/types/secret-vault.d.ts.map +1 -0
- package/dist/{selector-D8O6B_Rm.d.ts → types/selector.d.ts} +4 -6
- package/dist/types/selector.d.ts.map +1 -0
- package/dist/types/session-reader.d.ts +81 -0
- package/dist/types/session-reader.d.ts.map +1 -0
- package/dist/{session-rewinder-C9HnMkhP.d.ts → types/session-rewinder.d.ts} +5 -6
- package/dist/types/session-rewinder.d.ts.map +1 -0
- package/dist/types/session.d.ts +650 -0
- package/dist/types/session.d.ts.map +1 -0
- package/dist/types/side-effect.d.ts +34 -0
- package/dist/types/side-effect.d.ts.map +1 -0
- package/dist/{skill-DHniprNl.d.ts → types/skill.d.ts} +4 -5
- package/dist/types/skill.d.ts.map +1 -0
- package/dist/types/slash-command.d.ts +59 -0
- package/dist/types/slash-command.d.ts.map +1 -0
- package/dist/types/spec.d.ts +77 -0
- package/dist/types/spec.d.ts.map +1 -0
- package/dist/types/system-prompt-contributor.d.ts +20 -0
- package/dist/types/system-prompt-contributor.d.ts.map +1 -0
- package/dist/types/system-prompt.d.ts +51 -0
- package/dist/types/system-prompt.d.ts.map +1 -0
- package/dist/{task-graph-CH3acNQ7.d.ts → types/task-graph.d.ts} +21 -22
- package/dist/types/task-graph.d.ts.map +1 -0
- package/dist/types/token-counter.d.ts +42 -0
- package/dist/types/token-counter.d.ts.map +1 -0
- package/dist/types/tool-executor.d.ts +133 -0
- package/dist/types/tool-executor.d.ts.map +1 -0
- package/dist/types/tool-markers.d.ts +23 -0
- package/dist/types/tool-markers.d.ts.map +1 -0
- package/dist/types/tool.d.ts +245 -0
- package/dist/types/tool.d.ts.map +1 -0
- package/dist/types/utility-types.d.ts +31 -0
- package/dist/types/utility-types.d.ts.map +1 -0
- package/dist/utils/assert-never.d.ts +14 -0
- package/dist/utils/assert-never.d.ts.map +1 -0
- package/dist/utils/atomic-write.d.ts +12 -0
- package/dist/utils/atomic-write.d.ts.map +1 -0
- package/dist/utils/child-env.d.ts +67 -0
- package/dist/utils/child-env.d.ts.map +1 -0
- package/dist/utils/color.d.ts +20 -0
- package/dist/utils/color.d.ts.map +1 -0
- package/dist/utils/config-json.d.ts +14 -0
- package/dist/utils/config-json.d.ts.map +1 -0
- package/dist/utils/context-evidence.d.ts +47 -0
- package/dist/utils/context-evidence.d.ts.map +1 -0
- package/dist/utils/deep-merge.d.ts +64 -0
- package/dist/utils/deep-merge.d.ts.map +1 -0
- package/dist/utils/diff.d.ts +11 -0
- package/dist/utils/diff.d.ts.map +1 -0
- package/dist/utils/error.d.ts +2 -3
- package/dist/utils/error.d.ts.map +1 -0
- package/dist/utils/error.js +3 -3
- package/dist/utils/error.js.map +7 -1
- package/dist/utils/expect-defined.d.ts +2 -3
- package/dist/utils/expect-defined.d.ts.map +1 -0
- package/dist/utils/expect-defined.js +3 -3
- package/dist/utils/expect-defined.js.map +7 -1
- package/dist/utils/glob-expand.d.ts +10 -0
- package/dist/utils/glob-expand.d.ts.map +1 -0
- package/dist/utils/glob-match.d.ts +4 -0
- package/dist/utils/glob-match.d.ts.map +1 -0
- package/dist/utils/index.d.ts +37 -920
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +242 -33
- package/dist/utils/index.js.map +7 -1
- package/dist/utils/instruction-file.d.ts +3 -0
- package/dist/utils/instruction-file.d.ts.map +1 -0
- package/dist/utils/ip-guard.d.ts +34 -0
- package/dist/utils/ip-guard.d.ts.map +1 -0
- package/dist/utils/json-repair.d.ts +23 -0
- package/dist/utils/json-repair.d.ts.map +1 -0
- package/dist/utils/json-schema-validate.d.ts +42 -0
- package/dist/utils/json-schema-validate.d.ts.map +1 -0
- package/dist/utils/lru-cache.d.ts +29 -0
- package/dist/utils/lru-cache.d.ts.map +1 -0
- package/dist/utils/merge-custom-models.d.ts +12 -0
- package/dist/utils/merge-custom-models.d.ts.map +1 -0
- package/dist/utils/merge-models-payload.d.ts +20 -0
- package/dist/utils/merge-models-payload.d.ts.map +1 -0
- package/dist/utils/message-invariants.d.ts +22 -0
- package/dist/utils/message-invariants.d.ts.map +1 -0
- package/dist/utils/newline-normalize.d.ts +5 -0
- package/dist/utils/newline-normalize.d.ts.map +1 -0
- package/dist/utils/regex-guard.d.ts +21 -0
- package/dist/utils/regex-guard.d.ts.map +1 -0
- package/dist/utils/safe-json.d.ts +31 -0
- package/dist/utils/safe-json.d.ts.map +1 -0
- package/dist/utils/session-scoped-path.d.ts +13 -0
- package/dist/utils/session-scoped-path.d.ts.map +1 -0
- package/dist/utils/sleep.d.ts +5 -0
- package/dist/utils/sleep.d.ts.map +1 -0
- package/dist/utils/slug.d.ts +13 -0
- package/dist/utils/slug.d.ts.map +1 -0
- package/dist/utils/string.d.ts +9 -0
- package/dist/utils/string.d.ts.map +1 -0
- package/dist/utils/task-format.d.ts +22 -0
- package/dist/utils/task-format.d.ts.map +1 -0
- package/dist/utils/term.d.ts +133 -0
- package/dist/utils/term.d.ts.map +1 -0
- package/dist/utils/todos-format.d.ts +30 -0
- package/dist/utils/todos-format.d.ts.map +1 -0
- package/dist/utils/token-estimate.d.ts +112 -0
- package/dist/utils/token-estimate.d.ts.map +1 -0
- package/dist/utils/tool-description-mode.d.ts +28 -0
- package/dist/utils/tool-description-mode.d.ts.map +1 -0
- package/dist/utils/tool-output-serializer.d.ts +40 -0
- package/dist/utils/tool-output-serializer.d.ts.map +1 -0
- package/dist/utils/tool-result-render-mode.d.ts +55 -0
- package/dist/utils/tool-result-render-mode.d.ts.map +1 -0
- package/dist/utils/tool-subject.d.ts +5 -0
- package/dist/utils/tool-subject.d.ts.map +1 -0
- package/dist/utils/tool-wire-compact.d.ts +28 -0
- package/dist/utils/tool-wire-compact.d.ts.map +1 -0
- package/dist/utils/ulid.d.ts +11 -0
- package/dist/utils/ulid.d.ts.map +1 -0
- package/dist/{wstack-paths-C3K40Qst.d.ts → utils/wstack-paths.d.ts} +7 -8
- package/dist/utils/wstack-paths.d.ts.map +1 -0
- package/dist/worktree/index.d.ts +2 -0
- package/dist/worktree/index.d.ts.map +1 -0
- package/dist/{worktree-manager-DzwxKE35.d.ts → worktree/worktree-manager.d.ts} +19 -13
- package/dist/worktree/worktree-manager.d.ts.map +1 -0
- package/instructions/autonomy/active-mission.md +2 -4
- package/instructions/sections/tool/delegation-full.md +1 -1
- package/package.json +4 -5
- package/skills/node-modern/SKILL.md +2 -2
- package/skills/plugin-author/SKILL.md +9 -16
- package/dist/dispatcher-types.d-BBeXBQgS.d.ts +0 -66
- package/dist/global-mailbox-sZwyI6CS.d.ts +0 -959
- package/dist/index--Gm41aBJ.d.ts +0 -671
- package/dist/mcp-servers-DEV4s6Ks.d.ts +0 -259
- package/dist/multi-agent-coordinator-4RCRZKjN.d.ts +0 -1770
- package/dist/null-fleet-bus-CFoNVQEK.d.ts +0 -2127
- package/dist/pipeline-DGDyIohT.d.ts +0 -331
- package/dist/provider-model-resolve-o2hHLs79.d.ts +0 -263
- package/dist/secret-scrubber-3MHDDAtm.d.ts +0 -6
- package/dist/secret-vault-DxohkUBc.d.ts +0 -272
- package/dist/session-reader-7Esxrkpw.d.ts +0 -155
- package/dist/task-format-GX0B1mMC.d.ts +0 -23
- package/dist/todos-checkpoint-FY7PjmMx.d.ts +0 -850
- package/dist/tool-BNlnIJvo.d.ts +0 -2190
- package/dist/tool-executor-CckSCM5E.d.ts +0 -906
|
@@ -1,959 +0,0 @@
|
|
|
1
|
-
import { M as MailboxMessage, a as MailboxAgentStatus, b as Mailbox, c as MailboxSendInput, d as MailboxQuery, e as MailboxAckInput, f as MailboxAckBatchInput, A as AgentRegistrationInput, g as AgentHeartbeatInput, C as ClientRegistrationInput, h as ClientHeartbeatInput, i as ClientStatus, P as PurgeOptions, j as PurgeResult } from './mailbox-types-BGZWrYTJ.js';
|
|
2
|
-
import { E as EventBus } from './events-Bgnh43r9.js';
|
|
3
|
-
|
|
4
|
-
declare const HQ_PROTOCOL_VERSION: 1;
|
|
5
|
-
type HqProtocolVersion = typeof HQ_PROTOCOL_VERSION;
|
|
6
|
-
type HqClientKind = 'tui' | 'repl' | 'webui' | 'cli' | 'unknown';
|
|
7
|
-
type HqWorkspaceKind = 'git' | 'directory' | 'unknown';
|
|
8
|
-
type HqProjectStatus = 'active' | 'idle' | 'stale' | 'error';
|
|
9
|
-
type HqClientCapability = 'telemetry.publish' | 'session.summary' | 'fleet.summary' | 'mailbox.summary' | 'control.receive';
|
|
10
|
-
type HqToolArgsPolicy = 'none' | 'summary' | 'redacted';
|
|
11
|
-
type HqPathPolicy = 'none' | 'project-relative' | 'redacted' | 'full';
|
|
12
|
-
interface HqRedactionPolicy {
|
|
13
|
-
rawContent: boolean;
|
|
14
|
-
toolArgs: HqToolArgsPolicy;
|
|
15
|
-
paths: HqPathPolicy;
|
|
16
|
-
}
|
|
17
|
-
declare const DEFAULT_HQ_REDACTION_POLICY: HqRedactionPolicy;
|
|
18
|
-
interface HqClientIdentity {
|
|
19
|
-
clientId: string;
|
|
20
|
-
kind: HqClientKind;
|
|
21
|
-
version?: string;
|
|
22
|
-
machineId: string;
|
|
23
|
-
hostname?: string;
|
|
24
|
-
pid?: number;
|
|
25
|
-
startedAt: string;
|
|
26
|
-
}
|
|
27
|
-
interface HqProjectIdentity {
|
|
28
|
-
projectId: string;
|
|
29
|
-
projectRoot: string;
|
|
30
|
-
projectName: string;
|
|
31
|
-
gitRemote?: string;
|
|
32
|
-
gitBranch?: string;
|
|
33
|
-
machineId: string;
|
|
34
|
-
workspaceKind: HqWorkspaceKind;
|
|
35
|
-
}
|
|
36
|
-
interface HqClientHelloPayload {
|
|
37
|
-
protocolVersion: HqProtocolVersion;
|
|
38
|
-
client: HqClientIdentity;
|
|
39
|
-
project: HqProjectIdentity;
|
|
40
|
-
capabilities: readonly HqClientCapability[];
|
|
41
|
-
}
|
|
42
|
-
interface HqWelcomePayload {
|
|
43
|
-
type: 'hq.welcome';
|
|
44
|
-
protocolVersion: HqProtocolVersion;
|
|
45
|
-
serverTime: string;
|
|
46
|
-
acceptedCapabilities: readonly HqClientCapability[];
|
|
47
|
-
redactionPolicy: HqRedactionPolicy;
|
|
48
|
-
}
|
|
49
|
-
interface HqEventEnvelope<TPayload = unknown> {
|
|
50
|
-
id: string;
|
|
51
|
-
type: HqEventType | (string & {});
|
|
52
|
-
schemaVersion: HqProtocolVersion;
|
|
53
|
-
timestamp: string;
|
|
54
|
-
clientId: string;
|
|
55
|
-
projectId: string;
|
|
56
|
-
sessionId?: string;
|
|
57
|
-
runId?: string;
|
|
58
|
-
seq: number;
|
|
59
|
-
payload: TPayload;
|
|
60
|
-
}
|
|
61
|
-
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';
|
|
62
|
-
interface HqClientHeartbeatPayload {
|
|
63
|
-
uptimeMs: number;
|
|
64
|
-
activeSessionId?: string;
|
|
65
|
-
activeRunId?: string;
|
|
66
|
-
status: HqProjectStatus;
|
|
67
|
-
activeSubagents?: number;
|
|
68
|
-
queuedTasks?: number;
|
|
69
|
-
}
|
|
70
|
-
type HqSessionStatus = 'idle' | 'running' | 'paused' | 'completed' | 'failed';
|
|
71
|
-
interface HqSessionStartedPayload {
|
|
72
|
-
sessionId: string;
|
|
73
|
-
provider?: string;
|
|
74
|
-
model?: string;
|
|
75
|
-
startedAt: string;
|
|
76
|
-
}
|
|
77
|
-
interface HqSessionStatusPayload {
|
|
78
|
-
status: HqSessionStatus;
|
|
79
|
-
phase?: string;
|
|
80
|
-
message?: string;
|
|
81
|
-
}
|
|
82
|
-
interface HqUsagePayload {
|
|
83
|
-
inputTokens?: number;
|
|
84
|
-
outputTokens?: number;
|
|
85
|
-
totalTokens?: number;
|
|
86
|
-
costUsd?: number;
|
|
87
|
-
durationMs?: number;
|
|
88
|
-
}
|
|
89
|
-
interface HqToolStartedPayload {
|
|
90
|
-
toolName: string;
|
|
91
|
-
capabilities?: readonly string[];
|
|
92
|
-
risk?: string;
|
|
93
|
-
inputSummary?: unknown;
|
|
94
|
-
}
|
|
95
|
-
interface HqToolCompletedPayload {
|
|
96
|
-
toolName: string;
|
|
97
|
-
status: 'success' | 'error' | 'timeout' | 'cancelled';
|
|
98
|
-
durationMs: number;
|
|
99
|
-
outputSummary?: unknown;
|
|
100
|
-
errorClass?: string;
|
|
101
|
-
}
|
|
102
|
-
interface HqSubagentSummary {
|
|
103
|
-
subagentId: string;
|
|
104
|
-
role?: string;
|
|
105
|
-
status: 'pending' | 'running' | 'idle' | 'completed' | 'failed' | 'stopped';
|
|
106
|
-
task?: string;
|
|
107
|
-
currentTool?: string;
|
|
108
|
-
runtimeMs?: number;
|
|
109
|
-
costUsd?: number;
|
|
110
|
-
lastActivityAt?: string;
|
|
111
|
-
}
|
|
112
|
-
interface HqFleetSnapshotPayload {
|
|
113
|
-
runId: string;
|
|
114
|
-
activeSubagents: number;
|
|
115
|
-
queuedTasks: number;
|
|
116
|
-
completedTasks: number;
|
|
117
|
-
failedTasks: number;
|
|
118
|
-
totalCostUsd?: number;
|
|
119
|
-
subagents: readonly HqSubagentSummary[];
|
|
120
|
-
}
|
|
121
|
-
/** Payload for `agent.message` events — a subagent's conversational output. */
|
|
122
|
-
interface HqAgentMessagePayload {
|
|
123
|
-
subagentId: string;
|
|
124
|
-
agentName: string;
|
|
125
|
-
content: string;
|
|
126
|
-
kind: 'text' | 'thinking' | 'tool_use' | 'tool_result' | 'error' | 'status' | 'system';
|
|
127
|
-
iteration: number;
|
|
128
|
-
ts: string;
|
|
129
|
-
toolName?: string;
|
|
130
|
-
costUsd?: number;
|
|
131
|
-
}
|
|
132
|
-
/** Payload for `agent.status` events — a subagent's lifecycle transition. */
|
|
133
|
-
interface HqAgentStatusPayload {
|
|
134
|
-
subagentId: string;
|
|
135
|
-
agentName: string;
|
|
136
|
-
status: 'spawned' | 'running' | 'completed' | 'failed' | 'timeout' | 'stopped' | 'budget_exhausted';
|
|
137
|
-
ts: string;
|
|
138
|
-
summary?: string;
|
|
139
|
-
task?: string;
|
|
140
|
-
}
|
|
141
|
-
interface HqFleetEventPayload {
|
|
142
|
-
runId: string;
|
|
143
|
-
subagentId?: string;
|
|
144
|
-
event: string;
|
|
145
|
-
summary?: string;
|
|
146
|
-
data?: unknown;
|
|
147
|
-
}
|
|
148
|
-
type HqBrainEventKind = 'decision_requested' | 'decision_answered' | 'decision_ask_human' | 'human_answered' | 'decision_denied' | 'intervention';
|
|
149
|
-
interface HqBrainEventPayload {
|
|
150
|
-
/** Which brain lifecycle event this is (mirrors the EventBus `brain.*` name suffix). */
|
|
151
|
-
kind: HqBrainEventKind;
|
|
152
|
-
/** The decision request id, when present (decision_request/answer/deny). */
|
|
153
|
-
requestId?: string;
|
|
154
|
-
/** Short human-readable question the brain was asked. */
|
|
155
|
-
question?: string;
|
|
156
|
-
/** The source that triggered the decision (e.g. 'autonomy', 'system'). */
|
|
157
|
-
source?: string;
|
|
158
|
-
/** Resolved risk tier, when known (e.g. 'low' | 'medium' | 'high'). */
|
|
159
|
-
risk?: string;
|
|
160
|
-
/** The chosen decision kind, when answered/denied (e.g. 'answer' | 'ask_human' | 'deny'). */
|
|
161
|
-
decision?: string;
|
|
162
|
-
/** Free-text rationale or answer payload, when present. */
|
|
163
|
-
detail?: string;
|
|
164
|
-
/** For `intervention`: the watched signal that engaged the brain. */
|
|
165
|
-
interventionKind?: 'tool_failure_streak' | 'error_storm';
|
|
166
|
-
/** For `intervention`: true when a steer was actually delivered to the agent. */
|
|
167
|
-
intervened?: boolean;
|
|
168
|
-
/** Epoch milliseconds at which the event occurred. */
|
|
169
|
-
at: number;
|
|
170
|
-
}
|
|
171
|
-
type HqWorktreeEventKind = 'allocated' | 'committed' | 'merged' | 'conflict' | 'released' | 'failed';
|
|
172
|
-
interface HqWorktreeEventPayload {
|
|
173
|
-
/** Which worktree lifecycle event this is (mirrors `worktree.<kind>`). */
|
|
174
|
-
kind: HqWorktreeEventKind;
|
|
175
|
-
handleId: string;
|
|
176
|
-
ownerId: string;
|
|
177
|
-
ownerLabel?: string;
|
|
178
|
-
slug?: string;
|
|
179
|
-
branch?: string;
|
|
180
|
-
baseBranch?: string;
|
|
181
|
-
/** For `committed`: diff stats. */
|
|
182
|
-
insertions?: number;
|
|
183
|
-
deletions?: number;
|
|
184
|
-
files?: number;
|
|
185
|
-
sha?: string;
|
|
186
|
-
/** For `merged`: whether the merge was a squash. */
|
|
187
|
-
squash?: boolean;
|
|
188
|
-
/** For `conflict`: the list of conflicting files. */
|
|
189
|
-
conflictFiles?: readonly string[];
|
|
190
|
-
/** For `released`: whether the worktree was kept (true) or pruned (false). */
|
|
191
|
-
kept?: boolean;
|
|
192
|
-
/** For `failed`: the error message. */
|
|
193
|
-
error?: string;
|
|
194
|
-
}
|
|
195
|
-
type HqSessionLiveStatus = 'active' | 'idle' | 'closing' | 'stale';
|
|
196
|
-
type HqSessionAgentLiveStatus = 'idle' | 'running' | 'streaming' | 'waiting_user' | 'error';
|
|
197
|
-
/** A single live agent inside a session snapshot (mirrors SessionRegistry's AgentEntry). */
|
|
198
|
-
interface HqSessionAgentSummary {
|
|
199
|
-
id: string;
|
|
200
|
-
name: string;
|
|
201
|
-
/** UTC ISO timestamp when this agent/run started, when known. */
|
|
202
|
-
startedAt?: string;
|
|
203
|
-
status: HqSessionAgentLiveStatus;
|
|
204
|
-
currentTool?: string;
|
|
205
|
-
iterations: number;
|
|
206
|
-
toolCalls: number;
|
|
207
|
-
costUsd?: number;
|
|
208
|
-
tokensIn?: number;
|
|
209
|
-
tokensOut?: number;
|
|
210
|
-
ctxPct?: number;
|
|
211
|
-
model?: string;
|
|
212
|
-
/** Throttled tail of the response currently streaming, when known. */
|
|
213
|
-
partialText?: string;
|
|
214
|
-
lastActivityAt: string;
|
|
215
|
-
}
|
|
216
|
-
/** Payload for `session.snapshot` — one connected terminal's live state. */
|
|
217
|
-
interface HqSessionSnapshotPayload {
|
|
218
|
-
sessionId: string;
|
|
219
|
-
clientKind: HqClientKind;
|
|
220
|
-
machineId: string;
|
|
221
|
-
hostname?: string;
|
|
222
|
-
pid?: number;
|
|
223
|
-
projectId: string;
|
|
224
|
-
projectName: string;
|
|
225
|
-
projectRoot: string;
|
|
226
|
-
gitBranch?: string;
|
|
227
|
-
status: HqSessionLiveStatus;
|
|
228
|
-
startedAt: string;
|
|
229
|
-
lastActivityAt: string;
|
|
230
|
-
agentCount: number;
|
|
231
|
-
agents: readonly HqSessionAgentSummary[];
|
|
232
|
-
}
|
|
233
|
-
type HqTranscriptRole = 'user' | 'assistant' | 'thinking' | 'tool' | 'system' | 'error';
|
|
234
|
-
/** One rendered conversation turn. Canonical shape shared by client streaming
|
|
235
|
-
* and server-side JSONL replay so both planes agree. */
|
|
236
|
-
interface HqTranscriptEntry {
|
|
237
|
-
ts: string;
|
|
238
|
-
role: HqTranscriptRole;
|
|
239
|
-
text: string;
|
|
240
|
-
tool?: string;
|
|
241
|
-
/** Stringified tool input/arguments, for tool calls (shown alongside the result). */
|
|
242
|
-
toolInput?: string;
|
|
243
|
-
durationMs?: number;
|
|
244
|
-
isError?: boolean;
|
|
245
|
-
toolUseId?: string;
|
|
246
|
-
/** Which agent/subagent produced this turn, when attribution is known. */
|
|
247
|
-
agentId?: string;
|
|
248
|
-
}
|
|
249
|
-
/** Payload for `session.transcript` — an incremental batch of new turns. */
|
|
250
|
-
interface HqTranscriptAppendPayload {
|
|
251
|
-
sessionId: string;
|
|
252
|
-
/** Monotonic sequence index of the FIRST entry in this batch within the session. */
|
|
253
|
-
fromSeq: number;
|
|
254
|
-
entries: readonly HqTranscriptEntry[];
|
|
255
|
-
}
|
|
256
|
-
/** Payload for `session.ended` — a terminal closed. */
|
|
257
|
-
interface HqSessionEndedPayload {
|
|
258
|
-
sessionId: string;
|
|
259
|
-
endedAt: string;
|
|
260
|
-
}
|
|
261
|
-
/** A physical machine, aggregated by HQ from connected clients' machineId. */
|
|
262
|
-
interface HqMachineRecord {
|
|
263
|
-
machineId: string;
|
|
264
|
-
hostname?: string;
|
|
265
|
-
clientCount: number;
|
|
266
|
-
sessionCount: number;
|
|
267
|
-
agentCount: number;
|
|
268
|
-
projectIds: readonly string[];
|
|
269
|
-
lastActivityAt: string;
|
|
270
|
-
}
|
|
271
|
-
type HqMailboxMessageType = 'note' | 'ask' | 'assign' | 'steer' | 'btw' | 'broadcast' | 'status' | 'result' | 'review' | 'control';
|
|
272
|
-
type HqMailboxPriority = 'low' | 'normal' | 'high';
|
|
273
|
-
type HqMailboxAgentStatus = 'idle' | 'running' | 'streaming' | 'waiting_user' | 'error' | 'offline';
|
|
274
|
-
interface HqMailboxMessageSummary {
|
|
275
|
-
mailId: string;
|
|
276
|
-
messageId: string;
|
|
277
|
-
from: string;
|
|
278
|
-
to: string;
|
|
279
|
-
type: HqMailboxMessageType;
|
|
280
|
-
subject: string;
|
|
281
|
-
priority: HqMailboxPriority;
|
|
282
|
-
timestamp: string;
|
|
283
|
-
replyTo?: string;
|
|
284
|
-
senderSessionId?: string;
|
|
285
|
-
completed: boolean;
|
|
286
|
-
completedBy?: string;
|
|
287
|
-
completedAt?: string;
|
|
288
|
-
unreadCount?: number;
|
|
289
|
-
readCount?: number;
|
|
290
|
-
hasBody: boolean;
|
|
291
|
-
bodyPreview?: string;
|
|
292
|
-
outcomePreview?: string;
|
|
293
|
-
task?: {
|
|
294
|
-
taskId?: string;
|
|
295
|
-
agentRole?: string;
|
|
296
|
-
agentName?: string;
|
|
297
|
-
status?: 'pending' | 'in_progress' | 'completed' | 'failed';
|
|
298
|
-
};
|
|
299
|
-
}
|
|
300
|
-
interface HqMailboxAgentSummary {
|
|
301
|
-
agentId: string;
|
|
302
|
-
name: string;
|
|
303
|
-
role?: string;
|
|
304
|
-
sessionId: string;
|
|
305
|
-
status: HqMailboxAgentStatus;
|
|
306
|
-
currentTool?: string;
|
|
307
|
-
currentTask?: string;
|
|
308
|
-
iterations: number;
|
|
309
|
-
toolCalls: number;
|
|
310
|
-
lastActivityAt: string;
|
|
311
|
-
lastSeenAt: string;
|
|
312
|
-
online: boolean;
|
|
313
|
-
source?: 'cli' | 'webui' | 'mcp' | 'acp' | 'http';
|
|
314
|
-
}
|
|
315
|
-
interface HqMailboxSnapshotPayload {
|
|
316
|
-
mailboxId: string;
|
|
317
|
-
scope: 'project' | 'global';
|
|
318
|
-
messages: readonly HqMailboxMessageSummary[];
|
|
319
|
-
agents: readonly HqMailboxAgentSummary[];
|
|
320
|
-
totals: {
|
|
321
|
-
messages: number;
|
|
322
|
-
unread: number;
|
|
323
|
-
incomplete: number;
|
|
324
|
-
highPriority: number;
|
|
325
|
-
onlineAgents: number;
|
|
326
|
-
};
|
|
327
|
-
}
|
|
328
|
-
interface HqMailboxEventPayload {
|
|
329
|
-
mailboxId: string;
|
|
330
|
-
action: 'message.sent' | 'message.read' | 'message.completed' | 'message.updated' | 'agent.registered' | 'agent.heartbeat' | 'agent.offline' | 'agent.deregistered';
|
|
331
|
-
message?: HqMailboxMessageSummary;
|
|
332
|
-
agent?: HqMailboxAgentSummary;
|
|
333
|
-
summary?: string;
|
|
334
|
-
}
|
|
335
|
-
interface HqWorklistSnapshotPayload {
|
|
336
|
-
todos?: HqWorklistCounts;
|
|
337
|
-
tasks?: HqWorklistCounts;
|
|
338
|
-
plans?: HqWorklistCounts;
|
|
339
|
-
activeItem?: string;
|
|
340
|
-
}
|
|
341
|
-
interface HqWorklistCounts {
|
|
342
|
-
total: number;
|
|
343
|
-
pending: number;
|
|
344
|
-
inProgress: number;
|
|
345
|
-
completed: number;
|
|
346
|
-
failed?: number;
|
|
347
|
-
}
|
|
348
|
-
interface HqGitSnapshotPayload {
|
|
349
|
-
branch?: string;
|
|
350
|
-
dirtyFiles?: number;
|
|
351
|
-
stagedFiles?: number;
|
|
352
|
-
ahead?: number;
|
|
353
|
-
behind?: number;
|
|
354
|
-
}
|
|
355
|
-
interface HqClientRecord {
|
|
356
|
-
clientId: string;
|
|
357
|
-
kind: HqClientKind;
|
|
358
|
-
machineId: string;
|
|
359
|
-
hostname?: string;
|
|
360
|
-
pid?: number;
|
|
361
|
-
version?: string;
|
|
362
|
-
connected: boolean;
|
|
363
|
-
connectedAt?: string;
|
|
364
|
-
lastSeenAt: string;
|
|
365
|
-
projectId: string;
|
|
366
|
-
sessionId?: string;
|
|
367
|
-
capabilities: readonly HqClientCapability[];
|
|
368
|
-
}
|
|
369
|
-
interface HqProjectRecord {
|
|
370
|
-
projectId: string;
|
|
371
|
-
projectName: string;
|
|
372
|
-
projectRootDisplay: string;
|
|
373
|
-
machineIds: readonly string[];
|
|
374
|
-
gitBranch?: string;
|
|
375
|
-
activeClients: number;
|
|
376
|
-
activeSessions: number;
|
|
377
|
-
activeSubagents: number;
|
|
378
|
-
totalCostUsd: number;
|
|
379
|
-
lastActivityAt: string;
|
|
380
|
-
status: HqProjectStatus;
|
|
381
|
-
}
|
|
382
|
-
interface HqSessionSummary {
|
|
383
|
-
sessionId: string;
|
|
384
|
-
projectId: string;
|
|
385
|
-
clientId: string;
|
|
386
|
-
status: HqSessionStatus;
|
|
387
|
-
provider?: string;
|
|
388
|
-
model?: string;
|
|
389
|
-
startedAt?: string;
|
|
390
|
-
lastActivityAt: string;
|
|
391
|
-
costUsd?: number;
|
|
392
|
-
}
|
|
393
|
-
interface HqFleetSummary {
|
|
394
|
-
runId: string;
|
|
395
|
-
projectId: string;
|
|
396
|
-
clientId: string;
|
|
397
|
-
activeSubagents: number;
|
|
398
|
-
queuedTasks: number;
|
|
399
|
-
completedTasks: number;
|
|
400
|
-
failedTasks: number;
|
|
401
|
-
totalCostUsd?: number;
|
|
402
|
-
lastActivityAt: string;
|
|
403
|
-
}
|
|
404
|
-
interface HqMailboxSummary {
|
|
405
|
-
mailboxId: string;
|
|
406
|
-
projectId: string;
|
|
407
|
-
scope: 'project' | 'global';
|
|
408
|
-
messageCount: number;
|
|
409
|
-
unreadCount: number;
|
|
410
|
-
incompleteCount: number;
|
|
411
|
-
highPriorityCount: number;
|
|
412
|
-
onlineAgentCount: number;
|
|
413
|
-
lastActivityAt: string;
|
|
414
|
-
}
|
|
415
|
-
interface HqSnapshot {
|
|
416
|
-
generatedAt: string;
|
|
417
|
-
clients: readonly HqClientRecord[];
|
|
418
|
-
projects: readonly HqProjectRecord[];
|
|
419
|
-
sessions: readonly HqSessionSummary[];
|
|
420
|
-
fleets: readonly HqFleetSummary[];
|
|
421
|
-
mailboxes: readonly HqMailboxSummary[];
|
|
422
|
-
/** Physical machines aggregated from connected clients (optional, additive). */
|
|
423
|
-
machines?: readonly HqMachineRecord[];
|
|
424
|
-
/** Live terminal sessions with their agents — the spine of the fleet tree. */
|
|
425
|
-
liveSessions?: readonly HqSessionSnapshotPayload[];
|
|
426
|
-
totals: {
|
|
427
|
-
activeProjects: number;
|
|
428
|
-
activeClients: number;
|
|
429
|
-
activeSessions: number;
|
|
430
|
-
activeSubagents: number;
|
|
431
|
-
unreadMailboxMessages: number;
|
|
432
|
-
incompleteMailboxMessages: number;
|
|
433
|
-
totalCostUsd: number;
|
|
434
|
-
/** Distinct physical machines currently connected. */
|
|
435
|
-
activeMachines?: number;
|
|
436
|
-
/** Total live agents across all sessions. */
|
|
437
|
-
activeAgents?: number;
|
|
438
|
-
};
|
|
439
|
-
}
|
|
440
|
-
interface HqBrowserSnapshotMessage {
|
|
441
|
-
type: 'hq.snapshot';
|
|
442
|
-
snapshot: HqSnapshot;
|
|
443
|
-
}
|
|
444
|
-
interface HqBrowserEventMessage<TPayload = unknown> {
|
|
445
|
-
type: 'hq.event';
|
|
446
|
-
event: HqEventEnvelope<TPayload>;
|
|
447
|
-
}
|
|
448
|
-
interface HqAlertMessage {
|
|
449
|
-
type: 'hq.alert';
|
|
450
|
-
severity: 'info' | 'warn' | 'error';
|
|
451
|
-
message: string;
|
|
452
|
-
timestamp: string;
|
|
453
|
-
}
|
|
454
|
-
type HqBrowserMessage = HqBrowserSnapshotMessage | HqBrowserEventMessage | HqAlertMessage;
|
|
455
|
-
interface HqClientHelloMessage {
|
|
456
|
-
type: 'client.hello';
|
|
457
|
-
payload: HqClientHelloPayload;
|
|
458
|
-
}
|
|
459
|
-
interface HqClientEventMessage<TPayload = unknown> {
|
|
460
|
-
type: 'client.event';
|
|
461
|
-
event: HqEventEnvelope<TPayload>;
|
|
462
|
-
}
|
|
463
|
-
interface HqClientCommandPollMessage {
|
|
464
|
-
type: 'client.command_poll';
|
|
465
|
-
clientId: string;
|
|
466
|
-
projectId: string;
|
|
467
|
-
afterCommandId?: string;
|
|
468
|
-
limit?: number;
|
|
469
|
-
}
|
|
470
|
-
interface HqClientCommandAckMessage {
|
|
471
|
-
type: 'client.command_ack';
|
|
472
|
-
clientId: string;
|
|
473
|
-
projectId: string;
|
|
474
|
-
commandId: string;
|
|
475
|
-
status: 'accepted' | 'completed' | 'failed' | 'rejected';
|
|
476
|
-
message?: string;
|
|
477
|
-
}
|
|
478
|
-
interface HqQueuedCommand {
|
|
479
|
-
commandId: string;
|
|
480
|
-
type: string;
|
|
481
|
-
createdAt: string;
|
|
482
|
-
payload: unknown;
|
|
483
|
-
requiresAck?: boolean;
|
|
484
|
-
}
|
|
485
|
-
interface HqServerCommandBatchMessage {
|
|
486
|
-
type: 'hq.command_batch';
|
|
487
|
-
commands: readonly HqQueuedCommand[];
|
|
488
|
-
}
|
|
489
|
-
type HqClientMessage = HqClientHelloMessage | HqClientEventMessage | HqClientCommandPollMessage | HqClientCommandAckMessage;
|
|
490
|
-
type HqServerMessage = HqServerCommandBatchMessage | HqWelcomePayload;
|
|
491
|
-
/**
|
|
492
|
-
* Discriminated parse result for {@link parseHqFrame}. The `reason` field
|
|
493
|
-
* is only present when `ok` is `false`; consumers should narrow on `ok`
|
|
494
|
-
* before accessing `frame` or `reason`.
|
|
495
|
-
*/
|
|
496
|
-
type HqParseResult = {
|
|
497
|
-
ok: true;
|
|
498
|
-
frame: HqClientMessage;
|
|
499
|
-
} | {
|
|
500
|
-
ok: false;
|
|
501
|
-
reason: 'invalid-json' | 'unknown-type' | 'malformed';
|
|
502
|
-
};
|
|
503
|
-
/**
|
|
504
|
-
* Strictly parse a raw client → server frame into a {@link HqParseResult}.
|
|
505
|
-
*
|
|
506
|
-
* Validates, in order:
|
|
507
|
-
* 1. JSON syntax (`invalid-json` on failure)
|
|
508
|
-
* 2. Top-level object with string `type` discriminator
|
|
509
|
-
* 3. `type` is one of {@link HqClientMessage} union members (`unknown-type`)
|
|
510
|
-
* 4. Per-type field-shape presence checks (`malformed` on failure)
|
|
511
|
-
*
|
|
512
|
-
* On success, `frame` is narrowed to {@link HqClientMessage} and consumers
|
|
513
|
-
* can switch on `frame.type` for type-safe access to per-union-member
|
|
514
|
-
* fields without `as` casts.
|
|
515
|
-
*/
|
|
516
|
-
declare function parseHqFrame(raw: string | Buffer): HqParseResult;
|
|
517
|
-
/**
|
|
518
|
-
* Validate the `payload` field of a {@link HqEventEnvelope} for known
|
|
519
|
-
* event types. Returns `{ ok: true, payload }` with a narrowed payload
|
|
520
|
-
* type when the event type has a registered shape guard and the payload
|
|
521
|
-
* matches it; `{ ok: true, payload: unknown }` for event types that the
|
|
522
|
-
* server does not yet validate; or `{ ok: false, reason }` when the
|
|
523
|
-
* payload fails the registered guard.
|
|
524
|
-
*
|
|
525
|
-
* Use this after {@link parseHqFrame} has produced a valid frame, when
|
|
526
|
-
* the frame is `client.event` and the server is about to consume the
|
|
527
|
-
* event payload.
|
|
528
|
-
*/
|
|
529
|
-
type HqEventPayloadResult<T> = {
|
|
530
|
-
ok: true;
|
|
531
|
-
payload: T;
|
|
532
|
-
} | {
|
|
533
|
-
ok: false;
|
|
534
|
-
reason: 'unknown-event-type' | 'malformed-payload';
|
|
535
|
-
};
|
|
536
|
-
declare function parseHqEventPayload(eventType: string, payload: unknown): HqEventPayloadResult<unknown>;
|
|
537
|
-
declare function createHqEventEnvelope<TPayload>(input: {
|
|
538
|
-
id: string;
|
|
539
|
-
type: HqEventType | (string & {});
|
|
540
|
-
timestamp: string;
|
|
541
|
-
clientId: string;
|
|
542
|
-
projectId: string;
|
|
543
|
-
seq: number;
|
|
544
|
-
payload: TPayload;
|
|
545
|
-
sessionId?: string;
|
|
546
|
-
runId?: string;
|
|
547
|
-
}): HqEventEnvelope<TPayload>;
|
|
548
|
-
|
|
549
|
-
interface HqMailboxMappingOptions {
|
|
550
|
-
mailboxId: string;
|
|
551
|
-
scope?: 'project' | 'global';
|
|
552
|
-
limit?: number;
|
|
553
|
-
previewLength?: number;
|
|
554
|
-
redactionPolicy?: Partial<HqRedactionPolicy>;
|
|
555
|
-
}
|
|
556
|
-
interface HqMailboxSnapshotOptions extends HqMailboxMappingOptions {
|
|
557
|
-
includeCompleted?: boolean;
|
|
558
|
-
}
|
|
559
|
-
type HqMailboxEventAction = HqMailboxEventPayload['action'];
|
|
560
|
-
declare function mapMailboxMessageToHqSummary(message: MailboxMessage, options?: Pick<HqMailboxMappingOptions, 'previewLength' | 'redactionPolicy'>): HqMailboxMessageSummary;
|
|
561
|
-
declare function mapMailboxAgentToHqSummary(agent: MailboxAgentStatus): HqMailboxAgentSummary;
|
|
562
|
-
declare function createMailboxSnapshotPayload(messages: readonly MailboxMessage[], agents: readonly MailboxAgentStatus[], options: HqMailboxSnapshotOptions): HqMailboxSnapshotPayload;
|
|
563
|
-
declare function createMailboxSnapshotPayloadFromMailbox(mailbox: Pick<Mailbox, 'query' | 'getAgentStatuses'>, options: HqMailboxSnapshotOptions): Promise<HqMailboxSnapshotPayload>;
|
|
564
|
-
declare function createMailboxEventPayload(input: {
|
|
565
|
-
mailboxId: string;
|
|
566
|
-
action: HqMailboxEventAction;
|
|
567
|
-
message?: MailboxMessage;
|
|
568
|
-
agent?: MailboxAgentStatus;
|
|
569
|
-
summary?: string;
|
|
570
|
-
previewLength?: number;
|
|
571
|
-
redactionPolicy?: Partial<HqRedactionPolicy>;
|
|
572
|
-
}): HqMailboxEventPayload;
|
|
573
|
-
|
|
574
|
-
interface HqSocketLike {
|
|
575
|
-
readyState: number;
|
|
576
|
-
send(data: string): void;
|
|
577
|
-
close(code?: number, reason?: string): void;
|
|
578
|
-
addEventListener?(type: 'open' | 'close' | 'error' | 'message', listener: (event: unknown) => void): void;
|
|
579
|
-
removeEventListener?(type: 'open' | 'close' | 'error' | 'message', listener: (event: unknown) => void): void;
|
|
580
|
-
on?(type: 'open' | 'close' | 'error' | 'message', listener: (event: unknown) => void): void;
|
|
581
|
-
off?(type: 'open' | 'close' | 'error' | 'message', listener: (event: unknown) => void): void;
|
|
582
|
-
}
|
|
583
|
-
type HqSocketFactory = (url: string, init: {
|
|
584
|
-
token?: string;
|
|
585
|
-
}) => HqSocketLike;
|
|
586
|
-
interface HqPublisherCommandResult {
|
|
587
|
-
commandId: string;
|
|
588
|
-
status: 'accepted' | 'completed' | 'failed' | 'rejected';
|
|
589
|
-
message?: string;
|
|
590
|
-
}
|
|
591
|
-
type HqPublisherCommandHandler = (command: HqQueuedCommand) => void | HqPublisherCommandResult | Promise<void | HqPublisherCommandResult>;
|
|
592
|
-
interface HqPublisherOptions {
|
|
593
|
-
url: string;
|
|
594
|
-
token?: string;
|
|
595
|
-
client: HqClientIdentity;
|
|
596
|
-
project: HqProjectIdentity;
|
|
597
|
-
capabilities?: readonly HqClientCapability[];
|
|
598
|
-
socketFactory?: HqSocketFactory;
|
|
599
|
-
now?: () => string;
|
|
600
|
-
idFactory?: () => string;
|
|
601
|
-
reconnect?: boolean;
|
|
602
|
-
reconnectBaseMs?: number;
|
|
603
|
-
reconnectMaxMs?: number;
|
|
604
|
-
maxQueuedMessages?: number;
|
|
605
|
-
redactionPolicy?: Partial<HqRedactionPolicy>;
|
|
606
|
-
commandPollIntervalMs?: number;
|
|
607
|
-
commandPollLimit?: number;
|
|
608
|
-
onCommand?: HqPublisherCommandHandler;
|
|
609
|
-
/**
|
|
610
|
-
* Local auto-discovery hook: re-resolve the HQ endpoint before EVERY
|
|
611
|
-
* connect attempt (e.g. by reading `<hq dataDir>/runtime.json`). Returning
|
|
612
|
-
* `undefined` means no HQ is currently discoverable — the publisher stays
|
|
613
|
-
* dormant (events keep queueing, bounded) and re-checks every
|
|
614
|
-
* {@link HqPublisherOptions.discoveryPollMs}. Because the endpoint is
|
|
615
|
-
* re-resolved per attempt, an HQ started AFTER this client — or restarted
|
|
616
|
-
* on a different port, or one that minted its first client token on boot —
|
|
617
|
-
* is picked up automatically.
|
|
618
|
-
*/
|
|
619
|
-
resolveEndpoint?: () => {
|
|
620
|
-
url: string;
|
|
621
|
-
token?: string | undefined;
|
|
622
|
-
} | undefined;
|
|
623
|
-
/** Dormant re-check interval while `resolveEndpoint` yields nothing. Default 5s. */
|
|
624
|
-
discoveryPollMs?: number;
|
|
625
|
-
/**
|
|
626
|
-
* Diagnostic sink for the one-time consecutive-connect-failure warning.
|
|
627
|
-
* The publisher is otherwise deliberately silent (dormant queueing), which
|
|
628
|
-
* made auth failures invisible: a token the server rejects — e.g. a wrong
|
|
629
|
-
* `WRONGSTACK_HQ_TOKEN` against a remote HQ — looked exactly like "HQ not
|
|
630
|
-
* running". Defaults to a single structured `console.warn` line.
|
|
631
|
-
*/
|
|
632
|
-
warn?: (message: string) => void;
|
|
633
|
-
}
|
|
634
|
-
interface HqPublishEventOptions {
|
|
635
|
-
type: HqEventType | (string & {});
|
|
636
|
-
payload: unknown;
|
|
637
|
-
sessionId?: string;
|
|
638
|
-
runId?: string;
|
|
639
|
-
timestamp?: string;
|
|
640
|
-
}
|
|
641
|
-
declare class HqPublisher {
|
|
642
|
-
private readonly options;
|
|
643
|
-
private readonly socketFactory;
|
|
644
|
-
private readonly now;
|
|
645
|
-
private readonly idFactory;
|
|
646
|
-
private readonly capabilities;
|
|
647
|
-
private readonly reconnect;
|
|
648
|
-
private readonly reconnectBaseMs;
|
|
649
|
-
private readonly reconnectMaxMs;
|
|
650
|
-
private readonly maxQueuedMessages;
|
|
651
|
-
private socket;
|
|
652
|
-
private seq;
|
|
653
|
-
private queue;
|
|
654
|
-
private stopped;
|
|
655
|
-
private reconnectAttempt;
|
|
656
|
-
private connectWarningEmitted;
|
|
657
|
-
private lastAttempt;
|
|
658
|
-
private reconnectTimer;
|
|
659
|
-
private commandPollTimer;
|
|
660
|
-
private lastCommandId;
|
|
661
|
-
constructor(options: HqPublisherOptions);
|
|
662
|
-
connect(): void;
|
|
663
|
-
close(): void;
|
|
664
|
-
publishEvent<TPayload>(options: HqPublishEventOptions & {
|
|
665
|
-
payload: TPayload;
|
|
666
|
-
}): HqEventEnvelope<TPayload>;
|
|
667
|
-
publishMailboxSnapshot(mailbox: Pick<Mailbox, 'query' | 'getAgentStatuses'>, options: Omit<HqMailboxSnapshotOptions, 'redactionPolicy'> & {
|
|
668
|
-
sessionId?: string;
|
|
669
|
-
timestamp?: string;
|
|
670
|
-
}): Promise<HqEventEnvelope<HqMailboxSnapshotPayload>>;
|
|
671
|
-
publishMailboxEvent(input: {
|
|
672
|
-
mailboxId: string;
|
|
673
|
-
action: HqMailboxEventAction;
|
|
674
|
-
message?: MailboxMessage;
|
|
675
|
-
agent?: MailboxAgentStatus;
|
|
676
|
-
summary?: string;
|
|
677
|
-
previewLength?: number;
|
|
678
|
-
sessionId?: string;
|
|
679
|
-
timestamp?: string;
|
|
680
|
-
}): HqEventEnvelope<HqMailboxEventPayload>;
|
|
681
|
-
/** The client identity this publisher announced (clientId, kind, machineId, …). */
|
|
682
|
-
get identity(): HqClientIdentity;
|
|
683
|
-
/** The project identity this publisher is bound to. */
|
|
684
|
-
get project(): HqProjectIdentity;
|
|
685
|
-
/** Publish a live session/terminal snapshot (state + agents). */
|
|
686
|
-
publishSessionSnapshot(payload: HqSessionSnapshotPayload, opts?: {
|
|
687
|
-
timestamp?: string;
|
|
688
|
-
}): HqEventEnvelope<HqSessionSnapshotPayload>;
|
|
689
|
-
/** Publish an incremental batch of transcript turns for a session. */
|
|
690
|
-
publishTranscriptAppend(payload: HqTranscriptAppendPayload, opts?: {
|
|
691
|
-
timestamp?: string;
|
|
692
|
-
}): HqEventEnvelope<HqTranscriptAppendPayload>;
|
|
693
|
-
/** Mark a session/terminal as ended. */
|
|
694
|
-
publishSessionEnded(payload: HqSessionEndedPayload, opts?: {
|
|
695
|
-
timestamp?: string;
|
|
696
|
-
}): HqEventEnvelope<HqSessionEndedPayload>;
|
|
697
|
-
/** Publish a fleet (multi-agent coordinator) snapshot. */
|
|
698
|
-
publishFleetSnapshot(payload: HqFleetSnapshotPayload, opts?: {
|
|
699
|
-
sessionId?: string;
|
|
700
|
-
timestamp?: string;
|
|
701
|
-
}): HqEventEnvelope<HqFleetSnapshotPayload>;
|
|
702
|
-
pollCommands(): void;
|
|
703
|
-
ackCommand(result: HqPublisherCommandResult): void;
|
|
704
|
-
private createHelloFrame;
|
|
705
|
-
private sendHelloNow;
|
|
706
|
-
private sendFrame;
|
|
707
|
-
private enqueue;
|
|
708
|
-
/** Batch-dequeue up to 50 frames at a time, yielding to the microtask
|
|
709
|
-
* queue between batches so we don't starve the event loop on reconnect. */
|
|
710
|
-
private flushQueue;
|
|
711
|
-
private startCommandPolling;
|
|
712
|
-
private stopCommandPolling;
|
|
713
|
-
private handleServerMessage;
|
|
714
|
-
private parseServerMessage;
|
|
715
|
-
private extractMessageData;
|
|
716
|
-
private handleCommandBatch;
|
|
717
|
-
private scheduleReconnect;
|
|
718
|
-
private emitConnectWarning;
|
|
719
|
-
/**
|
|
720
|
-
* Dormant re-check while no HQ endpoint is discoverable. Uses a FIXED
|
|
721
|
-
* interval (not the exponential reconnect backoff): the check is a cheap
|
|
722
|
-
* local file read, and backing off would delay attaching to an HQ the
|
|
723
|
-
* user just started — the whole point of auto-discovery.
|
|
724
|
-
*/
|
|
725
|
-
private scheduleDiscoveryPoll;
|
|
726
|
-
}
|
|
727
|
-
|
|
728
|
-
/**
|
|
729
|
-
* GlobalMailbox — project-level inter-agent mailbox with cross-session support.
|
|
730
|
-
*
|
|
731
|
-
* Stores messages at `~/.wrongstack/projects/<slug>/_mailbox.jsonl` so all
|
|
732
|
-
* sessions (terminals, WebUIs) working on the same project share one inbox.
|
|
733
|
-
*
|
|
734
|
-
* Features:
|
|
735
|
-
* - Agent registration + heartbeat (agents go stale after 60s without heartbeat)
|
|
736
|
-
* - Per-recipient read receipts (readBy[agentId] = ISO8601)
|
|
737
|
-
* - Atomic file-locking for concurrent multi-process writes
|
|
738
|
-
* - Unread count for new-mail notifications
|
|
739
|
-
* - Online agent list
|
|
740
|
-
*
|
|
741
|
-
* @module GlobalMailbox
|
|
742
|
-
*/
|
|
743
|
-
|
|
744
|
-
type HqPublisherRef = HqPublisher | (() => HqPublisher | undefined);
|
|
745
|
-
/**
|
|
746
|
-
* Derive the project-level mailbox directory path.
|
|
747
|
-
*
|
|
748
|
-
* Delegates to the CANONICAL `projectSlug()` from wstack-paths so every
|
|
749
|
-
* surface (CLI, TUI, WebUI, mailbox tool, loop checker) lands in the exact
|
|
750
|
-
* same `~/.wrongstack/projects/<slug>/` directory. A previous inline copy
|
|
751
|
-
* skipped the leading/trailing-hyphen strip, which silently split agents
|
|
752
|
-
* working on projects with non-alphanumeric name edges into TWO mailboxes.
|
|
753
|
-
*
|
|
754
|
-
* @param projectRoot — absolute path to the project root
|
|
755
|
-
* @param globalRoot — `~/.wrongstack` (or custom global root)
|
|
756
|
-
*/
|
|
757
|
-
declare function resolveProjectDir(projectRoot: string, globalRoot: string): string;
|
|
758
|
-
declare class GlobalMailbox implements Mailbox {
|
|
759
|
-
/** Path to the JSONL message file. */
|
|
760
|
-
readonly messagePath: string;
|
|
761
|
-
/** Path to the JSON agent registry file. */
|
|
762
|
-
readonly registryPath: string;
|
|
763
|
-
/** Path to the JSON client registry file. */
|
|
764
|
-
readonly clientRegistryPath: string;
|
|
765
|
-
/** Optional event bus for emitting agent registration/heartbeat events. */
|
|
766
|
-
private readonly _events?;
|
|
767
|
-
/** Optional HQ publisher for cross-project command-center telemetry. */
|
|
768
|
-
private readonly _hqPublisher?;
|
|
769
|
-
/**
|
|
770
|
-
* Local cache of the agent registry to avoid re-reading on every call.
|
|
771
|
-
* Time-bounded: the registry file is shared ACROSS PROCESSES (that's the
|
|
772
|
-
* whole point of GlobalMailbox), so a cache served forever would never see
|
|
773
|
-
* agents registered by other sessions. Writers always bypass it.
|
|
774
|
-
*/
|
|
775
|
-
private _registryCache;
|
|
776
|
-
/** When the registry cache was last refreshed from disk (epoch ms). */
|
|
777
|
-
private _registryCacheAt;
|
|
778
|
-
/**
|
|
779
|
-
* Local cache of the client registry to avoid re-reading on every call.
|
|
780
|
-
* Same reasoning as agent registry cache.
|
|
781
|
-
*/
|
|
782
|
-
private _clientRegistryCache;
|
|
783
|
-
/** When the client registry cache was last refreshed from disk (epoch ms). */
|
|
784
|
-
private _clientRegistryCacheAt;
|
|
785
|
-
/** Last time each local agent sent a heartbeat (throttle). */
|
|
786
|
-
private _lastHeartbeat;
|
|
787
|
-
/** Last time each local client sent a heartbeat (throttle). */
|
|
788
|
-
private _lastClientHeartbeat;
|
|
789
|
-
/**
|
|
790
|
-
* In-memory mirror of the JSONL message file. The mailbox is shared
|
|
791
|
-
* ACROSS PROCESSES, so reads cannot trust the cache blindly — we pair it
|
|
792
|
-
* with an mtime check. The file lock serializes every write, so a
|
|
793
|
-
* changed mtimeMs is a definitive signal that another process (or this
|
|
794
|
-
* one) wrote; an unchanged mtimeMs guarantees no write happened and the
|
|
795
|
-
* cache is current. This collapses the per-iteration `query()` cost from
|
|
796
|
-
* O(file_size) disk + parse to O(messages) in memory.
|
|
797
|
-
*/
|
|
798
|
-
private _messageCache;
|
|
799
|
-
/** mtimeMs of the file when `_messageCache` was populated. */
|
|
800
|
-
private _messageCacheMtime;
|
|
801
|
-
/** Size of the file when `_messageCache` was populated (extra guard). */
|
|
802
|
-
private _messageCacheSize;
|
|
803
|
-
/**
|
|
804
|
-
* Serializes reads of the message file so overlapping concurrent
|
|
805
|
-
* `_readMessagesCached()` calls don't both enter the incremental "file
|
|
806
|
-
* only grew" branch against the same stale `_messageCacheSize` and
|
|
807
|
-
* each push the same tail bytes onto the cache (duplicating every
|
|
808
|
-
* appended message). The chain runs each read to completion before
|
|
809
|
-
* the next starts, in issue order — readers are read-only and never
|
|
810
|
-
* conflict with each other on content, only on the cache mutation
|
|
811
|
-
* that follows the read. Pattern mirrors `DefaultMemoryStore.runSerialized`.
|
|
812
|
-
*/
|
|
813
|
-
private _readChain;
|
|
814
|
-
/**
|
|
815
|
-
* @param projectDir — `~/.wrongstack/projects/<slug>/`
|
|
816
|
-
* @param events — optional EventBus for real-time TUI/WebUI notifications
|
|
817
|
-
* @param hqPublisher — optional HQ publisher, or getter, for cross-project telemetry
|
|
818
|
-
*/
|
|
819
|
-
constructor(projectDir: string, events?: EventBus, hqPublisher?: HqPublisherRef);
|
|
820
|
-
private get hqMailboxId();
|
|
821
|
-
private get hqPublisher();
|
|
822
|
-
private publishHqMailboxEvent;
|
|
823
|
-
private publishHqMailboxSnapshot;
|
|
824
|
-
send(input: MailboxSendInput): Promise<MailboxMessage>;
|
|
825
|
-
query(q: MailboxQuery): Promise<MailboxMessage[]>;
|
|
826
|
-
ack(input: MailboxAckInput): Promise<MailboxMessage | null>;
|
|
827
|
-
ackMany(input: MailboxAckBatchInput): Promise<MailboxMessage[]>;
|
|
828
|
-
unreadCount(forAgentId: string): Promise<number>;
|
|
829
|
-
softDelete(mailId: string, by: string): Promise<MailboxMessage | null>;
|
|
830
|
-
restore(mailId: string): Promise<MailboxMessage | null>;
|
|
831
|
-
registerAgent(input: AgentRegistrationInput): Promise<void>;
|
|
832
|
-
deregisterAgent(agentId: string): Promise<void>;
|
|
833
|
-
heartbeat(input: AgentHeartbeatInput): Promise<void>;
|
|
834
|
-
getAgentStatuses(): Promise<MailboxAgentStatus[]>;
|
|
835
|
-
getOnlineAgents(): Promise<MailboxAgentStatus[]>;
|
|
836
|
-
registerClient(input: ClientRegistrationInput): Promise<void>;
|
|
837
|
-
clientHeartbeat(input: ClientHeartbeatInput): Promise<void>;
|
|
838
|
-
getClientStatuses(): Promise<ClientStatus[]>;
|
|
839
|
-
close(): Promise<void>;
|
|
840
|
-
clearAll(): Promise<void>;
|
|
841
|
-
purgeStale(opts?: PurgeOptions): Promise<PurgeResult>;
|
|
842
|
-
/**
|
|
843
|
-
* Read all messages from the JSONL file. Always reads + parses the file.
|
|
844
|
-
* Callers that can tolerate a stale-by-mtime view should use
|
|
845
|
-
* {@link _readMessagesCached}; writers that need the post-lock truth
|
|
846
|
-
* should call this directly (it's what {@link _readMessagesFresh} aliases).
|
|
847
|
-
*/
|
|
848
|
-
private _readMessages;
|
|
849
|
-
/**
|
|
850
|
-
* Read only newly-appended bytes from the file and append them to the
|
|
851
|
-
* in-memory cache. This avoids re-reading and re-parsing the entire file
|
|
852
|
-
* when another process appended messages since our last read.
|
|
853
|
-
*
|
|
854
|
-
* Only safe when the file grew in size (messages are append-only). When
|
|
855
|
-
* the file was rewritten (ack/purge changed existing content), callers
|
|
856
|
-
* must fall back to {@link _readMessages}.
|
|
857
|
-
*
|
|
858
|
-
* @returns The (now up-to-date) message cache.
|
|
859
|
-
*/
|
|
860
|
-
private _readNewMessagesOnly;
|
|
861
|
-
/** Parse a JSONL string into MailboxMessage[], including migration. */
|
|
862
|
-
private _parseLines;
|
|
863
|
-
/**
|
|
864
|
-
* Read messages, then adopt the result as the in-memory cache. Use this
|
|
865
|
-
* from writers that just took the file lock — the read reflects the
|
|
866
|
-
* authoritative post-lock state and should be served to subsequent
|
|
867
|
-
* queries without re-reading.
|
|
868
|
-
*
|
|
869
|
-
* The mtime/size are captured from the stat at read time so the cache
|
|
870
|
-
* trackers match exactly what was parsed. Writers that subsequently
|
|
871
|
-
* rewrite the file MUST re-stat after the write and re-promote with the
|
|
872
|
-
* post-write values (see ackMany / softDelete / restore / purgeStale /
|
|
873
|
-
* clearAll) — otherwise a concurrent reader misclassifies the rewrite
|
|
874
|
-
* as a "file only grew" append and corrupts the cache.
|
|
875
|
-
*/
|
|
876
|
-
private _readMessagesFresh;
|
|
877
|
-
/**
|
|
878
|
-
* Stat the message file, returning its mtimeMs and size. Returns
|
|
879
|
-
* `-1/-1` when the file does not yet exist (ENOENT) so callers can
|
|
880
|
-
* still promote a cache snapshot — the next read will re-stat and
|
|
881
|
-
* fall through to a full re-read. Call from inside the file lock so
|
|
882
|
-
* the result reflects the post-write on-disk state, not a later
|
|
883
|
-
* intermediate state from another process.
|
|
884
|
-
*/
|
|
885
|
-
private _statMessageFile;
|
|
886
|
-
/**
|
|
887
|
-
* Read messages, consulting the mtime-bounded in-memory cache first,
|
|
888
|
-
* serialized so concurrent callers don't both mutate the cache.
|
|
889
|
-
*
|
|
890
|
-
* The mailbox file is shared across processes; every `send`/`ack`/
|
|
891
|
-
* `clearAll`/`purgeStale` takes the file lock, so writes are serialized
|
|
892
|
-
* and a changed mtimeMs is a definitive freshness signal. When the
|
|
893
|
-
* stat matches the cached mtime+size we return the cached array — no
|
|
894
|
-
* file read and no JSON.parse — collapsing the per-iteration query
|
|
895
|
-
* cost on the mailbox-loop hot path.
|
|
896
|
-
*
|
|
897
|
-
* When the file only grew (new messages appended by another process),
|
|
898
|
-
* we read and parse just the tail bytes instead of the entire file.
|
|
899
|
-
* This avoids re-parsing the full 10K-message history on every check.
|
|
900
|
-
*
|
|
901
|
-
* SERIALIZATION: the actual work is chained onto `_readChain` so two
|
|
902
|
-
* overlapping calls can't both pass the `st.size > _messageCacheSize`
|
|
903
|
-
* incremental check against the same stale tracker and each push the
|
|
904
|
-
* same tail bytes onto the cache (duplicating every appended message).
|
|
905
|
-
* Readers don't conflict on file content — only on the cache mutation
|
|
906
|
-
* that follows the read — so we run them one at a time in issue order.
|
|
907
|
-
* Errors in the chain are swallowed so a failed read never poisons
|
|
908
|
-
* subsequent reads; each caller observes and re-throws its own error.
|
|
909
|
-
*/
|
|
910
|
-
private _readMessagesCached;
|
|
911
|
-
/**
|
|
912
|
-
* The un-serialized body of {@link _readMessagesCached}. Reads the
|
|
913
|
-
* message file with the mtime-bounded cache + incremental-tail
|
|
914
|
-
* optimization. Must only be called from `_readMessagesCached` so the
|
|
915
|
-
* cache mutations here don't race a sibling read.
|
|
916
|
-
*/
|
|
917
|
-
private _readMessagesCachedWork;
|
|
918
|
-
/**
|
|
919
|
-
* Replace the in-memory cache, setting the mtime/size trackers
|
|
920
|
-
* synchronously in the same step. Callers MUST pass the stat of the
|
|
921
|
-
* on-disk file state that produced `messages`.
|
|
922
|
-
*
|
|
923
|
-
* Why both are required (not fire-and-forget): `_readMessagesCached()`
|
|
924
|
-
* validates the cache against a fresh stat using these two trackers.
|
|
925
|
-
* If the cache array is updated but the trackers lag behind (e.g. via
|
|
926
|
-
* a deferred `stat().then(...)`), a concurrent reader landing in that
|
|
927
|
-
* window sees a mismatched mtime and falls into the incremental
|
|
928
|
-
* "file only grew" branch — parsing rewritten bytes as an appended
|
|
929
|
-
* tail and corrupting the cache with duplicates/garbage. So both
|
|
930
|
-
* values are captured under the file lock and applied synchronously
|
|
931
|
-
* here, matching the fix already shipped in DefaultMailbox.
|
|
932
|
-
*/
|
|
933
|
-
private _setMessageCache;
|
|
934
|
-
/**
|
|
935
|
-
* Append a single just-sent message to the in-memory cache without
|
|
936
|
-
* re-reading the file. The caller must hold the file lock (or have
|
|
937
|
-
* just released it after a successful append) and MUST pass the
|
|
938
|
-
* post-append stat so the mtime/size trackers advance in lock-step
|
|
939
|
-
* with the pushed content.
|
|
940
|
-
*
|
|
941
|
-
* Why the stat is required here: without it, `_messageCacheSize`
|
|
942
|
-
* stays at the pre-append value. A concurrent `_readMessagesCached()`
|
|
943
|
-
* then sees `st.size > _messageCacheSize` (the file did grow), takes
|
|
944
|
-
* the incremental branch, and re-reads the just-appended tail —
|
|
945
|
-
* pushing the same message onto the cache a second time. Setting the
|
|
946
|
-
* trackers here closes that window for the local-process append path.
|
|
947
|
-
*/
|
|
948
|
-
private _pushToCache;
|
|
949
|
-
private _ensureRegistry;
|
|
950
|
-
private _readRegistry;
|
|
951
|
-
private _pruneStaleInPlace;
|
|
952
|
-
private _writeRegistry;
|
|
953
|
-
private _ensureClientRegistry;
|
|
954
|
-
private _readClientRegistry;
|
|
955
|
-
private _pruneStaleClientsInPlace;
|
|
956
|
-
private _writeClientRegistry;
|
|
957
|
-
}
|
|
958
|
-
|
|
959
|
-
export { type HqRedactionPolicy as $, type HqMachineRecord as A, type HqMailboxAgentStatus as B, type HqMailboxAgentSummary as C, DEFAULT_HQ_REDACTION_POLICY as D, type HqMailboxEventAction as E, type HqMailboxEventPayload as F, GlobalMailbox as G, HQ_PROTOCOL_VERSION as H, type HqMailboxMappingOptions as I, type HqMailboxMessageSummary as J, type HqMailboxMessageType as K, type HqMailboxPriority as L, type HqMailboxSnapshotOptions as M, type HqMailboxSnapshotPayload as N, type HqMailboxSummary as O, type HqParseResult as P, type HqPathPolicy as Q, type HqProjectIdentity as R, type HqProjectRecord as S, type HqProjectStatus as T, type HqProtocolVersion as U, type HqPublishEventOptions as V, HqPublisher as W, type HqPublisherCommandHandler as X, type HqPublisherCommandResult as Y, type HqPublisherOptions as Z, type HqQueuedCommand as _, type HqAgentMessagePayload as a, type HqServerCommandBatchMessage as a0, type HqServerMessage as a1, type HqSessionAgentLiveStatus as a2, type HqSessionAgentSummary as a3, type HqSessionEndedPayload as a4, type HqSessionLiveStatus as a5, type HqSessionSnapshotPayload as a6, type HqSessionStartedPayload as a7, type HqSessionStatus as a8, type HqSessionStatusPayload as a9, resolveProjectDir as aA, type HqSessionSummary as aa, type HqSnapshot as ab, type HqSocketFactory as ac, type HqSocketLike as ad, type HqSubagentSummary as ae, type HqToolArgsPolicy as af, type HqToolCompletedPayload as ag, type HqToolStartedPayload as ah, type HqTranscriptAppendPayload as ai, type HqTranscriptEntry as aj, type HqTranscriptRole as ak, type HqUsagePayload as al, type HqWelcomePayload as am, type HqWorklistCounts as an, type HqWorklistSnapshotPayload as ao, type HqWorkspaceKind as ap, type HqWorktreeEventKind as aq, type HqWorktreeEventPayload as ar, createHqEventEnvelope as as, createMailboxEventPayload as at, createMailboxSnapshotPayload as au, createMailboxSnapshotPayloadFromMailbox as av, mapMailboxAgentToHqSummary as aw, mapMailboxMessageToHqSummary as ax, parseHqEventPayload as ay, parseHqFrame as az, type HqAgentStatusPayload as b, type HqAlertMessage as c, type HqBrainEventKind as d, type HqBrainEventPayload as e, type HqBrowserEventMessage as f, type HqBrowserMessage as g, type HqBrowserSnapshotMessage as h, type HqClientCapability as i, type HqClientCommandAckMessage as j, type HqClientCommandPollMessage as k, type HqClientEventMessage as l, type HqClientHeartbeatPayload as m, type HqClientHelloMessage as n, type HqClientHelloPayload as o, type HqClientIdentity as p, type HqClientKind as q, type HqClientMessage as r, type HqClientRecord as s, type HqEventEnvelope as t, type HqEventPayloadResult as u, type HqEventType as v, type HqFleetEventPayload as w, type HqFleetSnapshotPayload as x, type HqFleetSummary as y, type HqGitSnapshotPayload as z };
|