@wrongstack/core 0.297.0 → 0.298.1
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 +238 -157
- package/dist/coordination/agents/index.js +136 -1
- package/dist/coordination/agents/role-skills.d.ts +3 -2
- 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 +16493 -16068
- 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-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 +508 -253
- 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 +8 -4
- package/dist/coordination/sqlite-mailbox-credentials.d.ts +11 -0
- package/dist/core/fallback-profile-manager.d.ts +14 -0
- package/dist/core/index.js +451 -137
- 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 +2191 -1208
- package/dist/design/index.js +47 -8
- package/dist/execution/design-materialize.d.ts +22 -0
- package/dist/execution/index.js +495 -248
- 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 +3 -1
- 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 +401 -101
- package/dist/hq/kanban-store.d.ts +3 -0
- package/dist/hq/protocol/core.d.ts +3 -15
- package/dist/hq/protocol/envelope.d.ts +29 -0
- package/dist/hq/protocol/governance.d.ts +34 -0
- package/dist/hq/protocol/project.d.ts +3 -0
- package/dist/hq/protocol/resume.d.ts +1 -1
- package/dist/hq/protocol.d.ts +9 -8
- package/dist/hq/protocol.js +675 -0
- package/dist/index.js +9012 -6916
- package/dist/infrastructure/index.js +199 -102
- 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.js +27 -0
- package/dist/observability/prometheus.d.ts +11 -0
- package/dist/plugin/index.d.ts +5 -1
- package/dist/plugin/index.js +988 -558
- package/dist/plugins/auto-review-plugin.d.ts +1 -11
- package/dist/plugins/review-store-maintenance.d.ts +26 -0
- package/dist/plugins/review-types.d.ts +6 -0
- package/dist/security/auto-approve-policy.d.ts +37 -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 +3008 -2029
- package/dist/security/permission-helpers.d.ts +93 -0
- package/dist/security/permission-policy.d.ts +37 -35
- 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/index.js +929 -733
- package/dist/storage/provider-config-watcher.d.ts +1 -0
- package/dist/storage/session-helpers.d.ts +1 -0
- package/dist/storage/session-store.d.ts +9 -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 +287 -131
- package/dist/tools/mcp-use.d.ts +1 -1
- package/dist/types/blocks.d.ts +7 -0
- package/dist/types/config/autonomy.d.ts +15 -7
- package/dist/types/config/mcp-features.d.ts +9 -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/secret-vault.d.ts +8 -0
- package/dist/types/session.d.ts +2 -0
- package/dist/types/skill.d.ts +56 -0
- package/dist/types/tool-executor.d.ts +2 -0
- package/dist/utils/env-typed.d.ts +64 -0
- package/dist/utils/glob-match.d.ts +21 -1
- package/dist/utils/heap-watchdog.js +1 -1
- package/dist/utils/incoming-images.d.ts +19 -0
- package/dist/utils/index.d.ts +16 -12
- package/dist/utils/index.js +3128 -2800
- package/dist/utils/path-segment.d.ts +29 -0
- package/dist/utils/sage-output-block.js +48 -0
- package/dist/utils/win32-cmd.d.ts +25 -0
- package/dist/worktree/index.js +5 -0
- package/instructions/llm/chimera-review.md +4 -6
- package/package.json +13 -4
- package/skills/auto-review/SKILL.md +11 -76
- package/skills/chimera/SKILL.md +31 -49
- package/skills/data-governance/SKILL.md +92 -0
- package/skills/wrongstack-kanban/SKILL.md +125 -64
- 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/peer.d.ts.map +0 -1
- package/dist/hq/protocol/project.d.ts.map +0 -1
- package/dist/hq/protocol/resume.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/continuous-memory-profiler.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-types.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/memory-flight-recorder.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-name.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
|
@@ -1,11 +1,133 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
// src/chronicle/project-server.ts
|
|
4
|
+
import { randomBytes } from "node:crypto";
|
|
4
5
|
import * as fs9 from "node:fs";
|
|
5
6
|
import * as fsp4 from "node:fs/promises";
|
|
6
7
|
import * as net from "node:net";
|
|
7
8
|
import * as path15 from "node:path";
|
|
8
9
|
|
|
10
|
+
// src/utils/atomic-write.ts
|
|
11
|
+
import {
|
|
12
|
+
createPersistencePrimitives
|
|
13
|
+
} from "@wrongstack/persistence";
|
|
14
|
+
|
|
15
|
+
// src/types/errors.ts
|
|
16
|
+
var ERROR_CODES = {
|
|
17
|
+
// Provider
|
|
18
|
+
PROVIDER_RATE_LIMITED: "PROVIDER_RATE_LIMITED",
|
|
19
|
+
PROVIDER_AUTH_FAILED: "PROVIDER_AUTH_FAILED",
|
|
20
|
+
PROVIDER_OVERLOADED: "PROVIDER_OVERLOADED",
|
|
21
|
+
PROVIDER_INVALID_REQUEST: "PROVIDER_INVALID_REQUEST",
|
|
22
|
+
PROVIDER_SERVER_ERROR: "PROVIDER_SERVER_ERROR",
|
|
23
|
+
PROVIDER_NETWORK_ERROR: "PROVIDER_NETWORK_ERROR",
|
|
24
|
+
PROVIDER_CONTEXT_OVERFLOW: "PROVIDER_CONTEXT_OVERFLOW",
|
|
25
|
+
// Tool
|
|
26
|
+
TOOL_NOT_FOUND: "TOOL_NOT_FOUND",
|
|
27
|
+
TOOL_PERMISSION_DENIED: "TOOL_PERMISSION_DENIED",
|
|
28
|
+
TOOL_EXECUTION_FAILED: "TOOL_EXECUTION_FAILED",
|
|
29
|
+
TOOL_TIMEOUT: "TOOL_TIMEOUT",
|
|
30
|
+
TOOL_INPUT_INVALID: "TOOL_INPUT_INVALID",
|
|
31
|
+
// Config
|
|
32
|
+
CONFIG_INVALID: "CONFIG_INVALID",
|
|
33
|
+
CONFIG_NOT_FOUND: "CONFIG_NOT_FOUND",
|
|
34
|
+
CONFIG_PARSE_FAILED: "CONFIG_PARSE_FAILED",
|
|
35
|
+
CONFIG_MIGRATION_NEEDED: "CONFIG_MIGRATION_NEEDED",
|
|
36
|
+
// Plugin
|
|
37
|
+
PLUGIN_LOAD_FAILED: "PLUGIN_LOAD_FAILED",
|
|
38
|
+
PLUGIN_API_MISMATCH: "PLUGIN_API_MISMATCH",
|
|
39
|
+
PLUGIN_MISSING_DEPENDENCY: "PLUGIN_MISSING_DEPENDENCY",
|
|
40
|
+
// Agent
|
|
41
|
+
AGENT_ITERATION_LIMIT: "AGENT_ITERATION_LIMIT",
|
|
42
|
+
AGENT_CONTEXT_OVERFLOW: "AGENT_CONTEXT_OVERFLOW",
|
|
43
|
+
AGENT_ABORTED: "AGENT_ABORTED",
|
|
44
|
+
AGENT_RUN_FAILED: "AGENT_RUN_FAILED",
|
|
45
|
+
// Session
|
|
46
|
+
SESSION_NOT_FOUND: "SESSION_NOT_FOUND",
|
|
47
|
+
SESSION_CORRUPTED: "SESSION_CORRUPTED",
|
|
48
|
+
SESSION_WRITE_FAILED: "SESSION_WRITE_FAILED",
|
|
49
|
+
// Container / Registry
|
|
50
|
+
CONTAINER_TOKEN_ALREADY_BOUND: "CONTAINER_TOKEN_ALREADY_BOUND",
|
|
51
|
+
CONTAINER_TOKEN_NOT_BOUND: "CONTAINER_TOKEN_NOT_BOUND",
|
|
52
|
+
CONTAINER_CIRCULAR_DEPENDENCY: "CONTAINER_CIRCULAR_DEPENDENCY",
|
|
53
|
+
REGISTRY_DUPLICATE: "REGISTRY_DUPLICATE",
|
|
54
|
+
REGISTRY_NOT_FOUND: "REGISTRY_NOT_FOUND",
|
|
55
|
+
REGISTRY_INVALID: "REGISTRY_INVALID",
|
|
56
|
+
// File system
|
|
57
|
+
FS_READ_FAILED: "FS_READ_FAILED",
|
|
58
|
+
FS_WRITE_FAILED: "FS_WRITE_FAILED",
|
|
59
|
+
FS_MKDIR_FAILED: "FS_MKDIR_FAILED",
|
|
60
|
+
FS_DELETE_FAILED: "FS_DELETE_FAILED",
|
|
61
|
+
FS_ATOMIC_WRITE_FAILED: "FS_ATOMIC_WRITE_FAILED",
|
|
62
|
+
// SDD (Spec-Driven Development)
|
|
63
|
+
SDD_VALIDATION_FAILED: "SDD_VALIDATION_FAILED",
|
|
64
|
+
SDD_PARSE_FAILED: "SDD_PARSE_FAILED",
|
|
65
|
+
SDD_INVALID_STATE: "SDD_INVALID_STATE",
|
|
66
|
+
SDD_NOT_READY: "SDD_NOT_READY",
|
|
67
|
+
// General
|
|
68
|
+
VALIDATION_ERROR: "VALIDATION_ERROR",
|
|
69
|
+
PARSE_FAILED: "PARSE_FAILED",
|
|
70
|
+
UNKNOWN: "UNKNOWN"
|
|
71
|
+
};
|
|
72
|
+
var WrongStackError = class extends Error {
|
|
73
|
+
code;
|
|
74
|
+
subsystem;
|
|
75
|
+
severity;
|
|
76
|
+
recoverable;
|
|
77
|
+
context;
|
|
78
|
+
constructor(opts) {
|
|
79
|
+
super(opts.message, { cause: opts.cause });
|
|
80
|
+
this.name = "WrongStackError";
|
|
81
|
+
this.code = opts.code;
|
|
82
|
+
this.subsystem = opts.subsystem;
|
|
83
|
+
this.severity = opts.severity ?? "error";
|
|
84
|
+
this.recoverable = opts.recoverable ?? false;
|
|
85
|
+
this.context = opts.context;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Render a one-line user-facing description.
|
|
89
|
+
* Subclasses should override for domain-specific formatting.
|
|
90
|
+
*/
|
|
91
|
+
describe() {
|
|
92
|
+
const ctx = this.context ? ` ${formatContext(this.context)}` : "";
|
|
93
|
+
return `${this.code}: ${this.message}${ctx}`;
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
function formatContext(ctx) {
|
|
97
|
+
const parts = Object.entries(ctx).filter(([, v]) => v !== void 0).slice(0, 3).map(([k, v]) => `${k}=${String(v)}`);
|
|
98
|
+
return parts.length > 0 ? `[${parts.join(" ")}]` : "";
|
|
99
|
+
}
|
|
100
|
+
var FsError = class extends WrongStackError {
|
|
101
|
+
path;
|
|
102
|
+
constructor(opts) {
|
|
103
|
+
super({
|
|
104
|
+
message: opts.message,
|
|
105
|
+
code: opts.code,
|
|
106
|
+
subsystem: "fs",
|
|
107
|
+
severity: "error",
|
|
108
|
+
recoverable: opts.code !== ERROR_CODES.FS_READ_FAILED,
|
|
109
|
+
context: { path: opts.path, ...opts.context },
|
|
110
|
+
cause: opts.cause
|
|
111
|
+
});
|
|
112
|
+
this.name = "FsError";
|
|
113
|
+
this.path = opts.path;
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
// src/utils/atomic-write.ts
|
|
118
|
+
var primitives = createPersistencePrimitives({
|
|
119
|
+
createLockTimeoutError: ({ targetPath, timeoutMs }) => new FsError({
|
|
120
|
+
message: `Timed out waiting for file lock: ${targetPath}`,
|
|
121
|
+
code: "FS_ATOMIC_WRITE_FAILED",
|
|
122
|
+
path: targetPath,
|
|
123
|
+
context: { timeoutMs }
|
|
124
|
+
})
|
|
125
|
+
});
|
|
126
|
+
var atomicWrite = primitives.atomicWrite;
|
|
127
|
+
var atomicReplaceWithWriter = primitives.atomicReplaceWithWriter;
|
|
128
|
+
var ensureDir = primitives.ensureDir;
|
|
129
|
+
var withFileLock = primitives.withFileLock;
|
|
130
|
+
|
|
9
131
|
// src/utils/heap-watchdog.ts
|
|
10
132
|
import * as fs from "node:fs";
|
|
11
133
|
import * as fsp2 from "node:fs/promises";
|
|
@@ -526,7 +648,7 @@ function startHeapWatchdog(opts = {}) {
|
|
|
526
648
|
dirReady = true;
|
|
527
649
|
}
|
|
528
650
|
await fsp2.appendFile(targetPath, `${line}
|
|
529
|
-
`, "utf8");
|
|
651
|
+
`, { encoding: "utf8", mode: 384 });
|
|
530
652
|
});
|
|
531
653
|
const drainWrites = async (firstLine) => {
|
|
532
654
|
let line = firstLine;
|
|
@@ -1244,126 +1366,8 @@ import * as fs3 from "node:fs/promises";
|
|
|
1244
1366
|
import * as path8 from "node:path";
|
|
1245
1367
|
import { createInterface } from "node:readline";
|
|
1246
1368
|
|
|
1247
|
-
// src/
|
|
1248
|
-
|
|
1249
|
-
createPersistencePrimitives
|
|
1250
|
-
} from "@wrongstack/persistence";
|
|
1251
|
-
|
|
1252
|
-
// src/types/errors.ts
|
|
1253
|
-
var ERROR_CODES = {
|
|
1254
|
-
// Provider
|
|
1255
|
-
PROVIDER_RATE_LIMITED: "PROVIDER_RATE_LIMITED",
|
|
1256
|
-
PROVIDER_AUTH_FAILED: "PROVIDER_AUTH_FAILED",
|
|
1257
|
-
PROVIDER_OVERLOADED: "PROVIDER_OVERLOADED",
|
|
1258
|
-
PROVIDER_INVALID_REQUEST: "PROVIDER_INVALID_REQUEST",
|
|
1259
|
-
PROVIDER_SERVER_ERROR: "PROVIDER_SERVER_ERROR",
|
|
1260
|
-
PROVIDER_NETWORK_ERROR: "PROVIDER_NETWORK_ERROR",
|
|
1261
|
-
PROVIDER_CONTEXT_OVERFLOW: "PROVIDER_CONTEXT_OVERFLOW",
|
|
1262
|
-
// Tool
|
|
1263
|
-
TOOL_NOT_FOUND: "TOOL_NOT_FOUND",
|
|
1264
|
-
TOOL_PERMISSION_DENIED: "TOOL_PERMISSION_DENIED",
|
|
1265
|
-
TOOL_EXECUTION_FAILED: "TOOL_EXECUTION_FAILED",
|
|
1266
|
-
TOOL_TIMEOUT: "TOOL_TIMEOUT",
|
|
1267
|
-
TOOL_INPUT_INVALID: "TOOL_INPUT_INVALID",
|
|
1268
|
-
// Config
|
|
1269
|
-
CONFIG_INVALID: "CONFIG_INVALID",
|
|
1270
|
-
CONFIG_NOT_FOUND: "CONFIG_NOT_FOUND",
|
|
1271
|
-
CONFIG_PARSE_FAILED: "CONFIG_PARSE_FAILED",
|
|
1272
|
-
CONFIG_MIGRATION_NEEDED: "CONFIG_MIGRATION_NEEDED",
|
|
1273
|
-
// Plugin
|
|
1274
|
-
PLUGIN_LOAD_FAILED: "PLUGIN_LOAD_FAILED",
|
|
1275
|
-
PLUGIN_API_MISMATCH: "PLUGIN_API_MISMATCH",
|
|
1276
|
-
PLUGIN_MISSING_DEPENDENCY: "PLUGIN_MISSING_DEPENDENCY",
|
|
1277
|
-
// Agent
|
|
1278
|
-
AGENT_ITERATION_LIMIT: "AGENT_ITERATION_LIMIT",
|
|
1279
|
-
AGENT_CONTEXT_OVERFLOW: "AGENT_CONTEXT_OVERFLOW",
|
|
1280
|
-
AGENT_ABORTED: "AGENT_ABORTED",
|
|
1281
|
-
AGENT_RUN_FAILED: "AGENT_RUN_FAILED",
|
|
1282
|
-
// Session
|
|
1283
|
-
SESSION_NOT_FOUND: "SESSION_NOT_FOUND",
|
|
1284
|
-
SESSION_CORRUPTED: "SESSION_CORRUPTED",
|
|
1285
|
-
SESSION_WRITE_FAILED: "SESSION_WRITE_FAILED",
|
|
1286
|
-
// Container / Registry
|
|
1287
|
-
CONTAINER_TOKEN_ALREADY_BOUND: "CONTAINER_TOKEN_ALREADY_BOUND",
|
|
1288
|
-
CONTAINER_TOKEN_NOT_BOUND: "CONTAINER_TOKEN_NOT_BOUND",
|
|
1289
|
-
CONTAINER_CIRCULAR_DEPENDENCY: "CONTAINER_CIRCULAR_DEPENDENCY",
|
|
1290
|
-
REGISTRY_DUPLICATE: "REGISTRY_DUPLICATE",
|
|
1291
|
-
REGISTRY_NOT_FOUND: "REGISTRY_NOT_FOUND",
|
|
1292
|
-
REGISTRY_INVALID: "REGISTRY_INVALID",
|
|
1293
|
-
// File system
|
|
1294
|
-
FS_READ_FAILED: "FS_READ_FAILED",
|
|
1295
|
-
FS_WRITE_FAILED: "FS_WRITE_FAILED",
|
|
1296
|
-
FS_MKDIR_FAILED: "FS_MKDIR_FAILED",
|
|
1297
|
-
FS_DELETE_FAILED: "FS_DELETE_FAILED",
|
|
1298
|
-
FS_ATOMIC_WRITE_FAILED: "FS_ATOMIC_WRITE_FAILED",
|
|
1299
|
-
// SDD (Spec-Driven Development)
|
|
1300
|
-
SDD_VALIDATION_FAILED: "SDD_VALIDATION_FAILED",
|
|
1301
|
-
SDD_PARSE_FAILED: "SDD_PARSE_FAILED",
|
|
1302
|
-
SDD_INVALID_STATE: "SDD_INVALID_STATE",
|
|
1303
|
-
SDD_NOT_READY: "SDD_NOT_READY",
|
|
1304
|
-
// General
|
|
1305
|
-
VALIDATION_ERROR: "VALIDATION_ERROR",
|
|
1306
|
-
PARSE_FAILED: "PARSE_FAILED",
|
|
1307
|
-
UNKNOWN: "UNKNOWN"
|
|
1308
|
-
};
|
|
1309
|
-
var WrongStackError = class extends Error {
|
|
1310
|
-
code;
|
|
1311
|
-
subsystem;
|
|
1312
|
-
severity;
|
|
1313
|
-
recoverable;
|
|
1314
|
-
context;
|
|
1315
|
-
constructor(opts) {
|
|
1316
|
-
super(opts.message, { cause: opts.cause });
|
|
1317
|
-
this.name = "WrongStackError";
|
|
1318
|
-
this.code = opts.code;
|
|
1319
|
-
this.subsystem = opts.subsystem;
|
|
1320
|
-
this.severity = opts.severity ?? "error";
|
|
1321
|
-
this.recoverable = opts.recoverable ?? false;
|
|
1322
|
-
this.context = opts.context;
|
|
1323
|
-
}
|
|
1324
|
-
/**
|
|
1325
|
-
* Render a one-line user-facing description.
|
|
1326
|
-
* Subclasses should override for domain-specific formatting.
|
|
1327
|
-
*/
|
|
1328
|
-
describe() {
|
|
1329
|
-
const ctx = this.context ? ` ${formatContext(this.context)}` : "";
|
|
1330
|
-
return `${this.code}: ${this.message}${ctx}`;
|
|
1331
|
-
}
|
|
1332
|
-
};
|
|
1333
|
-
function formatContext(ctx) {
|
|
1334
|
-
const parts = Object.entries(ctx).filter(([, v]) => v !== void 0).slice(0, 3).map(([k, v]) => `${k}=${String(v)}`);
|
|
1335
|
-
return parts.length > 0 ? `[${parts.join(" ")}]` : "";
|
|
1336
|
-
}
|
|
1337
|
-
var FsError = class extends WrongStackError {
|
|
1338
|
-
path;
|
|
1339
|
-
constructor(opts) {
|
|
1340
|
-
super({
|
|
1341
|
-
message: opts.message,
|
|
1342
|
-
code: opts.code,
|
|
1343
|
-
subsystem: "fs",
|
|
1344
|
-
severity: "error",
|
|
1345
|
-
recoverable: opts.code !== ERROR_CODES.FS_READ_FAILED,
|
|
1346
|
-
context: { path: opts.path, ...opts.context },
|
|
1347
|
-
cause: opts.cause
|
|
1348
|
-
});
|
|
1349
|
-
this.name = "FsError";
|
|
1350
|
-
this.path = opts.path;
|
|
1351
|
-
}
|
|
1352
|
-
};
|
|
1353
|
-
|
|
1354
|
-
// src/utils/atomic-write.ts
|
|
1355
|
-
var primitives = createPersistencePrimitives({
|
|
1356
|
-
createLockTimeoutError: ({ targetPath, timeoutMs }) => new FsError({
|
|
1357
|
-
message: `Timed out waiting for file lock: ${targetPath}`,
|
|
1358
|
-
code: "FS_ATOMIC_WRITE_FAILED",
|
|
1359
|
-
path: targetPath,
|
|
1360
|
-
context: { timeoutMs }
|
|
1361
|
-
})
|
|
1362
|
-
});
|
|
1363
|
-
var atomicWrite = primitives.atomicWrite;
|
|
1364
|
-
var atomicReplaceWithWriter = primitives.atomicReplaceWithWriter;
|
|
1365
|
-
var ensureDir = primitives.ensureDir;
|
|
1366
|
-
var withFileLock = primitives.withFileLock;
|
|
1369
|
+
// src/security/file-permissions.ts
|
|
1370
|
+
var SECRET_FILE_MODE = 384;
|
|
1367
1371
|
|
|
1368
1372
|
// src/chronicle/event-hash.ts
|
|
1369
1373
|
import { createHash as createHash3 } from "node:crypto";
|
|
@@ -1422,7 +1426,16 @@ var ChronicleJournal = class {
|
|
|
1422
1426
|
drainPromise;
|
|
1423
1427
|
drainScheduled = false;
|
|
1424
1428
|
drainTimer;
|
|
1425
|
-
counters = {
|
|
1429
|
+
counters = {
|
|
1430
|
+
acceptedEvents: 0,
|
|
1431
|
+
persistedEvents: 0,
|
|
1432
|
+
rejectedEvents: 0,
|
|
1433
|
+
failedEvents: 0,
|
|
1434
|
+
batches: 0,
|
|
1435
|
+
maxObservedPending: 0,
|
|
1436
|
+
largestBatch: 0,
|
|
1437
|
+
partitionRolls: 0
|
|
1438
|
+
};
|
|
1426
1439
|
lastBatchDurationMs;
|
|
1427
1440
|
partitionIndex = 0;
|
|
1428
1441
|
partitionStartedAt;
|
|
@@ -1448,18 +1461,27 @@ var ChronicleJournal = class {
|
|
|
1448
1461
|
return this.partitionIndex === 0 ? this.basePath : rotatedPath(this.basePath, this.partitionIndex);
|
|
1449
1462
|
}
|
|
1450
1463
|
stats() {
|
|
1451
|
-
return {
|
|
1464
|
+
return {
|
|
1465
|
+
...this.counters,
|
|
1466
|
+
pendingEvents: this.pending.length,
|
|
1467
|
+
...this.lastBatchDurationMs !== void 0 ? { lastBatchDurationMs: this.lastBatchDurationMs } : {}
|
|
1468
|
+
};
|
|
1452
1469
|
}
|
|
1453
1470
|
append(input) {
|
|
1454
1471
|
if (this.pending.length >= this.maxPending) {
|
|
1455
1472
|
this.counters.rejectedEvents++;
|
|
1456
|
-
return Promise.reject(
|
|
1473
|
+
return Promise.reject(
|
|
1474
|
+
new Error(`Chronicle backpressure limit reached (${this.maxPending} pending events)`)
|
|
1475
|
+
);
|
|
1457
1476
|
}
|
|
1458
1477
|
const promise = new Promise((resolve12, reject) => {
|
|
1459
1478
|
this.pending.push({ input, resolve: resolve12, reject });
|
|
1460
1479
|
});
|
|
1461
1480
|
this.counters.acceptedEvents++;
|
|
1462
|
-
this.counters.maxObservedPending = Math.max(
|
|
1481
|
+
this.counters.maxObservedPending = Math.max(
|
|
1482
|
+
this.counters.maxObservedPending,
|
|
1483
|
+
this.pending.length
|
|
1484
|
+
);
|
|
1463
1485
|
this.scheduleDrain();
|
|
1464
1486
|
return promise;
|
|
1465
1487
|
}
|
|
@@ -1485,7 +1507,8 @@ var ChronicleJournal = class {
|
|
|
1485
1507
|
await this.flush();
|
|
1486
1508
|
const files = await collectPartitions(this.basePath);
|
|
1487
1509
|
const checkpointResult = await readRetentionCheckpoint(this.basePath);
|
|
1488
|
-
if (checkpointResult.error)
|
|
1510
|
+
if (checkpointResult.error)
|
|
1511
|
+
return { ok: false, entries: 0, brokenAt: 0, reason: checkpointResult.error };
|
|
1489
1512
|
return verifyPartitionFiles(files, checkpointResult.checkpoint);
|
|
1490
1513
|
}
|
|
1491
1514
|
async purge(options) {
|
|
@@ -1503,7 +1526,10 @@ var ChronicleJournal = class {
|
|
|
1503
1526
|
for (const suppliedPath of new Set(suppliedFiles)) {
|
|
1504
1527
|
const file = path8.resolve(suppliedPath);
|
|
1505
1528
|
if (!isJournalPartition(file, path8.dirname(this.basePath), this.basePath)) {
|
|
1506
|
-
errors.push({
|
|
1529
|
+
errors.push({
|
|
1530
|
+
file: suppliedPath,
|
|
1531
|
+
reason: "not a Chronicle journal partition in this journal directory"
|
|
1532
|
+
});
|
|
1507
1533
|
sc++;
|
|
1508
1534
|
continue;
|
|
1509
1535
|
}
|
|
@@ -1552,8 +1578,12 @@ var ChronicleJournal = class {
|
|
|
1552
1578
|
const checkpointResult = await readRetentionCheckpoint(familyBase);
|
|
1553
1579
|
if (checkpointResult.error) throw new Error(checkpointResult.error);
|
|
1554
1580
|
const checkpoint = checkpointResult.checkpoint;
|
|
1555
|
-
const nextCheckpoint = await verifyRetainedPrefix(
|
|
1556
|
-
|
|
1581
|
+
const nextCheckpoint = await verifyRetainedPrefix(
|
|
1582
|
+
streamEntriesStrict(file),
|
|
1583
|
+
checkpoint
|
|
1584
|
+
);
|
|
1585
|
+
if (!nextCheckpoint)
|
|
1586
|
+
throw new Error("partition does not extend the trusted Chronicle chain");
|
|
1557
1587
|
if (nextCheckpoint.sequence > (checkpoint?.sequence ?? 0)) {
|
|
1558
1588
|
await writeRetentionCheckpoint(familyBase, nextCheckpoint);
|
|
1559
1589
|
}
|
|
@@ -1573,7 +1603,13 @@ var ChronicleJournal = class {
|
|
|
1573
1603
|
}
|
|
1574
1604
|
}
|
|
1575
1605
|
}
|
|
1576
|
-
return {
|
|
1606
|
+
return {
|
|
1607
|
+
deletedCount: dc,
|
|
1608
|
+
deletedBytes: db,
|
|
1609
|
+
skippedCount: sc,
|
|
1610
|
+
errors,
|
|
1611
|
+
...options.dryRun ? { candidates } : {}
|
|
1612
|
+
};
|
|
1577
1613
|
}
|
|
1578
1614
|
async maybeAutoPurge() {
|
|
1579
1615
|
if (this.retentionDays <= 0) return;
|
|
@@ -1649,7 +1685,8 @@ var ChronicleJournal = class {
|
|
|
1649
1685
|
this.rotate();
|
|
1650
1686
|
return;
|
|
1651
1687
|
}
|
|
1652
|
-
if (Number.isFinite(this.maxPartitionSizeBytes) && this.partitionSizeBytes >= this.maxPartitionSizeBytes)
|
|
1688
|
+
if (Number.isFinite(this.maxPartitionSizeBytes) && this.partitionSizeBytes >= this.maxPartitionSizeBytes)
|
|
1689
|
+
this.rotate();
|
|
1653
1690
|
}
|
|
1654
1691
|
rotate() {
|
|
1655
1692
|
this.partitionIndex++;
|
|
@@ -1670,13 +1707,23 @@ var ChronicleJournal = class {
|
|
|
1670
1707
|
let prev = this.lastSequence > 0 ? { sequence: this.lastSequence, hash: this.lastHash } : void 0;
|
|
1671
1708
|
recorded = batch.map(({ input }) => {
|
|
1672
1709
|
const instant = this.now().toISOString();
|
|
1673
|
-
const uh = {
|
|
1710
|
+
const uh = {
|
|
1711
|
+
...input,
|
|
1712
|
+
occurredAt: input.occurredAt ?? instant,
|
|
1713
|
+
monotonicNs: input.monotonicNs ?? this.monotonicNow().toString(),
|
|
1714
|
+
schemaVersion: CHRONICLE_SCHEMA_VERSION,
|
|
1715
|
+
eventId: this.idFactory(),
|
|
1716
|
+
observedAt: instant,
|
|
1717
|
+
persistedAt: instant,
|
|
1718
|
+
sequence: (prev?.sequence ?? 0) + 1,
|
|
1719
|
+
previousHash: prev?.hash ?? GENESIS_HASH
|
|
1720
|
+
};
|
|
1674
1721
|
const event = { ...uh, hash: hashValue(uh) };
|
|
1675
1722
|
prev = event;
|
|
1676
1723
|
return event;
|
|
1677
1724
|
});
|
|
1678
1725
|
const serialized = recorded.map((e) => JSON.stringify(e)).join("\n") + "\n";
|
|
1679
|
-
await fs3.appendFile(cp, serialized, "utf8");
|
|
1726
|
+
await fs3.appendFile(cp, serialized, { encoding: "utf8", mode: SECRET_FILE_MODE });
|
|
1680
1727
|
this.partitionSizeBytes += Buffer.byteLength(serialized);
|
|
1681
1728
|
});
|
|
1682
1729
|
const last = recorded[recorded.length - 1];
|
|
@@ -1712,7 +1759,8 @@ async function collectPartitions(basePath) {
|
|
|
1712
1759
|
const result = [];
|
|
1713
1760
|
try {
|
|
1714
1761
|
const entries = await fs3.readdir(dir, { withFileTypes: true });
|
|
1715
|
-
for (const entry of entries)
|
|
1762
|
+
for (const entry of entries)
|
|
1763
|
+
if (entry.isFile() && pattern.test(entry.name)) result.push(path8.join(dir, entry.name));
|
|
1716
1764
|
} catch {
|
|
1717
1765
|
}
|
|
1718
1766
|
const baseFile = path8.join(dir, base + ext);
|
|
@@ -1787,23 +1835,42 @@ async function verifyPartitionFiles(files, checkpoint) {
|
|
|
1787
1835
|
for await (const entry of streamEntriesStrict(file)) {
|
|
1788
1836
|
const { hash: recordedHash, ...content } = entry;
|
|
1789
1837
|
if (entry.sequence <= checkpointSequence) {
|
|
1790
|
-
if (hashValue(content) !== recordedHash)
|
|
1838
|
+
if (hashValue(content) !== recordedHash)
|
|
1839
|
+
return { ok: false, entries, brokenAt: entries, reason: "entry hash mismatch" };
|
|
1791
1840
|
if (coveredPrevious && entry.sequence !== coveredPrevious.sequence + 1) {
|
|
1792
|
-
return {
|
|
1841
|
+
return {
|
|
1842
|
+
ok: false,
|
|
1843
|
+
entries,
|
|
1844
|
+
brokenAt: entries,
|
|
1845
|
+
reason: `sequence ${entry.sequence} is not ${coveredPrevious.sequence + 1}`
|
|
1846
|
+
};
|
|
1793
1847
|
}
|
|
1794
1848
|
if (coveredPrevious && entry.previousHash !== coveredPrevious.hash) {
|
|
1795
1849
|
return { ok: false, entries, brokenAt: entries, reason: "previous hash mismatch" };
|
|
1796
1850
|
}
|
|
1797
1851
|
if (entry.sequence === checkpointSequence && recordedHash !== checkpoint?.hash) {
|
|
1798
|
-
return {
|
|
1852
|
+
return {
|
|
1853
|
+
ok: false,
|
|
1854
|
+
entries,
|
|
1855
|
+
brokenAt: entries,
|
|
1856
|
+
reason: "retention checkpoint hash mismatch"
|
|
1857
|
+
};
|
|
1799
1858
|
}
|
|
1800
1859
|
coveredPrevious = entry;
|
|
1801
1860
|
continue;
|
|
1802
1861
|
}
|
|
1803
1862
|
const index = entries++;
|
|
1804
|
-
if (entry.sequence !== lastSequence + 1)
|
|
1805
|
-
|
|
1806
|
-
|
|
1863
|
+
if (entry.sequence !== lastSequence + 1)
|
|
1864
|
+
return {
|
|
1865
|
+
ok: false,
|
|
1866
|
+
entries,
|
|
1867
|
+
brokenAt: index,
|
|
1868
|
+
reason: `sequence ${entry.sequence} is not ${lastSequence + 1}`
|
|
1869
|
+
};
|
|
1870
|
+
if (entry.previousHash !== previousHash)
|
|
1871
|
+
return { ok: false, entries, brokenAt: index, reason: "previous hash mismatch" };
|
|
1872
|
+
if (hashValue(content) !== recordedHash)
|
|
1873
|
+
return { ok: false, entries, brokenAt: index, reason: "entry hash mismatch" };
|
|
1807
1874
|
previousHash = recordedHash;
|
|
1808
1875
|
lastSequence = entry.sequence;
|
|
1809
1876
|
}
|
|
@@ -1836,7 +1903,9 @@ async function readRetentionCheckpoint(basePath) {
|
|
|
1836
1903
|
}
|
|
1837
1904
|
async function writeRetentionCheckpoint(basePath, checkpoint) {
|
|
1838
1905
|
await atomicWrite(retentionCheckpointPath(basePath), `${JSON.stringify(checkpoint)}
|
|
1839
|
-
`, {
|
|
1906
|
+
`, {
|
|
1907
|
+
mode: 384
|
|
1908
|
+
});
|
|
1840
1909
|
}
|
|
1841
1910
|
function isHash(value) {
|
|
1842
1911
|
return typeof value === "string" && /^[a-f0-9]{64}$/.test(value);
|
|
@@ -1876,7 +1945,11 @@ async function readLastEntryState(filePath) {
|
|
|
1876
1945
|
const trimmed = lines[i].trim();
|
|
1877
1946
|
if (!trimmed) continue;
|
|
1878
1947
|
try {
|
|
1879
|
-
return {
|
|
1948
|
+
return {
|
|
1949
|
+
entry: JSON.parse(trimmed),
|
|
1950
|
+
size,
|
|
1951
|
+
birthtimeMs: stat5.birthtimeMs
|
|
1952
|
+
};
|
|
1880
1953
|
} catch {
|
|
1881
1954
|
}
|
|
1882
1955
|
}
|
|
@@ -4389,6 +4462,11 @@ var metadataPath = chronicleProjectServerMetadataPath(parsed.projectDir);
|
|
|
4389
4462
|
var idleInput = Number(process.env["WRONGSTACK_CHRONICLE_SERVER_IDLE_MS"]);
|
|
4390
4463
|
var idleMs = Number.isFinite(idleInput) && idleInput >= 100 ? idleInput : DEFAULT_IDLE_MS;
|
|
4391
4464
|
var startedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
4465
|
+
var authToken = randomBytes(16).toString("hex");
|
|
4466
|
+
var markMetadataWritten;
|
|
4467
|
+
var metadataWritten = new Promise((resolve12) => {
|
|
4468
|
+
markMetadataWritten = resolve12;
|
|
4469
|
+
});
|
|
4392
4470
|
var serverInfo = {
|
|
4393
4471
|
protocolVersion: CHRONICLE_PROJECT_SERVER_PROTOCOL_VERSION,
|
|
4394
4472
|
pid: process.pid,
|
|
@@ -4670,6 +4748,16 @@ function send(state, message) {
|
|
|
4670
4748
|
state.socket.write(encoded);
|
|
4671
4749
|
}
|
|
4672
4750
|
async function handleMessage(state, message) {
|
|
4751
|
+
if (message.authToken !== authToken) {
|
|
4752
|
+
send(state, {
|
|
4753
|
+
type: "response",
|
|
4754
|
+
id: message.id,
|
|
4755
|
+
ok: false,
|
|
4756
|
+
error: "Chronicle IPC request rejected: missing or invalid authToken. Reconnect to refresh metadata (server.json#authToken).",
|
|
4757
|
+
errorName: "UnauthorizedChronicleRequest"
|
|
4758
|
+
});
|
|
4759
|
+
return;
|
|
4760
|
+
}
|
|
4673
4761
|
if (message.type === "shutdown") {
|
|
4674
4762
|
send(state, { type: "response", id: message.id, ok: true, result: { stopped: true } });
|
|
4675
4763
|
await stop(message.reason ?? "client request");
|
|
@@ -4724,18 +4812,9 @@ function scheduleIdleStop() {
|
|
|
4724
4812
|
}
|
|
4725
4813
|
async function writeMetadata() {
|
|
4726
4814
|
await fsp4.mkdir(path15.dirname(metadataPath), { recursive: true });
|
|
4727
|
-
const
|
|
4728
|
-
await
|
|
4729
|
-
`, {
|
|
4730
|
-
encoding: "utf8",
|
|
4731
|
-
mode: 384
|
|
4732
|
-
});
|
|
4733
|
-
try {
|
|
4734
|
-
await fsp4.rename(temporary, metadataPath);
|
|
4735
|
-
} catch {
|
|
4736
|
-
await fsp4.rm(metadataPath, { force: true });
|
|
4737
|
-
await fsp4.rename(temporary, metadataPath);
|
|
4738
|
-
}
|
|
4815
|
+
const metadata = { ...serverInfo, authToken };
|
|
4816
|
+
await atomicWrite(metadataPath, `${JSON.stringify(metadata, null, 2)}
|
|
4817
|
+
`, { mode: 384 });
|
|
4739
4818
|
}
|
|
4740
4819
|
async function removeOwnedMetadata() {
|
|
4741
4820
|
try {
|
|
@@ -4749,6 +4828,7 @@ async function stop(_reason) {
|
|
|
4749
4828
|
stopping = true;
|
|
4750
4829
|
if (idleTimer) clearTimeout(idleTimer);
|
|
4751
4830
|
idleTimer = void 0;
|
|
4831
|
+
await removeOwnedMetadata();
|
|
4752
4832
|
await new Promise((resolve12) => server.close(() => resolve12()));
|
|
4753
4833
|
for (const state of clients) state.socket.destroy();
|
|
4754
4834
|
clients.clear();
|
|
@@ -4759,7 +4839,6 @@ async function stop(_reason) {
|
|
|
4759
4839
|
});
|
|
4760
4840
|
metricsStore?.close();
|
|
4761
4841
|
metricsStore = void 0;
|
|
4762
|
-
await removeOwnedMetadata();
|
|
4763
4842
|
if (process.platform !== "win32") await fsp4.rm(endpoint, { force: true }).catch(() => {
|
|
4764
4843
|
});
|
|
4765
4844
|
await stopMemoryWatchdog();
|
|
@@ -4775,7 +4854,9 @@ var server = net.createServer((socket) => {
|
|
|
4775
4854
|
socket.setEncoding("utf8");
|
|
4776
4855
|
const state = { socket, buffer: "" };
|
|
4777
4856
|
clients.add(state);
|
|
4778
|
-
|
|
4857
|
+
void metadataWritten.then(() => {
|
|
4858
|
+
if (!socket.destroyed) send(state, { type: "hello", ...serverInfo });
|
|
4859
|
+
});
|
|
4779
4860
|
socket.on("data", (chunk) => onData(state, chunk));
|
|
4780
4861
|
socket.on("close", () => {
|
|
4781
4862
|
clients.delete(state);
|
|
@@ -4818,7 +4899,7 @@ server.on("listening", () => {
|
|
|
4818
4899
|
} catch {
|
|
4819
4900
|
}
|
|
4820
4901
|
}
|
|
4821
|
-
void writeMetadata();
|
|
4902
|
+
void writeMetadata().then(() => markMetadataWritten?.());
|
|
4822
4903
|
void startChronicleFileObserver({
|
|
4823
4904
|
projectRoot: parsed.projectRoot,
|
|
4824
4905
|
journal: watcherSink,
|