@wrongstack/core 0.284.1 → 0.286.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent-status-tracker.d.ts +74 -0
- package/dist/agent-status-tracker.d.ts.map +1 -0
- package/dist/autophase/auto-phase-planner.d.ts +79 -0
- package/dist/autophase/auto-phase-planner.d.ts.map +1 -0
- package/dist/autophase/auto-phase-runner.d.ts +79 -0
- package/dist/autophase/auto-phase-runner.d.ts.map +1 -0
- package/dist/autophase/checkpoint.d.ts +49 -0
- package/dist/autophase/checkpoint.d.ts.map +1 -0
- package/dist/autophase/index.d.ts +9 -0
- package/dist/autophase/index.d.ts.map +1 -0
- package/dist/autophase/phase-graph-builder.d.ts +46 -0
- package/dist/autophase/phase-graph-builder.d.ts.map +1 -0
- package/dist/autophase/phase-orchestrator.d.ts +150 -0
- package/dist/autophase/phase-orchestrator.d.ts.map +1 -0
- package/dist/autophase/phase-store.d.ts +29 -0
- package/dist/autophase/phase-store.d.ts.map +1 -0
- package/dist/autophase/types.d.ts +329 -0
- package/dist/autophase/types.d.ts.map +1 -0
- package/dist/boot.d.ts +73 -0
- package/dist/boot.d.ts.map +1 -0
- package/dist/coordination/adaptive-concurrency.d.ts +63 -0
- package/dist/coordination/adaptive-concurrency.d.ts.map +1 -0
- package/dist/coordination/agent-bridge.d.ts +24 -0
- package/dist/coordination/agent-bridge.d.ts.map +1 -0
- package/dist/coordination/agent-monitor.d.ts +129 -0
- package/dist/coordination/agent-monitor.d.ts.map +1 -0
- package/dist/coordination/agent-subagent-runner.d.ts +74 -0
- package/dist/coordination/agent-subagent-runner.d.ts.map +1 -0
- package/dist/coordination/agents/agent-prompts.d.ts +2 -0
- package/dist/coordination/agents/agent-prompts.d.ts.map +1 -0
- package/dist/coordination/agents/index.d.ts +35 -0
- package/dist/coordination/agents/index.d.ts.map +1 -0
- package/dist/coordination/agents/phase1-discovery.d.ts +4 -0
- package/dist/coordination/agents/phase1-discovery.d.ts.map +1 -0
- package/dist/coordination/agents/phase2-planning.d.ts +4 -0
- package/dist/coordination/agents/phase2-planning.d.ts.map +1 -0
- package/dist/coordination/agents/phase3-build.d.ts +4 -0
- package/dist/coordination/agents/phase3-build.d.ts.map +1 -0
- package/dist/coordination/agents/phase3-techstack.d.ts +13 -0
- package/dist/coordination/agents/phase3-techstack.d.ts.map +1 -0
- package/dist/coordination/agents/phase4-verify.d.ts +4 -0
- package/dist/coordination/agents/phase4-verify.d.ts.map +1 -0
- package/dist/coordination/agents/phase5-review.d.ts +4 -0
- package/dist/coordination/agents/phase5-review.d.ts.map +1 -0
- package/dist/coordination/agents/phase6-domain.d.ts +4 -0
- package/dist/coordination/agents/phase6-domain.d.ts.map +1 -0
- package/dist/coordination/agents/phase7-knowledge.d.ts +4 -0
- package/dist/coordination/agents/phase7-knowledge.d.ts.map +1 -0
- package/dist/coordination/agents/phase8-delivery.d.ts +4 -0
- package/dist/coordination/agents/phase8-delivery.d.ts.map +1 -0
- package/dist/coordination/agents/phase9-meta.d.ts +4 -0
- package/dist/coordination/agents/phase9-meta.d.ts.map +1 -0
- package/dist/coordination/agents/types.d.ts +79 -0
- package/dist/coordination/agents/types.d.ts.map +1 -0
- package/dist/coordination/agents.d.ts +8 -0
- package/dist/coordination/agents.d.ts.map +1 -0
- package/dist/coordination/auto-extend.d.ts +46 -0
- package/dist/coordination/auto-extend.d.ts.map +1 -0
- package/dist/coordination/autonomous-brain.d.ts +152 -0
- package/dist/coordination/autonomous-brain.d.ts.map +1 -0
- package/dist/coordination/autonomous-coordinator.d.ts +243 -0
- package/dist/coordination/autonomous-coordinator.d.ts.map +1 -0
- package/dist/coordination/brain-ledger.d.ts +142 -0
- package/dist/coordination/brain-ledger.d.ts.map +1 -0
- package/dist/coordination/brain-monitor.d.ts +103 -0
- package/dist/coordination/brain-monitor.d.ts.map +1 -0
- package/dist/coordination/brain.d.ts +147 -0
- package/dist/coordination/brain.d.ts.map +1 -0
- package/dist/coordination/change-manager.d.ts +151 -0
- package/dist/coordination/change-manager.d.ts.map +1 -0
- package/dist/coordination/checkpoint-wiring.d.ts +61 -0
- package/dist/coordination/checkpoint-wiring.d.ts.map +1 -0
- package/dist/coordination/collab-bus.d.ts +132 -0
- package/dist/coordination/collab-bus.d.ts.map +1 -0
- package/dist/coordination/collab-debug.d.ts +302 -0
- package/dist/coordination/collab-debug.d.ts.map +1 -0
- package/dist/coordination/commit-safety.d.ts +72 -0
- package/dist/coordination/commit-safety.d.ts.map +1 -0
- package/dist/coordination/consensus-protocol.d.ts +106 -0
- package/dist/coordination/consensus-protocol.d.ts.map +1 -0
- package/dist/coordination/coordinator/error-classifier.d.ts +15 -0
- package/dist/coordination/coordinator/error-classifier.d.ts.map +1 -0
- package/dist/coordination/delegate-tool.d.ts +101 -0
- package/dist/coordination/delegate-tool.d.ts.map +1 -0
- package/dist/coordination/dep-watcher-bridge.d.ts +47 -0
- package/dist/coordination/dep-watcher-bridge.d.ts.map +1 -0
- package/dist/coordination/dep-watcher.d.ts +74 -0
- package/dist/coordination/dep-watcher.d.ts.map +1 -0
- package/dist/coordination/director/director-errors.d.ts +29 -0
- package/dist/coordination/director/director-errors.d.ts.map +1 -0
- package/dist/coordination/director-construction.d.ts +90 -0
- package/dist/coordination/director-construction.d.ts.map +1 -0
- package/dist/coordination/director-prompts.d.ts +119 -0
- package/dist/coordination/director-prompts.d.ts.map +1 -0
- package/dist/coordination/director-session.d.ts +68 -0
- package/dist/coordination/director-session.d.ts.map +1 -0
- package/dist/coordination/director-tools.d.ts +65 -0
- package/dist/coordination/director-tools.d.ts.map +1 -0
- package/dist/coordination/director.d.ts +802 -0
- package/dist/coordination/director.d.ts.map +1 -0
- package/dist/coordination/dispatcher.d.ts +82 -0
- package/dist/coordination/dispatcher.d.ts.map +1 -0
- package/dist/coordination/file-author-tracker.d.ts +76 -0
- package/dist/coordination/file-author-tracker.d.ts.map +1 -0
- package/dist/coordination/fleet-bus.d.ts +122 -0
- package/dist/coordination/fleet-bus.d.ts.map +1 -0
- package/dist/coordination/fleet-event-validation.d.ts +10 -0
- package/dist/coordination/fleet-event-validation.d.ts.map +1 -0
- package/dist/coordination/fleet-manager.d.ts +234 -0
- package/dist/coordination/fleet-manager.d.ts.map +1 -0
- package/dist/coordination/fleet-spawn.d.ts +102 -0
- package/dist/coordination/fleet-spawn.d.ts.map +1 -0
- package/dist/coordination/fleet-status-tool.d.ts +36 -0
- package/dist/coordination/fleet-status-tool.d.ts.map +1 -0
- package/dist/coordination/fleet-supervisor.d.ts +157 -0
- package/dist/coordination/fleet-supervisor.d.ts.map +1 -0
- package/dist/coordination/fleet.d.ts +96 -0
- package/dist/coordination/fleet.d.ts.map +1 -0
- package/dist/coordination/global-mailbox.d.ts +295 -0
- package/dist/coordination/global-mailbox.d.ts.map +1 -0
- package/dist/coordination/icoordinator.d.ts +97 -0
- package/dist/coordination/icoordinator.d.ts.map +1 -0
- package/dist/coordination/ifleet-manager.d.ts +177 -0
- package/dist/coordination/ifleet-manager.d.ts.map +1 -0
- package/dist/coordination/in-memory-transport.d.ts +12 -0
- package/dist/coordination/in-memory-transport.d.ts.map +1 -0
- package/dist/coordination/index.d.ts +79 -2587
- package/dist/coordination/index.d.ts.map +1 -0
- package/dist/coordination/index.js +2262 -673
- package/dist/coordination/index.js.map +7 -1
- package/dist/coordination/knowledge-graph.d.ts +229 -0
- package/dist/coordination/knowledge-graph.d.ts.map +1 -0
- package/dist/coordination/large-answer-store.d.ts +61 -0
- package/dist/coordination/large-answer-store.d.ts.map +1 -0
- package/dist/coordination/mail-tools.d.ts +34 -0
- package/dist/coordination/mail-tools.d.ts.map +1 -0
- package/dist/coordination/mailbox-actions.d.ts +67 -0
- package/dist/coordination/mailbox-actions.d.ts.map +1 -0
- package/dist/coordination/mailbox-constants.d.ts +64 -0
- package/dist/coordination/mailbox-constants.d.ts.map +1 -0
- package/dist/coordination/mailbox-events.d.ts +32 -0
- package/dist/coordination/mailbox-events.d.ts.map +1 -0
- package/dist/coordination/mailbox-health.d.ts +131 -0
- package/dist/coordination/mailbox-health.d.ts.map +1 -0
- package/dist/coordination/mailbox-hooks.d.ts +55 -0
- package/dist/coordination/mailbox-hooks.d.ts.map +1 -0
- package/dist/coordination/mailbox-message-codec.d.ts +8 -0
- package/dist/coordination/mailbox-message-codec.d.ts.map +1 -0
- package/dist/coordination/mailbox-tool.d.ts +75 -0
- package/dist/coordination/mailbox-tool.d.ts.map +1 -0
- package/dist/{mailbox-types-BGZWrYTJ.d.ts → coordination/mailbox-types.d.ts} +125 -26
- package/dist/coordination/mailbox-types.d.ts.map +1 -0
- package/dist/coordination/mailbox.d.ts +88 -0
- package/dist/coordination/mailbox.d.ts.map +1 -0
- package/dist/coordination/model-matrix.d.ts +98 -0
- package/dist/coordination/model-matrix.d.ts.map +1 -0
- package/dist/coordination/multi-agent-coordinator.d.ts +202 -0
- package/dist/coordination/multi-agent-coordinator.d.ts.map +1 -0
- package/dist/coordination/null-fleet-bus.d.ts +10 -0
- package/dist/coordination/null-fleet-bus.d.ts.map +1 -0
- package/dist/coordination/package-author-tracker.d.ts +87 -0
- package/dist/coordination/package-author-tracker.d.ts.map +1 -0
- package/dist/coordination/package-outdated-watcher.d.ts +83 -0
- package/dist/coordination/package-outdated-watcher.d.ts.map +1 -0
- package/dist/coordination/single-instance-mailbox.d.ts +154 -0
- package/dist/coordination/single-instance-mailbox.d.ts.map +1 -0
- package/dist/coordination/spawn-budget.d.ts +6 -0
- package/dist/coordination/spawn-budget.d.ts.map +1 -0
- package/dist/coordination/subagent-budget.d.ts +323 -0
- package/dist/coordination/subagent-budget.d.ts.map +1 -0
- package/dist/coordination/subagent-nicknames.d.ts +42 -0
- package/dist/coordination/subagent-nicknames.d.ts.map +1 -0
- package/dist/coordination/subagent-result-tool.d.ts +20 -0
- package/dist/coordination/subagent-result-tool.d.ts.map +1 -0
- package/dist/coordination/task-auctioneer.d.ts +143 -0
- package/dist/coordination/task-auctioneer.d.ts.map +1 -0
- package/dist/coordination/task-dag.d.ts +147 -0
- package/dist/coordination/task-dag.d.ts.map +1 -0
- package/dist/coordination/techstack-mailbox-consumer.d.ts +50 -0
- package/dist/coordination/techstack-mailbox-consumer.d.ts.map +1 -0
- package/dist/coordination/transport.d.ts +2 -0
- package/dist/coordination/transport.d.ts.map +1 -0
- package/dist/coordination/worktree-task-runner.d.ts +45 -0
- package/dist/coordination/worktree-task-runner.d.ts.map +1 -0
- package/dist/core/agent-internals.d.ts +41 -0
- package/dist/core/agent-internals.d.ts.map +1 -0
- package/dist/core/agent-loop.d.ts +18 -0
- package/dist/core/agent-loop.d.ts.map +1 -0
- package/dist/core/agent-response.d.ts +21 -0
- package/dist/core/agent-response.d.ts.map +1 -0
- package/dist/core/agent-tools.d.ts +21 -0
- package/dist/core/agent-tools.d.ts.map +1 -0
- package/dist/core/agent-types.d.ts +95 -0
- package/dist/core/agent-types.d.ts.map +1 -0
- package/dist/core/agent.d.ts +54 -0
- package/dist/core/agent.d.ts.map +1 -0
- package/dist/core/btw.d.ts +40 -0
- package/dist/core/btw.d.ts.map +1 -0
- package/dist/core/context.d.ts +269 -0
- package/dist/core/context.d.ts.map +1 -0
- package/dist/core/continue-intent.d.ts +92 -0
- package/dist/core/continue-intent.d.ts.map +1 -0
- package/dist/core/continue-to-next-iteration.d.ts +96 -0
- package/dist/core/continue-to-next-iteration.d.ts.map +1 -0
- package/dist/core/conversation-state.d.ts +96 -0
- package/dist/core/conversation-state.d.ts.map +1 -0
- package/dist/core/fallback-model.d.ts +94 -0
- package/dist/core/fallback-model.d.ts.map +1 -0
- package/dist/core/fleet-pulse.d.ts +42 -0
- package/dist/core/fleet-pulse.d.ts.map +1 -0
- package/dist/core/input-builder.d.ts +95 -0
- package/dist/core/input-builder.d.ts.map +1 -0
- package/dist/core/instruction-bundle.d.ts +22 -0
- package/dist/core/instruction-bundle.d.ts.map +1 -0
- package/dist/core/iteration-limit.d.ts +35 -0
- package/dist/core/iteration-limit.d.ts.map +1 -0
- package/dist/core/mailbox-loop.d.ts +63 -0
- package/dist/core/mailbox-loop.d.ts.map +1 -0
- package/dist/core/modes/brief.d.ts +2 -0
- package/dist/core/modes/brief.d.ts.map +1 -0
- package/dist/core/modes/default.d.ts +8 -0
- package/dist/core/modes/default.d.ts.map +1 -0
- package/dist/core/modes/teach.d.ts +2 -0
- package/dist/core/modes/teach.d.ts.map +1 -0
- package/dist/core/provider-runner.d.ts +24 -0
- package/dist/core/provider-runner.d.ts.map +1 -0
- package/dist/core/queued-messages.d.ts +55 -0
- package/dist/core/queued-messages.d.ts.map +1 -0
- package/dist/core/run-env.d.ts +49 -0
- package/dist/core/run-env.d.ts.map +1 -0
- package/dist/core/streaming-response-builder.d.ts +78 -0
- package/dist/core/streaming-response-builder.d.ts.map +1 -0
- package/dist/core/system-prompt-builder.d.ts +213 -0
- package/dist/core/system-prompt-builder.d.ts.map +1 -0
- package/dist/defaults/index.d.ts +68 -158
- package/dist/defaults/index.d.ts.map +1 -0
- package/dist/defaults/index.js +2061 -1300
- package/dist/defaults/index.js.map +7 -1
- package/dist/execution/auto-compaction-middleware.d.ts +123 -0
- package/dist/execution/auto-compaction-middleware.d.ts.map +1 -0
- package/dist/execution/autonomous-runner.d.ts +61 -0
- package/dist/execution/autonomous-runner.d.ts.map +1 -0
- package/dist/execution/autonomy-brain.d.ts +151 -0
- package/dist/execution/autonomy-brain.d.ts.map +1 -0
- package/dist/execution/autonomy-prompt-contributor.d.ts +39 -0
- package/dist/execution/autonomy-prompt-contributor.d.ts.map +1 -0
- package/dist/execution/brain-chain.d.ts +53 -0
- package/dist/execution/brain-chain.d.ts.map +1 -0
- package/dist/execution/brain-evaluation.d.ts +66 -0
- package/dist/execution/brain-evaluation.d.ts.map +1 -0
- package/dist/execution/brain-runtime.d.ts +171 -0
- package/dist/execution/brain-runtime.d.ts.map +1 -0
- package/dist/execution/compaction-core.d.ts +103 -0
- package/dist/execution/compaction-core.d.ts.map +1 -0
- package/dist/execution/compactor.d.ts +56 -0
- package/dist/execution/compactor.d.ts.map +1 -0
- package/dist/execution/council-brain.d.ts +79 -0
- package/dist/execution/council-brain.d.ts.map +1 -0
- package/dist/execution/design-color.d.ts +31 -0
- package/dist/execution/design-color.d.ts.map +1 -0
- package/dist/execution/design-detect.d.ts +96 -0
- package/dist/execution/design-detect.d.ts.map +1 -0
- package/dist/execution/design-kit-loader.d.ts +53 -0
- package/dist/execution/design-kit-loader.d.ts.map +1 -0
- package/dist/execution/design-materialize.d.ts +32 -0
- package/dist/execution/design-materialize.d.ts.map +1 -0
- package/dist/execution/design-project-store.d.ts +57 -0
- package/dist/execution/design-project-store.d.ts.map +1 -0
- package/dist/execution/design-verify.d.ts +44 -0
- package/dist/execution/design-verify.d.ts.map +1 -0
- package/dist/execution/error-handler.d.ts +34 -0
- package/dist/execution/error-handler.d.ts.map +1 -0
- package/dist/{parallel-eternal-engine-HUrtePLd.d.ts → execution/eternal-autonomy.d.ts} +22 -225
- package/dist/execution/eternal-autonomy.d.ts.map +1 -0
- package/dist/execution/goal-preamble.d.ts +2 -0
- package/dist/execution/goal-preamble.d.ts.map +1 -0
- package/dist/execution/index.d.ts +25 -180
- package/dist/execution/index.d.ts.map +1 -0
- package/dist/execution/index.js +1748 -490
- package/dist/execution/index.js.map +7 -1
- package/dist/execution/intelligent-compactor.d.ts +85 -0
- package/dist/execution/intelligent-compactor.d.ts.map +1 -0
- package/dist/execution/model-runtime.d.ts +75 -0
- package/dist/execution/model-runtime.d.ts.map +1 -0
- package/dist/execution/parallel-eternal-engine.d.ts +142 -0
- package/dist/execution/parallel-eternal-engine.d.ts.map +1 -0
- package/dist/execution/prompt-enhancer.d.ts +12 -13
- package/dist/execution/prompt-enhancer.d.ts.map +1 -0
- package/dist/execution/prompt-enhancer.js +13 -7
- package/dist/execution/prompt-enhancer.js.map +7 -1
- package/dist/execution/prompt-loader.d.ts +52 -0
- package/dist/execution/prompt-loader.d.ts.map +1 -0
- package/dist/execution/provider-runner-impl.d.ts +14 -0
- package/dist/execution/provider-runner-impl.d.ts.map +1 -0
- package/dist/execution/regex-patterns.d.ts +7 -0
- package/dist/execution/regex-patterns.d.ts.map +1 -0
- package/dist/execution/retry-policy.d.ts +35 -0
- package/dist/execution/retry-policy.d.ts.map +1 -0
- package/dist/execution/selective-compactor.d.ts +94 -0
- package/dist/execution/selective-compactor.d.ts.map +1 -0
- package/dist/execution/skill-loader.d.ts +43 -0
- package/dist/execution/skill-loader.d.ts.map +1 -0
- package/dist/execution/strategy-compactor.d.ts +43 -0
- package/dist/execution/strategy-compactor.d.ts.map +1 -0
- package/dist/execution/tool-executor.d.ts +112 -0
- package/dist/execution/tool-executor.d.ts.map +1 -0
- package/dist/extension/extension-points.d.ts +121 -0
- package/dist/extension/extension-points.d.ts.map +1 -0
- package/dist/extension/index.d.ts +3 -10
- package/dist/extension/index.d.ts.map +1 -0
- package/dist/extension/index.js +59 -5
- package/dist/extension/index.js.map +7 -1
- package/dist/extension/registry.d.ts +86 -0
- package/dist/extension/registry.d.ts.map +1 -0
- package/dist/fleet-notifier.d.ts +28 -0
- package/dist/fleet-notifier.d.ts.map +1 -0
- package/dist/hooks/http-executor.d.ts +11 -0
- package/dist/hooks/http-executor.d.ts.map +1 -0
- package/dist/hooks/index.d.ts +10 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/registry.d.ts +71 -0
- package/dist/hooks/registry.d.ts.map +1 -0
- package/dist/hooks/runner.d.ts +65 -0
- package/dist/hooks/runner.d.ts.map +1 -0
- package/dist/hooks/shell-executor.d.ts +33 -0
- package/dist/hooks/shell-executor.d.ts.map +1 -0
- package/dist/hooks/shell-hooks-equal.d.ts +15 -0
- package/dist/hooks/shell-hooks-equal.d.ts.map +1 -0
- package/dist/hq/agent-bridge.d.ts +27 -0
- package/dist/hq/agent-bridge.d.ts.map +1 -0
- package/dist/hq/alerts.d.ts +67 -0
- package/dist/hq/alerts.d.ts.map +1 -0
- package/dist/hq/auth-store.d.ts +179 -0
- package/dist/hq/auth-store.d.ts.map +1 -0
- package/dist/hq/brain-bridge.d.ts +37 -0
- package/dist/hq/brain-bridge.d.ts.map +1 -0
- package/dist/hq/commands.d.ts +122 -0
- package/dist/hq/commands.d.ts.map +1 -0
- package/dist/hq/cost-bridge.d.ts +36 -0
- package/dist/hq/cost-bridge.d.ts.map +1 -0
- package/dist/hq/factory.d.ts +69 -0
- package/dist/hq/factory.d.ts.map +1 -0
- package/dist/hq/fleet-bridge.d.ts +39 -0
- package/dist/hq/fleet-bridge.d.ts.map +1 -0
- package/dist/hq/index.d.ts +18 -816
- package/dist/hq/index.d.ts.map +1 -0
- package/dist/hq/index.js +1043 -192
- package/dist/hq/index.js.map +7 -1
- package/dist/hq/mailbox-mapper.d.ts +27 -0
- package/dist/hq/mailbox-mapper.d.ts.map +1 -0
- package/dist/hq/persistence.d.ts +121 -0
- package/dist/hq/persistence.d.ts.map +1 -0
- package/dist/hq/protocol.d.ts +612 -0
- package/dist/hq/protocol.d.ts.map +1 -0
- package/dist/hq/publisher.d.ts +181 -0
- package/dist/hq/publisher.d.ts.map +1 -0
- package/dist/hq/redaction.d.ts +30 -0
- package/dist/hq/redaction.d.ts.map +1 -0
- package/dist/hq/session-bridge.d.ts +29 -0
- package/dist/hq/session-bridge.d.ts.map +1 -0
- package/dist/hq/tool-bridge.d.ts +41 -0
- package/dist/hq/tool-bridge.d.ts.map +1 -0
- package/dist/hq/transcript-mapper.d.ts +36 -0
- package/dist/hq/transcript-mapper.d.ts.map +1 -0
- package/dist/hq/worktree-bridge.d.ts +34 -0
- package/dist/hq/worktree-bridge.d.ts.map +1 -0
- package/dist/index.d.ts +114 -2872
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6104 -2737
- package/dist/index.js.map +7 -1
- package/dist/infrastructure/context-manager.d.ts +92 -0
- package/dist/infrastructure/context-manager.d.ts.map +1 -0
- package/dist/infrastructure/index.d.ts +6 -64
- package/dist/infrastructure/index.d.ts.map +1 -0
- package/dist/infrastructure/index.js +39 -12
- package/dist/infrastructure/index.js.map +7 -1
- package/dist/infrastructure/logger.d.ts +99 -0
- package/dist/infrastructure/logger.d.ts.map +1 -0
- package/dist/infrastructure/mcp-servers.d.ts +83 -0
- package/dist/infrastructure/mcp-servers.d.ts.map +1 -0
- package/dist/{path-resolver-CMS5307d.d.ts → infrastructure/path-resolver.d.ts} +3 -5
- package/dist/infrastructure/path-resolver.d.ts.map +1 -0
- package/dist/infrastructure/token-counter.d.ts +57 -0
- package/dist/infrastructure/token-counter.d.ts.map +1 -0
- package/dist/kernel/container.d.ts +84 -0
- package/dist/kernel/container.d.ts.map +1 -0
- package/dist/{events-Bgnh43r9.d.ts → kernel/events.d.ts} +134 -210
- package/dist/kernel/events.d.ts.map +1 -0
- package/dist/kernel/index.d.ts +6 -107
- package/dist/kernel/index.d.ts.map +1 -0
- package/dist/kernel/index.js +56 -4
- package/dist/kernel/index.js.map +7 -1
- package/dist/kernel/pipeline.d.ts +105 -0
- package/dist/kernel/pipeline.d.ts.map +1 -0
- package/dist/kernel/run-controller.d.ts +55 -0
- package/dist/kernel/run-controller.d.ts.map +1 -0
- package/dist/kernel/tokens.d.ts +53 -0
- package/dist/kernel/tokens.d.ts.map +1 -0
- package/dist/mailbox-attach.d.ts +27 -0
- package/dist/mailbox-attach.d.ts.map +1 -0
- package/dist/middleware/collab-pause.d.ts +73 -0
- package/dist/middleware/collab-pause.d.ts.map +1 -0
- package/dist/models/codex-catalog.d.ts +41 -0
- package/dist/models/codex-catalog.d.ts.map +1 -0
- package/dist/models/index.d.ts +8 -163
- package/dist/models/index.d.ts.map +1 -0
- package/dist/models/index.js +150 -51
- package/dist/models/index.js.map +7 -1
- package/dist/models/llm-selector.d.ts +47 -0
- package/dist/models/llm-selector.d.ts.map +1 -0
- package/dist/models/mode-store.d.ts +22 -0
- package/dist/models/mode-store.d.ts.map +1 -0
- package/dist/models/model-intelligence.d.ts +56 -0
- package/dist/models/model-intelligence.d.ts.map +1 -0
- package/dist/models/model-router.d.ts +100 -0
- package/dist/models/model-router.d.ts.map +1 -0
- package/dist/models/models-registry.d.ts +106 -0
- package/dist/models/models-registry.d.ts.map +1 -0
- package/dist/models/provider-model-resolve.d.ts +69 -0
- package/dist/models/provider-model-resolve.d.ts.map +1 -0
- package/dist/observability/event-bridge.d.ts +10 -0
- package/dist/observability/event-bridge.d.ts.map +1 -0
- package/dist/observability/health.d.ts +18 -0
- package/dist/observability/health.d.ts.map +1 -0
- package/dist/observability/index.d.ts +9 -354
- package/dist/observability/index.d.ts.map +1 -0
- package/dist/observability/index.js +37 -23
- package/dist/observability/index.js.map +7 -1
- package/dist/observability/metrics.d.ts +26 -0
- package/dist/observability/metrics.d.ts.map +1 -0
- package/dist/observability/otel-tracer.d.ts +41 -0
- package/dist/observability/otel-tracer.d.ts.map +1 -0
- package/dist/observability/otlp-metrics.d.ts +111 -0
- package/dist/observability/otlp-metrics.d.ts.map +1 -0
- package/dist/observability/otlp-traces.d.ts +95 -0
- package/dist/observability/otlp-traces.d.ts.map +1 -0
- package/dist/observability/prometheus.d.ts +49 -0
- package/dist/observability/prometheus.d.ts.map +1 -0
- package/dist/observability/tracer.d.ts +9 -0
- package/dist/observability/tracer.d.ts.map +1 -0
- package/dist/plugin/api.d.ts +226 -0
- package/dist/plugin/api.d.ts.map +1 -0
- package/dist/plugin/loader.d.ts +73 -0
- package/dist/plugin/loader.d.ts.map +1 -0
- package/dist/plugins/chimera-plugin.d.ts +37 -0
- package/dist/plugins/chimera-plugin.d.ts.map +1 -0
- package/dist/plugins/prompts-plugin.d.ts +26 -0
- package/dist/plugins/prompts-plugin.d.ts.map +1 -0
- package/dist/plugins/security-plugin.d.ts +19 -0
- package/dist/plugins/security-plugin.d.ts.map +1 -0
- package/dist/plugins/skills-plugin.d.ts +42 -0
- package/dist/plugins/skills-plugin.d.ts.map +1 -0
- package/dist/plugins/sync-plugin.d.ts +22 -0
- package/dist/plugins/sync-plugin.d.ts.map +1 -0
- package/dist/prompts/index.d.ts +3 -0
- package/dist/prompts/index.d.ts.map +1 -0
- package/dist/prompts/prompt-installer.d.ts +50 -0
- package/dist/prompts/prompt-installer.d.ts.map +1 -0
- package/dist/prompts/prompt-manifest-store.d.ts +18 -0
- package/dist/prompts/prompt-manifest-store.d.ts.map +1 -0
- package/dist/registry/provider-registry.d.ts +51 -0
- package/dist/registry/provider-registry.d.ts.map +1 -0
- package/dist/registry/slash-command-registry.d.ts +61 -0
- package/dist/registry/slash-command-registry.d.ts.map +1 -0
- package/dist/registry/tool-registry.d.ts +154 -0
- package/dist/registry/tool-registry.d.ts.map +1 -0
- package/dist/replay/hash.d.ts +31 -0
- package/dist/replay/hash.d.ts.map +1 -0
- package/dist/replay/replay-provider-runner.d.ts +53 -0
- package/dist/replay/replay-provider-runner.d.ts.map +1 -0
- package/dist/{index-CbyuOE5y.d.ts → security/capabilities.d.ts} +31 -34
- package/dist/security/capabilities.d.ts.map +1 -0
- package/dist/security/config-secrets.d.ts +25 -0
- package/dist/security/config-secrets.d.ts.map +1 -0
- package/dist/security/index.d.ts +7 -8
- package/dist/security/index.d.ts.map +1 -0
- package/dist/security/index.js +354 -401
- package/dist/security/index.js.map +7 -1
- package/dist/security/permission-policy-schema.d.ts +77 -0
- package/dist/security/permission-policy-schema.d.ts.map +1 -0
- package/dist/security/permission-policy.d.ts +158 -0
- package/dist/security/permission-policy.d.ts.map +1 -0
- package/dist/security/secret-scrubber.d.ts +14 -0
- package/dist/security/secret-scrubber.d.ts.map +1 -0
- package/dist/security/secret-vault.d.ts +96 -0
- package/dist/security/secret-vault.d.ts.map +1 -0
- package/dist/security/yolo-risk.d.ts +11 -0
- package/dist/security/yolo-risk.d.ts.map +1 -0
- package/dist/{session-registry-Dvg7i_IA.d.ts → session-registry.d.ts} +8 -9
- package/dist/session-registry.d.ts.map +1 -0
- package/dist/skills/foreign-sources.d.ts +59 -0
- package/dist/skills/foreign-sources.d.ts.map +1 -0
- package/dist/skills/frontmatter.d.ts +44 -0
- package/dist/skills/frontmatter.d.ts.map +1 -0
- package/dist/skills/github-fetcher.d.ts +38 -0
- package/dist/skills/github-fetcher.d.ts.map +1 -0
- package/dist/skills/index.d.ts +11 -582
- package/dist/skills/index.d.ts.map +1 -0
- package/dist/skills/index.js +81 -43
- package/dist/skills/index.js.map +7 -1
- package/dist/skills/limits.d.ts +92 -0
- package/dist/skills/limits.d.ts.map +1 -0
- package/dist/skills/manifest-store.d.ts +42 -0
- package/dist/skills/manifest-store.d.ts.map +1 -0
- package/dist/skills/registry/github-direct-adapter.d.ts +17 -0
- package/dist/skills/registry/github-direct-adapter.d.ts.map +1 -0
- package/dist/skills/registry/registry-adapter.d.ts +84 -0
- package/dist/skills/registry/registry-adapter.d.ts.map +1 -0
- package/dist/skills/registry/skills-sh-adapter.d.ts +13 -0
- package/dist/skills/registry/skills-sh-adapter.d.ts.map +1 -0
- package/dist/skills/skill-generator.d.ts +82 -0
- package/dist/skills/skill-generator.d.ts.map +1 -0
- package/dist/skills/skill-installer.d.ts +124 -0
- package/dist/skills/skill-installer.d.ts.map +1 -0
- package/dist/storage/annotations-store.d.ts +118 -0
- package/dist/storage/annotations-store.d.ts.map +1 -0
- package/dist/storage/attachment-store.d.ts +31 -0
- package/dist/storage/attachment-store.d.ts.map +1 -0
- package/dist/storage/cloud-sync.d.ts +44 -0
- package/dist/storage/cloud-sync.d.ts.map +1 -0
- package/dist/storage/completed-work-checkpoint.d.ts +11 -0
- package/dist/storage/completed-work-checkpoint.d.ts.map +1 -0
- package/dist/storage/config-loader.d.ts +114 -0
- package/dist/storage/config-loader.d.ts.map +1 -0
- package/dist/storage/config-migration.d.ts +87 -0
- package/dist/storage/config-migration.d.ts.map +1 -0
- package/dist/storage/config-store.d.ts +22 -0
- package/dist/storage/config-store.d.ts.map +1 -0
- package/dist/{director-state-CMS_bMs4.d.ts → storage/director-state.d.ts} +28 -8
- package/dist/storage/director-state.d.ts.map +1 -0
- package/dist/storage/file-session-writer.d.ts +169 -0
- package/dist/storage/file-session-writer.d.ts.map +1 -0
- package/dist/{goal-store-Datpp-ar.d.ts → storage/goal-store.d.ts} +26 -19
- package/dist/storage/goal-store.d.ts.map +1 -0
- package/dist/storage/index.d.ts +39 -1031
- package/dist/storage/index.d.ts.map +1 -0
- package/dist/storage/index.js +783 -443
- package/dist/storage/index.js.map +7 -1
- package/dist/storage/input-history-store.d.ts +56 -0
- package/dist/storage/input-history-store.d.ts.map +1 -0
- package/dist/storage/memory-backend.d.ts +66 -0
- package/dist/storage/memory-backend.d.ts.map +1 -0
- package/dist/storage/memory-consolidator.d.ts +50 -0
- package/dist/storage/memory-consolidator.d.ts.map +1 -0
- package/dist/storage/memory-graph-backend.d.ts +117 -0
- package/dist/storage/memory-graph-backend.d.ts.map +1 -0
- package/dist/storage/memory-store.d.ts +119 -0
- package/dist/storage/memory-store.d.ts.map +1 -0
- package/dist/storage/plan-store.d.ts +78 -0
- package/dist/storage/plan-store.d.ts.map +1 -0
- package/dist/storage/plan-templates.d.ts +21 -0
- package/dist/storage/plan-templates.d.ts.map +1 -0
- package/dist/storage/prompt-store.d.ts +37 -0
- package/dist/storage/prompt-store.d.ts.map +1 -0
- package/dist/storage/prompt-usage-store.d.ts +29 -0
- package/dist/storage/prompt-usage-store.d.ts.map +1 -0
- package/dist/storage/provider-config-watcher.d.ts +34 -0
- package/dist/storage/provider-config-watcher.d.ts.map +1 -0
- package/dist/storage/queue-store.d.ts +41 -0
- package/dist/storage/queue-store.d.ts.map +1 -0
- package/dist/storage/recovery-lock.d.ts +79 -0
- package/dist/storage/recovery-lock.d.ts.map +1 -0
- package/dist/storage/replay-log-store.d.ts +97 -0
- package/dist/storage/replay-log-store.d.ts.map +1 -0
- package/dist/storage/session-analyzer.d.ts +48 -0
- package/dist/storage/session-analyzer.d.ts.map +1 -0
- package/dist/storage/session-checkpoint-cas.d.ts +37 -0
- package/dist/storage/session-checkpoint-cas.d.ts.map +1 -0
- package/dist/{session-event-bridge-D_z_mBwk.d.ts → storage/session-event-bridge.d.ts} +14 -15
- package/dist/storage/session-event-bridge.d.ts.map +1 -0
- package/dist/storage/session-helpers.d.ts +9 -0
- package/dist/storage/session-helpers.d.ts.map +1 -0
- package/dist/storage/session-id.d.ts +18 -0
- package/dist/storage/session-id.d.ts.map +1 -0
- package/dist/storage/session-reader.d.ts +21 -0
- package/dist/storage/session-reader.d.ts.map +1 -0
- package/dist/storage/session-recovery.d.ts +93 -0
- package/dist/storage/session-recovery.d.ts.map +1 -0
- package/dist/storage/session-resume-validation.d.ts +6 -0
- package/dist/storage/session-resume-validation.d.ts.map +1 -0
- package/dist/storage/session-rewinder.d.ts +21 -0
- package/dist/storage/session-rewinder.d.ts.map +1 -0
- package/dist/storage/session-store.d.ts +219 -0
- package/dist/storage/session-store.d.ts.map +1 -0
- package/dist/storage/session-summary.d.ts +12 -0
- package/dist/storage/session-summary.d.ts.map +1 -0
- package/dist/storage/session-tool-call-ends.d.ts +5 -0
- package/dist/storage/session-tool-call-ends.d.ts.map +1 -0
- package/dist/storage/storage-concurrency.d.ts +2 -0
- package/dist/storage/storage-concurrency.d.ts.map +1 -0
- package/dist/storage/task-store.d.ts +33 -0
- package/dist/storage/task-store.d.ts.map +1 -0
- package/dist/storage/todos-checkpoint.d.ts +39 -0
- package/dist/storage/todos-checkpoint.d.ts.map +1 -0
- package/dist/storage/tool-audit-log.d.ts +141 -0
- package/dist/storage/tool-audit-log.d.ts.map +1 -0
- package/dist/tasking/index.d.ts +3 -124
- package/dist/tasking/index.d.ts.map +1 -0
- package/dist/tasking/index.js +57 -4
- package/dist/tasking/index.js.map +7 -1
- package/dist/tasking/task-store.d.ts +22 -0
- package/dist/tasking/task-store.d.ts.map +1 -0
- package/dist/tasking/task-tracker.d.ts +102 -0
- package/dist/tasking/task-tracker.d.ts.map +1 -0
- package/dist/tools/index.d.ts +2 -59
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +93 -14
- package/dist/tools/index.js.map +7 -1
- package/dist/tools/mcp-control.d.ts +53 -0
- package/dist/tools/mcp-control.d.ts.map +1 -0
- package/dist/tools/mcp-use.d.ts +24 -0
- package/dist/tools/mcp-use.d.ts.map +1 -0
- package/dist/types/agent-bridge.d.ts +42 -0
- package/dist/types/agent-bridge.d.ts.map +1 -0
- package/dist/types/attachment.d.ts +54 -0
- package/dist/types/attachment.d.ts.map +1 -0
- package/dist/types/autonomy.d.ts +5 -0
- package/dist/types/autonomy.d.ts.map +1 -0
- package/dist/types/blocks.d.ts +76 -0
- package/dist/types/blocks.d.ts.map +1 -0
- package/dist/{compactor-DQLL4HTo.d.ts → types/compactor.d.ts} +5 -7
- package/dist/types/compactor.d.ts.map +1 -0
- package/dist/{config-MRqn1V-u.d.ts → types/config.d.ts} +344 -355
- package/dist/types/config.d.ts.map +1 -0
- package/dist/types/context-evidence.d.ts +68 -0
- package/dist/types/context-evidence.d.ts.map +1 -0
- package/dist/types/context-window.d.ts +35 -0
- package/dist/types/context-window.d.ts.map +1 -0
- package/dist/{default-config-B79_gJYv.d.ts → types/default-config.d.ts} +10 -11
- package/dist/types/default-config.d.ts.map +1 -0
- package/dist/types/design-kit.d.ts +91 -0
- package/dist/types/design-kit.d.ts.map +1 -0
- package/dist/{retry-policy-CQ7KwXJa.d.ts → types/error-handler.d.ts} +5 -12
- package/dist/types/error-handler.d.ts.map +1 -0
- package/dist/types/errors.d.ts +277 -0
- package/dist/types/errors.d.ts.map +1 -0
- package/dist/types/hooks.d.ts +167 -0
- package/dist/types/hooks.d.ts.map +1 -0
- package/dist/types/index.d.ts +40 -244
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +101 -12
- package/dist/types/index.js.map +7 -1
- package/dist/{input-reader-E-ffP2ee.d.ts → types/input-reader.d.ts} +3 -4
- package/dist/types/input-reader.d.ts.map +1 -0
- package/dist/{logger-B63L5bTg.d.ts → types/logger.d.ts} +3 -4
- package/dist/types/logger.d.ts.map +1 -0
- package/dist/types/memory.d.ts +89 -0
- package/dist/types/memory.d.ts.map +1 -0
- package/dist/types/messages.d.ts +24 -0
- package/dist/types/messages.d.ts.map +1 -0
- package/dist/types/mode-prompts.d.ts +2 -0
- package/dist/types/mode-prompts.d.ts.map +1 -0
- package/dist/{mode-CZlO9iU1.d.ts → types/mode.d.ts} +6 -7
- package/dist/types/mode.d.ts.map +1 -0
- package/dist/types/models-registry.d.ts +105 -0
- package/dist/types/models-registry.d.ts.map +1 -0
- package/dist/types/multi-agent.d.ts +443 -0
- package/dist/types/multi-agent.d.ts.map +1 -0
- package/dist/{observability-D-HZN_mF.d.ts → types/observability.d.ts} +17 -13
- package/dist/types/observability.d.ts.map +1 -0
- package/dist/{path-resolver-CPRj4bFY.d.ts → types/path-resolver.d.ts} +2 -3
- package/dist/types/path-resolver.d.ts.map +1 -0
- package/dist/{permission-ByDKXEcG.d.ts → types/permission.d.ts} +8 -9
- package/dist/types/permission.d.ts.map +1 -0
- package/dist/types/plugin.d.ts +385 -0
- package/dist/types/plugin.d.ts.map +1 -0
- package/dist/types/prompt-registry.d.ts +81 -0
- package/dist/types/prompt-registry.d.ts.map +1 -0
- package/dist/{prompt-DLd35n4Q.d.ts → types/prompt.d.ts} +14 -15
- package/dist/types/prompt.d.ts.map +1 -0
- package/dist/{provider-runner-ChL-kVg6.d.ts → types/provider-runner.d.ts} +9 -10
- package/dist/types/provider-runner.d.ts.map +1 -0
- package/dist/types/provider.d.ts +387 -0
- package/dist/types/provider.d.ts.map +1 -0
- package/dist/types/renderer.d.ts +23 -0
- package/dist/types/renderer.d.ts.map +1 -0
- package/dist/types/retry-policy.d.ts +7 -0
- package/dist/types/retry-policy.d.ts.map +1 -0
- package/dist/types/secret-scrubber.d.ts +5 -0
- package/dist/types/secret-scrubber.d.ts.map +1 -0
- package/dist/{secret-vault-BAKpgFw_.d.ts → types/secret-vault.d.ts} +13 -7
- package/dist/types/secret-vault.d.ts.map +1 -0
- package/dist/{selector-D8O6B_Rm.d.ts → types/selector.d.ts} +4 -6
- package/dist/types/selector.d.ts.map +1 -0
- package/dist/types/session-reader.d.ts +81 -0
- package/dist/types/session-reader.d.ts.map +1 -0
- package/dist/{session-rewinder-C9HnMkhP.d.ts → types/session-rewinder.d.ts} +5 -6
- package/dist/types/session-rewinder.d.ts.map +1 -0
- package/dist/types/session.d.ts +650 -0
- package/dist/types/session.d.ts.map +1 -0
- package/dist/types/side-effect.d.ts +34 -0
- package/dist/types/side-effect.d.ts.map +1 -0
- package/dist/{skill-DHniprNl.d.ts → types/skill.d.ts} +4 -5
- package/dist/types/skill.d.ts.map +1 -0
- package/dist/types/slash-command.d.ts +59 -0
- package/dist/types/slash-command.d.ts.map +1 -0
- package/dist/types/spec.d.ts +77 -0
- package/dist/types/spec.d.ts.map +1 -0
- package/dist/types/system-prompt-contributor.d.ts +20 -0
- package/dist/types/system-prompt-contributor.d.ts.map +1 -0
- package/dist/types/system-prompt.d.ts +51 -0
- package/dist/types/system-prompt.d.ts.map +1 -0
- package/dist/{task-graph-CH3acNQ7.d.ts → types/task-graph.d.ts} +21 -22
- package/dist/types/task-graph.d.ts.map +1 -0
- package/dist/types/token-counter.d.ts +42 -0
- package/dist/types/token-counter.d.ts.map +1 -0
- package/dist/types/tool-executor.d.ts +133 -0
- package/dist/types/tool-executor.d.ts.map +1 -0
- package/dist/types/tool-markers.d.ts +23 -0
- package/dist/types/tool-markers.d.ts.map +1 -0
- package/dist/types/tool.d.ts +252 -0
- package/dist/types/tool.d.ts.map +1 -0
- package/dist/types/utility-types.d.ts +31 -0
- package/dist/types/utility-types.d.ts.map +1 -0
- package/dist/utils/assert-never.d.ts +14 -0
- package/dist/utils/assert-never.d.ts.map +1 -0
- package/dist/utils/atomic-write.d.ts +12 -0
- package/dist/utils/atomic-write.d.ts.map +1 -0
- package/dist/utils/child-env.d.ts +67 -0
- package/dist/utils/child-env.d.ts.map +1 -0
- package/dist/utils/color.d.ts +20 -0
- package/dist/utils/color.d.ts.map +1 -0
- package/dist/utils/config-json.d.ts +14 -0
- package/dist/utils/config-json.d.ts.map +1 -0
- package/dist/utils/context-evidence.d.ts +47 -0
- package/dist/utils/context-evidence.d.ts.map +1 -0
- package/dist/utils/deep-merge.d.ts +64 -0
- package/dist/utils/deep-merge.d.ts.map +1 -0
- package/dist/utils/diff.d.ts +11 -0
- package/dist/utils/diff.d.ts.map +1 -0
- package/dist/utils/error.d.ts +2 -3
- package/dist/utils/error.d.ts.map +1 -0
- package/dist/utils/error.js +3 -3
- package/dist/utils/error.js.map +7 -1
- package/dist/utils/expect-defined.d.ts +2 -3
- package/dist/utils/expect-defined.d.ts.map +1 -0
- package/dist/utils/expect-defined.js +3 -3
- package/dist/utils/expect-defined.js.map +7 -1
- package/dist/utils/glob-expand.d.ts +10 -0
- package/dist/utils/glob-expand.d.ts.map +1 -0
- package/dist/utils/glob-match.d.ts +4 -0
- package/dist/utils/glob-match.d.ts.map +1 -0
- package/dist/utils/incoming-images.d.ts +39 -0
- package/dist/utils/incoming-images.d.ts.map +1 -0
- package/dist/utils/index.d.ts +38 -920
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +323 -36
- package/dist/utils/index.js.map +7 -1
- package/dist/utils/instruction-file.d.ts +3 -0
- package/dist/utils/instruction-file.d.ts.map +1 -0
- package/dist/utils/ip-guard.d.ts +34 -0
- package/dist/utils/ip-guard.d.ts.map +1 -0
- package/dist/utils/json-repair.d.ts +23 -0
- package/dist/utils/json-repair.d.ts.map +1 -0
- package/dist/utils/json-schema-validate.d.ts +42 -0
- package/dist/utils/json-schema-validate.d.ts.map +1 -0
- package/dist/utils/lru-cache.d.ts +29 -0
- package/dist/utils/lru-cache.d.ts.map +1 -0
- package/dist/utils/merge-custom-models.d.ts +12 -0
- package/dist/utils/merge-custom-models.d.ts.map +1 -0
- package/dist/utils/merge-models-payload.d.ts +20 -0
- package/dist/utils/merge-models-payload.d.ts.map +1 -0
- package/dist/utils/message-invariants.d.ts +22 -0
- package/dist/utils/message-invariants.d.ts.map +1 -0
- package/dist/utils/newline-normalize.d.ts +5 -0
- package/dist/utils/newline-normalize.d.ts.map +1 -0
- package/dist/utils/regex-guard.d.ts +21 -0
- package/dist/utils/regex-guard.d.ts.map +1 -0
- package/dist/utils/safe-json.d.ts +31 -0
- package/dist/utils/safe-json.d.ts.map +1 -0
- package/dist/utils/session-scoped-path.d.ts +13 -0
- package/dist/utils/session-scoped-path.d.ts.map +1 -0
- package/dist/utils/sleep.d.ts +5 -0
- package/dist/utils/sleep.d.ts.map +1 -0
- package/dist/utils/slug.d.ts +13 -0
- package/dist/utils/slug.d.ts.map +1 -0
- package/dist/utils/string.d.ts +9 -0
- package/dist/utils/string.d.ts.map +1 -0
- package/dist/utils/task-format.d.ts +22 -0
- package/dist/utils/task-format.d.ts.map +1 -0
- package/dist/utils/term.d.ts +133 -0
- package/dist/utils/term.d.ts.map +1 -0
- package/dist/utils/todos-format.d.ts +30 -0
- package/dist/utils/todos-format.d.ts.map +1 -0
- package/dist/utils/token-estimate.d.ts +112 -0
- package/dist/utils/token-estimate.d.ts.map +1 -0
- package/dist/utils/tool-description-mode.d.ts +28 -0
- package/dist/utils/tool-description-mode.d.ts.map +1 -0
- package/dist/utils/tool-output-serializer.d.ts +40 -0
- package/dist/utils/tool-output-serializer.d.ts.map +1 -0
- package/dist/utils/tool-result-render-mode.d.ts +55 -0
- package/dist/utils/tool-result-render-mode.d.ts.map +1 -0
- package/dist/utils/tool-subject.d.ts +5 -0
- package/dist/utils/tool-subject.d.ts.map +1 -0
- package/dist/utils/tool-wire-compact.d.ts +28 -0
- package/dist/utils/tool-wire-compact.d.ts.map +1 -0
- package/dist/utils/ulid.d.ts +11 -0
- package/dist/utils/ulid.d.ts.map +1 -0
- package/dist/{wstack-paths-C3K40Qst.d.ts → utils/wstack-paths.d.ts} +7 -8
- package/dist/utils/wstack-paths.d.ts.map +1 -0
- package/dist/worktree/index.d.ts +2 -0
- package/dist/worktree/index.d.ts.map +1 -0
- package/dist/{worktree-manager-DzwxKE35.d.ts → worktree/worktree-manager.d.ts} +32 -17
- package/dist/worktree/worktree-manager.d.ts.map +1 -0
- package/instructions/agents/browser.md +25 -16
- package/instructions/autonomy/active-mission.md +2 -4
- package/instructions/coordination/subagent-baseline.md +16 -2
- package/instructions/leader-after-task.md +3 -1
- package/instructions/sections/tool/common-patterns.md +7 -1
- package/instructions/sections/tool/delegation-full.md +1 -1
- package/instructions/system.md +47 -0
- package/package.json +4 -5
- package/skills/docker-deploy/SKILL.md +1 -1
- package/skills/node-modern/SKILL.md +2 -2
- package/skills/plugin-author/SKILL.md +9 -16
- package/skills/wrongstack-mailbox/SKILL.md +51 -12
- package/dist/dispatcher-types.d-BBeXBQgS.d.ts +0 -66
- package/dist/global-mailbox-sZwyI6CS.d.ts +0 -959
- package/dist/index--Gm41aBJ.d.ts +0 -671
- package/dist/mcp-servers-DEV4s6Ks.d.ts +0 -259
- package/dist/multi-agent-coordinator-4RCRZKjN.d.ts +0 -1770
- package/dist/null-fleet-bus-CFoNVQEK.d.ts +0 -2127
- package/dist/pipeline-DGDyIohT.d.ts +0 -331
- package/dist/provider-model-resolve-o2hHLs79.d.ts +0 -263
- package/dist/secret-scrubber-3MHDDAtm.d.ts +0 -6
- package/dist/secret-vault-DxohkUBc.d.ts +0 -272
- package/dist/session-reader-7Esxrkpw.d.ts +0 -155
- package/dist/task-format-GX0B1mMC.d.ts +0 -23
- package/dist/todos-checkpoint-FY7PjmMx.d.ts +0 -850
- package/dist/tool-BNlnIJvo.d.ts +0 -2190
- package/dist/tool-executor-CckSCM5E.d.ts +0 -906
package/dist/security/index.js
CHANGED
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
import { randomBytes, createCipheriv, createDecipheriv, scryptSync } from 'crypto';
|
|
2
|
-
import * as fs2 from 'fs';
|
|
3
|
-
import * as fs from 'fs/promises';
|
|
4
|
-
import * as path from 'path';
|
|
5
|
-
|
|
6
1
|
// src/security/secret-scrubber.ts
|
|
7
2
|
var PATTERNS = [
|
|
8
3
|
// Anchored at the start where possible so partial matches inside larger
|
|
@@ -191,6 +186,17 @@ var DefaultSecretScrubber = class {
|
|
|
191
186
|
return visit(obj);
|
|
192
187
|
}
|
|
193
188
|
};
|
|
189
|
+
|
|
190
|
+
// src/security/secret-vault.ts
|
|
191
|
+
import { createCipheriv, createDecipheriv, randomBytes as randomBytes2, scryptSync } from "node:crypto";
|
|
192
|
+
import * as fs2 from "node:fs";
|
|
193
|
+
import * as fsp from "node:fs/promises";
|
|
194
|
+
import * as path2 from "node:path";
|
|
195
|
+
|
|
196
|
+
// src/utils/atomic-write.ts
|
|
197
|
+
import { randomBytes } from "node:crypto";
|
|
198
|
+
import * as fs from "node:fs/promises";
|
|
199
|
+
import * as path from "node:path";
|
|
194
200
|
async function atomicWrite(targetPath, content, opts = {}) {
|
|
195
201
|
const dir = path.dirname(targetPath);
|
|
196
202
|
await fs.mkdir(dir, { recursive: true });
|
|
@@ -253,7 +259,7 @@ async function renameWithRetry(from, to) {
|
|
|
253
259
|
if (!code || !TRANSIENT_RENAME_CODES.has(code) || i === delays.length) {
|
|
254
260
|
throw err;
|
|
255
261
|
}
|
|
256
|
-
await new Promise((
|
|
262
|
+
await new Promise((resolve) => setTimeout(resolve, delays[i]));
|
|
257
263
|
}
|
|
258
264
|
}
|
|
259
265
|
throw lastErr;
|
|
@@ -326,7 +332,7 @@ function toErrorMessage(err) {
|
|
|
326
332
|
// src/utils/expect-defined.ts
|
|
327
333
|
function expectDefined(value, label) {
|
|
328
334
|
if (value === null || value === void 0) {
|
|
329
|
-
const err = new Error("Expected value to be defined");
|
|
335
|
+
const err = new Error(label ? `Expected ${label} to be defined` : "Expected value to be defined");
|
|
330
336
|
err.name = "ExpectDefinedError";
|
|
331
337
|
throw err;
|
|
332
338
|
}
|
|
@@ -571,6 +577,49 @@ function encryptedPrefixForVersion(version) {
|
|
|
571
577
|
return `enc:v${version}:`;
|
|
572
578
|
}
|
|
573
579
|
|
|
580
|
+
// src/security/config-secrets.ts
|
|
581
|
+
function decryptConfigSecrets(cfg, vault, opts) {
|
|
582
|
+
const warn = opts?.warn ?? ((msg) => console.warn(msg));
|
|
583
|
+
return walk(cfg, vault, (v, key) => {
|
|
584
|
+
try {
|
|
585
|
+
return vault.decrypt(v);
|
|
586
|
+
} catch (err) {
|
|
587
|
+
warn(
|
|
588
|
+
`[secret-vault] Failed to decrypt "${key}": ${err instanceof Error ? err.message : err}`
|
|
589
|
+
);
|
|
590
|
+
return "";
|
|
591
|
+
}
|
|
592
|
+
});
|
|
593
|
+
}
|
|
594
|
+
function encryptConfigSecrets(cfg, vault, _opts) {
|
|
595
|
+
return walk(cfg, vault, (v) => vault.encrypt(v));
|
|
596
|
+
}
|
|
597
|
+
function walk(node, vault, transform) {
|
|
598
|
+
if (node === null || node === void 0) return node;
|
|
599
|
+
if (typeof node !== "object") return node;
|
|
600
|
+
if (Array.isArray(node)) {
|
|
601
|
+
return node.map((item) => walk(item, vault, transform));
|
|
602
|
+
}
|
|
603
|
+
const out = /* @__PURE__ */ Object.create(null);
|
|
604
|
+
for (const [k, v] of Object.entries(node)) {
|
|
605
|
+
if (typeof v === "string" && isSecretField(k)) {
|
|
606
|
+
out[k] = transform(v, k);
|
|
607
|
+
} else if (typeof v === "object" && v !== null) {
|
|
608
|
+
out[k] = walk(v, vault, transform);
|
|
609
|
+
} else {
|
|
610
|
+
out[k] = v;
|
|
611
|
+
}
|
|
612
|
+
}
|
|
613
|
+
return out;
|
|
614
|
+
}
|
|
615
|
+
var SECRET_KEY_PATTERN = /(?:apikey|api_key|authtoken|auth_token|bearer|secret|password|passwd|pwd|refreshtoken|refresh_token|sessionkey|session_key|access[_-]?token|private[_-]?key)/i;
|
|
616
|
+
var NON_SECRET_OVERRIDES = /* @__PURE__ */ new Set(["publickey", "public_key"]);
|
|
617
|
+
function isSecretField(name) {
|
|
618
|
+
const lc = name.toLowerCase();
|
|
619
|
+
if (NON_SECRET_OVERRIDES.has(lc)) return false;
|
|
620
|
+
return SECRET_KEY_PATTERN.test(lc);
|
|
621
|
+
}
|
|
622
|
+
|
|
574
623
|
// src/security/secret-vault.ts
|
|
575
624
|
var KEY_BYTES = 32;
|
|
576
625
|
var IV_BYTES = 12;
|
|
@@ -602,8 +651,8 @@ function deriveKEK(passphrase, salt) {
|
|
|
602
651
|
});
|
|
603
652
|
}
|
|
604
653
|
function wrapDataKey(dataKey, keyVersion, passphrase) {
|
|
605
|
-
const salt =
|
|
606
|
-
const iv =
|
|
654
|
+
const salt = randomBytes2(KEK_SALT_BYTES);
|
|
655
|
+
const iv = randomBytes2(IV_BYTES);
|
|
607
656
|
const kek = deriveKEK(passphrase, salt);
|
|
608
657
|
const cipher = createCipheriv(ALGO, kek, iv);
|
|
609
658
|
const ct = Buffer.concat([cipher.update(dataKey), cipher.final()]);
|
|
@@ -656,31 +705,40 @@ function unwrapDataKey(buf, keyFile) {
|
|
|
656
705
|
});
|
|
657
706
|
}
|
|
658
707
|
}
|
|
659
|
-
function checkKeyFilePermissions(keyFile) {
|
|
708
|
+
function checkKeyFilePermissions(keyFile, opts) {
|
|
660
709
|
if (process.platform === "win32") return;
|
|
710
|
+
const warn = opts?.warn ?? ((msg) => console.warn(msg));
|
|
661
711
|
try {
|
|
662
712
|
const stat2 = fs2.statSync(keyFile);
|
|
663
713
|
const actualMode = stat2.mode & 511;
|
|
664
714
|
if (actualMode !== KEY_FILE_MODE) {
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
message: `Key file ${keyFile} has mode ${actualMode.toString(8)} \u2014 expected ${KEY_FILE_MODE.toString(8)}. Run: chmod ${KEY_FILE_MODE.toString(8)} ${keyFile}`,
|
|
669
|
-
keyFile,
|
|
670
|
-
expectedMode: KEY_FILE_MODE,
|
|
671
|
-
actualMode,
|
|
672
|
-
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
673
|
-
}));
|
|
715
|
+
warn(
|
|
716
|
+
`Key file ${keyFile} has mode ${actualMode.toString(8)} \u2014 expected ${KEY_FILE_MODE.toString(8)}. Run: chmod ${KEY_FILE_MODE.toString(8)} ${keyFile}`
|
|
717
|
+
);
|
|
674
718
|
}
|
|
675
719
|
} catch {
|
|
676
720
|
}
|
|
677
721
|
}
|
|
678
722
|
var DefaultSecretVault = class {
|
|
679
723
|
keyFile;
|
|
724
|
+
logger;
|
|
680
725
|
key;
|
|
681
726
|
_keyVersion = 1;
|
|
682
727
|
constructor(opts) {
|
|
683
728
|
this.keyFile = opts.keyFile;
|
|
729
|
+
this.logger = opts.logger;
|
|
730
|
+
}
|
|
731
|
+
/**
|
|
732
|
+
* Emit a structured warning. Uses the configured Logger when available;
|
|
733
|
+
* falls back to console.warn(JSON) so warnings are never silently dropped
|
|
734
|
+
* during early boot.
|
|
735
|
+
*/
|
|
736
|
+
logWarn(msg, ctx) {
|
|
737
|
+
if (this.logger) {
|
|
738
|
+
this.logger.warn(msg, ctx);
|
|
739
|
+
} else {
|
|
740
|
+
console.warn(JSON.stringify({ ...ctx, message: msg, timestamp: (/* @__PURE__ */ new Date()).toISOString() }));
|
|
741
|
+
}
|
|
684
742
|
}
|
|
685
743
|
/** Current key version. Starts at 1; incremented by rotateKey(). */
|
|
686
744
|
get keyVersion() {
|
|
@@ -693,7 +751,7 @@ var DefaultSecretVault = class {
|
|
|
693
751
|
encrypt(plaintext) {
|
|
694
752
|
if (this.isEncrypted(plaintext)) return plaintext;
|
|
695
753
|
const key = this.loadOrCreateKey();
|
|
696
|
-
const iv =
|
|
754
|
+
const iv = randomBytes2(IV_BYTES);
|
|
697
755
|
const cipher = createCipheriv(ALGO, key, iv);
|
|
698
756
|
const ct = Buffer.concat([cipher.update(plaintext, "utf8"), cipher.final()]);
|
|
699
757
|
const tag = cipher.getAuthTag();
|
|
@@ -746,9 +804,9 @@ var DefaultSecretVault = class {
|
|
|
746
804
|
*/
|
|
747
805
|
rotateKey() {
|
|
748
806
|
const oldVersion = this._keyVersion;
|
|
749
|
-
const newKey =
|
|
807
|
+
const newKey = randomBytes2(KEY_BYTES);
|
|
750
808
|
const newVersion = oldVersion + 1;
|
|
751
|
-
fs2.mkdirSync(
|
|
809
|
+
fs2.mkdirSync(path2.dirname(this.keyFile), { recursive: true });
|
|
752
810
|
const passphrase = getVaultPassphrase();
|
|
753
811
|
if (passphrase) {
|
|
754
812
|
fs2.writeFileSync(this.keyFile, wrapDataKey(newKey, newVersion, passphrase), { mode: 384 });
|
|
@@ -759,7 +817,7 @@ var DefaultSecretVault = class {
|
|
|
759
817
|
newKey.copy(keyFileBuf, KEY_FILE_MAGIC.length + 1);
|
|
760
818
|
fs2.writeFileSync(this.keyFile, keyFileBuf, { mode: 384 });
|
|
761
819
|
}
|
|
762
|
-
checkKeyFilePermissions(this.keyFile);
|
|
820
|
+
checkKeyFilePermissions(this.keyFile, { warn: (msg) => this.logWarn(msg) });
|
|
763
821
|
this.key = newKey;
|
|
764
822
|
this._keyVersion = newVersion;
|
|
765
823
|
return { oldVersion, newVersion };
|
|
@@ -778,7 +836,7 @@ var DefaultSecretVault = class {
|
|
|
778
836
|
fs2.writeFileSync(this.keyFile, wrapDataKey(this.key, this._keyVersion, passphrase), {
|
|
779
837
|
mode: 384
|
|
780
838
|
});
|
|
781
|
-
checkKeyFilePermissions(this.keyFile);
|
|
839
|
+
checkKeyFilePermissions(this.keyFile, { warn: (msg) => this.logWarn(msg) });
|
|
782
840
|
} catch {
|
|
783
841
|
}
|
|
784
842
|
}
|
|
@@ -790,13 +848,13 @@ var DefaultSecretVault = class {
|
|
|
790
848
|
const { key: key2, version } = unwrapDataKey(buf, this.keyFile);
|
|
791
849
|
this.key = key2;
|
|
792
850
|
this._keyVersion = version;
|
|
793
|
-
checkKeyFilePermissions(this.keyFile);
|
|
851
|
+
checkKeyFilePermissions(this.keyFile, { warn: (msg) => this.logWarn(msg) });
|
|
794
852
|
return this.key;
|
|
795
853
|
}
|
|
796
854
|
if (buf.length === KEY_BYTES) {
|
|
797
855
|
this.key = buf;
|
|
798
856
|
this._keyVersion = 1;
|
|
799
|
-
checkKeyFilePermissions(this.keyFile);
|
|
857
|
+
checkKeyFilePermissions(this.keyFile, { warn: (msg) => this.logWarn(msg) });
|
|
800
858
|
this.migrateToWrappedIfPassphrase();
|
|
801
859
|
return this.key;
|
|
802
860
|
}
|
|
@@ -820,7 +878,7 @@ var DefaultSecretVault = class {
|
|
|
820
878
|
}
|
|
821
879
|
this.key = Buffer.from(key2);
|
|
822
880
|
this._keyVersion = version;
|
|
823
|
-
checkKeyFilePermissions(this.keyFile);
|
|
881
|
+
checkKeyFilePermissions(this.keyFile, { warn: (msg) => this.logWarn(msg) });
|
|
824
882
|
this.migrateToWrappedIfPassphrase();
|
|
825
883
|
return this.key;
|
|
826
884
|
}
|
|
@@ -832,8 +890,8 @@ var DefaultSecretVault = class {
|
|
|
832
890
|
} catch (err) {
|
|
833
891
|
if (err.code !== "ENOENT") throw err;
|
|
834
892
|
}
|
|
835
|
-
fs2.mkdirSync(
|
|
836
|
-
const key =
|
|
893
|
+
fs2.mkdirSync(path2.dirname(this.keyFile), { recursive: true });
|
|
894
|
+
const key = randomBytes2(KEY_BYTES);
|
|
837
895
|
const passphrase = getVaultPassphrase();
|
|
838
896
|
const initialBytes = passphrase ? wrapDataKey(key, 1, passphrase) : key;
|
|
839
897
|
try {
|
|
@@ -845,13 +903,13 @@ var DefaultSecretVault = class {
|
|
|
845
903
|
const { key: winnerKey, version } = unwrapDataKey(buf, this.keyFile);
|
|
846
904
|
this.key = winnerKey;
|
|
847
905
|
this._keyVersion = version;
|
|
848
|
-
checkKeyFilePermissions(this.keyFile);
|
|
906
|
+
checkKeyFilePermissions(this.keyFile, { warn: (msg) => this.logWarn(msg) });
|
|
849
907
|
return this.key;
|
|
850
908
|
}
|
|
851
909
|
if (buf.length === KEY_BYTES) {
|
|
852
910
|
this.key = buf;
|
|
853
911
|
this._keyVersion = 1;
|
|
854
|
-
checkKeyFilePermissions(this.keyFile);
|
|
912
|
+
checkKeyFilePermissions(this.keyFile, { warn: (msg) => this.logWarn(msg) });
|
|
855
913
|
return this.key;
|
|
856
914
|
}
|
|
857
915
|
if (buf.length === VERSIONED_KEY_FILE_SIZE) {
|
|
@@ -867,7 +925,7 @@ var DefaultSecretVault = class {
|
|
|
867
925
|
const winnerKey = buf.subarray(KEY_FILE_MAGIC.length + 1);
|
|
868
926
|
this.key = Buffer.from(winnerKey);
|
|
869
927
|
this._keyVersion = version;
|
|
870
|
-
checkKeyFilePermissions(this.keyFile);
|
|
928
|
+
checkKeyFilePermissions(this.keyFile, { warn: (msg) => this.logWarn(msg) });
|
|
871
929
|
return this.key;
|
|
872
930
|
}
|
|
873
931
|
throw new ConfigError({
|
|
@@ -881,64 +939,23 @@ var DefaultSecretVault = class {
|
|
|
881
939
|
return key;
|
|
882
940
|
}
|
|
883
941
|
};
|
|
884
|
-
function decryptConfigSecrets(cfg, vault, opts) {
|
|
885
|
-
const warn = opts?.warn ?? ((msg) => console.warn(msg));
|
|
886
|
-
return walk(cfg, vault, (v, key) => {
|
|
887
|
-
try {
|
|
888
|
-
return vault.decrypt(v);
|
|
889
|
-
} catch (err) {
|
|
890
|
-
warn(
|
|
891
|
-
`[secret-vault] Failed to decrypt "${key}": ${err instanceof Error ? err.message : err}`
|
|
892
|
-
);
|
|
893
|
-
return "";
|
|
894
|
-
}
|
|
895
|
-
});
|
|
896
|
-
}
|
|
897
|
-
function encryptConfigSecrets(cfg, vault, _opts) {
|
|
898
|
-
return walk(cfg, vault, (v) => vault.encrypt(v));
|
|
899
|
-
}
|
|
900
|
-
function walk(node, vault, transform) {
|
|
901
|
-
if (node === null || node === void 0) return node;
|
|
902
|
-
if (typeof node !== "object") return node;
|
|
903
|
-
if (Array.isArray(node)) {
|
|
904
|
-
return node.map((item) => walk(item, vault, transform));
|
|
905
|
-
}
|
|
906
|
-
const out = /* @__PURE__ */ Object.create(null);
|
|
907
|
-
for (const [k, v] of Object.entries(node)) {
|
|
908
|
-
if (typeof v === "string" && isSecretField(k)) {
|
|
909
|
-
out[k] = transform(v, k);
|
|
910
|
-
} else if (typeof v === "object" && v !== null) {
|
|
911
|
-
out[k] = walk(v, vault, transform);
|
|
912
|
-
} else {
|
|
913
|
-
out[k] = v;
|
|
914
|
-
}
|
|
915
|
-
}
|
|
916
|
-
return out;
|
|
917
|
-
}
|
|
918
|
-
var SECRET_KEY_PATTERN = /(?:apikey|api_key|authtoken|auth_token|bearer|secret|password|passwd|pwd|refreshtoken|refresh_token|sessionkey|session_key|access[_-]?token|private[_-]?key)/i;
|
|
919
|
-
var NON_SECRET_OVERRIDES = /* @__PURE__ */ new Set(["publickey", "public_key"]);
|
|
920
|
-
function isSecretField(name) {
|
|
921
|
-
const lc = name.toLowerCase();
|
|
922
|
-
if (NON_SECRET_OVERRIDES.has(lc)) return false;
|
|
923
|
-
return SECRET_KEY_PATTERN.test(lc);
|
|
924
|
-
}
|
|
925
942
|
async function rewriteConfigEncrypted(configPath, vault, patch) {
|
|
926
943
|
let current = {};
|
|
927
944
|
try {
|
|
928
|
-
const raw = await
|
|
945
|
+
const raw = await fsp.readFile(configPath, "utf8");
|
|
929
946
|
current = JSON.parse(raw);
|
|
930
947
|
} catch {
|
|
931
948
|
}
|
|
932
949
|
const merged = deepMerge(current, patch ?? {});
|
|
933
950
|
const encrypted = encryptConfigSecrets(merged, vault);
|
|
934
|
-
await
|
|
951
|
+
await fsp.mkdir(path2.dirname(configPath), { recursive: true });
|
|
935
952
|
await atomicWrite(configPath, JSON.stringify(encrypted, null, 2), { mode: 384 });
|
|
936
953
|
await restrictFilePermissions(configPath);
|
|
937
954
|
}
|
|
938
955
|
async function migratePlaintextSecrets(configPath, vault, logger) {
|
|
939
956
|
let raw;
|
|
940
957
|
try {
|
|
941
|
-
raw = await
|
|
958
|
+
raw = await fsp.readFile(configPath, "utf8");
|
|
942
959
|
} catch {
|
|
943
960
|
return { migrated: 0, file: configPath };
|
|
944
961
|
}
|
|
@@ -964,7 +981,7 @@ async function rotateConfigKeys(configPath, vault, logger) {
|
|
|
964
981
|
const warn = logger?.warn ?? ((msg) => console.warn(msg));
|
|
965
982
|
let raw;
|
|
966
983
|
try {
|
|
967
|
-
raw = await
|
|
984
|
+
raw = await fsp.readFile(configPath, "utf8");
|
|
968
985
|
} catch {
|
|
969
986
|
const { oldVersion: oldVersion2, newVersion: newVersion2 } = vault.rotateKey();
|
|
970
987
|
log(`[secret-vault] Key rotated (v${oldVersion2} \u2192 v${newVersion2}) \u2014 no config file to re-encrypt`);
|
|
@@ -1045,8 +1062,8 @@ async function restrictFilePermissions(filePath, opts) {
|
|
|
1045
1062
|
const warn = opts?.warn ?? ((msg) => console.warn(msg));
|
|
1046
1063
|
if (process.platform === "win32") {
|
|
1047
1064
|
try {
|
|
1048
|
-
const { execFile } = await import(
|
|
1049
|
-
const { promisify } = await import(
|
|
1065
|
+
const { execFile } = await import("node:child_process");
|
|
1066
|
+
const { promisify } = await import("node:util");
|
|
1050
1067
|
const execFileAsync = promisify(execFile);
|
|
1051
1068
|
const user = windowsAccountName();
|
|
1052
1069
|
if (!user) {
|
|
@@ -1063,7 +1080,7 @@ async function restrictFilePermissions(filePath, opts) {
|
|
|
1063
1080
|
}
|
|
1064
1081
|
} else {
|
|
1065
1082
|
try {
|
|
1066
|
-
await
|
|
1083
|
+
await fsp.chmod(filePath, 384);
|
|
1067
1084
|
} catch {
|
|
1068
1085
|
}
|
|
1069
1086
|
}
|
|
@@ -1095,6 +1112,9 @@ function walkCount(node, vault, counter) {
|
|
|
1095
1112
|
return out;
|
|
1096
1113
|
}
|
|
1097
1114
|
|
|
1115
|
+
// src/security/permission-policy.ts
|
|
1116
|
+
import * as fs3 from "node:fs/promises";
|
|
1117
|
+
|
|
1098
1118
|
// src/security/capabilities.ts
|
|
1099
1119
|
var ToolCapabilities = {
|
|
1100
1120
|
/** Can execute arbitrary commands in the user's shell (the `bash` tool). */
|
|
@@ -1158,7 +1178,7 @@ var DANGEROUS_FOR_SUBAGENTS = [
|
|
|
1158
1178
|
ToolCapabilities.CONFIG_MUTATE,
|
|
1159
1179
|
ToolCapabilities.PACKAGE_INSTALL
|
|
1160
1180
|
];
|
|
1161
|
-
[
|
|
1181
|
+
var WIDE_SUBAGENT_CAPABILITIES = [
|
|
1162
1182
|
ToolCapabilities.FS_READ,
|
|
1163
1183
|
ToolCapabilities.FS_WRITE,
|
|
1164
1184
|
ToolCapabilities.NET_OUTBOUND,
|
|
@@ -1196,6 +1216,173 @@ function getDangerousCapabilities(toolOrCaps) {
|
|
|
1196
1216
|
);
|
|
1197
1217
|
}
|
|
1198
1218
|
|
|
1219
|
+
// src/security/permission-policy-schema.ts
|
|
1220
|
+
var TRUST_POLICY_SCHEMA_VERSION = 1;
|
|
1221
|
+
var TRUST_POLICY_LIMITS = Object.freeze({
|
|
1222
|
+
maxTools: 1e3,
|
|
1223
|
+
maxPatternsPerRule: 1e3,
|
|
1224
|
+
maxToolNameChars: 256,
|
|
1225
|
+
maxPatternChars: 4096
|
|
1226
|
+
});
|
|
1227
|
+
var TRUST_POLICY_JSON_SCHEMA = Object.freeze({
|
|
1228
|
+
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
1229
|
+
$id: "https://wrongstack.dev/schemas/trust-policy-v1.json",
|
|
1230
|
+
title: "WrongStack Trust Policy",
|
|
1231
|
+
type: "object",
|
|
1232
|
+
maxProperties: TRUST_POLICY_LIMITS.maxTools,
|
|
1233
|
+
propertyNames: {
|
|
1234
|
+
minLength: 1,
|
|
1235
|
+
maxLength: TRUST_POLICY_LIMITS.maxToolNameChars,
|
|
1236
|
+
not: { enum: ["__proto__", "prototype", "constructor"] }
|
|
1237
|
+
},
|
|
1238
|
+
additionalProperties: {
|
|
1239
|
+
type: "object",
|
|
1240
|
+
additionalProperties: false,
|
|
1241
|
+
properties: {
|
|
1242
|
+
allow: {
|
|
1243
|
+
type: "array",
|
|
1244
|
+
maxItems: TRUST_POLICY_LIMITS.maxPatternsPerRule,
|
|
1245
|
+
items: { type: "string", minLength: 1, maxLength: TRUST_POLICY_LIMITS.maxPatternChars }
|
|
1246
|
+
},
|
|
1247
|
+
deny: {
|
|
1248
|
+
type: "array",
|
|
1249
|
+
maxItems: TRUST_POLICY_LIMITS.maxPatternsPerRule,
|
|
1250
|
+
items: { type: "string", minLength: 1, maxLength: TRUST_POLICY_LIMITS.maxPatternChars }
|
|
1251
|
+
},
|
|
1252
|
+
auto: { type: "boolean" },
|
|
1253
|
+
trustWorkdir: { type: "boolean" },
|
|
1254
|
+
denyPrivate: { type: "boolean" }
|
|
1255
|
+
}
|
|
1256
|
+
}
|
|
1257
|
+
});
|
|
1258
|
+
var RULE_FIELDS = /* @__PURE__ */ new Set(["allow", "deny", "auto", "trustWorkdir", "denyPrivate"]);
|
|
1259
|
+
var UNSAFE_PROPERTY_NAMES = /* @__PURE__ */ new Set(["__proto__", "prototype", "constructor"]);
|
|
1260
|
+
function isRecord(value) {
|
|
1261
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
1262
|
+
}
|
|
1263
|
+
function error(diagnostics, code, path3, message) {
|
|
1264
|
+
diagnostics.push({ severity: "error", code, path: path3, message });
|
|
1265
|
+
}
|
|
1266
|
+
function validatePatterns(value, path3, diagnostics) {
|
|
1267
|
+
if (!Array.isArray(value)) {
|
|
1268
|
+
error(diagnostics, "invalid_pattern_list", path3, "must be an array of strings");
|
|
1269
|
+
return void 0;
|
|
1270
|
+
}
|
|
1271
|
+
if (value.length > TRUST_POLICY_LIMITS.maxPatternsPerRule) {
|
|
1272
|
+
error(
|
|
1273
|
+
diagnostics,
|
|
1274
|
+
"too_many_patterns",
|
|
1275
|
+
path3,
|
|
1276
|
+
`must contain at most ${TRUST_POLICY_LIMITS.maxPatternsPerRule} patterns`
|
|
1277
|
+
);
|
|
1278
|
+
return void 0;
|
|
1279
|
+
}
|
|
1280
|
+
const patterns = [];
|
|
1281
|
+
const seen = /* @__PURE__ */ new Set();
|
|
1282
|
+
for (const [index, pattern] of value.entries()) {
|
|
1283
|
+
const itemPath = `${path3}[${index}]`;
|
|
1284
|
+
if (typeof pattern !== "string" || pattern.length === 0 || pattern.length > TRUST_POLICY_LIMITS.maxPatternChars) {
|
|
1285
|
+
error(
|
|
1286
|
+
diagnostics,
|
|
1287
|
+
"invalid_pattern",
|
|
1288
|
+
itemPath,
|
|
1289
|
+
`must be a non-empty string up to ${TRUST_POLICY_LIMITS.maxPatternChars} characters`
|
|
1290
|
+
);
|
|
1291
|
+
continue;
|
|
1292
|
+
}
|
|
1293
|
+
if (seen.has(pattern)) {
|
|
1294
|
+
diagnostics.push({
|
|
1295
|
+
severity: "warning",
|
|
1296
|
+
code: "duplicate_pattern",
|
|
1297
|
+
path: itemPath,
|
|
1298
|
+
message: "duplicates an earlier pattern and was normalized away"
|
|
1299
|
+
});
|
|
1300
|
+
continue;
|
|
1301
|
+
}
|
|
1302
|
+
seen.add(pattern);
|
|
1303
|
+
patterns.push(pattern);
|
|
1304
|
+
}
|
|
1305
|
+
return patterns;
|
|
1306
|
+
}
|
|
1307
|
+
function validateTrustPolicy(value) {
|
|
1308
|
+
const diagnostics = [];
|
|
1309
|
+
if (!isRecord(value)) {
|
|
1310
|
+
return {
|
|
1311
|
+
ok: false,
|
|
1312
|
+
diagnostics: [
|
|
1313
|
+
{
|
|
1314
|
+
severity: "error",
|
|
1315
|
+
code: "invalid_root",
|
|
1316
|
+
path: "$",
|
|
1317
|
+
message: "trust policy must be an object"
|
|
1318
|
+
}
|
|
1319
|
+
]
|
|
1320
|
+
};
|
|
1321
|
+
}
|
|
1322
|
+
const entries = Object.entries(value);
|
|
1323
|
+
if (entries.length > TRUST_POLICY_LIMITS.maxTools) {
|
|
1324
|
+
error(
|
|
1325
|
+
diagnostics,
|
|
1326
|
+
"too_many_tools",
|
|
1327
|
+
"$",
|
|
1328
|
+
`must contain at most ${TRUST_POLICY_LIMITS.maxTools} tool rules`
|
|
1329
|
+
);
|
|
1330
|
+
}
|
|
1331
|
+
const policy = {};
|
|
1332
|
+
for (const [toolName, rawRule] of entries.slice(0, TRUST_POLICY_LIMITS.maxTools)) {
|
|
1333
|
+
const toolPath = `$[${JSON.stringify(toolName)}]`;
|
|
1334
|
+
if (toolName.length === 0 || toolName.length > TRUST_POLICY_LIMITS.maxToolNameChars) {
|
|
1335
|
+
error(
|
|
1336
|
+
diagnostics,
|
|
1337
|
+
"invalid_tool_name",
|
|
1338
|
+
toolPath,
|
|
1339
|
+
`tool name must be 1-${TRUST_POLICY_LIMITS.maxToolNameChars} characters`
|
|
1340
|
+
);
|
|
1341
|
+
continue;
|
|
1342
|
+
}
|
|
1343
|
+
if (UNSAFE_PROPERTY_NAMES.has(toolName)) {
|
|
1344
|
+
error(
|
|
1345
|
+
diagnostics,
|
|
1346
|
+
"unsafe_tool_name",
|
|
1347
|
+
toolPath,
|
|
1348
|
+
"reserved object property names are not valid tool rules"
|
|
1349
|
+
);
|
|
1350
|
+
continue;
|
|
1351
|
+
}
|
|
1352
|
+
if (!isRecord(rawRule)) {
|
|
1353
|
+
error(diagnostics, "invalid_rule", toolPath, "tool rule must be an object");
|
|
1354
|
+
continue;
|
|
1355
|
+
}
|
|
1356
|
+
for (const field of Object.keys(rawRule)) {
|
|
1357
|
+
if (!RULE_FIELDS.has(field)) {
|
|
1358
|
+
error(
|
|
1359
|
+
diagnostics,
|
|
1360
|
+
"unknown_field",
|
|
1361
|
+
`${toolPath}.${field}`,
|
|
1362
|
+
`unknown policy field "${field}"`
|
|
1363
|
+
);
|
|
1364
|
+
}
|
|
1365
|
+
}
|
|
1366
|
+
const rule = {};
|
|
1367
|
+
for (const field of ["allow", "deny"]) {
|
|
1368
|
+
if (rawRule[field] === void 0) continue;
|
|
1369
|
+
const patterns = validatePatterns(rawRule[field], `${toolPath}.${field}`, diagnostics);
|
|
1370
|
+
if (patterns) rule[field] = patterns;
|
|
1371
|
+
}
|
|
1372
|
+
for (const field of ["auto", "trustWorkdir", "denyPrivate"]) {
|
|
1373
|
+
const setting = rawRule[field];
|
|
1374
|
+
if (setting === void 0) continue;
|
|
1375
|
+
if (typeof setting !== "boolean") {
|
|
1376
|
+
error(diagnostics, "invalid_boolean", `${toolPath}.${field}`, "must be a boolean");
|
|
1377
|
+
} else {
|
|
1378
|
+
rule[field] = setting;
|
|
1379
|
+
}
|
|
1380
|
+
}
|
|
1381
|
+
policy[toolName] = rule;
|
|
1382
|
+
}
|
|
1383
|
+
return diagnostics.some((diagnostic) => diagnostic.severity === "error") ? { ok: false, diagnostics } : { ok: true, policy, diagnostics };
|
|
1384
|
+
}
|
|
1385
|
+
|
|
1199
1386
|
// src/utils/lru-cache.ts
|
|
1200
1387
|
var LruCache = class {
|
|
1201
1388
|
store = /* @__PURE__ */ new Map();
|
|
@@ -1230,253 +1417,13 @@ var LruCache = class {
|
|
|
1230
1417
|
return this.store.size;
|
|
1231
1418
|
}
|
|
1232
1419
|
};
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
// make a filesystem — wipes a partition
|
|
1236
|
-
/\bformat\s+[A-Za-z]:/i,
|
|
1237
|
-
// format C: — wipes a Windows volume
|
|
1238
|
-
/\bdiskpart\b/i,
|
|
1239
|
-
// Windows partition editor
|
|
1240
|
-
/\bdd\b[^|]*\bof=(?:\/dev\/|\\\\[.?]\\)/i,
|
|
1241
|
-
// dd writing straight to a raw device
|
|
1242
|
-
/>\s*\/dev\/(?:sd|hd|nvme|disk|mapper|vd)/i,
|
|
1243
|
-
// redirect into a raw block device
|
|
1244
|
-
/:\(\)\s*\{\s*:\|:&\s*\}\s*;/
|
|
1245
|
-
// classic fork bomb
|
|
1246
|
-
];
|
|
1247
|
-
var HIGH_IMPACT_PATTERNS = [
|
|
1248
|
-
/\b(?:curl|wget|fetch|httpie|http|irm|iwr|Invoke-WebRequest|Invoke-RestMethod)\b[\s\S]{0,300}\|\s*(?:sudo\s+)?(?:sh|bash|zsh|fish|pwsh|powershell|iex|Invoke-Expression)\b/i,
|
|
1249
|
-
/\b(?:powershell|pwsh)(?:\.exe)?\b[\s\S]{0,120}-(?:enc|encodedcommand)\b/i,
|
|
1250
|
-
/\b(?:shutdown|reboot)\b/i
|
|
1251
|
-
];
|
|
1252
|
-
var CATASTROPHIC_POSIX_ROOTS = /* @__PURE__ */ new Set([
|
|
1253
|
-
"/etc",
|
|
1254
|
-
"/usr",
|
|
1255
|
-
"/bin",
|
|
1256
|
-
"/sbin",
|
|
1257
|
-
"/lib",
|
|
1258
|
-
"/lib64",
|
|
1259
|
-
"/var",
|
|
1260
|
-
"/boot",
|
|
1261
|
-
"/dev",
|
|
1262
|
-
"/sys",
|
|
1263
|
-
"/proc",
|
|
1264
|
-
"/opt",
|
|
1265
|
-
"/root",
|
|
1266
|
-
"/home",
|
|
1267
|
-
"/srv",
|
|
1268
|
-
"/run",
|
|
1269
|
-
"/system",
|
|
1270
|
-
"/library",
|
|
1271
|
-
"/applications",
|
|
1272
|
-
"/users"
|
|
1273
|
-
]);
|
|
1274
|
-
var CATASTROPHIC_WIN_SUBDIRS = /* @__PURE__ */ new Set([
|
|
1275
|
-
"windows",
|
|
1276
|
-
"system32",
|
|
1277
|
-
"winnt",
|
|
1278
|
-
"program files",
|
|
1279
|
-
"program files (x86)",
|
|
1280
|
-
"programdata",
|
|
1281
|
-
"users"
|
|
1282
|
-
]);
|
|
1283
|
-
var SHELL_OPERATORS = /* @__PURE__ */ new Set(["&&", "||", "|", ";", ">", ">>", "<", "2>", "2>>"]);
|
|
1420
|
+
|
|
1421
|
+
// src/security/yolo-risk.ts
|
|
1284
1422
|
function getInputString(input, key) {
|
|
1285
1423
|
if (!input || typeof input !== "object") return void 0;
|
|
1286
1424
|
const value = input[key];
|
|
1287
1425
|
return typeof value === "string" ? value : void 0;
|
|
1288
1426
|
}
|
|
1289
|
-
function pathLooksInsideProject(rawPath, projectRoot) {
|
|
1290
|
-
if (!projectRoot) return false;
|
|
1291
|
-
if (rawPath === "~" || rawPath.startsWith("~/") || rawPath.startsWith("~\\")) return false;
|
|
1292
|
-
const resolved = path.resolve(projectRoot, rawPath);
|
|
1293
|
-
const relative2 = path.relative(projectRoot, resolved);
|
|
1294
|
-
return !!relative2 && !relative2.startsWith("..") && !path.isAbsolute(relative2);
|
|
1295
|
-
}
|
|
1296
|
-
function tokenizeShell(command) {
|
|
1297
|
-
return command.match(/"[^"]*"|'[^']*'|\S+/g)?.map((token) => token.replace(/^['"]|['"]$/g, "")) ?? [];
|
|
1298
|
-
}
|
|
1299
|
-
function commandSegment(tokens, start) {
|
|
1300
|
-
const out = [];
|
|
1301
|
-
for (let i = start; i < tokens.length; i++) {
|
|
1302
|
-
const token = tokens[i];
|
|
1303
|
-
if (token === void 0 || SHELL_OPERATORS.has(token)) break;
|
|
1304
|
-
out.push(token);
|
|
1305
|
-
}
|
|
1306
|
-
return out;
|
|
1307
|
-
}
|
|
1308
|
-
function hasShortFlag(args, letters) {
|
|
1309
|
-
const seen = /* @__PURE__ */ new Set();
|
|
1310
|
-
for (const arg of args) {
|
|
1311
|
-
if (!arg.startsWith("-") || arg.startsWith("--")) continue;
|
|
1312
|
-
for (const ch of arg.replace(/^-+/, "")) seen.add(ch.toLowerCase());
|
|
1313
|
-
}
|
|
1314
|
-
return letters.split("").every((letter) => seen.has(letter));
|
|
1315
|
-
}
|
|
1316
|
-
function hasRecursiveForceDelete(command, projectRoot) {
|
|
1317
|
-
const tokens = tokenizeShell(command);
|
|
1318
|
-
for (let i = 0; i < tokens.length; i++) {
|
|
1319
|
-
const token = tokens[i]?.toLowerCase();
|
|
1320
|
-
if (!token) continue;
|
|
1321
|
-
if (token === "rm" || token === "rmdir") {
|
|
1322
|
-
const args = commandSegment(tokens, i + 1);
|
|
1323
|
-
const recursiveForce = hasShortFlag(args, "rf") || args.some((arg) => arg === "--recursive") && args.some((arg) => arg === "--force");
|
|
1324
|
-
if (recursiveForce) {
|
|
1325
|
-
const targets = args.filter((arg) => !arg.startsWith("-") && !SHELL_OPERATORS.has(arg));
|
|
1326
|
-
if (targets.length > 0 && targets.every((target) => target.trim().length === 0)) {
|
|
1327
|
-
continue;
|
|
1328
|
-
}
|
|
1329
|
-
if (targets.length === 0) return true;
|
|
1330
|
-
if (targets.some(isCatastrophicDeleteTarget)) return true;
|
|
1331
|
-
if (targets.some((target) => !pathLooksInsideProject(target, projectRoot))) return true;
|
|
1332
|
-
}
|
|
1333
|
-
}
|
|
1334
|
-
if (token === "remove-item" || token === "ri") {
|
|
1335
|
-
const args = commandSegment(tokens, i + 1).map((arg) => arg.toLowerCase());
|
|
1336
|
-
const recurse = args.some((arg) => arg === "-recurse" || arg === "-r");
|
|
1337
|
-
const force = args.some((arg) => arg === "-force" || arg === "-f");
|
|
1338
|
-
if (recurse && force && !args.includes("-whatif")) {
|
|
1339
|
-
const targets = args.filter((arg) => !arg.startsWith("-") && !SHELL_OPERATORS.has(arg));
|
|
1340
|
-
if (targets.length === 0) return true;
|
|
1341
|
-
if (targets.some(isCatastrophicDeleteTarget)) return true;
|
|
1342
|
-
if (targets.some((target) => !pathLooksInsideProject(target, projectRoot))) return true;
|
|
1343
|
-
}
|
|
1344
|
-
}
|
|
1345
|
-
if (token === "rd" || token === "rmdir") {
|
|
1346
|
-
const args = commandSegment(tokens, i + 1).map((arg) => arg.toLowerCase());
|
|
1347
|
-
if (args.includes("/s")) {
|
|
1348
|
-
const targets = args.filter((arg) => !arg.startsWith("-") && !arg.startsWith("/") && !SHELL_OPERATORS.has(arg));
|
|
1349
|
-
if (targets.length === 0) return true;
|
|
1350
|
-
if (targets.some(isCatastrophicDeleteTarget)) return true;
|
|
1351
|
-
if (targets.some((target) => !pathLooksInsideProject(target, projectRoot))) return true;
|
|
1352
|
-
}
|
|
1353
|
-
}
|
|
1354
|
-
}
|
|
1355
|
-
return false;
|
|
1356
|
-
}
|
|
1357
|
-
function hasGitHistoryRewrite(command) {
|
|
1358
|
-
const tokens = tokenizeShell(command).map((token) => token.toLowerCase());
|
|
1359
|
-
for (let i = 0; i < tokens.length; i++) {
|
|
1360
|
-
if (tokens[i] !== "git") continue;
|
|
1361
|
-
const args = commandSegment(tokens, i + 1);
|
|
1362
|
-
if (args.includes("reset") && args.some((arg) => arg === "--hard" || arg.startsWith("--hard="))) {
|
|
1363
|
-
return true;
|
|
1364
|
-
}
|
|
1365
|
-
const cleanIdx = args.indexOf("clean");
|
|
1366
|
-
if (cleanIdx >= 0) {
|
|
1367
|
-
const cleanArgs = args.slice(cleanIdx + 1);
|
|
1368
|
-
if (cleanArgs.some((arg) => arg === "-f" || arg === "--force" || /^-[a-z]*f[a-z]*$/i.test(arg))) {
|
|
1369
|
-
return true;
|
|
1370
|
-
}
|
|
1371
|
-
}
|
|
1372
|
-
const pushIdx = args.indexOf("push");
|
|
1373
|
-
if (pushIdx >= 0) {
|
|
1374
|
-
const pushArgs = args.slice(pushIdx + 1);
|
|
1375
|
-
if (pushArgs.some(
|
|
1376
|
-
(arg) => arg === "-f" || arg === "--force" || arg === "--force-with-lease" || arg.startsWith("--force=") || arg.startsWith("--force-with-lease=")
|
|
1377
|
-
)) {
|
|
1378
|
-
return true;
|
|
1379
|
-
}
|
|
1380
|
-
}
|
|
1381
|
-
}
|
|
1382
|
-
return false;
|
|
1383
|
-
}
|
|
1384
|
-
function hasExternalPublish(command) {
|
|
1385
|
-
const tokens = tokenizeShell(command).map((token) => token.toLowerCase());
|
|
1386
|
-
for (let i = 0; i < tokens.length; i++) {
|
|
1387
|
-
const cmd = tokens[i];
|
|
1388
|
-
if (!cmd) continue;
|
|
1389
|
-
const args = commandSegment(tokens, i + 1);
|
|
1390
|
-
if (["npm", "pnpm", "yarn", "bun"].includes(cmd) && (args.includes("publish") || args.includes("deploy"))) {
|
|
1391
|
-
return true;
|
|
1392
|
-
}
|
|
1393
|
-
if (cmd === "cargo" && (args.includes("publish") || args.includes("yank"))) return true;
|
|
1394
|
-
if ((cmd === "docker" || cmd === "podman") && args.includes("push")) return true;
|
|
1395
|
-
if (cmd === "kubectl") {
|
|
1396
|
-
const deleteIdx = args.indexOf("delete");
|
|
1397
|
-
if (deleteIdx >= 0 && (args[deleteIdx + 1] === "namespace" || args[deleteIdx + 1] === "ns")) {
|
|
1398
|
-
return true;
|
|
1399
|
-
}
|
|
1400
|
-
if (args.includes("drain")) return true;
|
|
1401
|
-
}
|
|
1402
|
-
}
|
|
1403
|
-
return false;
|
|
1404
|
-
}
|
|
1405
|
-
function hasFindExec(command) {
|
|
1406
|
-
const tokens = tokenizeShell(command).map((token) => token.toLowerCase());
|
|
1407
|
-
for (let i = 0; i < tokens.length; i++) {
|
|
1408
|
-
if (tokens[i] !== "find") continue;
|
|
1409
|
-
const args = commandSegment(tokens, i + 1);
|
|
1410
|
-
if (args.some((arg) => arg === "-exec" || arg === "-ok" || arg === "-execdir")) return true;
|
|
1411
|
-
}
|
|
1412
|
-
return false;
|
|
1413
|
-
}
|
|
1414
|
-
function isCatastrophicDeleteTarget(rawTarget) {
|
|
1415
|
-
const t = rawTarget.replace(/^['"]|['"]$/g, "").trim();
|
|
1416
|
-
if (!t) return false;
|
|
1417
|
-
if (t === "*" || t === "." || t === "./" || t === ".\\" || t === "./*" || t === ".\\*") return true;
|
|
1418
|
-
const s = t.replace(/[\\/]\*+$/, "").replace(/[\\/]+$/, "");
|
|
1419
|
-
if (s === "") return true;
|
|
1420
|
-
if (s === "~" || /^\$HOME$/i.test(s) || /^%USERPROFILE%$/i.test(s)) return true;
|
|
1421
|
-
if (/^[A-Za-z]:$/.test(s)) return true;
|
|
1422
|
-
const norm = s.toLowerCase().replace(/\\/g, "/");
|
|
1423
|
-
if (CATASTROPHIC_POSIX_ROOTS.has(norm)) return true;
|
|
1424
|
-
const win = norm.match(/^[a-z]:\/([^/]+)$/);
|
|
1425
|
-
if (win?.[1] && CATASTROPHIC_WIN_SUBDIRS.has(win[1])) return true;
|
|
1426
|
-
return false;
|
|
1427
|
-
}
|
|
1428
|
-
function hasCatastrophicDelete(command) {
|
|
1429
|
-
const tokens = tokenizeShell(command);
|
|
1430
|
-
for (let i = 0; i < tokens.length; i++) {
|
|
1431
|
-
const token = tokens[i]?.toLowerCase();
|
|
1432
|
-
if (!token) continue;
|
|
1433
|
-
if (token === "rm") {
|
|
1434
|
-
const args = tokens.slice(i + 1);
|
|
1435
|
-
const recursiveOrForce = args.some(
|
|
1436
|
-
(arg) => /^-[^-]*[rf]/i.test(arg) || arg === "--recursive" || arg === "--force" || arg === "--no-preserve-root"
|
|
1437
|
-
);
|
|
1438
|
-
if (!recursiveOrForce) continue;
|
|
1439
|
-
const targets = args.filter((arg) => !arg.startsWith("-") && !SHELL_OPERATORS.has(arg));
|
|
1440
|
-
if (targets.length === 0) return true;
|
|
1441
|
-
if (targets.some(isCatastrophicDeleteTarget)) return true;
|
|
1442
|
-
}
|
|
1443
|
-
if (token === "remove-item" || token === "ri") {
|
|
1444
|
-
const args = tokens.slice(i + 1);
|
|
1445
|
-
const recursive = args.some((arg) => {
|
|
1446
|
-
const a = arg.toLowerCase();
|
|
1447
|
-
return a === "-recurse" || a === "-force";
|
|
1448
|
-
});
|
|
1449
|
-
if (!recursive) continue;
|
|
1450
|
-
const targets = args.filter((arg) => !arg.startsWith("-") && !SHELL_OPERATORS.has(arg));
|
|
1451
|
-
if (targets.some(isCatastrophicDeleteTarget)) return true;
|
|
1452
|
-
}
|
|
1453
|
-
if (token === "rmdir" || token === "rd") {
|
|
1454
|
-
const args = tokens.slice(i + 1);
|
|
1455
|
-
const recursive = args.some((arg) => arg.toLowerCase() === "/s");
|
|
1456
|
-
if (!recursive) continue;
|
|
1457
|
-
const targets = args.filter((arg) => !arg.startsWith("-") && !arg.startsWith("/") && !SHELL_OPERATORS.has(arg));
|
|
1458
|
-
if (targets.some(isCatastrophicDeleteTarget)) return true;
|
|
1459
|
-
}
|
|
1460
|
-
if (token === "del" || token === "erase") {
|
|
1461
|
-
const args = tokens.slice(i + 1);
|
|
1462
|
-
const targets = args.filter((arg) => !arg.startsWith("-") && !arg.startsWith("/") && !SHELL_OPERATORS.has(arg));
|
|
1463
|
-
if (targets.some(isCatastrophicDeleteTarget)) return true;
|
|
1464
|
-
}
|
|
1465
|
-
}
|
|
1466
|
-
return false;
|
|
1467
|
-
}
|
|
1468
|
-
function isClearlyDestructiveBashCommand(command, projectRoot) {
|
|
1469
|
-
const trimmed = command.trim();
|
|
1470
|
-
if (!trimmed) return false;
|
|
1471
|
-
if (hasRecursiveForceDelete(trimmed, projectRoot)) return true;
|
|
1472
|
-
if (hasGitHistoryRewrite(trimmed)) return true;
|
|
1473
|
-
if (hasExternalPublish(trimmed)) return true;
|
|
1474
|
-
if (hasFindExec(trimmed)) return true;
|
|
1475
|
-
if (hasCatastrophicDelete(trimmed)) return true;
|
|
1476
|
-
if (CATASTROPHIC_PATTERNS.some((pattern) => pattern.test(trimmed))) return true;
|
|
1477
|
-
if (HIGH_IMPACT_PATTERNS.some((pattern) => pattern.test(trimmed))) return true;
|
|
1478
|
-
return false;
|
|
1479
|
-
}
|
|
1480
1427
|
|
|
1481
1428
|
// src/security/permission-policy.ts
|
|
1482
1429
|
function matchesTrust(patterns, subject) {
|
|
@@ -1555,7 +1502,7 @@ var DefaultPermissionPolicy = class {
|
|
|
1555
1502
|
trustFile;
|
|
1556
1503
|
yolo;
|
|
1557
1504
|
yoloDestructive;
|
|
1558
|
-
/**
|
|
1505
|
+
/** Deprecated compatibility flag; no longer gates YOLO calls. */
|
|
1559
1506
|
confirmDestructive;
|
|
1560
1507
|
/**
|
|
1561
1508
|
* Session-scoped "soft deny" map. When the user presses 'n' (block once),
|
|
@@ -1590,7 +1537,7 @@ var DefaultPermissionPolicy = class {
|
|
|
1590
1537
|
/**
|
|
1591
1538
|
* Evaluate-result cache. Keyed by `tool.name::subject` so repeated calls
|
|
1592
1539
|
* with the same tool+input skip namespace matching, subject computation,
|
|
1593
|
-
* pattern matching (matchAny)
|
|
1540
|
+
* and pattern matching (matchAny).
|
|
1594
1541
|
*
|
|
1595
1542
|
* Cleared on any state change (reload, trust, deny, yolo toggle) because
|
|
1596
1543
|
* the result depends on the full policy state. The write-tool smart-bypass
|
|
@@ -1604,11 +1551,13 @@ var DefaultPermissionPolicy = class {
|
|
|
1604
1551
|
* the LRU evicts the least-recently-used entries first.
|
|
1605
1552
|
*/
|
|
1606
1553
|
_evalCache = new LruCache(500);
|
|
1554
|
+
policyDiagnostics = [];
|
|
1555
|
+
policyInvalid = false;
|
|
1607
1556
|
constructor(opts) {
|
|
1608
1557
|
this.trustFile = opts.trustFile;
|
|
1609
1558
|
this.yolo = opts.yolo ?? false;
|
|
1610
1559
|
this.yoloDestructive = opts.yoloDestructive ?? opts.forceAllYolo ?? false;
|
|
1611
|
-
this.confirmDestructive =
|
|
1560
|
+
this.confirmDestructive = opts.confirmDestructive ?? false;
|
|
1612
1561
|
this.promptDelegate = opts.promptDelegate;
|
|
1613
1562
|
}
|
|
1614
1563
|
/**
|
|
@@ -1638,22 +1587,59 @@ var DefaultPermissionPolicy = class {
|
|
|
1638
1587
|
getYoloDestructive() {
|
|
1639
1588
|
return this.yoloDestructive;
|
|
1640
1589
|
}
|
|
1641
|
-
/** Toggle destructive confirmation
|
|
1642
|
-
setConfirmDestructive(
|
|
1643
|
-
if (
|
|
1644
|
-
this.confirmDestructive =
|
|
1590
|
+
/** Toggle deprecated destructive confirmation compatibility flag. */
|
|
1591
|
+
setConfirmDestructive(enabled) {
|
|
1592
|
+
if (this.confirmDestructive !== enabled) this._evalCache.clear();
|
|
1593
|
+
this.confirmDestructive = enabled;
|
|
1645
1594
|
}
|
|
1646
|
-
/** Check
|
|
1595
|
+
/** Check deprecated destructive confirmation compatibility flag. */
|
|
1647
1596
|
getConfirmDestructive() {
|
|
1648
1597
|
return this.confirmDestructive;
|
|
1649
1598
|
}
|
|
1599
|
+
/** Read-only diagnostics for policy inspector/editor surfaces. */
|
|
1600
|
+
getPolicyDiagnostics() {
|
|
1601
|
+
return this.policyDiagnostics.map((diagnostic) => ({ ...diagnostic }));
|
|
1602
|
+
}
|
|
1650
1603
|
async reload() {
|
|
1604
|
+
this.policyDiagnostics = [];
|
|
1605
|
+
this.policyInvalid = false;
|
|
1651
1606
|
try {
|
|
1652
|
-
const raw = await
|
|
1607
|
+
const raw = await fs3.readFile(this.trustFile, "utf8");
|
|
1653
1608
|
const parsed = safeParse(raw);
|
|
1654
|
-
if (parsed.ok
|
|
1655
|
-
|
|
1609
|
+
if (!parsed.ok) {
|
|
1610
|
+
this.policy = {};
|
|
1611
|
+
this.policyInvalid = true;
|
|
1612
|
+
this.policyDiagnostics = [
|
|
1613
|
+
{
|
|
1614
|
+
severity: "error",
|
|
1615
|
+
code: "invalid_json",
|
|
1616
|
+
path: "$",
|
|
1617
|
+
message: parsed.error ?? "trust policy is not valid JSON"
|
|
1618
|
+
}
|
|
1619
|
+
];
|
|
1620
|
+
} else {
|
|
1621
|
+
const validation = validateTrustPolicy(parsed.value);
|
|
1622
|
+
this.policyDiagnostics = validation.diagnostics;
|
|
1623
|
+
if (validation.ok) {
|
|
1624
|
+
this.policy = validation.policy;
|
|
1625
|
+
} else {
|
|
1626
|
+
this.policy = {};
|
|
1627
|
+
this.policyInvalid = true;
|
|
1628
|
+
}
|
|
1629
|
+
}
|
|
1630
|
+
} catch (err) {
|
|
1656
1631
|
this.policy = {};
|
|
1632
|
+
if (err.code !== "ENOENT") {
|
|
1633
|
+
this.policyInvalid = true;
|
|
1634
|
+
this.policyDiagnostics = [
|
|
1635
|
+
{
|
|
1636
|
+
severity: "error",
|
|
1637
|
+
code: "read_error",
|
|
1638
|
+
path: "$",
|
|
1639
|
+
message: err instanceof Error ? err.message : String(err)
|
|
1640
|
+
}
|
|
1641
|
+
];
|
|
1642
|
+
}
|
|
1657
1643
|
}
|
|
1658
1644
|
this.wildcardEntries = [];
|
|
1659
1645
|
for (const [key, val] of Object.entries(this.policy)) {
|
|
@@ -1666,6 +1652,13 @@ var DefaultPermissionPolicy = class {
|
|
|
1666
1652
|
}
|
|
1667
1653
|
async evaluate(tool, input, ctx) {
|
|
1668
1654
|
if (!this.loaded) await this.reload();
|
|
1655
|
+
if (this.policyInvalid) {
|
|
1656
|
+
return {
|
|
1657
|
+
permission: "deny",
|
|
1658
|
+
source: "deny",
|
|
1659
|
+
reason: "trust policy is invalid; refusing tool execution until it is repaired"
|
|
1660
|
+
};
|
|
1661
|
+
}
|
|
1669
1662
|
const namespaceEntry = this.findNamespaceEntry(tool.name);
|
|
1670
1663
|
const entry = this.policy[tool.name] ?? namespaceEntry;
|
|
1671
1664
|
const subject = subjectForToolInput(tool.name, input, tool.subjectKey);
|
|
@@ -1698,29 +1691,6 @@ var DefaultPermissionPolicy = class {
|
|
|
1698
1691
|
this._evalCache.set(cacheKey, decision);
|
|
1699
1692
|
return decision;
|
|
1700
1693
|
}
|
|
1701
|
-
if (this.yolo) {
|
|
1702
|
-
const destructive = this.isDestructiveYoloCall(tool, input, ctx);
|
|
1703
|
-
if (destructive) {
|
|
1704
|
-
if (this.promptDelegate) {
|
|
1705
|
-
const decision = await this.promptDelegate(tool, input, subject ?? tool.name);
|
|
1706
|
-
if (decision === "deny") {
|
|
1707
|
-
await this.deny({ tool: tool.name, pattern: subject ?? tool.name });
|
|
1708
|
-
return { permission: "deny", source: "user", reason: "user denied destructive yolo" };
|
|
1709
|
-
}
|
|
1710
|
-
return {
|
|
1711
|
-
permission: decision === "yes" || decision === "always" ? "auto" : "deny",
|
|
1712
|
-
source: "user",
|
|
1713
|
-
reason: "destructive yolo approved for this call"
|
|
1714
|
-
};
|
|
1715
|
-
}
|
|
1716
|
-
return {
|
|
1717
|
-
permission: "confirm",
|
|
1718
|
-
source: "yolo_destructive",
|
|
1719
|
-
riskTier: "destructive",
|
|
1720
|
-
reason: "destructive tool needs explicit approval in YOLO mode"
|
|
1721
|
-
};
|
|
1722
|
-
}
|
|
1723
|
-
}
|
|
1724
1694
|
if (entry?.allow && subject && matchesTrust(entry.allow, subject)) {
|
|
1725
1695
|
const decision = { permission: "auto", source: "trust", reason: "matched allow pattern" };
|
|
1726
1696
|
this._evalCache.set(cacheKey, decision);
|
|
@@ -1802,47 +1772,6 @@ var DefaultPermissionPolicy = class {
|
|
|
1802
1772
|
}
|
|
1803
1773
|
return { permission: "confirm", source: "default" };
|
|
1804
1774
|
}
|
|
1805
|
-
// Capability-based destructive check (preferred over name-based)
|
|
1806
|
-
isDestructiveByCapability(tool) {
|
|
1807
|
-
const caps = tool.capabilities ?? [];
|
|
1808
|
-
if (caps.includes(ToolCapabilities.SHELL_ARBITRARY)) return true;
|
|
1809
|
-
if (caps.includes(ToolCapabilities.SHELL_RESTRICTED)) return true;
|
|
1810
|
-
if (caps.includes(ToolCapabilities.SHELL_EXEC)) return true;
|
|
1811
|
-
if (caps.includes(ToolCapabilities.FS_WRITE)) return true;
|
|
1812
|
-
if (caps.includes(ToolCapabilities.FS_WRITE_OUTSIDE_PROJECT)) return true;
|
|
1813
|
-
return false;
|
|
1814
|
-
}
|
|
1815
|
-
isDestructiveYoloCall(tool, input, ctx) {
|
|
1816
|
-
if (tool.name === "mcp_control") {
|
|
1817
|
-
const action = getInputString(input, "action");
|
|
1818
|
-
if (action === "list" || action === "search" || action === "activate" || action === "deactivate") {
|
|
1819
|
-
return false;
|
|
1820
|
-
}
|
|
1821
|
-
}
|
|
1822
|
-
if (this.isDestructiveByCapability(tool)) {
|
|
1823
|
-
const caps = tool.capabilities ?? [];
|
|
1824
|
-
if (caps.includes(ToolCapabilities.SHELL_ARBITRARY) || caps.includes(ToolCapabilities.SHELL_RESTRICTED) || caps.includes(ToolCapabilities.SHELL_EXEC)) {
|
|
1825
|
-
const command = shellCommandLineFromInput(input);
|
|
1826
|
-
return command ? isClearlyDestructiveBashCommand(command, ctx.projectRoot) : tool.riskTier === "destructive";
|
|
1827
|
-
}
|
|
1828
|
-
if (caps.includes(ToolCapabilities.FS_WRITE_OUTSIDE_PROJECT)) return true;
|
|
1829
|
-
if (caps.includes(ToolCapabilities.FS_WRITE)) {
|
|
1830
|
-
const targetPath = getInputString(input, "path") ?? getInputString(input, "file");
|
|
1831
|
-
if (!targetPath || !ctx.projectRoot) return false;
|
|
1832
|
-
return !pathLooksInsideProject(targetPath, ctx.projectRoot);
|
|
1833
|
-
}
|
|
1834
|
-
}
|
|
1835
|
-
if (tool.name === "bash" || tool.name === "shell" || tool.name === "exec") {
|
|
1836
|
-
const command = shellCommandLineFromInput(input);
|
|
1837
|
-
return command ? isClearlyDestructiveBashCommand(command, ctx.projectRoot) : tool.riskTier === "destructive";
|
|
1838
|
-
}
|
|
1839
|
-
if (tool.name === "write" || tool.name === "edit" || tool.name === "replace" || tool.name === "patch") {
|
|
1840
|
-
const targetPath = getInputString(input, "path") ?? getInputString(input, "file");
|
|
1841
|
-
if (!targetPath || !ctx.projectRoot) return false;
|
|
1842
|
-
return !pathLooksInsideProject(targetPath, ctx.projectRoot);
|
|
1843
|
-
}
|
|
1844
|
-
return tool.riskTier === "destructive";
|
|
1845
|
-
}
|
|
1846
1775
|
isSensitiveReadCall(tool, input) {
|
|
1847
1776
|
const isReadTool = hasCapability(tool, ToolCapabilities.FS_READ) || tool.name === "read" || tool.name === "grep" || tool.name === "glob" || tool.name === "tree";
|
|
1848
1777
|
if (isReadTool && inputPathLooksSensitive(input)) return true;
|
|
@@ -1859,6 +1788,9 @@ var DefaultPermissionPolicy = class {
|
|
|
1859
1788
|
}
|
|
1860
1789
|
async trust(rule) {
|
|
1861
1790
|
if (!this.loaded) await this.reload();
|
|
1791
|
+
if (this.policyInvalid) {
|
|
1792
|
+
throw new Error("Cannot update trust rules while trust.json is invalid; repair it first.");
|
|
1793
|
+
}
|
|
1862
1794
|
const entry = this.policy[rule.tool] ?? {};
|
|
1863
1795
|
entry.allow = Array.from(/* @__PURE__ */ new Set([...entry.allow ?? [], rule.pattern]));
|
|
1864
1796
|
this.policy[rule.tool] = entry;
|
|
@@ -1877,6 +1809,9 @@ var DefaultPermissionPolicy = class {
|
|
|
1877
1809
|
/** Persist a deny rule — this tool+pattern pair is permanently blocked. */
|
|
1878
1810
|
async deny(rule) {
|
|
1879
1811
|
if (!this.loaded) await this.reload();
|
|
1812
|
+
if (this.policyInvalid) {
|
|
1813
|
+
throw new Error("Cannot update deny rules while trust.json is invalid; repair it first.");
|
|
1814
|
+
}
|
|
1880
1815
|
const entry = this.policy[rule.tool] ?? {};
|
|
1881
1816
|
entry.deny = Array.from(/* @__PURE__ */ new Set([...entry.deny ?? [], rule.pattern]));
|
|
1882
1817
|
this.policy[rule.tool] = entry;
|
|
@@ -1950,7 +1885,25 @@ var AutoApprovePermissionPolicy = class _AutoApprovePermissionPolicy {
|
|
|
1950
1885
|
async reload() {
|
|
1951
1886
|
}
|
|
1952
1887
|
};
|
|
1953
|
-
|
|
1954
|
-
|
|
1888
|
+
export {
|
|
1889
|
+
AutoApprovePermissionPolicy,
|
|
1890
|
+
DANGEROUS_FOR_SUBAGENTS,
|
|
1891
|
+
DefaultPermissionPolicy,
|
|
1892
|
+
DefaultSecretScrubber,
|
|
1893
|
+
DefaultSecretVault,
|
|
1894
|
+
TRUST_POLICY_JSON_SCHEMA,
|
|
1895
|
+
TRUST_POLICY_LIMITS,
|
|
1896
|
+
TRUST_POLICY_SCHEMA_VERSION,
|
|
1897
|
+
ToolCapabilities,
|
|
1898
|
+
decryptConfigSecrets,
|
|
1899
|
+
encryptConfigSecrets,
|
|
1900
|
+
getDangerousCapabilities,
|
|
1901
|
+
hasCapability,
|
|
1902
|
+
hasDangerousCapabilityForSubagents,
|
|
1903
|
+
isSecretField,
|
|
1904
|
+
migratePlaintextSecrets,
|
|
1905
|
+
rewriteConfigEncrypted,
|
|
1906
|
+
rotateConfigKeys,
|
|
1907
|
+
validateTrustPolicy
|
|
1908
|
+
};
|
|
1955
1909
|
//# sourceMappingURL=index.js.map
|
|
1956
|
-
//# sourceMappingURL=index.js.map
|