@wrongstack/core 0.296.4 → 0.298.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/chronicle/index.js +126 -22
- package/dist/chronicle/project-server-client.d.ts +12 -0
- package/dist/chronicle/project-server-protocol.d.ts +22 -0
- package/dist/chronicle/project-server.js +1076 -283
- package/dist/coordination/agents/index.js +136 -1
- package/dist/coordination/agents/role-skills.d.ts +3 -2
- package/dist/coordination/brain-cache.d.ts +14 -0
- package/dist/coordination/brain-trace.d.ts +2 -1
- package/dist/coordination/director/director-task-registry.d.ts +12 -0
- package/dist/coordination/fleet-supervisor.d.ts +21 -0
- package/dist/coordination/index.d.ts +23 -21
- package/dist/coordination/index.js +16514 -15945
- package/dist/coordination/mail-tools.d.ts +3 -3
- package/dist/coordination/mailbox-credential-store.d.ts +22 -2
- package/dist/coordination/mailbox-credential-throttle.d.ts +63 -0
- package/dist/coordination/mailbox-http-router.d.ts +6 -0
- package/dist/coordination/mailbox-project-server-client.d.ts +16 -0
- package/dist/coordination/mailbox-project-server-protocol.d.ts +43 -5
- package/dist/coordination/mailbox-project-server.js +1270 -289
- package/dist/coordination/provider-status-tracker.d.ts +2 -0
- package/dist/coordination/remote-mailbox-credential-store.d.ts +5 -5
- package/dist/coordination/remote-mailbox.d.ts +30 -4
- package/dist/coordination/sqlite-mailbox-credentials.d.ts +11 -0
- package/dist/core/context.d.ts +5 -5
- package/dist/core/fallback-profile-manager.d.ts +14 -0
- package/dist/core/index.js +624 -168
- package/dist/core/instruction-bundle.d.ts +12 -0
- package/dist/core/system-prompt-builder.d.ts +14 -0
- package/dist/core/system-prompt-skill-bodies.d.ts +1 -1
- package/dist/core/system-prompt-skill-text.d.ts +1 -2
- package/dist/defaults/index.js +2393 -1302
- package/dist/design/index.js +47 -8
- package/dist/execution/design-materialize.d.ts +22 -0
- package/dist/execution/index.js +582 -285
- package/dist/execution/skill-loader.d.ts +10 -1
- package/dist/execution/tool-error-taxonomy.d.ts +31 -0
- package/dist/execution/tool-executor.d.ts +1 -0
- package/dist/goal/index.js +71 -17
- package/dist/goal/phase-store.d.ts +7 -0
- package/dist/hooks/index.js +5 -0
- package/dist/hq/auth-audit.d.ts +6 -0
- package/dist/hq/auth-store.d.ts +59 -3
- package/dist/hq/index.js +680 -163
- package/dist/hq/kanban-store.d.ts +3 -0
- package/dist/hq/persistence/event-log.d.ts +25 -0
- package/dist/hq/persistence.d.ts +1 -1
- package/dist/hq/protocol/browser.d.ts +2 -1
- package/dist/hq/protocol/client.d.ts +18 -1
- package/dist/hq/protocol/core.d.ts +5 -16
- package/dist/hq/protocol/envelope.d.ts +29 -0
- package/dist/hq/protocol/governance.d.ts +34 -0
- package/dist/hq/protocol/peer.d.ts +55 -0
- package/dist/hq/protocol/project.d.ts +3 -0
- package/dist/hq/protocol/resume.d.ts +56 -0
- package/dist/hq/protocol.d.ts +11 -8
- package/dist/hq/protocol.js +675 -0
- package/dist/hq/publisher.d.ts +31 -2
- package/dist/hq/session-bridge.d.ts +8 -0
- package/dist/index.js +7197 -4006
- package/dist/infrastructure/index.js +198 -101
- package/dist/kernel/events/session-events.d.ts +3 -0
- package/dist/kernel/events/tool-events.d.ts +3 -1
- package/dist/models/index.js +1 -1
- package/dist/observability/index.d.ts +1 -1
- package/dist/observability/index.js +103 -5
- package/dist/observability/metrics.d.ts +37 -0
- package/dist/observability/prometheus.d.ts +11 -0
- package/dist/plugin/index.d.ts +5 -1
- package/dist/plugin/index.js +965 -511
- package/dist/plugins/auto-review-plugin.d.ts +6 -0
- package/dist/plugins/review-store-maintenance.d.ts +26 -0
- package/dist/plugins/review-types.d.ts +6 -0
- package/dist/security/capabilities.d.ts +45 -1
- package/dist/security/error-sanitize.d.ts +49 -0
- package/dist/security/file-permissions.d.ts +41 -0
- package/dist/security/index.d.ts +9 -6
- package/dist/security/index.js +3007 -2032
- package/dist/security/permission-policy.d.ts +55 -3
- package/dist/security/secret-vault.d.ts +17 -0
- package/dist/security/totp.d.ts +86 -0
- package/dist/skills/frontmatter.d.ts +12 -1
- package/dist/skills/github-fetcher.d.ts +48 -0
- package/dist/skills/index.js +137 -26
- package/dist/skills/limits.d.ts +19 -0
- package/dist/skills/skill-installer.d.ts +13 -0
- package/dist/storage/file-session-writer.d.ts +23 -0
- package/dist/storage/index.js +1140 -905
- package/dist/storage/provider-config-watcher.d.ts +1 -0
- package/dist/storage/session-helpers.d.ts +1 -0
- package/dist/storage/session-reader.d.ts +0 -7
- package/dist/storage/session-store/types.d.ts +12 -1
- package/dist/storage/session-store.d.ts +11 -2
- package/dist/storage/session-workspace-checkpoints.d.ts +5 -0
- package/dist/tools/fallback-manage-tools.d.ts +6 -0
- package/dist/tools/index.js +305 -133
- package/dist/tools/mcp-use.d.ts +1 -1
- package/dist/types/blocks.d.ts +7 -0
- package/dist/types/config/autonomy.d.ts +12 -3
- package/dist/types/config/mcp-features.d.ts +15 -1
- package/dist/types/config/root.d.ts +10 -4
- package/dist/types/context-window.d.ts +15 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/observability.d.ts +13 -0
- package/dist/types/secret-vault.d.ts +8 -0
- package/dist/types/session.d.ts +42 -0
- package/dist/types/skill.d.ts +56 -0
- package/dist/types/tool-executor.d.ts +2 -0
- package/dist/utils/continuous-memory-profiler.d.ts +35 -0
- package/dist/utils/env-typed.d.ts +64 -0
- package/dist/utils/glob-match.d.ts +21 -1
- package/dist/utils/heap-watchdog-types.d.ts +62 -0
- package/dist/utils/heap-watchdog.d.ts +15 -34
- package/dist/utils/heap-watchdog.js +592 -18
- package/dist/utils/incoming-images.d.ts +19 -0
- package/dist/utils/index.d.ts +15 -11
- package/dist/utils/index.js +1425 -545
- package/dist/utils/memory-flight-recorder.d.ts +47 -0
- package/dist/utils/path-segment.d.ts +29 -0
- package/dist/utils/tool-name.d.ts +34 -0
- package/dist/utils/win32-cmd.d.ts +25 -0
- package/dist/worktree/index.js +5 -0
- package/package.json +11 -3
- package/skills/chimera/SKILL.md +16 -4
- package/skills/data-governance/SKILL.md +92 -0
- package/skills/wrongstack-kanban/SKILL.md +129 -0
- package/skills/wrongstack-kanban/agents/openai.yaml +4 -0
- package/skills/wrongstack-mailbox-mcp/SKILL.md +72 -0
- package/skills/wrongstack-mailbox-mcp/agents/openai.yaml +4 -0
- package/dist/agent-status-helpers.d.ts.map +0 -1
- package/dist/agent-status-tracker.d.ts.map +0 -1
- package/dist/boot.d.ts.map +0 -1
- package/dist/chronicle/context.d.ts.map +0 -1
- package/dist/chronicle/decision-adapter.d.ts.map +0 -1
- package/dist/chronicle/domain-adapter.d.ts.map +0 -1
- package/dist/chronicle/event-hash.d.ts.map +0 -1
- package/dist/chronicle/file-observer.d.ts.map +0 -1
- package/dist/chronicle/health-monitor.d.ts.map +0 -1
- package/dist/chronicle/identity.d.ts.map +0 -1
- package/dist/chronicle/index.d.ts.map +0 -1
- package/dist/chronicle/index.js.map +0 -7
- package/dist/chronicle/journal.d.ts.map +0 -1
- package/dist/chronicle/legacy-journal-import.d.ts.map +0 -1
- package/dist/chronicle/metrics-store.d.ts.map +0 -1
- package/dist/chronicle/partition-filename.d.ts.map +0 -1
- package/dist/chronicle/partition-range-cache.d.ts.map +0 -1
- package/dist/chronicle/process-adapter.d.ts.map +0 -1
- package/dist/chronicle/project-access.d.ts.map +0 -1
- package/dist/chronicle/project-server-client.d.ts.map +0 -1
- package/dist/chronicle/project-server-endpoint.d.ts.map +0 -1
- package/dist/chronicle/project-server-protocol.d.ts.map +0 -1
- package/dist/chronicle/project-server.d.ts.map +0 -1
- package/dist/chronicle/project-server.js.map +0 -7
- package/dist/chronicle/prompt-manifest.d.ts.map +0 -1
- package/dist/chronicle/provider-adapter.d.ts.map +0 -1
- package/dist/chronicle/query.d.ts.map +0 -1
- package/dist/chronicle/review-adapter.d.ts.map +0 -1
- package/dist/chronicle/rollup-adapter.d.ts.map +0 -1
- package/dist/chronicle/sink.d.ts.map +0 -1
- package/dist/chronicle/sqlite-journal.d.ts.map +0 -1
- package/dist/chronicle/sqlite-query.d.ts.map +0 -1
- package/dist/chronicle/stream-adapter.d.ts.map +0 -1
- package/dist/chronicle/tool-adapter.d.ts.map +0 -1
- package/dist/chronicle/types.d.ts.map +0 -1
- package/dist/coordination/adaptive-concurrency.d.ts.map +0 -1
- package/dist/coordination/agent-bridge.d.ts.map +0 -1
- package/dist/coordination/agent-monitor.d.ts.map +0 -1
- package/dist/coordination/agent-subagent-runner.d.ts.map +0 -1
- package/dist/coordination/agents/agent-prompts.d.ts.map +0 -1
- package/dist/coordination/agents/index.d.ts.map +0 -1
- package/dist/coordination/agents/index.js.map +0 -7
- package/dist/coordination/agents/phase1-discovery.d.ts.map +0 -1
- package/dist/coordination/agents/phase2-planning.d.ts.map +0 -1
- package/dist/coordination/agents/phase3-build.d.ts.map +0 -1
- package/dist/coordination/agents/phase3-techstack.d.ts.map +0 -1
- package/dist/coordination/agents/phase3-wave1-platform.d.ts.map +0 -1
- package/dist/coordination/agents/phase3-wave2-meta.d.ts.map +0 -1
- package/dist/coordination/agents/phase4-verify.d.ts.map +0 -1
- package/dist/coordination/agents/phase5-review.d.ts.map +0 -1
- package/dist/coordination/agents/phase6-domain.d.ts.map +0 -1
- package/dist/coordination/agents/phase7-knowledge.d.ts.map +0 -1
- package/dist/coordination/agents/phase8-delivery.d.ts.map +0 -1
- package/dist/coordination/agents/phase8-wave3-products.d.ts.map +0 -1
- package/dist/coordination/agents/phase9-meta.d.ts.map +0 -1
- package/dist/coordination/agents/phase9-wave4-platform-meta.d.ts.map +0 -1
- package/dist/coordination/agents/project-agent-config-validation.d.ts.map +0 -1
- package/dist/coordination/agents/project-agent-consolidation.d.ts.map +0 -1
- package/dist/coordination/agents/project-agent-files.d.ts.map +0 -1
- package/dist/coordination/agents/project-agent-identity-types.d.ts.map +0 -1
- package/dist/coordination/agents/project-agent-identity.d.ts.map +0 -1
- package/dist/coordination/agents/project-agent-knowledge-manifests.d.ts.map +0 -1
- package/dist/coordination/agents/project-agent-learning-entries.d.ts.map +0 -1
- package/dist/coordination/agents/project-agent-learning-normalize.d.ts.map +0 -1
- package/dist/coordination/agents/project-agent-learning-policy.d.ts.map +0 -1
- package/dist/coordination/agents/project-agent-learning-structured.d.ts.map +0 -1
- package/dist/coordination/agents/project-agent-paths.d.ts.map +0 -1
- package/dist/coordination/agents/project-agent-profile.d.ts.map +0 -1
- package/dist/coordination/agents/role-skills.d.ts.map +0 -1
- package/dist/coordination/agents/types.d.ts.map +0 -1
- package/dist/coordination/agents.d.ts.map +0 -1
- package/dist/coordination/auto-extend.d.ts.map +0 -1
- package/dist/coordination/autonomous-brain.d.ts.map +0 -1
- package/dist/coordination/autonomous-coordinator.d.ts.map +0 -1
- package/dist/coordination/brain-cache.d.ts.map +0 -1
- package/dist/coordination/brain-heuristics.d.ts.map +0 -1
- package/dist/coordination/brain-ledger.d.ts.map +0 -1
- package/dist/coordination/brain-monitor.d.ts.map +0 -1
- package/dist/coordination/brain-rules.d.ts.map +0 -1
- package/dist/coordination/brain-telemetry.d.ts.map +0 -1
- package/dist/coordination/brain-trace.d.ts.map +0 -1
- package/dist/coordination/brain.d.ts.map +0 -1
- package/dist/coordination/change-manager.d.ts.map +0 -1
- package/dist/coordination/checkpoint-wiring.d.ts.map +0 -1
- package/dist/coordination/collab-bus.d.ts.map +0 -1
- package/dist/coordination/collab-debug-types.d.ts.map +0 -1
- package/dist/coordination/collab-debug.d.ts.map +0 -1
- package/dist/coordination/collab-director-host.d.ts.map +0 -1
- package/dist/coordination/commit-safety.d.ts.map +0 -1
- package/dist/coordination/consensus-protocol.d.ts.map +0 -1
- package/dist/coordination/coordinator/error-classifier.d.ts.map +0 -1
- package/dist/coordination/delegate-tool.d.ts.map +0 -1
- package/dist/coordination/dep-watcher-bridge.d.ts.map +0 -1
- package/dist/coordination/dep-watcher.d.ts.map +0 -1
- package/dist/coordination/director/director-btw-notes.d.ts.map +0 -1
- package/dist/coordination/director/director-budget-policy.d.ts.map +0 -1
- package/dist/coordination/director/director-collab.d.ts.map +0 -1
- package/dist/coordination/director/director-errors.d.ts.map +0 -1
- package/dist/coordination/director/director-task-registry.d.ts.map +0 -1
- package/dist/coordination/director/director-toolset.d.ts.map +0 -1
- package/dist/coordination/director-basic-tools.d.ts.map +0 -1
- package/dist/coordination/director-collab-tools.d.ts.map +0 -1
- package/dist/coordination/director-host-contracts.d.ts.map +0 -1
- package/dist/coordination/director-input-helpers.d.ts.map +0 -1
- package/dist/coordination/director-kanban-queue-helpers.d.ts.map +0 -1
- package/dist/coordination/director-options.d.ts.map +0 -1
- package/dist/coordination/director-prompts.d.ts.map +0 -1
- package/dist/coordination/director-quality-gate-tool.d.ts.map +0 -1
- package/dist/coordination/director-session.d.ts.map +0 -1
- package/dist/coordination/director-spawn-model.d.ts.map +0 -1
- package/dist/coordination/director-tools.d.ts.map +0 -1
- package/dist/coordination/director.d.ts.map +0 -1
- package/dist/coordination/dispatcher.d.ts.map +0 -1
- package/dist/coordination/file-author-tracker.d.ts.map +0 -1
- package/dist/coordination/fleet-bus.d.ts.map +0 -1
- package/dist/coordination/fleet-event-validation.d.ts.map +0 -1
- package/dist/coordination/fleet-manager.d.ts.map +0 -1
- package/dist/coordination/fleet-spawn.d.ts.map +0 -1
- package/dist/coordination/fleet-status-tool.d.ts.map +0 -1
- package/dist/coordination/fleet-supervisor.d.ts.map +0 -1
- package/dist/coordination/fleet.d.ts.map +0 -1
- package/dist/coordination/global-mailbox-completion.d.ts.map +0 -1
- package/dist/coordination/global-mailbox-paths.d.ts.map +0 -1
- package/dist/coordination/icoordinator.d.ts.map +0 -1
- package/dist/coordination/ifleet-manager.d.ts.map +0 -1
- package/dist/coordination/in-memory-transport.d.ts.map +0 -1
- package/dist/coordination/index.d.ts.map +0 -1
- package/dist/coordination/index.js.map +0 -7
- package/dist/coordination/knowledge-graph.d.ts.map +0 -1
- package/dist/coordination/large-answer-store.d.ts.map +0 -1
- package/dist/coordination/mail-tools.d.ts.map +0 -1
- package/dist/coordination/mailbox-actions.d.ts.map +0 -1
- package/dist/coordination/mailbox-auth-types.d.ts.map +0 -1
- package/dist/coordination/mailbox-codecs.d.ts.map +0 -1
- package/dist/coordination/mailbox-constants.d.ts.map +0 -1
- package/dist/coordination/mailbox-credential-store.d.ts.map +0 -1
- package/dist/coordination/mailbox-events.d.ts.map +0 -1
- package/dist/coordination/mailbox-health.d.ts.map +0 -1
- package/dist/coordination/mailbox-hooks.d.ts.map +0 -1
- package/dist/coordination/mailbox-http-auth.d.ts.map +0 -1
- package/dist/coordination/mailbox-http-rate-limit.d.ts.map +0 -1
- package/dist/coordination/mailbox-http-router.d.ts.map +0 -1
- package/dist/coordination/mailbox-http-validation.d.ts.map +0 -1
- package/dist/coordination/mailbox-message-codec.d.ts.map +0 -1
- package/dist/coordination/mailbox-parse-state.d.ts.map +0 -1
- package/dist/coordination/mailbox-project-server-client.d.ts.map +0 -1
- package/dist/coordination/mailbox-project-server-endpoint.d.ts.map +0 -1
- package/dist/coordination/mailbox-project-server-protocol.d.ts.map +0 -1
- package/dist/coordination/mailbox-project-server.d.ts.map +0 -1
- package/dist/coordination/mailbox-project-server.js.map +0 -7
- package/dist/coordination/mailbox-receipt-folding.d.ts.map +0 -1
- package/dist/coordination/mailbox-registry-codec.d.ts.map +0 -1
- package/dist/coordination/mailbox-retention-state.d.ts.map +0 -1
- package/dist/coordination/mailbox-status-mappers.d.ts.map +0 -1
- package/dist/coordination/mailbox-tool.d.ts.map +0 -1
- package/dist/coordination/mailbox-type-properties.d.ts.map +0 -1
- package/dist/coordination/mailbox-types.d.ts.map +0 -1
- package/dist/coordination/model-matrix.d.ts.map +0 -1
- package/dist/coordination/multi-agent-coordinator.d.ts.map +0 -1
- package/dist/coordination/multi-agent-timeout.d.ts.map +0 -1
- package/dist/coordination/null-fleet-bus.d.ts.map +0 -1
- package/dist/coordination/package-author-tracker.d.ts.map +0 -1
- package/dist/coordination/package-outdated-watcher.d.ts.map +0 -1
- package/dist/coordination/provider-status-tracker.d.ts.map +0 -1
- package/dist/coordination/remote-mailbox-credential-store.d.ts.map +0 -1
- package/dist/coordination/remote-mailbox.d.ts.map +0 -1
- package/dist/coordination/single-instance-mailbox.d.ts.map +0 -1
- package/dist/coordination/spawn-budget.d.ts.map +0 -1
- package/dist/coordination/sqlite-mailbox-compaction.d.ts.map +0 -1
- package/dist/coordination/sqlite-mailbox-credentials.d.ts.map +0 -1
- package/dist/coordination/sqlite-mailbox-rows.d.ts.map +0 -1
- package/dist/coordination/sqlite-mailbox-schema.d.ts.map +0 -1
- package/dist/coordination/sqlite-mailbox.d.ts.map +0 -1
- package/dist/coordination/subagent-budget.d.ts.map +0 -1
- package/dist/coordination/subagent-nicknames.d.ts.map +0 -1
- package/dist/coordination/subagent-result-tool.d.ts.map +0 -1
- package/dist/coordination/task-auctioneer.d.ts.map +0 -1
- package/dist/coordination/task-dag.d.ts.map +0 -1
- package/dist/coordination/techstack-mailbox-consumer.d.ts.map +0 -1
- package/dist/coordination/transport.d.ts.map +0 -1
- package/dist/coordination/worktree-task-runner.d.ts.map +0 -1
- package/dist/core/agent-internals.d.ts.map +0 -1
- package/dist/core/agent-loop.d.ts.map +0 -1
- package/dist/core/agent-response.d.ts.map +0 -1
- package/dist/core/agent-tools.d.ts.map +0 -1
- package/dist/core/agent-types.d.ts.map +0 -1
- package/dist/core/agent.d.ts.map +0 -1
- package/dist/core/btw.d.ts.map +0 -1
- package/dist/core/context.d.ts.map +0 -1
- package/dist/core/continue-intent.d.ts.map +0 -1
- package/dist/core/continue-to-next-iteration.d.ts.map +0 -1
- package/dist/core/conversation-state.d.ts.map +0 -1
- package/dist/core/fallback-model.d.ts.map +0 -1
- package/dist/core/fallback-profile-manager.d.ts.map +0 -1
- package/dist/core/fleet-pulse.d.ts.map +0 -1
- package/dist/core/index.d.ts.map +0 -1
- package/dist/core/index.js.map +0 -7
- package/dist/core/input-builder.d.ts.map +0 -1
- package/dist/core/instruction-bundle.d.ts.map +0 -1
- package/dist/core/iteration-limit.d.ts.map +0 -1
- package/dist/core/mailbox-loop.d.ts.map +0 -1
- package/dist/core/model-availability-calendar.d.ts.map +0 -1
- package/dist/core/model-ref.d.ts.map +0 -1
- package/dist/core/model-ref.js.map +0 -7
- package/dist/core/modes/brief.d.ts.map +0 -1
- package/dist/core/modes/default.d.ts.map +0 -1
- package/dist/core/modes/teach.d.ts.map +0 -1
- package/dist/core/provider-runner.d.ts.map +0 -1
- package/dist/core/queued-messages.d.ts.map +0 -1
- package/dist/core/request-provider-binding.d.ts.map +0 -1
- package/dist/core/run-env.d.ts.map +0 -1
- package/dist/core/streaming-response-builder.d.ts.map +0 -1
- package/dist/core/system-prompt-blocks.d.ts.map +0 -1
- package/dist/core/system-prompt-builder.d.ts.map +0 -1
- package/dist/core/system-prompt-environment-probes.d.ts.map +0 -1
- package/dist/core/system-prompt-environment.d.ts.map +0 -1
- package/dist/core/system-prompt-memory-skills.d.ts.map +0 -1
- package/dist/core/system-prompt-plan.d.ts.map +0 -1
- package/dist/core/system-prompt-shell.d.ts.map +0 -1
- package/dist/core/system-prompt-skill-bodies.d.ts.map +0 -1
- package/dist/core/system-prompt-skill-text.d.ts.map +0 -1
- package/dist/defaults/index.d.ts.map +0 -1
- package/dist/defaults/index.js.map +0 -7
- package/dist/design/index.d.ts.map +0 -1
- package/dist/design/index.js.map +0 -7
- package/dist/execution/auto-compaction-middleware.d.ts.map +0 -1
- package/dist/execution/autonomous-runner.d.ts.map +0 -1
- package/dist/execution/autonomy-brain.d.ts.map +0 -1
- package/dist/execution/autonomy-prompt-contributor.d.ts.map +0 -1
- package/dist/execution/brain-chain.d.ts.map +0 -1
- package/dist/execution/brain-circuit.d.ts.map +0 -1
- package/dist/execution/brain-evaluation.d.ts.map +0 -1
- package/dist/execution/brain-runtime-constants.d.ts.map +0 -1
- package/dist/execution/brain-runtime.d.ts.map +0 -1
- package/dist/execution/compaction-core.d.ts.map +0 -1
- package/dist/execution/compaction-scoring.d.ts.map +0 -1
- package/dist/execution/compaction-summary-cache.d.ts.map +0 -1
- package/dist/execution/compactor.d.ts.map +0 -1
- package/dist/execution/council-brain.d.ts.map +0 -1
- package/dist/execution/council-orchestrator.d.ts.map +0 -1
- package/dist/execution/council-personas.d.ts.map +0 -1
- package/dist/execution/council-profiles.d.ts.map +0 -1
- package/dist/execution/council-prompts.d.ts.map +0 -1
- package/dist/execution/council-resolution.d.ts.map +0 -1
- package/dist/execution/design-color.d.ts.map +0 -1
- package/dist/execution/design-detect.d.ts.map +0 -1
- package/dist/execution/design-kit-loader.d.ts.map +0 -1
- package/dist/execution/design-materialize.d.ts.map +0 -1
- package/dist/execution/design-project-store.d.ts.map +0 -1
- package/dist/execution/design-tune.d.ts.map +0 -1
- package/dist/execution/design-verify.d.ts.map +0 -1
- package/dist/execution/enhance-recovery.d.ts.map +0 -1
- package/dist/execution/error-handler.d.ts.map +0 -1
- package/dist/execution/eternal-autonomy-types.d.ts.map +0 -1
- package/dist/execution/eternal-autonomy.d.ts.map +0 -1
- package/dist/execution/goal-preamble.d.ts.map +0 -1
- package/dist/execution/index.d.ts.map +0 -1
- package/dist/execution/index.js.map +0 -7
- package/dist/execution/intelligent-compactor.d.ts.map +0 -1
- package/dist/execution/model-runtime.d.ts.map +0 -1
- package/dist/execution/one-shot-llm.d.ts.map +0 -1
- package/dist/execution/parallel-eternal-engine.d.ts.map +0 -1
- package/dist/execution/prompt-enhancer.d.ts.map +0 -1
- package/dist/execution/prompt-enhancer.js.map +0 -7
- package/dist/execution/prompt-loader.d.ts.map +0 -1
- package/dist/execution/provider-runner-impl.d.ts.map +0 -1
- package/dist/execution/regex-patterns.d.ts.map +0 -1
- package/dist/execution/retry-policy.d.ts.map +0 -1
- package/dist/execution/selective-compactor.d.ts.map +0 -1
- package/dist/execution/skill-loader.d.ts.map +0 -1
- package/dist/execution/strategy-compactor.d.ts.map +0 -1
- package/dist/execution/subagent-compaction.d.ts.map +0 -1
- package/dist/execution/tool-executor-logging.d.ts.map +0 -1
- package/dist/execution/tool-executor-results.d.ts.map +0 -1
- package/dist/execution/tool-executor-stream.d.ts.map +0 -1
- package/dist/execution/tool-executor-support.d.ts.map +0 -1
- package/dist/execution/tool-executor.d.ts.map +0 -1
- package/dist/extension/extension-points.d.ts.map +0 -1
- package/dist/extension/index.d.ts.map +0 -1
- package/dist/extension/index.js.map +0 -7
- package/dist/extension/registry.d.ts.map +0 -1
- package/dist/fleet-notifier.d.ts.map +0 -1
- package/dist/goal/checkpoint.d.ts.map +0 -1
- package/dist/goal/goal-assessor.d.ts.map +0 -1
- package/dist/goal/goal-planner.d.ts.map +0 -1
- package/dist/goal/goal-runner.d.ts.map +0 -1
- package/dist/goal/index.d.ts.map +0 -1
- package/dist/goal/index.js.map +0 -7
- package/dist/goal/phase-board-mutations.d.ts.map +0 -1
- package/dist/goal/phase-graph-builder.d.ts.map +0 -1
- package/dist/goal/phase-orchestrator-integration.d.ts.map +0 -1
- package/dist/goal/phase-orchestrator-queries.d.ts.map +0 -1
- package/dist/goal/phase-orchestrator-runtime.d.ts.map +0 -1
- package/dist/goal/phase-orchestrator-types.d.ts.map +0 -1
- package/dist/goal/phase-orchestrator.d.ts.map +0 -1
- package/dist/goal/phase-store.d.ts.map +0 -1
- package/dist/goal/types.d.ts.map +0 -1
- package/dist/hooks/http-executor.d.ts.map +0 -1
- package/dist/hooks/index.d.ts.map +0 -1
- package/dist/hooks/index.js.map +0 -7
- package/dist/hooks/registry.d.ts.map +0 -1
- package/dist/hooks/runner.d.ts.map +0 -1
- package/dist/hooks/shell-executor.d.ts.map +0 -1
- package/dist/hooks/shell-hooks-equal.d.ts.map +0 -1
- package/dist/hq/alerts.d.ts.map +0 -1
- package/dist/hq/auth-audit.d.ts.map +0 -1
- package/dist/hq/auth-store.d.ts.map +0 -1
- package/dist/hq/bootstrap-store.d.ts.map +0 -1
- package/dist/hq/brain-bridge.d.ts.map +0 -1
- package/dist/hq/bridge-context.d.ts.map +0 -1
- package/dist/hq/commands.d.ts.map +0 -1
- package/dist/hq/cost-bridge.d.ts.map +0 -1
- package/dist/hq/exposure.d.ts.map +0 -1
- package/dist/hq/factory.d.ts.map +0 -1
- package/dist/hq/fleet-bridge.d.ts.map +0 -1
- package/dist/hq/index.d.ts.map +0 -1
- package/dist/hq/index.js.map +0 -7
- package/dist/hq/kanban-store.d.ts.map +0 -1
- package/dist/hq/mailbox-mapper.d.ts.map +0 -1
- package/dist/hq/persistence/event-log.d.ts.map +0 -1
- package/dist/hq/persistence/jsonl-io.d.ts.map +0 -1
- package/dist/hq/persistence/simple-log.d.ts.map +0 -1
- package/dist/hq/persistence/snapshot-store.d.ts.map +0 -1
- package/dist/hq/persistence/timeseries-store.d.ts.map +0 -1
- package/dist/hq/persistence.d.ts.map +0 -1
- package/dist/hq/protocol/brain.d.ts.map +0 -1
- package/dist/hq/protocol/browser.d.ts.map +0 -1
- package/dist/hq/protocol/client.d.ts.map +0 -1
- package/dist/hq/protocol/core.d.ts.map +0 -1
- package/dist/hq/protocol/fleet.d.ts.map +0 -1
- package/dist/hq/protocol/kanban.d.ts.map +0 -1
- package/dist/hq/protocol/mailbox.d.ts.map +0 -1
- package/dist/hq/protocol/mcp.d.ts.map +0 -1
- package/dist/hq/protocol/project.d.ts.map +0 -1
- package/dist/hq/protocol/session.d.ts.map +0 -1
- package/dist/hq/protocol/tool.d.ts.map +0 -1
- package/dist/hq/protocol.d.ts.map +0 -1
- package/dist/hq/publisher.d.ts.map +0 -1
- package/dist/hq/redaction.d.ts.map +0 -1
- package/dist/hq/session-bridge.d.ts.map +0 -1
- package/dist/hq/tool-bridge.d.ts.map +0 -1
- package/dist/hq/transcript-mapper.d.ts.map +0 -1
- package/dist/hq/worktree-bridge.d.ts.map +0 -1
- package/dist/hq/write-queues.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -7
- package/dist/infrastructure/context-manager.d.ts.map +0 -1
- package/dist/infrastructure/index.d.ts.map +0 -1
- package/dist/infrastructure/index.js.map +0 -7
- package/dist/infrastructure/logger.d.ts.map +0 -1
- package/dist/infrastructure/mcp-servers.d.ts.map +0 -1
- package/dist/infrastructure/path-resolver.d.ts.map +0 -1
- package/dist/infrastructure/provider-cache-ledger.d.ts.map +0 -1
- package/dist/infrastructure/token-counter.d.ts.map +0 -1
- package/dist/kernel/container.d.ts.map +0 -1
- package/dist/kernel/events/agent-events.d.ts.map +0 -1
- package/dist/kernel/events/brain-events.d.ts.map +0 -1
- package/dist/kernel/events/file-events.d.ts.map +0 -1
- package/dist/kernel/events/fleet-events.d.ts.map +0 -1
- package/dist/kernel/events/memory-events.d.ts.map +0 -1
- package/dist/kernel/events/network-events.d.ts.map +0 -1
- package/dist/kernel/events/process-events.d.ts.map +0 -1
- package/dist/kernel/events/provider-events.d.ts.map +0 -1
- package/dist/kernel/events/sdd-events.d.ts.map +0 -1
- package/dist/kernel/events/session-events.d.ts.map +0 -1
- package/dist/kernel/events/tool-events.d.ts.map +0 -1
- package/dist/kernel/events/worktree-events.d.ts.map +0 -1
- package/dist/kernel/events.d.ts.map +0 -1
- package/dist/kernel/index.d.ts.map +0 -1
- package/dist/kernel/index.js.map +0 -7
- package/dist/kernel/pipeline.d.ts.map +0 -1
- package/dist/kernel/run-controller.d.ts.map +0 -1
- package/dist/kernel/tokens.d.ts.map +0 -1
- package/dist/mailbox-attach.d.ts.map +0 -1
- package/dist/middleware/collab-pause.d.ts.map +0 -1
- package/dist/models/alibaba-token-plan-catalog.d.ts.map +0 -1
- package/dist/models/codex-catalog.d.ts.map +0 -1
- package/dist/models/index.d.ts.map +0 -1
- package/dist/models/index.js.map +0 -7
- package/dist/models/llm-selector.d.ts.map +0 -1
- package/dist/models/mode-store.d.ts.map +0 -1
- package/dist/models/model-intelligence.d.ts.map +0 -1
- package/dist/models/model-router.d.ts.map +0 -1
- package/dist/models/models-registry.d.ts.map +0 -1
- package/dist/models/provider-model-resolve.d.ts.map +0 -1
- package/dist/notifications/index.d.ts.map +0 -1
- package/dist/notifications/index.js.map +0 -7
- package/dist/notifications/notifier-impl.d.ts.map +0 -1
- package/dist/notifications/notifier.d.ts.map +0 -1
- package/dist/notifications/types.d.ts.map +0 -1
- package/dist/observability/event-bridge.d.ts.map +0 -1
- package/dist/observability/health.d.ts.map +0 -1
- package/dist/observability/index.d.ts.map +0 -1
- package/dist/observability/index.js.map +0 -7
- package/dist/observability/metrics.d.ts.map +0 -1
- package/dist/observability/network-telemetry.d.ts.map +0 -1
- package/dist/observability/otel-tracer.d.ts.map +0 -1
- package/dist/observability/otlp-metrics.d.ts.map +0 -1
- package/dist/observability/otlp-traces.d.ts.map +0 -1
- package/dist/observability/process-telemetry.d.ts.map +0 -1
- package/dist/observability/prometheus.d.ts.map +0 -1
- package/dist/observability/redact-command.d.ts.map +0 -1
- package/dist/observability/tracer.d.ts.map +0 -1
- package/dist/plugin/api.d.ts.map +0 -1
- package/dist/plugin/config.d.ts.map +0 -1
- package/dist/plugin/index.d.ts.map +0 -1
- package/dist/plugin/index.js.map +0 -7
- package/dist/plugin/loader.d.ts.map +0 -1
- package/dist/plugins/auto-review-plugin.d.ts.map +0 -1
- package/dist/plugins/chimera-plugin.d.ts.map +0 -1
- package/dist/plugins/prompts-plugin.d.ts.map +0 -1
- package/dist/plugins/review-claim-registry.d.ts.map +0 -1
- package/dist/plugins/review-context-builder.d.ts.map +0 -1
- package/dist/plugins/review-finding-commands.d.ts.map +0 -1
- package/dist/plugins/review-finding-integration.d.ts.map +0 -1
- package/dist/plugins/review-finding-parser.d.ts.map +0 -1
- package/dist/plugins/review-finding-store.d.ts.map +0 -1
- package/dist/plugins/review-finding-types.d.ts.map +0 -1
- package/dist/plugins/review-report-integration.d.ts.map +0 -1
- package/dist/plugins/review-report-store.d.ts.map +0 -1
- package/dist/plugins/review-report-types.d.ts.map +0 -1
- package/dist/plugins/review-types.d.ts.map +0 -1
- package/dist/plugins/skills-plugin.d.ts.map +0 -1
- package/dist/plugins/sync-plugin.d.ts.map +0 -1
- package/dist/prompts/index.d.ts.map +0 -1
- package/dist/prompts/prompt-installer.d.ts.map +0 -1
- package/dist/prompts/prompt-manifest-store.d.ts.map +0 -1
- package/dist/registry/index.d.ts.map +0 -1
- package/dist/registry/index.js.map +0 -7
- package/dist/registry/provider-registry.d.ts.map +0 -1
- package/dist/registry/slash-command-registry.d.ts.map +0 -1
- package/dist/registry/tool-registry.d.ts.map +0 -1
- package/dist/replay/hash.d.ts.map +0 -1
- package/dist/replay/index.d.ts.map +0 -1
- package/dist/replay/index.js.map +0 -7
- package/dist/replay/replay-provider-runner.d.ts.map +0 -1
- package/dist/security/capabilities.d.ts.map +0 -1
- package/dist/security/config-secrets.d.ts.map +0 -1
- package/dist/security/directory-permission-policy.d.ts.map +0 -1
- package/dist/security/directory-policy-schema.d.ts.map +0 -1
- package/dist/security/index.d.ts.map +0 -1
- package/dist/security/index.js.map +0 -7
- package/dist/security/kanban-boundary.d.ts.map +0 -1
- package/dist/security/permission-policy-schema.d.ts.map +0 -1
- package/dist/security/permission-policy.d.ts.map +0 -1
- package/dist/security/readonly-permission-policy.d.ts.map +0 -1
- package/dist/security/secret-scrubber.d.ts.map +0 -1
- package/dist/security/secret-vault.d.ts.map +0 -1
- package/dist/security/trust-boundary.d.ts.map +0 -1
- package/dist/security/yolo-risk.d.ts.map +0 -1
- package/dist/session-registry-atomic-file.d.ts.map +0 -1
- package/dist/session-registry-types.d.ts.map +0 -1
- package/dist/session-registry.d.ts.map +0 -1
- package/dist/skills/foreign-sources.d.ts.map +0 -1
- package/dist/skills/frontmatter.d.ts.map +0 -1
- package/dist/skills/github-fetcher.d.ts.map +0 -1
- package/dist/skills/index.d.ts.map +0 -1
- package/dist/skills/index.js.map +0 -7
- package/dist/skills/limits.d.ts.map +0 -1
- package/dist/skills/manifest-store.d.ts.map +0 -1
- package/dist/skills/registry/github-direct-adapter.d.ts.map +0 -1
- package/dist/skills/registry/registry-adapter.d.ts.map +0 -1
- package/dist/skills/registry/skills-sh-adapter.d.ts.map +0 -1
- package/dist/skills/skill-generator.d.ts.map +0 -1
- package/dist/skills/skill-installer.d.ts.map +0 -1
- package/dist/storage/annotations-store.d.ts.map +0 -1
- package/dist/storage/attachment-store.d.ts.map +0 -1
- package/dist/storage/cloud-sync.d.ts.map +0 -1
- package/dist/storage/completed-work-checkpoint.d.ts.map +0 -1
- package/dist/storage/config-loader/bootstrap.d.ts.map +0 -1
- package/dist/storage/config-loader/default-repair.d.ts.map +0 -1
- package/dist/storage/config-loader/defaults.d.ts.map +0 -1
- package/dist/storage/config-loader/diagnostics.d.ts.map +0 -1
- package/dist/storage/config-loader/env-overrides.d.ts.map +0 -1
- package/dist/storage/config-loader/in-project-policy.d.ts.map +0 -1
- package/dist/storage/config-loader/inline-provider-models.d.ts.map +0 -1
- package/dist/storage/config-loader/legacy-sage-migration.d.ts.map +0 -1
- package/dist/storage/config-loader/path-identity.d.ts.map +0 -1
- package/dist/storage/config-loader/types.d.ts.map +0 -1
- package/dist/storage/config-loader/validation.d.ts.map +0 -1
- package/dist/storage/config-loader.d.ts.map +0 -1
- package/dist/storage/config-migration.d.ts.map +0 -1
- package/dist/storage/config-store.d.ts.map +0 -1
- package/dist/storage/director-state.d.ts.map +0 -1
- package/dist/storage/file-session-writer.d.ts.map +0 -1
- package/dist/storage/goal-coordination.d.ts.map +0 -1
- package/dist/storage/goal-kanban.d.ts.map +0 -1
- package/dist/storage/goal-store.d.ts.map +0 -1
- package/dist/storage/index.d.ts.map +0 -1
- package/dist/storage/index.js.map +0 -7
- package/dist/storage/input-history-store.d.ts.map +0 -1
- package/dist/storage/memory-backend.d.ts.map +0 -1
- package/dist/storage/memory-consolidator.d.ts.map +0 -1
- package/dist/storage/memory-graph-backend.d.ts.map +0 -1
- package/dist/storage/plan-store.d.ts.map +0 -1
- package/dist/storage/plan-templates.d.ts.map +0 -1
- package/dist/storage/prompt-store.d.ts.map +0 -1
- package/dist/storage/prompt-usage-store.d.ts.map +0 -1
- package/dist/storage/provider-config-watcher.d.ts.map +0 -1
- package/dist/storage/queue-store.d.ts.map +0 -1
- package/dist/storage/recovery-lock.d.ts.map +0 -1
- package/dist/storage/replay-log-store.d.ts.map +0 -1
- package/dist/storage/session-analyzer.d.ts.map +0 -1
- package/dist/storage/session-checkpoint-cas.d.ts.map +0 -1
- package/dist/storage/session-event-bridge.d.ts.map +0 -1
- package/dist/storage/session-helpers.d.ts.map +0 -1
- package/dist/storage/session-id-resolver.d.ts.map +0 -1
- package/dist/storage/session-id.d.ts.map +0 -1
- package/dist/storage/session-read-scrubber.d.ts.map +0 -1
- package/dist/storage/session-reader.d.ts.map +0 -1
- package/dist/storage/session-recovery.d.ts.map +0 -1
- package/dist/storage/session-resume-validation.d.ts.map +0 -1
- package/dist/storage/session-rewind-apply.d.ts.map +0 -1
- package/dist/storage/session-rewinder.d.ts.map +0 -1
- package/dist/storage/session-store/delete-session-artifacts.d.ts.map +0 -1
- package/dist/storage/session-store/delete-session-guards.d.ts.map +0 -1
- package/dist/storage/session-store/directory-scan.d.ts.map +0 -1
- package/dist/storage/session-store/directory-session-files.d.ts.map +0 -1
- package/dist/storage/session-store/events.d.ts.map +0 -1
- package/dist/storage/session-store/fork-session.d.ts.map +0 -1
- package/dist/storage/session-store/index-reader.d.ts.map +0 -1
- package/dist/storage/session-store/load-cache.d.ts.map +0 -1
- package/dist/storage/session-store/load-session-data.d.ts.map +0 -1
- package/dist/storage/session-store/paths.d.ts.map +0 -1
- package/dist/storage/session-store/prune-helpers.d.ts.map +0 -1
- package/dist/storage/session-store/replay.d.ts.map +0 -1
- package/dist/storage/session-store/search-events.d.ts.map +0 -1
- package/dist/storage/session-store/shard-manifest.d.ts.map +0 -1
- package/dist/storage/session-store/summary-builder.d.ts.map +0 -1
- package/dist/storage/session-store/summary-header.d.ts.map +0 -1
- package/dist/storage/session-store/types.d.ts.map +0 -1
- package/dist/storage/session-store.d.ts.map +0 -1
- package/dist/storage/session-summary.d.ts.map +0 -1
- package/dist/storage/session-tool-call-ends.d.ts.map +0 -1
- package/dist/storage/session-writer-scrubber.d.ts.map +0 -1
- package/dist/storage/session-writer-truncate.d.ts.map +0 -1
- package/dist/storage/storage-concurrency.d.ts.map +0 -1
- package/dist/storage/task-store.d.ts.map +0 -1
- package/dist/storage/todos-checkpoint.d.ts.map +0 -1
- package/dist/storage/tool-audit-log.d.ts.map +0 -1
- package/dist/tasking/index.d.ts.map +0 -1
- package/dist/tasking/index.js.map +0 -7
- package/dist/tasking/task-store.d.ts.map +0 -1
- package/dist/tasking/task-tracker.d.ts.map +0 -1
- package/dist/tools/council-tool.d.ts.map +0 -1
- package/dist/tools/fallback-chain-manage-tool.d.ts.map +0 -1
- package/dist/tools/fallback-favorite-manage-tool.d.ts.map +0 -1
- package/dist/tools/fallback-manage-helpers.d.ts.map +0 -1
- package/dist/tools/fallback-manage-tool-options.d.ts.map +0 -1
- package/dist/tools/fallback-manage-tools.d.ts.map +0 -1
- package/dist/tools/fallback-model-ref-parse.d.ts.map +0 -1
- package/dist/tools/fallback-provider-key-store.d.ts.map +0 -1
- package/dist/tools/fallback-system-config-view-tool.d.ts.map +0 -1
- package/dist/tools/index.d.ts.map +0 -1
- package/dist/tools/index.js.map +0 -7
- package/dist/tools/mcp-control.d.ts.map +0 -1
- package/dist/tools/mcp-use.d.ts.map +0 -1
- package/dist/tools/one-shot-llm-tool.d.ts.map +0 -1
- package/dist/tools/plugin-manager.d.ts.map +0 -1
- package/dist/types/agent-bridge.d.ts.map +0 -1
- package/dist/types/attachment.d.ts.map +0 -1
- package/dist/types/autonomy.d.ts.map +0 -1
- package/dist/types/blocks.d.ts.map +0 -1
- package/dist/types/compactor.d.ts.map +0 -1
- package/dist/types/config/autonomy.d.ts.map +0 -1
- package/dist/types/config/context.d.ts.map +0 -1
- package/dist/types/config/fleet-chat.d.ts.map +0 -1
- package/dist/types/config/mcp-features.d.ts.map +0 -1
- package/dist/types/config/providers.d.ts.map +0 -1
- package/dist/types/config/root.d.ts.map +0 -1
- package/dist/types/config/runtime.d.ts.map +0 -1
- package/dist/types/config/skills-fleet-brain.d.ts.map +0 -1
- package/dist/types/config/tools.d.ts.map +0 -1
- package/dist/types/config.d.ts.map +0 -1
- package/dist/types/context-evidence.d.ts.map +0 -1
- package/dist/types/context-window.d.ts.map +0 -1
- package/dist/types/council.d.ts.map +0 -1
- package/dist/types/default-config.d.ts.map +0 -1
- package/dist/types/design-kit.d.ts.map +0 -1
- package/dist/types/error-handler.d.ts.map +0 -1
- package/dist/types/errors.d.ts.map +0 -1
- package/dist/types/file-event-record.d.ts.map +0 -1
- package/dist/types/hooks.d.ts.map +0 -1
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/index.js.map +0 -7
- package/dist/types/input-reader.d.ts.map +0 -1
- package/dist/types/logger.d.ts.map +0 -1
- package/dist/types/memory.d.ts.map +0 -1
- package/dist/types/messages.d.ts.map +0 -1
- package/dist/types/mode-prompts.d.ts.map +0 -1
- package/dist/types/mode.d.ts.map +0 -1
- package/dist/types/models-registry.d.ts.map +0 -1
- package/dist/types/multi-agent.d.ts.map +0 -1
- package/dist/types/observability.d.ts.map +0 -1
- package/dist/types/one-shot-llm.d.ts.map +0 -1
- package/dist/types/path-resolver.d.ts.map +0 -1
- package/dist/types/permission.d.ts.map +0 -1
- package/dist/types/plugin.d.ts.map +0 -1
- package/dist/types/prompt-registry.d.ts.map +0 -1
- package/dist/types/prompt.d.ts.map +0 -1
- package/dist/types/provider-runner.d.ts.map +0 -1
- package/dist/types/provider.d.ts.map +0 -1
- package/dist/types/quota-regex.d.ts.map +0 -1
- package/dist/types/renderer.d.ts.map +0 -1
- package/dist/types/retry-policy.d.ts.map +0 -1
- package/dist/types/secret-scrubber.d.ts.map +0 -1
- package/dist/types/secret-vault.d.ts.map +0 -1
- package/dist/types/selector.d.ts.map +0 -1
- package/dist/types/session-markers.d.ts.map +0 -1
- package/dist/types/session-markers.js.map +0 -7
- package/dist/types/session-reader.d.ts.map +0 -1
- package/dist/types/session-rewinder.d.ts.map +0 -1
- package/dist/types/session.d.ts.map +0 -1
- package/dist/types/side-effect.d.ts.map +0 -1
- package/dist/types/skill.d.ts.map +0 -1
- package/dist/types/slash-command.d.ts.map +0 -1
- package/dist/types/spec.d.ts.map +0 -1
- package/dist/types/system-prompt-contributor.d.ts.map +0 -1
- package/dist/types/system-prompt.d.ts.map +0 -1
- package/dist/types/task-graph.d.ts.map +0 -1
- package/dist/types/token-counter.d.ts.map +0 -1
- package/dist/types/tool-executor.d.ts.map +0 -1
- package/dist/types/tool-markers.d.ts.map +0 -1
- package/dist/types/tool.d.ts.map +0 -1
- package/dist/types/utility-types.d.ts.map +0 -1
- package/dist/utils/assert-never.d.ts.map +0 -1
- package/dist/utils/atomic-write.d.ts.map +0 -1
- package/dist/utils/cache-key.d.ts.map +0 -1
- package/dist/utils/child-env.d.ts.map +0 -1
- package/dist/utils/color.d.ts.map +0 -1
- package/dist/utils/compaction-preview.d.ts.map +0 -1
- package/dist/utils/config-backup.d.ts.map +0 -1
- package/dist/utils/config-json.d.ts.map +0 -1
- package/dist/utils/connectivity.d.ts.map +0 -1
- package/dist/utils/context-breakdown.d.ts.map +0 -1
- package/dist/utils/context-evidence.d.ts.map +0 -1
- package/dist/utils/crash-shield.d.ts.map +0 -1
- package/dist/utils/deep-merge.d.ts.map +0 -1
- package/dist/utils/diff.d.ts.map +0 -1
- package/dist/utils/error.d.ts.map +0 -1
- package/dist/utils/error.js.map +0 -7
- package/dist/utils/expect-defined.d.ts.map +0 -1
- package/dist/utils/expect-defined.js.map +0 -7
- package/dist/utils/glob-expand.d.ts.map +0 -1
- package/dist/utils/glob-match.d.ts.map +0 -1
- package/dist/utils/heap-watchdog.d.ts.map +0 -1
- package/dist/utils/heap-watchdog.js.map +0 -7
- package/dist/utils/incoming-images.d.ts.map +0 -1
- package/dist/utils/index.d.ts.map +0 -1
- package/dist/utils/index.js.map +0 -7
- package/dist/utils/instruction-file.d.ts.map +0 -1
- package/dist/utils/ip-guard.d.ts.map +0 -1
- package/dist/utils/json-repair.d.ts.map +0 -1
- package/dist/utils/json-schema-validate.d.ts.map +0 -1
- package/dist/utils/lru-cache.d.ts.map +0 -1
- package/dist/utils/merge-custom-models.d.ts.map +0 -1
- package/dist/utils/merge-models-payload.d.ts.map +0 -1
- package/dist/utils/message-invariants.d.ts.map +0 -1
- package/dist/utils/newline-normalize.d.ts.map +0 -1
- package/dist/utils/perf-profile.d.ts.map +0 -1
- package/dist/utils/pid.d.ts.map +0 -1
- package/dist/utils/project-identity.d.ts.map +0 -1
- package/dist/utils/project-watch.d.ts.map +0 -1
- package/dist/utils/regex-guard.d.ts.map +0 -1
- package/dist/utils/safe-json.d.ts.map +0 -1
- package/dist/utils/sage-output-block.d.ts.map +0 -1
- package/dist/utils/session-scoped-path.d.ts.map +0 -1
- package/dist/utils/sleep.d.ts.map +0 -1
- package/dist/utils/slug.d.ts.map +0 -1
- package/dist/utils/socket-path.d.ts.map +0 -1
- package/dist/utils/sqlite-warning.d.ts.map +0 -1
- package/dist/utils/string.d.ts.map +0 -1
- package/dist/utils/task-format.d.ts.map +0 -1
- package/dist/utils/term.d.ts.map +0 -1
- package/dist/utils/todos-format.d.ts.map +0 -1
- package/dist/utils/token-estimate.d.ts.map +0 -1
- package/dist/utils/tool-description-mode.d.ts.map +0 -1
- package/dist/utils/tool-output-serializer.d.ts.map +0 -1
- package/dist/utils/tool-result-render-mode.d.ts.map +0 -1
- package/dist/utils/tool-subject.d.ts.map +0 -1
- package/dist/utils/tool-wire-compact.d.ts.map +0 -1
- package/dist/utils/tree-kill.d.ts.map +0 -1
- package/dist/utils/tree-kill.js.map +0 -7
- package/dist/utils/ulid.d.ts.map +0 -1
- package/dist/utils/walk-ignore.d.ts.map +0 -1
- package/dist/utils/wstack-paths.d.ts.map +0 -1
- package/dist/worktree/index.d.ts.map +0 -1
- package/dist/worktree/index.js.map +0 -7
- package/dist/worktree/worktree-git.d.ts.map +0 -1
- package/dist/worktree/worktree-managed-ops.d.ts.map +0 -1
- package/dist/worktree/worktree-manager.d.ts.map +0 -1
- package/dist/worktree/worktree-types.d.ts.map +0 -1
|
@@ -0,0 +1,675 @@
|
|
|
1
|
+
// src/hq/protocol/governance.ts
|
|
2
|
+
var SIGNAL_LEVELS = /* @__PURE__ */ new Set([
|
|
3
|
+
"healthy",
|
|
4
|
+
"notice",
|
|
5
|
+
"warning",
|
|
6
|
+
"unavailable"
|
|
7
|
+
]);
|
|
8
|
+
var SIGNAL_CODES = /* @__PURE__ */ new Set([
|
|
9
|
+
"attachment_broker_healthy",
|
|
10
|
+
"attachment_broker_initializing",
|
|
11
|
+
"attachment_broker_status_unavailable",
|
|
12
|
+
"attachment_broker_degraded",
|
|
13
|
+
"attachment_broker_audit_unhealthy",
|
|
14
|
+
"attachment_broker_revocation_pending",
|
|
15
|
+
"attachment_broker_stopped",
|
|
16
|
+
"broker_missing",
|
|
17
|
+
"broker_invalid",
|
|
18
|
+
"connection_failed",
|
|
19
|
+
"request_rejected",
|
|
20
|
+
"unexpected_response"
|
|
21
|
+
]);
|
|
22
|
+
var OPERATOR_ACTIONS = /* @__PURE__ */ new Set(["none", "observe", "investigate"]);
|
|
23
|
+
var BROKER_STATES = /* @__PURE__ */ new Set(["idle", "active", "retry_wait", "stopped"]);
|
|
24
|
+
var BROKER_HEALTH = /* @__PURE__ */ new Set(["initializing", "healthy", "degraded", "stopped"]);
|
|
25
|
+
function isNonNegativeInteger(value) {
|
|
26
|
+
return typeof value === "number" && Number.isInteger(value) && value >= 0;
|
|
27
|
+
}
|
|
28
|
+
function hasOnlyKeys(value, allowed) {
|
|
29
|
+
const allowedKeys = new Set(allowed);
|
|
30
|
+
return Object.keys(value).every((key) => allowedKeys.has(key));
|
|
31
|
+
}
|
|
32
|
+
function isHqGovernanceSnapshotPayload(value) {
|
|
33
|
+
if (typeof value !== "object" || value === null || Array.isArray(value)) return false;
|
|
34
|
+
const payload = value;
|
|
35
|
+
if (!hasOnlyKeys(payload, [
|
|
36
|
+
"schemaVersion",
|
|
37
|
+
"projectId",
|
|
38
|
+
"observedAt",
|
|
39
|
+
"available",
|
|
40
|
+
"signal",
|
|
41
|
+
"daemon",
|
|
42
|
+
"attachmentBroker"
|
|
43
|
+
]) || payload.schemaVersion !== 1 || typeof payload.projectId !== "string" || payload.projectId.length === 0 || typeof payload.observedAt !== "string" || typeof payload.available !== "boolean" || typeof payload.signal !== "object" || payload.signal === null || Array.isArray(payload.signal)) {
|
|
44
|
+
return false;
|
|
45
|
+
}
|
|
46
|
+
const signal = payload.signal;
|
|
47
|
+
if (!hasOnlyKeys(signal, ["level", "code", "operatorAction", "executionDisposition"]) || !SIGNAL_LEVELS.has(signal.level) || !SIGNAL_CODES.has(signal.code) || !OPERATOR_ACTIONS.has(signal.operatorAction) || signal.executionDisposition !== "continue") {
|
|
48
|
+
return false;
|
|
49
|
+
}
|
|
50
|
+
if (payload.available === false && (signal.level !== "unavailable" || payload.daemon !== void 0 || payload.attachmentBroker !== void 0) || payload.available === true && signal.level === "unavailable") {
|
|
51
|
+
return false;
|
|
52
|
+
}
|
|
53
|
+
if (payload.daemon !== void 0) {
|
|
54
|
+
if (typeof payload.daemon !== "object" || payload.daemon === null || Array.isArray(payload.daemon)) {
|
|
55
|
+
return false;
|
|
56
|
+
}
|
|
57
|
+
const daemon = payload.daemon;
|
|
58
|
+
if (!hasOnlyKeys(daemon, ["pid", "startedAt"]) || !isNonNegativeInteger(daemon.pid) || typeof daemon.startedAt !== "string") {
|
|
59
|
+
return false;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
if (payload.attachmentBroker !== void 0 && payload.attachmentBroker !== null) {
|
|
63
|
+
if (typeof payload.attachmentBroker !== "object" || Array.isArray(payload.attachmentBroker)) {
|
|
64
|
+
return false;
|
|
65
|
+
}
|
|
66
|
+
const broker = payload.attachmentBroker;
|
|
67
|
+
if (!hasOnlyKeys(broker, [
|
|
68
|
+
"state",
|
|
69
|
+
"health",
|
|
70
|
+
"consecutiveFailures",
|
|
71
|
+
"pendingRevocations",
|
|
72
|
+
"auditHealthy",
|
|
73
|
+
"expiresAt",
|
|
74
|
+
"nextActionAt"
|
|
75
|
+
]) || !BROKER_STATES.has(broker.state) || !BROKER_HEALTH.has(broker.health) || !isNonNegativeInteger(broker.consecutiveFailures) || !isNonNegativeInteger(broker.pendingRevocations) || typeof broker.auditHealthy !== "boolean" || broker.expiresAt !== void 0 && typeof broker.expiresAt !== "string" || broker.nextActionAt !== void 0 && typeof broker.nextActionAt !== "string") {
|
|
76
|
+
return false;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
return true;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// src/hq/protocol/kanban.ts
|
|
83
|
+
var HQ_KANBAN_ID_PATTERN = /^[A-Za-z0-9][A-Za-z0-9_-]*$/;
|
|
84
|
+
var MAX_HQ_KANBAN_BOARDS = 250;
|
|
85
|
+
var MAX_HQ_KANBAN_BOARD_BYTES = 75e4;
|
|
86
|
+
function isHqKanbanSnapshotPayload(value) {
|
|
87
|
+
if (typeof value !== "object" || value === null) return false;
|
|
88
|
+
const payload = value;
|
|
89
|
+
if (typeof payload.projectId !== "string" || payload.projectId.length === 0 || typeof payload.generatedAt !== "string" || !Number.isFinite(Date.parse(payload.generatedAt)) || !Array.isArray(payload.boards) || !Array.isArray(payload.tombstones) || payload.boards.length > MAX_HQ_KANBAN_BOARDS || payload.tombstones.length > MAX_HQ_KANBAN_BOARDS) {
|
|
90
|
+
return false;
|
|
91
|
+
}
|
|
92
|
+
const seen = /* @__PURE__ */ new Set();
|
|
93
|
+
for (const item of payload.boards) {
|
|
94
|
+
if (!isBoardRecord(item) || seen.has(item.boardId)) return false;
|
|
95
|
+
seen.add(item.boardId);
|
|
96
|
+
}
|
|
97
|
+
for (const item of payload.tombstones) {
|
|
98
|
+
if (!isTombstone(item) || seen.has(item.boardId)) return false;
|
|
99
|
+
seen.add(item.boardId);
|
|
100
|
+
}
|
|
101
|
+
return true;
|
|
102
|
+
}
|
|
103
|
+
function isBoardRecord(value) {
|
|
104
|
+
if (typeof value !== "object" || value === null) return false;
|
|
105
|
+
const record = value;
|
|
106
|
+
if (typeof record.boardId !== "string" || !HQ_KANBAN_ID_PATTERN.test(record.boardId) || typeof record.revision !== "number" || !Number.isSafeInteger(record.revision) || record.revision < 0 || typeof record.updatedAt !== "string" || !Number.isFinite(Date.parse(record.updatedAt)) || typeof record.board !== "object" || record.board === null || Array.isArray(record.board)) {
|
|
107
|
+
return false;
|
|
108
|
+
}
|
|
109
|
+
const board = record.board;
|
|
110
|
+
if (board.id !== record.boardId) return false;
|
|
111
|
+
try {
|
|
112
|
+
return new TextEncoder().encode(JSON.stringify(board)).byteLength <= MAX_HQ_KANBAN_BOARD_BYTES;
|
|
113
|
+
} catch {
|
|
114
|
+
return false;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
function isTombstone(value) {
|
|
118
|
+
if (typeof value !== "object" || value === null) return false;
|
|
119
|
+
const record = value;
|
|
120
|
+
return typeof record.boardId === "string" && HQ_KANBAN_ID_PATTERN.test(record.boardId) && typeof record.revision === "number" && Number.isSafeInteger(record.revision) && record.revision >= 0 && typeof record.deletedAt === "string" && Number.isFinite(Date.parse(record.deletedAt));
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
// src/hq/protocol/peer.ts
|
|
124
|
+
var HQ_PEER_REHYDRATE_REASONS = /* @__PURE__ */ new Set([
|
|
125
|
+
"graceful",
|
|
126
|
+
"crash",
|
|
127
|
+
"heartbeat-timeout",
|
|
128
|
+
"auth-revoked"
|
|
129
|
+
]);
|
|
130
|
+
var HQ_PEER_REHYDRATE_HINT_MAX_CHARS = 280;
|
|
131
|
+
var HQ_BROWSER_PEER_RESUME_CLIENT_ID = "__hq_peer__";
|
|
132
|
+
function isStringOrUndefined(x) {
|
|
133
|
+
return x === void 0 || typeof x === "string";
|
|
134
|
+
}
|
|
135
|
+
function isHqPeerRehydratePayload(x) {
|
|
136
|
+
if (typeof x !== "object" || x === null || Array.isArray(x)) return false;
|
|
137
|
+
const v = x;
|
|
138
|
+
if (typeof v.projectId !== "string" || v.projectId.length === 0) return false;
|
|
139
|
+
if (typeof v.machineId !== "string" || v.machineId.length === 0) return false;
|
|
140
|
+
if (typeof v.leaderClientId !== "string" || v.leaderClientId.length === 0) return false;
|
|
141
|
+
if (typeof v.previousLeaderHandle !== "string" || v.previousLeaderHandle.length === 0) return false;
|
|
142
|
+
if (typeof v.reason !== "string" || !HQ_PEER_REHYDRATE_REASONS.has(v.reason)) return false;
|
|
143
|
+
if (typeof v.detectedAt !== "string" || !Number.isFinite(Date.parse(v.detectedAt))) return false;
|
|
144
|
+
if (!isStringOrUndefined(v.rehydrateHint)) return false;
|
|
145
|
+
if (v.rehydrateHint !== void 0 && v.rehydrateHint.length > HQ_PEER_REHYDRATE_HINT_MAX_CHARS) return false;
|
|
146
|
+
if (!isStringOrUndefined(v.rehydrateCommandId)) return false;
|
|
147
|
+
return true;
|
|
148
|
+
}
|
|
149
|
+
function isHqPeerLostPayload(x) {
|
|
150
|
+
if (typeof x !== "object" || x === null || Array.isArray(x)) return false;
|
|
151
|
+
const v = x;
|
|
152
|
+
if (typeof v.projectId !== "string" || v.projectId.length === 0) return false;
|
|
153
|
+
if (typeof v.machineId !== "string" || v.machineId.length === 0) return false;
|
|
154
|
+
if (typeof v.leaderClientId !== "string" || v.leaderClientId.length === 0) return false;
|
|
155
|
+
if (typeof v.previousLeaderHandle !== "string" || v.previousLeaderHandle.length === 0) return false;
|
|
156
|
+
if (typeof v.reason !== "string" || !HQ_PEER_REHYDRATE_REASONS.has(v.reason)) return false;
|
|
157
|
+
if (typeof v.detectedAt !== "string" || !Number.isFinite(Date.parse(v.detectedAt))) return false;
|
|
158
|
+
return true;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
// src/hq/protocol/envelope.ts
|
|
162
|
+
var HQ_PROTOCOL_VERSION = 1;
|
|
163
|
+
|
|
164
|
+
// src/hq/protocol/core.ts
|
|
165
|
+
var KNOWN_HQ_CLIENT_FRAME_TYPES = /* @__PURE__ */ new Set([
|
|
166
|
+
"client.hello",
|
|
167
|
+
"client.event",
|
|
168
|
+
"client.command_poll",
|
|
169
|
+
"client.command_ack",
|
|
170
|
+
"client.resume"
|
|
171
|
+
]);
|
|
172
|
+
var HQ_CLIENT_KINDS = /* @__PURE__ */ new Set([
|
|
173
|
+
"tui",
|
|
174
|
+
"repl",
|
|
175
|
+
"webui",
|
|
176
|
+
"cli",
|
|
177
|
+
"mailbox",
|
|
178
|
+
"unknown"
|
|
179
|
+
]);
|
|
180
|
+
var HQ_WORKSPACE_KINDS = /* @__PURE__ */ new Set(["git", "directory", "unknown"]);
|
|
181
|
+
var HQ_CLIENT_CAPABILITIES = /* @__PURE__ */ new Set([
|
|
182
|
+
"telemetry.publish",
|
|
183
|
+
"session.summary",
|
|
184
|
+
"fleet.summary",
|
|
185
|
+
"mailbox.summary",
|
|
186
|
+
"mailbox.serve",
|
|
187
|
+
"control.receive"
|
|
188
|
+
]);
|
|
189
|
+
var HQ_COMMAND_ACK_STATUSES = /* @__PURE__ */ new Set([
|
|
190
|
+
"accepted",
|
|
191
|
+
"completed",
|
|
192
|
+
"failed",
|
|
193
|
+
"rejected"
|
|
194
|
+
]);
|
|
195
|
+
function hasStringType(x) {
|
|
196
|
+
return typeof x === "object" && x !== null && typeof x.type === "string";
|
|
197
|
+
}
|
|
198
|
+
function isHqClientIdentity(x) {
|
|
199
|
+
if (typeof x !== "object" || x === null) return false;
|
|
200
|
+
const v = x;
|
|
201
|
+
return typeof v.clientId === "string" && typeof v.kind === "string" && HQ_CLIENT_KINDS.has(v.kind) && typeof v.machineId === "string" && typeof v.startedAt === "string";
|
|
202
|
+
}
|
|
203
|
+
function isHqProjectIdentity(x) {
|
|
204
|
+
if (typeof x !== "object" || x === null) return false;
|
|
205
|
+
const v = x;
|
|
206
|
+
return typeof v.projectId === "string" && typeof v.projectRoot === "string" && typeof v.projectName === "string" && typeof v.machineId === "string" && typeof v.workspaceKind === "string" && HQ_WORKSPACE_KINDS.has(v.workspaceKind);
|
|
207
|
+
}
|
|
208
|
+
function isHqRedactionPolicy(x) {
|
|
209
|
+
if (typeof x !== "object" || x === null) return false;
|
|
210
|
+
const v = x;
|
|
211
|
+
return typeof v.rawContent === "boolean" && (v.toolArgs === "none" || v.toolArgs === "summary" || v.toolArgs === "redacted" || v.toolArgs === "full") && (v.paths === "none" || v.paths === "project-relative" || v.paths === "redacted" || v.paths === "full");
|
|
212
|
+
}
|
|
213
|
+
function isHqClientHelloPayload(x) {
|
|
214
|
+
if (typeof x !== "object" || x === null) return false;
|
|
215
|
+
const v = x;
|
|
216
|
+
return typeof v.protocolVersion === "number" && isHqClientIdentity(v.client) && isHqProjectIdentity(v.project) && Array.isArray(v.capabilities) && v.capabilities.every(
|
|
217
|
+
(capability) => typeof capability === "string" && HQ_CLIENT_CAPABILITIES.has(capability)
|
|
218
|
+
) && (v.redactionPolicy === void 0 || isHqRedactionPolicy(v.redactionPolicy));
|
|
219
|
+
}
|
|
220
|
+
function isHqEventEnvelope(x) {
|
|
221
|
+
if (typeof x !== "object" || x === null) return false;
|
|
222
|
+
const v = x;
|
|
223
|
+
return typeof v.id === "string" && typeof v.type === "string" && v.schemaVersion === HQ_PROTOCOL_VERSION && typeof v.timestamp === "string" && typeof v.clientId === "string" && typeof v.projectId === "string" && Number.isSafeInteger(v.seq) && v.seq >= 0 && Object.hasOwn(v, "payload");
|
|
224
|
+
}
|
|
225
|
+
function isHqClientCommandPollMessage(x) {
|
|
226
|
+
if (typeof x !== "object" || x === null) return false;
|
|
227
|
+
const v = x;
|
|
228
|
+
return typeof v.clientId === "string" && typeof v.projectId === "string" && (v.afterCommandId === void 0 || typeof v.afterCommandId === "string") && (v.limit === void 0 || Number.isSafeInteger(v.limit) && v.limit > 0 && v.limit <= 200);
|
|
229
|
+
}
|
|
230
|
+
function isHqClientCommandAckMessage(x) {
|
|
231
|
+
if (typeof x !== "object" || x === null) return false;
|
|
232
|
+
const v = x;
|
|
233
|
+
return typeof v.clientId === "string" && typeof v.projectId === "string" && typeof v.commandId === "string" && typeof v.status === "string" && HQ_COMMAND_ACK_STATUSES.has(v.status) && (v.message === void 0 || typeof v.message === "string");
|
|
234
|
+
}
|
|
235
|
+
function isHqClientResumeMessage(x) {
|
|
236
|
+
if (typeof x !== "object" || x === null) return false;
|
|
237
|
+
const v = x;
|
|
238
|
+
return typeof v.type === "string" && v.type === "client.resume" && Number.isSafeInteger(v.lastSeqSeen) && v.lastSeqSeen >= 0 && (v.clientId === void 0 || typeof v.clientId === "string") && (v.projectId === void 0 || typeof v.projectId === "string");
|
|
239
|
+
}
|
|
240
|
+
function parseHqFrame(raw) {
|
|
241
|
+
let parsed;
|
|
242
|
+
try {
|
|
243
|
+
parsed = JSON.parse(typeof raw === "string" ? raw : raw.toString("utf8"));
|
|
244
|
+
} catch {
|
|
245
|
+
return { ok: false, reason: "invalid-json" };
|
|
246
|
+
}
|
|
247
|
+
if (!hasStringType(parsed)) {
|
|
248
|
+
return { ok: false, reason: "malformed" };
|
|
249
|
+
}
|
|
250
|
+
const obj = parsed;
|
|
251
|
+
if (!KNOWN_HQ_CLIENT_FRAME_TYPES.has(obj.type)) {
|
|
252
|
+
return { ok: false, reason: "unknown-type" };
|
|
253
|
+
}
|
|
254
|
+
switch (obj.type) {
|
|
255
|
+
case "client.hello":
|
|
256
|
+
if (!isHqClientHelloPayload(obj.payload)) {
|
|
257
|
+
return { ok: false, reason: "malformed" };
|
|
258
|
+
}
|
|
259
|
+
return { ok: true, frame: { type: "client.hello", payload: obj.payload } };
|
|
260
|
+
case "client.event":
|
|
261
|
+
if (!isHqEventEnvelope(obj.event)) {
|
|
262
|
+
return { ok: false, reason: "malformed" };
|
|
263
|
+
}
|
|
264
|
+
return { ok: true, frame: { type: "client.event", event: obj.event } };
|
|
265
|
+
case "client.command_poll":
|
|
266
|
+
if (!isHqClientCommandPollMessage(obj)) {
|
|
267
|
+
return { ok: false, reason: "malformed" };
|
|
268
|
+
}
|
|
269
|
+
return {
|
|
270
|
+
ok: true,
|
|
271
|
+
frame: {
|
|
272
|
+
type: "client.command_poll",
|
|
273
|
+
clientId: obj.clientId,
|
|
274
|
+
projectId: obj.projectId,
|
|
275
|
+
...typeof obj.afterCommandId === "string" ? { afterCommandId: obj.afterCommandId } : {},
|
|
276
|
+
...typeof obj.limit === "number" ? { limit: obj.limit } : {}
|
|
277
|
+
}
|
|
278
|
+
};
|
|
279
|
+
case "client.command_ack":
|
|
280
|
+
if (!isHqClientCommandAckMessage(obj)) {
|
|
281
|
+
return { ok: false, reason: "malformed" };
|
|
282
|
+
}
|
|
283
|
+
return {
|
|
284
|
+
ok: true,
|
|
285
|
+
frame: {
|
|
286
|
+
type: "client.command_ack",
|
|
287
|
+
clientId: obj.clientId,
|
|
288
|
+
projectId: obj.projectId,
|
|
289
|
+
commandId: obj.commandId,
|
|
290
|
+
status: obj.status,
|
|
291
|
+
...typeof obj.message === "string" ? { message: obj.message } : {}
|
|
292
|
+
}
|
|
293
|
+
};
|
|
294
|
+
case "client.resume":
|
|
295
|
+
if (!isHqClientResumeMessage(obj)) {
|
|
296
|
+
return { ok: false, reason: "malformed" };
|
|
297
|
+
}
|
|
298
|
+
return {
|
|
299
|
+
ok: true,
|
|
300
|
+
frame: {
|
|
301
|
+
type: "client.resume",
|
|
302
|
+
lastSeqSeen: obj.lastSeqSeen,
|
|
303
|
+
...typeof obj.clientId === "string" ? { clientId: obj.clientId } : {},
|
|
304
|
+
...typeof obj.projectId === "string" ? { projectId: obj.projectId } : {}
|
|
305
|
+
}
|
|
306
|
+
};
|
|
307
|
+
default: {
|
|
308
|
+
const _exhaustive = obj.type;
|
|
309
|
+
return _exhaustive;
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
var KNOWN_HQ_EVENT_PAYLOAD_TYPES = /* @__PURE__ */ new Set([
|
|
314
|
+
"mailbox.snapshot",
|
|
315
|
+
"mailbox.event",
|
|
316
|
+
"kanban.snapshot",
|
|
317
|
+
"session.snapshot",
|
|
318
|
+
"session.transcript",
|
|
319
|
+
"session.ended",
|
|
320
|
+
"fleet.snapshot",
|
|
321
|
+
"fleet.event",
|
|
322
|
+
"brain.event",
|
|
323
|
+
"worktree.event",
|
|
324
|
+
"tool.started",
|
|
325
|
+
"tool.completed",
|
|
326
|
+
"session.usage",
|
|
327
|
+
"client.heartbeat",
|
|
328
|
+
"mcp.health.snapshot",
|
|
329
|
+
"mcp.operation",
|
|
330
|
+
"governance.snapshot",
|
|
331
|
+
"peer.rehydrate",
|
|
332
|
+
"peer.lost"
|
|
333
|
+
]);
|
|
334
|
+
function isHqMcpLatencySummary(x) {
|
|
335
|
+
if (typeof x !== "object" || x === null) return false;
|
|
336
|
+
const v = x;
|
|
337
|
+
return typeof v.count === "number" && (v.lastMs === void 0 || typeof v.lastMs === "number") && (v.minMs === void 0 || typeof v.minMs === "number") && (v.maxMs === void 0 || typeof v.maxMs === "number") && (v.p50Ms === void 0 || typeof v.p50Ms === "number") && (v.p95Ms === void 0 || typeof v.p95Ms === "number");
|
|
338
|
+
}
|
|
339
|
+
function isHqMcpFailureCounts(x) {
|
|
340
|
+
if (typeof x !== "object" || x === null) return false;
|
|
341
|
+
const v = x;
|
|
342
|
+
return typeof v.transport === "number" && typeof v.protocol === "number" && typeof v.tool === "number";
|
|
343
|
+
}
|
|
344
|
+
function isHqMcpHealthCheck(x) {
|
|
345
|
+
if (typeof x !== "object" || x === null) return false;
|
|
346
|
+
const v = x;
|
|
347
|
+
return typeof v.name === "string" && typeof v.passed === "boolean" && (v.value === void 0 || typeof v.value === "number") && (v.threshold === void 0 || typeof v.threshold === "number");
|
|
348
|
+
}
|
|
349
|
+
var HQ_MCP_HEALTH_STATES = /* @__PURE__ */ new Set([
|
|
350
|
+
"disabled",
|
|
351
|
+
"dormant",
|
|
352
|
+
"connecting",
|
|
353
|
+
"healthy",
|
|
354
|
+
"degraded",
|
|
355
|
+
"failed"
|
|
356
|
+
]);
|
|
357
|
+
var HQ_MCP_CONNECTION_STATES = /* @__PURE__ */ new Set([
|
|
358
|
+
"idle",
|
|
359
|
+
"dormant",
|
|
360
|
+
"connecting",
|
|
361
|
+
"connected",
|
|
362
|
+
"reconnecting",
|
|
363
|
+
"disconnected",
|
|
364
|
+
"failed"
|
|
365
|
+
]);
|
|
366
|
+
function isHqMcpServerHealth(x) {
|
|
367
|
+
if (typeof x !== "object" || x === null) return false;
|
|
368
|
+
const v = x;
|
|
369
|
+
return typeof v.name === "string" && typeof v.projectId === "string" && typeof v.clientId === "string" && typeof v.connectionState === "string" && HQ_MCP_CONNECTION_STATES.has(v.connectionState) && typeof v.healthState === "string" && HQ_MCP_HEALTH_STATES.has(v.healthState) && (v.lastSuccessAt === void 0 || typeof v.lastSuccessAt === "string") && (v.lastFailureAt === void 0 || typeof v.lastFailureAt === "string") && (v.lastFailureKind === void 0 || v.lastFailureKind === "transport" || v.lastFailureKind === "protocol" || v.lastFailureKind === "tool") && typeof v.consecutiveFailures === "number" && isHqMcpFailureCounts(v.failures) && typeof v.reconnectCount === "number" && typeof v.wakeCount === "number" && typeof v.sleepCount === "number" && typeof v.restartCount === "number" && isHqMcpLatencySummary(v.connectionLatency) && isHqMcpLatencySummary(v.discoveryLatency) && isHqMcpLatencySummary(v.callLatency) && typeof v.inFlightCalls === "number" && typeof v.peakInFlightCalls === "number" && Array.isArray(v.healthChecks) && v.healthChecks.every(isHqMcpHealthCheck);
|
|
370
|
+
}
|
|
371
|
+
function isHqMcpHealthSnapshotPayload(x) {
|
|
372
|
+
if (typeof x !== "object" || x === null) return false;
|
|
373
|
+
const v = x;
|
|
374
|
+
return Array.isArray(v.servers) && v.servers.every(isHqMcpServerHealth);
|
|
375
|
+
}
|
|
376
|
+
function isHqMcpOperationPayload(x) {
|
|
377
|
+
if (typeof x !== "object" || x === null) return false;
|
|
378
|
+
const v = x;
|
|
379
|
+
return typeof v.operation === "object" && v.operation !== null && Array.isArray(v.servers) && v.servers.every(isHqMcpServerHealth);
|
|
380
|
+
}
|
|
381
|
+
function isHqMailboxMessageSummary(x) {
|
|
382
|
+
if (typeof x !== "object" || x === null) return false;
|
|
383
|
+
const v = x;
|
|
384
|
+
return typeof v.messageId === "string" && typeof v.from === "string" && typeof v.to === "string" && typeof v.subject === "string" && typeof v.priority === "string" && typeof v.timestamp === "string" && typeof v.completed === "boolean" && typeof v.hasBody === "boolean";
|
|
385
|
+
}
|
|
386
|
+
function isHqMailboxAgentSummary(x) {
|
|
387
|
+
if (typeof x !== "object" || x === null) return false;
|
|
388
|
+
const v = x;
|
|
389
|
+
return typeof v.agentId === "string" && typeof v.name === "string" && typeof v.sessionId === "string" && typeof v.status === "string" && typeof v.iterations === "number" && typeof v.toolCalls === "number" && typeof v.lastActivityAt === "string" && typeof v.lastSeenAt === "string" && typeof v.online === "boolean";
|
|
390
|
+
}
|
|
391
|
+
function isHqMailboxSnapshotPayload(x) {
|
|
392
|
+
if (typeof x !== "object" || x === null) return false;
|
|
393
|
+
const v = x;
|
|
394
|
+
if (typeof v.mailboxId !== "string" || v.scope !== "project" && v.scope !== "global" || !Array.isArray(v.messages) || !Array.isArray(v.agents) || typeof v.totals !== "object" || v.totals === null) {
|
|
395
|
+
return false;
|
|
396
|
+
}
|
|
397
|
+
const totals = v.totals;
|
|
398
|
+
if (typeof totals.messages !== "number" || typeof totals.unread !== "number" || typeof totals.incomplete !== "number" || typeof totals.highPriority !== "number" || typeof totals.onlineAgents !== "number") {
|
|
399
|
+
return false;
|
|
400
|
+
}
|
|
401
|
+
for (const message of v.messages) {
|
|
402
|
+
if (!isHqMailboxMessageSummary(message)) return false;
|
|
403
|
+
}
|
|
404
|
+
for (const agent of v.agents) {
|
|
405
|
+
if (!isHqMailboxAgentSummary(agent)) return false;
|
|
406
|
+
}
|
|
407
|
+
return true;
|
|
408
|
+
}
|
|
409
|
+
var HQ_MAILBOX_EVENT_ACTIONS = /* @__PURE__ */ new Set([
|
|
410
|
+
"message.sent",
|
|
411
|
+
"message.read",
|
|
412
|
+
"message.completed",
|
|
413
|
+
"message.updated",
|
|
414
|
+
"agent.registered",
|
|
415
|
+
"agent.heartbeat",
|
|
416
|
+
"agent.offline",
|
|
417
|
+
"agent.deregistered"
|
|
418
|
+
]);
|
|
419
|
+
function isHqMailboxEventPayload(x) {
|
|
420
|
+
if (typeof x !== "object" || x === null) return false;
|
|
421
|
+
const v = x;
|
|
422
|
+
if (typeof v.mailboxId !== "string") return false;
|
|
423
|
+
if (typeof v.action !== "string" || !HQ_MAILBOX_EVENT_ACTIONS.has(v.action)) return false;
|
|
424
|
+
if (v.message !== void 0 && !isHqMailboxMessageSummary(v.message)) return false;
|
|
425
|
+
if (v.agent !== void 0 && !isHqMailboxAgentSummary(v.agent)) return false;
|
|
426
|
+
return true;
|
|
427
|
+
}
|
|
428
|
+
var HQ_SESSION_AGENT_STATUSES = /* @__PURE__ */ new Set([
|
|
429
|
+
"idle",
|
|
430
|
+
"running",
|
|
431
|
+
"streaming",
|
|
432
|
+
"waiting_user",
|
|
433
|
+
"error"
|
|
434
|
+
]);
|
|
435
|
+
function isHqSessionAgentSummary(x) {
|
|
436
|
+
if (typeof x !== "object" || x === null) return false;
|
|
437
|
+
const v = x;
|
|
438
|
+
return typeof v.id === "string" && typeof v.name === "string" && typeof v.status === "string" && HQ_SESSION_AGENT_STATUSES.has(v.status) && typeof v.iterations === "number" && typeof v.toolCalls === "number" && typeof v.lastActivityAt === "string";
|
|
439
|
+
}
|
|
440
|
+
var HQ_SESSION_STATUSES = /* @__PURE__ */ new Set(["active", "idle", "closing", "stale"]);
|
|
441
|
+
function isHqSessionSnapshotPayload(x) {
|
|
442
|
+
if (typeof x !== "object" || x === null) return false;
|
|
443
|
+
const v = x;
|
|
444
|
+
if (typeof v.sessionId !== "string" || typeof v.clientKind !== "string" || typeof v.machineId !== "string" || typeof v.projectId !== "string" || typeof v.projectName !== "string" || typeof v.projectRoot !== "string" || typeof v.status !== "string" || !HQ_SESSION_STATUSES.has(v.status) || typeof v.startedAt !== "string" || typeof v.lastActivityAt !== "string" || typeof v.agentCount !== "number" || !Array.isArray(v.agents)) {
|
|
445
|
+
return false;
|
|
446
|
+
}
|
|
447
|
+
for (const agent of v.agents) {
|
|
448
|
+
if (!isHqSessionAgentSummary(agent)) return false;
|
|
449
|
+
}
|
|
450
|
+
return true;
|
|
451
|
+
}
|
|
452
|
+
var HQ_TRANSCRIPT_ROLES = /* @__PURE__ */ new Set([
|
|
453
|
+
"user",
|
|
454
|
+
"assistant",
|
|
455
|
+
"thinking",
|
|
456
|
+
"tool",
|
|
457
|
+
"system",
|
|
458
|
+
"error"
|
|
459
|
+
]);
|
|
460
|
+
function isHqTranscriptEntry(x) {
|
|
461
|
+
if (typeof x !== "object" || x === null) return false;
|
|
462
|
+
const v = x;
|
|
463
|
+
return typeof v.ts === "string" && typeof v.role === "string" && HQ_TRANSCRIPT_ROLES.has(v.role) && typeof v.text === "string";
|
|
464
|
+
}
|
|
465
|
+
function isHqTranscriptAppendPayload(x) {
|
|
466
|
+
if (typeof x !== "object" || x === null) return false;
|
|
467
|
+
const v = x;
|
|
468
|
+
if (typeof v.sessionId !== "string" || typeof v.fromSeq !== "number" || !Array.isArray(v.entries)) {
|
|
469
|
+
return false;
|
|
470
|
+
}
|
|
471
|
+
for (const entry of v.entries) {
|
|
472
|
+
if (!isHqTranscriptEntry(entry)) return false;
|
|
473
|
+
}
|
|
474
|
+
return true;
|
|
475
|
+
}
|
|
476
|
+
function isHqSessionEndedPayload(x) {
|
|
477
|
+
if (typeof x !== "object" || x === null) return false;
|
|
478
|
+
const v = x;
|
|
479
|
+
return typeof v.sessionId === "string" && typeof v.endedAt === "string";
|
|
480
|
+
}
|
|
481
|
+
var HQ_FLEET_SUBAGENT_STATUS = /* @__PURE__ */ new Set([
|
|
482
|
+
"pending",
|
|
483
|
+
"running",
|
|
484
|
+
"idle",
|
|
485
|
+
"completed",
|
|
486
|
+
"failed",
|
|
487
|
+
"stopped"
|
|
488
|
+
]);
|
|
489
|
+
function isHqSubagentSummary(x) {
|
|
490
|
+
if (typeof x !== "object" || x === null) return false;
|
|
491
|
+
const v = x;
|
|
492
|
+
return typeof v.subagentId === "string" && typeof v.status === "string" && HQ_FLEET_SUBAGENT_STATUS.has(v.status);
|
|
493
|
+
}
|
|
494
|
+
function isHqFleetSnapshotPayload(x) {
|
|
495
|
+
if (typeof x !== "object" || x === null) return false;
|
|
496
|
+
const v = x;
|
|
497
|
+
if (typeof v.runId !== "string" || typeof v.activeSubagents !== "number" || typeof v.queuedTasks !== "number" || typeof v.completedTasks !== "number" || typeof v.failedTasks !== "number" || !Array.isArray(v.subagents)) {
|
|
498
|
+
return false;
|
|
499
|
+
}
|
|
500
|
+
for (const s of v.subagents) {
|
|
501
|
+
if (!isHqSubagentSummary(s)) return false;
|
|
502
|
+
}
|
|
503
|
+
return true;
|
|
504
|
+
}
|
|
505
|
+
function isHqFleetEventPayload(x) {
|
|
506
|
+
if (typeof x !== "object" || x === null) return false;
|
|
507
|
+
const v = x;
|
|
508
|
+
return typeof v.runId === "string" && typeof v.event === "string";
|
|
509
|
+
}
|
|
510
|
+
var HQ_BRAIN_EVENT_KINDS = /* @__PURE__ */ new Set([
|
|
511
|
+
"decision_requested",
|
|
512
|
+
"decision_answered",
|
|
513
|
+
"decision_ask_human",
|
|
514
|
+
"human_answered",
|
|
515
|
+
"decision_denied",
|
|
516
|
+
"intervention"
|
|
517
|
+
]);
|
|
518
|
+
function isHqBrainEventPayload(x) {
|
|
519
|
+
if (typeof x !== "object" || x === null) return false;
|
|
520
|
+
const v = x;
|
|
521
|
+
if (typeof v.kind !== "string" || !HQ_BRAIN_EVENT_KINDS.has(v.kind)) return false;
|
|
522
|
+
if (typeof v.at !== "number") return false;
|
|
523
|
+
return true;
|
|
524
|
+
}
|
|
525
|
+
var HQ_WORKTREE_EVENT_KINDS = /* @__PURE__ */ new Set([
|
|
526
|
+
"allocated",
|
|
527
|
+
"committed",
|
|
528
|
+
"merged",
|
|
529
|
+
"conflict",
|
|
530
|
+
"released",
|
|
531
|
+
"failed"
|
|
532
|
+
]);
|
|
533
|
+
function isHqWorktreeEventPayload(x) {
|
|
534
|
+
if (typeof x !== "object" || x === null) return false;
|
|
535
|
+
const v = x;
|
|
536
|
+
if (typeof v.kind !== "string" || !HQ_WORKTREE_EVENT_KINDS.has(v.kind)) return false;
|
|
537
|
+
if (typeof v.handleId !== "string" || typeof v.ownerId !== "string") return false;
|
|
538
|
+
return true;
|
|
539
|
+
}
|
|
540
|
+
function isHqToolStartedPayload(x) {
|
|
541
|
+
if (typeof x !== "object" || x === null) return false;
|
|
542
|
+
const v = x;
|
|
543
|
+
return typeof v.toolName === "string";
|
|
544
|
+
}
|
|
545
|
+
function isHqToolCompletedPayload(x) {
|
|
546
|
+
if (typeof x !== "object" || x === null) return false;
|
|
547
|
+
const v = x;
|
|
548
|
+
return typeof v.toolName === "string" && typeof v.status === "string" && typeof v.durationMs === "number";
|
|
549
|
+
}
|
|
550
|
+
function isHqUsagePayload(x) {
|
|
551
|
+
if (typeof x !== "object" || x === null) return false;
|
|
552
|
+
return !Array.isArray(x);
|
|
553
|
+
}
|
|
554
|
+
function isHqClientHeartbeatPayload(x) {
|
|
555
|
+
if (typeof x !== "object" || x === null || Array.isArray(x)) return false;
|
|
556
|
+
const v = x;
|
|
557
|
+
return typeof v.uptimeMs === "number" && (v.activeSessionId === void 0 || typeof v.activeSessionId === "string") && (v.activeRunId === void 0 || typeof v.activeRunId === "string") && typeof v.status === "string" && (v.status === "active" || v.status === "idle" || v.status === "stale" || v.status === "error") && (v.activeSubagents === void 0 || typeof v.activeSubagents === "number") && (v.queuedTasks === void 0 || typeof v.queuedTasks === "number");
|
|
558
|
+
}
|
|
559
|
+
function parseHqEventPayload(eventType, payload) {
|
|
560
|
+
if (!KNOWN_HQ_EVENT_PAYLOAD_TYPES.has(eventType)) {
|
|
561
|
+
return { ok: true, payload };
|
|
562
|
+
}
|
|
563
|
+
switch (eventType) {
|
|
564
|
+
case "mailbox.snapshot":
|
|
565
|
+
return isHqMailboxSnapshotPayload(payload) ? { ok: true, payload } : { ok: false, reason: "malformed-payload" };
|
|
566
|
+
case "mailbox.event":
|
|
567
|
+
return isHqMailboxEventPayload(payload) ? { ok: true, payload } : { ok: false, reason: "malformed-payload" };
|
|
568
|
+
case "kanban.snapshot":
|
|
569
|
+
return isHqKanbanSnapshotPayload(payload) ? { ok: true, payload } : { ok: false, reason: "malformed-payload" };
|
|
570
|
+
case "session.snapshot":
|
|
571
|
+
return isHqSessionSnapshotPayload(payload) ? { ok: true, payload } : { ok: false, reason: "malformed-payload" };
|
|
572
|
+
case "session.transcript":
|
|
573
|
+
return isHqTranscriptAppendPayload(payload) ? { ok: true, payload } : { ok: false, reason: "malformed-payload" };
|
|
574
|
+
case "session.ended":
|
|
575
|
+
return isHqSessionEndedPayload(payload) ? { ok: true, payload } : { ok: false, reason: "malformed-payload" };
|
|
576
|
+
case "fleet.snapshot":
|
|
577
|
+
return isHqFleetSnapshotPayload(payload) ? { ok: true, payload } : { ok: false, reason: "malformed-payload" };
|
|
578
|
+
case "fleet.event":
|
|
579
|
+
return isHqFleetEventPayload(payload) ? { ok: true, payload } : { ok: false, reason: "malformed-payload" };
|
|
580
|
+
case "brain.event":
|
|
581
|
+
return isHqBrainEventPayload(payload) ? { ok: true, payload } : { ok: false, reason: "malformed-payload" };
|
|
582
|
+
case "worktree.event":
|
|
583
|
+
return isHqWorktreeEventPayload(payload) ? { ok: true, payload } : { ok: false, reason: "malformed-payload" };
|
|
584
|
+
case "tool.started":
|
|
585
|
+
return isHqToolStartedPayload(payload) ? { ok: true, payload } : { ok: false, reason: "malformed-payload" };
|
|
586
|
+
case "tool.completed":
|
|
587
|
+
return isHqToolCompletedPayload(payload) ? { ok: true, payload } : { ok: false, reason: "malformed-payload" };
|
|
588
|
+
case "session.usage":
|
|
589
|
+
return isHqUsagePayload(payload) ? { ok: true, payload } : { ok: false, reason: "malformed-payload" };
|
|
590
|
+
case "client.heartbeat":
|
|
591
|
+
return isHqClientHeartbeatPayload(payload) ? { ok: true, payload } : { ok: false, reason: "malformed-payload" };
|
|
592
|
+
case "mcp.health.snapshot":
|
|
593
|
+
return isHqMcpHealthSnapshotPayload(payload) ? { ok: true, payload } : { ok: false, reason: "malformed-payload" };
|
|
594
|
+
case "mcp.operation":
|
|
595
|
+
return isHqMcpOperationPayload(payload) ? { ok: true, payload } : { ok: false, reason: "malformed-payload" };
|
|
596
|
+
case "governance.snapshot":
|
|
597
|
+
return isHqGovernanceSnapshotPayload(payload) ? { ok: true, payload } : { ok: false, reason: "malformed-payload" };
|
|
598
|
+
case "peer.rehydrate":
|
|
599
|
+
return isHqPeerRehydratePayload(payload) ? { ok: true, payload } : { ok: false, reason: "malformed-payload" };
|
|
600
|
+
case "peer.lost":
|
|
601
|
+
return isHqPeerLostPayload(payload) ? { ok: true, payload } : { ok: false, reason: "malformed-payload" };
|
|
602
|
+
default: {
|
|
603
|
+
const _exhaustive = eventType;
|
|
604
|
+
return _exhaustive;
|
|
605
|
+
}
|
|
606
|
+
}
|
|
607
|
+
}
|
|
608
|
+
function createHqEventEnvelope(input) {
|
|
609
|
+
return {
|
|
610
|
+
id: input.id,
|
|
611
|
+
type: input.type,
|
|
612
|
+
schemaVersion: HQ_PROTOCOL_VERSION,
|
|
613
|
+
timestamp: input.timestamp,
|
|
614
|
+
clientId: input.clientId,
|
|
615
|
+
projectId: input.projectId,
|
|
616
|
+
seq: input.seq,
|
|
617
|
+
payload: input.payload,
|
|
618
|
+
...input.sessionId !== void 0 ? { sessionId: input.sessionId } : {},
|
|
619
|
+
...input.runId !== void 0 ? { runId: input.runId } : {}
|
|
620
|
+
};
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
// src/hq/protocol/resume.ts
|
|
624
|
+
var HQ_RESUME_GAP_MAX_ENVELOPES = 1e3;
|
|
625
|
+
var HQ_RESUME_GAP_MAX_BYTES = 1048576;
|
|
626
|
+
var HQ_RESUME_GAP_MAX_STALE_MS = 24 * 60 * 60 * 1e3;
|
|
627
|
+
function isHqResumeGapMessage(x) {
|
|
628
|
+
if (typeof x !== "object" || x === null || Array.isArray(x)) return false;
|
|
629
|
+
const v = x;
|
|
630
|
+
if (v.type !== "hq.resume_gap") return false;
|
|
631
|
+
if (!Number.isSafeInteger(v.lastSeqSeen) || v.lastSeqSeen < 0) return false;
|
|
632
|
+
if (!Array.isArray(v.envelopes)) return false;
|
|
633
|
+
if (v.envelopes.length > HQ_RESUME_GAP_MAX_ENVELOPES) return false;
|
|
634
|
+
if (typeof v.truncated !== "boolean") return false;
|
|
635
|
+
return true;
|
|
636
|
+
}
|
|
637
|
+
function isHqResumeRejectMessage(x) {
|
|
638
|
+
if (typeof x !== "object" || x === null || Array.isArray(x)) return false;
|
|
639
|
+
const v = x;
|
|
640
|
+
if (v.type !== "hq.resume_reject") return false;
|
|
641
|
+
if (v.reason !== "gap_too_large" && v.reason !== "last_seen_too_old" && v.reason !== "log_unavailable") {
|
|
642
|
+
return false;
|
|
643
|
+
}
|
|
644
|
+
if (typeof v.detectedAt !== "string" || !Number.isFinite(Date.parse(v.detectedAt))) return false;
|
|
645
|
+
return true;
|
|
646
|
+
}
|
|
647
|
+
|
|
648
|
+
// src/hq/protocol/tool.ts
|
|
649
|
+
var DEFAULT_HQ_REDACTION_POLICY = {
|
|
650
|
+
rawContent: true,
|
|
651
|
+
toolArgs: "full",
|
|
652
|
+
paths: "full"
|
|
653
|
+
};
|
|
654
|
+
var HQ_TRANSCRIPT_TEXT_CAP = 16e3;
|
|
655
|
+
export {
|
|
656
|
+
DEFAULT_HQ_REDACTION_POLICY,
|
|
657
|
+
HQ_BROWSER_PEER_RESUME_CLIENT_ID,
|
|
658
|
+
HQ_PEER_REHYDRATE_HINT_MAX_CHARS,
|
|
659
|
+
HQ_PEER_REHYDRATE_REASONS,
|
|
660
|
+
HQ_PROTOCOL_VERSION,
|
|
661
|
+
HQ_RESUME_GAP_MAX_BYTES,
|
|
662
|
+
HQ_RESUME_GAP_MAX_ENVELOPES,
|
|
663
|
+
HQ_RESUME_GAP_MAX_STALE_MS,
|
|
664
|
+
HQ_TRANSCRIPT_TEXT_CAP,
|
|
665
|
+
createHqEventEnvelope,
|
|
666
|
+
isHqGovernanceSnapshotPayload,
|
|
667
|
+
isHqKanbanSnapshotPayload,
|
|
668
|
+
isHqPeerLostPayload,
|
|
669
|
+
isHqPeerRehydratePayload,
|
|
670
|
+
isHqResumeGapMessage,
|
|
671
|
+
isHqResumeRejectMessage,
|
|
672
|
+
parseHqEventPayload,
|
|
673
|
+
parseHqFrame
|
|
674
|
+
};
|
|
675
|
+
//# sourceMappingURL=protocol.js.map
|