@wrongstack/core 0.284.0 → 0.285.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent-status-tracker.d.ts +74 -0
- package/dist/agent-status-tracker.d.ts.map +1 -0
- package/dist/autophase/auto-phase-planner.d.ts +79 -0
- package/dist/autophase/auto-phase-planner.d.ts.map +1 -0
- package/dist/autophase/auto-phase-runner.d.ts +79 -0
- package/dist/autophase/auto-phase-runner.d.ts.map +1 -0
- package/dist/autophase/checkpoint.d.ts +49 -0
- package/dist/autophase/checkpoint.d.ts.map +1 -0
- package/dist/autophase/index.d.ts +9 -0
- package/dist/autophase/index.d.ts.map +1 -0
- package/dist/autophase/phase-graph-builder.d.ts +46 -0
- package/dist/autophase/phase-graph-builder.d.ts.map +1 -0
- package/dist/autophase/phase-orchestrator.d.ts +150 -0
- package/dist/autophase/phase-orchestrator.d.ts.map +1 -0
- package/dist/autophase/phase-store.d.ts +29 -0
- package/dist/autophase/phase-store.d.ts.map +1 -0
- package/dist/autophase/types.d.ts +329 -0
- package/dist/autophase/types.d.ts.map +1 -0
- package/dist/boot.d.ts +73 -0
- package/dist/boot.d.ts.map +1 -0
- package/dist/coordination/adaptive-concurrency.d.ts +63 -0
- package/dist/coordination/adaptive-concurrency.d.ts.map +1 -0
- package/dist/coordination/agent-bridge.d.ts +24 -0
- package/dist/coordination/agent-bridge.d.ts.map +1 -0
- package/dist/coordination/agent-monitor.d.ts +100 -0
- package/dist/coordination/agent-monitor.d.ts.map +1 -0
- package/dist/coordination/agent-subagent-runner.d.ts +74 -0
- package/dist/coordination/agent-subagent-runner.d.ts.map +1 -0
- package/dist/coordination/agents/agent-prompts.d.ts +2 -0
- package/dist/coordination/agents/agent-prompts.d.ts.map +1 -0
- package/dist/coordination/agents/index.d.ts +35 -0
- package/dist/coordination/agents/index.d.ts.map +1 -0
- package/dist/coordination/agents/phase1-discovery.d.ts +4 -0
- package/dist/coordination/agents/phase1-discovery.d.ts.map +1 -0
- package/dist/coordination/agents/phase2-planning.d.ts +4 -0
- package/dist/coordination/agents/phase2-planning.d.ts.map +1 -0
- package/dist/coordination/agents/phase3-build.d.ts +4 -0
- package/dist/coordination/agents/phase3-build.d.ts.map +1 -0
- package/dist/coordination/agents/phase3-techstack.d.ts +13 -0
- package/dist/coordination/agents/phase3-techstack.d.ts.map +1 -0
- package/dist/coordination/agents/phase4-verify.d.ts +4 -0
- package/dist/coordination/agents/phase4-verify.d.ts.map +1 -0
- package/dist/coordination/agents/phase5-review.d.ts +4 -0
- package/dist/coordination/agents/phase5-review.d.ts.map +1 -0
- package/dist/coordination/agents/phase6-domain.d.ts +4 -0
- package/dist/coordination/agents/phase6-domain.d.ts.map +1 -0
- package/dist/coordination/agents/phase7-knowledge.d.ts +4 -0
- package/dist/coordination/agents/phase7-knowledge.d.ts.map +1 -0
- package/dist/coordination/agents/phase8-delivery.d.ts +4 -0
- package/dist/coordination/agents/phase8-delivery.d.ts.map +1 -0
- package/dist/coordination/agents/phase9-meta.d.ts +4 -0
- package/dist/coordination/agents/phase9-meta.d.ts.map +1 -0
- package/dist/coordination/agents/types.d.ts +79 -0
- package/dist/coordination/agents/types.d.ts.map +1 -0
- package/dist/coordination/agents.d.ts +8 -0
- package/dist/coordination/agents.d.ts.map +1 -0
- package/dist/coordination/auto-extend.d.ts +46 -0
- package/dist/coordination/auto-extend.d.ts.map +1 -0
- package/dist/coordination/autonomous-brain.d.ts +154 -0
- package/dist/coordination/autonomous-brain.d.ts.map +1 -0
- package/dist/coordination/autonomous-coordinator.d.ts +239 -0
- package/dist/coordination/autonomous-coordinator.d.ts.map +1 -0
- package/dist/coordination/brain-monitor.d.ts +74 -0
- package/dist/coordination/brain-monitor.d.ts.map +1 -0
- package/dist/coordination/brain.d.ts +104 -0
- package/dist/coordination/brain.d.ts.map +1 -0
- package/dist/coordination/change-manager.d.ts +151 -0
- package/dist/coordination/change-manager.d.ts.map +1 -0
- package/dist/coordination/checkpoint-wiring.d.ts +61 -0
- package/dist/coordination/checkpoint-wiring.d.ts.map +1 -0
- package/dist/coordination/collab-bus.d.ts +132 -0
- package/dist/coordination/collab-bus.d.ts.map +1 -0
- package/dist/coordination/collab-debug.d.ts +302 -0
- package/dist/coordination/collab-debug.d.ts.map +1 -0
- package/dist/coordination/commit-safety.d.ts +72 -0
- package/dist/coordination/commit-safety.d.ts.map +1 -0
- package/dist/coordination/consensus-protocol.d.ts +106 -0
- package/dist/coordination/consensus-protocol.d.ts.map +1 -0
- package/dist/coordination/coordinator/error-classifier.d.ts +15 -0
- package/dist/coordination/coordinator/error-classifier.d.ts.map +1 -0
- package/dist/coordination/delegate-tool.d.ts +101 -0
- package/dist/coordination/delegate-tool.d.ts.map +1 -0
- package/dist/coordination/dep-watcher-bridge.d.ts +47 -0
- package/dist/coordination/dep-watcher-bridge.d.ts.map +1 -0
- package/dist/coordination/dep-watcher.d.ts +74 -0
- package/dist/coordination/dep-watcher.d.ts.map +1 -0
- package/dist/coordination/director/director-errors.d.ts +29 -0
- package/dist/coordination/director/director-errors.d.ts.map +1 -0
- package/dist/coordination/director-construction.d.ts +90 -0
- package/dist/coordination/director-construction.d.ts.map +1 -0
- package/dist/coordination/director-prompts.d.ts +119 -0
- package/dist/coordination/director-prompts.d.ts.map +1 -0
- package/dist/coordination/director-session.d.ts +68 -0
- package/dist/coordination/director-session.d.ts.map +1 -0
- package/dist/coordination/director-tools.d.ts +65 -0
- package/dist/coordination/director-tools.d.ts.map +1 -0
- package/dist/coordination/director.d.ts +802 -0
- package/dist/coordination/director.d.ts.map +1 -0
- package/dist/coordination/dispatcher.d.ts +82 -0
- package/dist/coordination/dispatcher.d.ts.map +1 -0
- package/dist/coordination/file-author-tracker.d.ts +76 -0
- package/dist/coordination/file-author-tracker.d.ts.map +1 -0
- package/dist/coordination/fleet-bus.d.ts +122 -0
- package/dist/coordination/fleet-bus.d.ts.map +1 -0
- package/dist/coordination/fleet-event-validation.d.ts +10 -0
- package/dist/coordination/fleet-event-validation.d.ts.map +1 -0
- package/dist/coordination/fleet-manager.d.ts +234 -0
- package/dist/coordination/fleet-manager.d.ts.map +1 -0
- package/dist/coordination/fleet-spawn.d.ts +102 -0
- package/dist/coordination/fleet-spawn.d.ts.map +1 -0
- package/dist/coordination/fleet-status-tool.d.ts +36 -0
- package/dist/coordination/fleet-status-tool.d.ts.map +1 -0
- package/dist/coordination/fleet-supervisor.d.ts +157 -0
- package/dist/coordination/fleet-supervisor.d.ts.map +1 -0
- package/dist/coordination/fleet.d.ts +96 -0
- package/dist/coordination/fleet.d.ts.map +1 -0
- package/dist/coordination/global-mailbox.d.ts +234 -0
- package/dist/coordination/global-mailbox.d.ts.map +1 -0
- package/dist/coordination/icoordinator.d.ts +97 -0
- package/dist/coordination/icoordinator.d.ts.map +1 -0
- package/dist/coordination/ifleet-manager.d.ts +177 -0
- package/dist/coordination/ifleet-manager.d.ts.map +1 -0
- package/dist/coordination/in-memory-transport.d.ts +12 -0
- package/dist/coordination/in-memory-transport.d.ts.map +1 -0
- package/dist/coordination/index.d.ts +78 -2587
- package/dist/coordination/index.d.ts.map +1 -0
- package/dist/coordination/index.js +739 -254
- package/dist/coordination/index.js.map +7 -1
- package/dist/coordination/knowledge-graph.d.ts +217 -0
- package/dist/coordination/knowledge-graph.d.ts.map +1 -0
- package/dist/coordination/large-answer-store.d.ts +61 -0
- package/dist/coordination/large-answer-store.d.ts.map +1 -0
- package/dist/coordination/mail-tools.d.ts +34 -0
- package/dist/coordination/mail-tools.d.ts.map +1 -0
- package/dist/coordination/mailbox-actions.d.ts +68 -0
- package/dist/coordination/mailbox-actions.d.ts.map +1 -0
- package/dist/coordination/mailbox-health.d.ts +131 -0
- package/dist/coordination/mailbox-health.d.ts.map +1 -0
- package/dist/coordination/mailbox-hooks.d.ts +55 -0
- package/dist/coordination/mailbox-hooks.d.ts.map +1 -0
- package/dist/coordination/mailbox-tool.d.ts +75 -0
- package/dist/coordination/mailbox-tool.d.ts.map +1 -0
- package/dist/{mailbox-types-BGZWrYTJ.d.ts → coordination/mailbox-types.d.ts} +37 -22
- package/dist/coordination/mailbox-types.d.ts.map +1 -0
- package/dist/coordination/mailbox.d.ts +69 -0
- package/dist/coordination/mailbox.d.ts.map +1 -0
- package/dist/coordination/model-matrix.d.ts +98 -0
- package/dist/coordination/model-matrix.d.ts.map +1 -0
- package/dist/coordination/multi-agent-coordinator.d.ts +202 -0
- package/dist/coordination/multi-agent-coordinator.d.ts.map +1 -0
- package/dist/coordination/null-fleet-bus.d.ts +10 -0
- package/dist/coordination/null-fleet-bus.d.ts.map +1 -0
- package/dist/coordination/package-author-tracker.d.ts +87 -0
- package/dist/coordination/package-author-tracker.d.ts.map +1 -0
- package/dist/coordination/package-outdated-watcher.d.ts +83 -0
- package/dist/coordination/package-outdated-watcher.d.ts.map +1 -0
- package/dist/coordination/single-instance-mailbox.d.ts +154 -0
- package/dist/coordination/single-instance-mailbox.d.ts.map +1 -0
- package/dist/coordination/spawn-budget.d.ts +6 -0
- package/dist/coordination/spawn-budget.d.ts.map +1 -0
- package/dist/coordination/subagent-budget.d.ts +323 -0
- package/dist/coordination/subagent-budget.d.ts.map +1 -0
- package/dist/coordination/subagent-nicknames.d.ts +42 -0
- package/dist/coordination/subagent-nicknames.d.ts.map +1 -0
- package/dist/coordination/subagent-result-tool.d.ts +20 -0
- package/dist/coordination/subagent-result-tool.d.ts.map +1 -0
- package/dist/coordination/task-auctioneer.d.ts +143 -0
- package/dist/coordination/task-auctioneer.d.ts.map +1 -0
- package/dist/coordination/task-dag.d.ts +147 -0
- package/dist/coordination/task-dag.d.ts.map +1 -0
- package/dist/coordination/techstack-mailbox-consumer.d.ts +50 -0
- package/dist/coordination/techstack-mailbox-consumer.d.ts.map +1 -0
- package/dist/coordination/transport.d.ts +2 -0
- package/dist/coordination/transport.d.ts.map +1 -0
- package/dist/coordination/worktree-task-runner.d.ts +45 -0
- package/dist/coordination/worktree-task-runner.d.ts.map +1 -0
- package/dist/core/agent-internals.d.ts +41 -0
- package/dist/core/agent-internals.d.ts.map +1 -0
- package/dist/core/agent-loop.d.ts +18 -0
- package/dist/core/agent-loop.d.ts.map +1 -0
- package/dist/core/agent-response.d.ts +21 -0
- package/dist/core/agent-response.d.ts.map +1 -0
- package/dist/core/agent-tools.d.ts +21 -0
- package/dist/core/agent-tools.d.ts.map +1 -0
- package/dist/core/agent-types.d.ts +95 -0
- package/dist/core/agent-types.d.ts.map +1 -0
- package/dist/core/agent.d.ts +54 -0
- package/dist/core/agent.d.ts.map +1 -0
- package/dist/core/btw.d.ts +40 -0
- package/dist/core/btw.d.ts.map +1 -0
- package/dist/core/context.d.ts +269 -0
- package/dist/core/context.d.ts.map +1 -0
- package/dist/core/continue-intent.d.ts +92 -0
- package/dist/core/continue-intent.d.ts.map +1 -0
- package/dist/core/continue-to-next-iteration.d.ts +96 -0
- package/dist/core/continue-to-next-iteration.d.ts.map +1 -0
- package/dist/core/conversation-state.d.ts +96 -0
- package/dist/core/conversation-state.d.ts.map +1 -0
- package/dist/core/fallback-model.d.ts +94 -0
- package/dist/core/fallback-model.d.ts.map +1 -0
- package/dist/core/fleet-pulse.d.ts +42 -0
- package/dist/core/fleet-pulse.d.ts.map +1 -0
- package/dist/core/input-builder.d.ts +95 -0
- package/dist/core/input-builder.d.ts.map +1 -0
- package/dist/core/instruction-bundle.d.ts +22 -0
- package/dist/core/instruction-bundle.d.ts.map +1 -0
- package/dist/core/iteration-limit.d.ts +35 -0
- package/dist/core/iteration-limit.d.ts.map +1 -0
- package/dist/core/mailbox-loop.d.ts +63 -0
- package/dist/core/mailbox-loop.d.ts.map +1 -0
- package/dist/core/modes/brief.d.ts +2 -0
- package/dist/core/modes/brief.d.ts.map +1 -0
- package/dist/core/modes/default.d.ts +8 -0
- package/dist/core/modes/default.d.ts.map +1 -0
- package/dist/core/modes/teach.d.ts +2 -0
- package/dist/core/modes/teach.d.ts.map +1 -0
- package/dist/core/provider-runner.d.ts +24 -0
- package/dist/core/provider-runner.d.ts.map +1 -0
- package/dist/core/queued-messages.d.ts +55 -0
- package/dist/core/queued-messages.d.ts.map +1 -0
- package/dist/core/run-env.d.ts +49 -0
- package/dist/core/run-env.d.ts.map +1 -0
- package/dist/core/streaming-response-builder.d.ts +78 -0
- package/dist/core/streaming-response-builder.d.ts.map +1 -0
- package/dist/core/system-prompt-builder.d.ts +213 -0
- package/dist/core/system-prompt-builder.d.ts.map +1 -0
- package/dist/defaults/index.d.ts +68 -158
- package/dist/defaults/index.d.ts.map +1 -0
- package/dist/defaults/index.js +1257 -819
- package/dist/defaults/index.js.map +7 -1
- package/dist/execution/auto-compaction-middleware.d.ts +123 -0
- package/dist/execution/auto-compaction-middleware.d.ts.map +1 -0
- package/dist/execution/autonomous-runner.d.ts +55 -0
- package/dist/execution/autonomous-runner.d.ts.map +1 -0
- package/dist/execution/autonomy-brain.d.ts +90 -0
- package/dist/execution/autonomy-brain.d.ts.map +1 -0
- package/dist/execution/autonomy-prompt-contributor.d.ts +39 -0
- package/dist/execution/autonomy-prompt-contributor.d.ts.map +1 -0
- package/dist/execution/compaction-core.d.ts +103 -0
- package/dist/execution/compaction-core.d.ts.map +1 -0
- package/dist/execution/compactor.d.ts +56 -0
- package/dist/execution/compactor.d.ts.map +1 -0
- package/dist/execution/design-color.d.ts +31 -0
- package/dist/execution/design-color.d.ts.map +1 -0
- package/dist/execution/design-detect.d.ts +96 -0
- package/dist/execution/design-detect.d.ts.map +1 -0
- package/dist/execution/design-kit-loader.d.ts +53 -0
- package/dist/execution/design-kit-loader.d.ts.map +1 -0
- package/dist/execution/design-materialize.d.ts +32 -0
- package/dist/execution/design-materialize.d.ts.map +1 -0
- package/dist/execution/design-project-store.d.ts +57 -0
- package/dist/execution/design-project-store.d.ts.map +1 -0
- package/dist/execution/design-verify.d.ts +44 -0
- package/dist/execution/design-verify.d.ts.map +1 -0
- package/dist/execution/error-handler.d.ts +34 -0
- package/dist/execution/error-handler.d.ts.map +1 -0
- package/dist/{parallel-eternal-engine-HUrtePLd.d.ts → execution/eternal-autonomy.d.ts} +10 -225
- package/dist/execution/eternal-autonomy.d.ts.map +1 -0
- package/dist/execution/goal-preamble.d.ts +2 -0
- package/dist/execution/goal-preamble.d.ts.map +1 -0
- package/dist/execution/index.d.ts +21 -180
- package/dist/execution/index.d.ts.map +1 -0
- package/dist/execution/index.js +465 -180
- package/dist/execution/index.js.map +7 -1
- package/dist/execution/intelligent-compactor.d.ts +85 -0
- package/dist/execution/intelligent-compactor.d.ts.map +1 -0
- package/dist/execution/model-runtime.d.ts +75 -0
- package/dist/execution/model-runtime.d.ts.map +1 -0
- package/dist/execution/parallel-eternal-engine.d.ts +130 -0
- package/dist/execution/parallel-eternal-engine.d.ts.map +1 -0
- package/dist/execution/prompt-enhancer.d.ts +12 -13
- package/dist/execution/prompt-enhancer.d.ts.map +1 -0
- package/dist/execution/prompt-enhancer.js +13 -7
- package/dist/execution/prompt-enhancer.js.map +7 -1
- package/dist/execution/prompt-loader.d.ts +52 -0
- package/dist/execution/prompt-loader.d.ts.map +1 -0
- package/dist/execution/provider-runner-impl.d.ts +14 -0
- package/dist/execution/provider-runner-impl.d.ts.map +1 -0
- package/dist/execution/regex-patterns.d.ts +7 -0
- package/dist/execution/regex-patterns.d.ts.map +1 -0
- package/dist/execution/retry-policy.d.ts +35 -0
- package/dist/execution/retry-policy.d.ts.map +1 -0
- package/dist/execution/selective-compactor.d.ts +94 -0
- package/dist/execution/selective-compactor.d.ts.map +1 -0
- package/dist/execution/skill-loader.d.ts +43 -0
- package/dist/execution/skill-loader.d.ts.map +1 -0
- package/dist/execution/strategy-compactor.d.ts +43 -0
- package/dist/execution/strategy-compactor.d.ts.map +1 -0
- package/dist/execution/tool-executor.d.ts +112 -0
- package/dist/execution/tool-executor.d.ts.map +1 -0
- package/dist/extension/extension-points.d.ts +121 -0
- package/dist/extension/extension-points.d.ts.map +1 -0
- package/dist/extension/index.d.ts +3 -10
- package/dist/extension/index.d.ts.map +1 -0
- package/dist/extension/index.js +59 -5
- package/dist/extension/index.js.map +7 -1
- package/dist/extension/registry.d.ts +86 -0
- package/dist/extension/registry.d.ts.map +1 -0
- package/dist/fleet-notifier.d.ts +28 -0
- package/dist/fleet-notifier.d.ts.map +1 -0
- package/dist/hooks/http-executor.d.ts +11 -0
- package/dist/hooks/http-executor.d.ts.map +1 -0
- package/dist/hooks/index.d.ts +10 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/registry.d.ts +71 -0
- package/dist/hooks/registry.d.ts.map +1 -0
- package/dist/hooks/runner.d.ts +65 -0
- package/dist/hooks/runner.d.ts.map +1 -0
- package/dist/hooks/shell-executor.d.ts +33 -0
- package/dist/hooks/shell-executor.d.ts.map +1 -0
- package/dist/hooks/shell-hooks-equal.d.ts +15 -0
- package/dist/hooks/shell-hooks-equal.d.ts.map +1 -0
- package/dist/hq/agent-bridge.d.ts +27 -0
- package/dist/hq/agent-bridge.d.ts.map +1 -0
- package/dist/hq/alerts.d.ts +67 -0
- package/dist/hq/alerts.d.ts.map +1 -0
- package/dist/hq/auth-store.d.ts +161 -0
- package/dist/hq/auth-store.d.ts.map +1 -0
- package/dist/hq/brain-bridge.d.ts +37 -0
- package/dist/hq/brain-bridge.d.ts.map +1 -0
- package/dist/hq/commands.d.ts +122 -0
- package/dist/hq/commands.d.ts.map +1 -0
- package/dist/hq/cost-bridge.d.ts +36 -0
- package/dist/hq/cost-bridge.d.ts.map +1 -0
- package/dist/hq/factory.d.ts +66 -0
- package/dist/hq/factory.d.ts.map +1 -0
- package/dist/hq/fleet-bridge.d.ts +39 -0
- package/dist/hq/fleet-bridge.d.ts.map +1 -0
- package/dist/hq/index.d.ts +18 -816
- package/dist/hq/index.d.ts.map +1 -0
- package/dist/hq/index.js +417 -122
- package/dist/hq/index.js.map +7 -1
- package/dist/hq/mailbox-mapper.d.ts +27 -0
- package/dist/hq/mailbox-mapper.d.ts.map +1 -0
- package/dist/hq/persistence.d.ts +121 -0
- package/dist/hq/persistence.d.ts.map +1 -0
- package/dist/hq/protocol.d.ts +560 -0
- package/dist/hq/protocol.d.ts.map +1 -0
- package/dist/hq/publisher.d.ts +177 -0
- package/dist/hq/publisher.d.ts.map +1 -0
- package/dist/hq/redaction.d.ts +30 -0
- package/dist/hq/redaction.d.ts.map +1 -0
- package/dist/hq/session-bridge.d.ts +29 -0
- package/dist/hq/session-bridge.d.ts.map +1 -0
- package/dist/hq/tool-bridge.d.ts +41 -0
- package/dist/hq/tool-bridge.d.ts.map +1 -0
- package/dist/hq/transcript-mapper.d.ts +36 -0
- package/dist/hq/transcript-mapper.d.ts.map +1 -0
- package/dist/hq/worktree-bridge.d.ts +34 -0
- package/dist/hq/worktree-bridge.d.ts.map +1 -0
- package/dist/index.d.ts +108 -2872
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2724 -1344
- package/dist/index.js.map +7 -1
- package/dist/infrastructure/context-manager.d.ts +92 -0
- package/dist/infrastructure/context-manager.d.ts.map +1 -0
- package/dist/infrastructure/index.d.ts +6 -64
- package/dist/infrastructure/index.d.ts.map +1 -0
- package/dist/infrastructure/index.js +39 -12
- package/dist/infrastructure/index.js.map +7 -1
- package/dist/infrastructure/logger.d.ts +99 -0
- package/dist/infrastructure/logger.d.ts.map +1 -0
- package/dist/infrastructure/mcp-servers.d.ts +83 -0
- package/dist/infrastructure/mcp-servers.d.ts.map +1 -0
- package/dist/{path-resolver-CMS5307d.d.ts → infrastructure/path-resolver.d.ts} +3 -5
- package/dist/infrastructure/path-resolver.d.ts.map +1 -0
- package/dist/infrastructure/token-counter.d.ts +57 -0
- package/dist/infrastructure/token-counter.d.ts.map +1 -0
- package/dist/kernel/container.d.ts +84 -0
- package/dist/kernel/container.d.ts.map +1 -0
- package/dist/{events-Bgnh43r9.d.ts → kernel/events.d.ts} +112 -206
- package/dist/kernel/events.d.ts.map +1 -0
- package/dist/kernel/index.d.ts +6 -107
- package/dist/kernel/index.d.ts.map +1 -0
- package/dist/kernel/index.js +56 -4
- package/dist/kernel/index.js.map +7 -1
- package/dist/kernel/pipeline.d.ts +105 -0
- package/dist/kernel/pipeline.d.ts.map +1 -0
- package/dist/kernel/run-controller.d.ts +55 -0
- package/dist/kernel/run-controller.d.ts.map +1 -0
- package/dist/kernel/tokens.d.ts +53 -0
- package/dist/kernel/tokens.d.ts.map +1 -0
- package/dist/mailbox-attach.d.ts +27 -0
- package/dist/mailbox-attach.d.ts.map +1 -0
- package/dist/middleware/collab-pause.d.ts +73 -0
- package/dist/middleware/collab-pause.d.ts.map +1 -0
- package/dist/models/codex-catalog.d.ts +41 -0
- package/dist/models/codex-catalog.d.ts.map +1 -0
- package/dist/models/index.d.ts +8 -163
- package/dist/models/index.d.ts.map +1 -0
- package/dist/models/index.js +150 -51
- package/dist/models/index.js.map +7 -1
- package/dist/models/llm-selector.d.ts +47 -0
- package/dist/models/llm-selector.d.ts.map +1 -0
- package/dist/models/mode-store.d.ts +22 -0
- package/dist/models/mode-store.d.ts.map +1 -0
- package/dist/models/model-intelligence.d.ts +56 -0
- package/dist/models/model-intelligence.d.ts.map +1 -0
- package/dist/models/model-router.d.ts +100 -0
- package/dist/models/model-router.d.ts.map +1 -0
- package/dist/models/models-registry.d.ts +106 -0
- package/dist/models/models-registry.d.ts.map +1 -0
- package/dist/models/provider-model-resolve.d.ts +69 -0
- package/dist/models/provider-model-resolve.d.ts.map +1 -0
- package/dist/observability/event-bridge.d.ts +10 -0
- package/dist/observability/event-bridge.d.ts.map +1 -0
- package/dist/observability/health.d.ts +18 -0
- package/dist/observability/health.d.ts.map +1 -0
- package/dist/observability/index.d.ts +9 -354
- package/dist/observability/index.d.ts.map +1 -0
- package/dist/observability/index.js +21 -8
- package/dist/observability/index.js.map +7 -1
- package/dist/observability/metrics.d.ts +26 -0
- package/dist/observability/metrics.d.ts.map +1 -0
- package/dist/observability/otel-tracer.d.ts +41 -0
- package/dist/observability/otel-tracer.d.ts.map +1 -0
- package/dist/observability/otlp-metrics.d.ts +111 -0
- package/dist/observability/otlp-metrics.d.ts.map +1 -0
- package/dist/observability/otlp-traces.d.ts +95 -0
- package/dist/observability/otlp-traces.d.ts.map +1 -0
- package/dist/observability/prometheus.d.ts +49 -0
- package/dist/observability/prometheus.d.ts.map +1 -0
- package/dist/observability/tracer.d.ts +9 -0
- package/dist/observability/tracer.d.ts.map +1 -0
- package/dist/plugin/api.d.ts +226 -0
- package/dist/plugin/api.d.ts.map +1 -0
- package/dist/plugin/loader.d.ts +73 -0
- package/dist/plugin/loader.d.ts.map +1 -0
- package/dist/plugins/chimera-plugin.d.ts +37 -0
- package/dist/plugins/chimera-plugin.d.ts.map +1 -0
- package/dist/plugins/git-plugin.d.ts +15 -0
- package/dist/plugins/git-plugin.d.ts.map +1 -0
- package/dist/plugins/observability-plugin.d.ts +19 -0
- package/dist/plugins/observability-plugin.d.ts.map +1 -0
- package/dist/plugins/plan-plugin.d.ts +16 -0
- package/dist/plugins/plan-plugin.d.ts.map +1 -0
- package/dist/plugins/prompts-plugin.d.ts +26 -0
- package/dist/plugins/prompts-plugin.d.ts.map +1 -0
- package/dist/plugins/security-plugin.d.ts +19 -0
- package/dist/plugins/security-plugin.d.ts.map +1 -0
- package/dist/plugins/skills-plugin.d.ts +42 -0
- package/dist/plugins/skills-plugin.d.ts.map +1 -0
- package/dist/plugins/sync-plugin.d.ts +22 -0
- package/dist/plugins/sync-plugin.d.ts.map +1 -0
- package/dist/prompts/index.d.ts +3 -0
- package/dist/prompts/index.d.ts.map +1 -0
- package/dist/prompts/prompt-installer.d.ts +50 -0
- package/dist/prompts/prompt-installer.d.ts.map +1 -0
- package/dist/prompts/prompt-manifest-store.d.ts +18 -0
- package/dist/prompts/prompt-manifest-store.d.ts.map +1 -0
- package/dist/registry/provider-registry.d.ts +51 -0
- package/dist/registry/provider-registry.d.ts.map +1 -0
- package/dist/registry/slash-command-registry.d.ts +61 -0
- package/dist/registry/slash-command-registry.d.ts.map +1 -0
- package/dist/registry/tool-registry.d.ts +154 -0
- package/dist/registry/tool-registry.d.ts.map +1 -0
- package/dist/replay/hash.d.ts +31 -0
- package/dist/replay/hash.d.ts.map +1 -0
- package/dist/replay/replay-provider-runner.d.ts +53 -0
- package/dist/replay/replay-provider-runner.d.ts.map +1 -0
- package/dist/{index-CbyuOE5y.d.ts → security/capabilities.d.ts} +31 -34
- package/dist/security/capabilities.d.ts.map +1 -0
- package/dist/security/config-secrets.d.ts +25 -0
- package/dist/security/config-secrets.d.ts.map +1 -0
- package/dist/security/index.d.ts +6 -8
- package/dist/security/index.d.ts.map +1 -0
- package/dist/security/index.js +102 -381
- package/dist/security/index.js.map +7 -1
- package/dist/security/permission-policy.d.ts +153 -0
- package/dist/security/permission-policy.d.ts.map +1 -0
- package/dist/security/secret-scrubber.d.ts +14 -0
- package/dist/security/secret-scrubber.d.ts.map +1 -0
- package/dist/security/secret-vault.d.ts +87 -0
- package/dist/security/secret-vault.d.ts.map +1 -0
- package/dist/security/yolo-risk.d.ts +11 -0
- package/dist/security/yolo-risk.d.ts.map +1 -0
- package/dist/{session-registry-Dvg7i_IA.d.ts → session-registry.d.ts} +8 -9
- package/dist/session-registry.d.ts.map +1 -0
- package/dist/skills/foreign-sources.d.ts +59 -0
- package/dist/skills/foreign-sources.d.ts.map +1 -0
- package/dist/skills/frontmatter.d.ts +44 -0
- package/dist/skills/frontmatter.d.ts.map +1 -0
- package/dist/skills/github-fetcher.d.ts +38 -0
- package/dist/skills/github-fetcher.d.ts.map +1 -0
- package/dist/skills/index.d.ts +11 -582
- package/dist/skills/index.d.ts.map +1 -0
- package/dist/skills/index.js +81 -43
- package/dist/skills/index.js.map +7 -1
- package/dist/skills/limits.d.ts +92 -0
- package/dist/skills/limits.d.ts.map +1 -0
- package/dist/skills/manifest-store.d.ts +42 -0
- package/dist/skills/manifest-store.d.ts.map +1 -0
- package/dist/skills/registry/github-direct-adapter.d.ts +17 -0
- package/dist/skills/registry/github-direct-adapter.d.ts.map +1 -0
- package/dist/skills/registry/registry-adapter.d.ts +84 -0
- package/dist/skills/registry/registry-adapter.d.ts.map +1 -0
- package/dist/skills/registry/skills-sh-adapter.d.ts +13 -0
- package/dist/skills/registry/skills-sh-adapter.d.ts.map +1 -0
- package/dist/skills/skill-generator.d.ts +82 -0
- package/dist/skills/skill-generator.d.ts.map +1 -0
- package/dist/skills/skill-installer.d.ts +124 -0
- package/dist/skills/skill-installer.d.ts.map +1 -0
- package/dist/storage/annotations-store.d.ts +118 -0
- package/dist/storage/annotations-store.d.ts.map +1 -0
- package/dist/storage/attachment-store.d.ts +31 -0
- package/dist/storage/attachment-store.d.ts.map +1 -0
- package/dist/storage/cloud-sync.d.ts +44 -0
- package/dist/storage/cloud-sync.d.ts.map +1 -0
- package/dist/storage/completed-work-checkpoint.d.ts +11 -0
- package/dist/storage/completed-work-checkpoint.d.ts.map +1 -0
- package/dist/storage/config-loader.d.ts +104 -0
- package/dist/storage/config-loader.d.ts.map +1 -0
- package/dist/storage/config-migration.d.ts +87 -0
- package/dist/storage/config-migration.d.ts.map +1 -0
- package/dist/storage/config-store.d.ts +22 -0
- package/dist/storage/config-store.d.ts.map +1 -0
- package/dist/{director-state-CMS_bMs4.d.ts → storage/director-state.d.ts} +28 -8
- package/dist/storage/director-state.d.ts.map +1 -0
- package/dist/storage/file-session-writer.d.ts +169 -0
- package/dist/storage/file-session-writer.d.ts.map +1 -0
- package/dist/{goal-store-Datpp-ar.d.ts → storage/goal-store.d.ts} +26 -19
- package/dist/storage/goal-store.d.ts.map +1 -0
- package/dist/storage/index.d.ts +39 -1031
- package/dist/storage/index.d.ts.map +1 -0
- package/dist/storage/index.js +655 -300
- package/dist/storage/index.js.map +7 -1
- package/dist/storage/input-history-store.d.ts +56 -0
- package/dist/storage/input-history-store.d.ts.map +1 -0
- package/dist/storage/memory-backend.d.ts +66 -0
- package/dist/storage/memory-backend.d.ts.map +1 -0
- package/dist/storage/memory-consolidator.d.ts +50 -0
- package/dist/storage/memory-consolidator.d.ts.map +1 -0
- package/dist/storage/memory-graph-backend.d.ts +117 -0
- package/dist/storage/memory-graph-backend.d.ts.map +1 -0
- package/dist/storage/memory-store.d.ts +119 -0
- package/dist/storage/memory-store.d.ts.map +1 -0
- package/dist/storage/plan-store.d.ts +78 -0
- package/dist/storage/plan-store.d.ts.map +1 -0
- package/dist/storage/plan-templates.d.ts +21 -0
- package/dist/storage/plan-templates.d.ts.map +1 -0
- package/dist/storage/prompt-store.d.ts +37 -0
- package/dist/storage/prompt-store.d.ts.map +1 -0
- package/dist/storage/prompt-usage-store.d.ts +29 -0
- package/dist/storage/prompt-usage-store.d.ts.map +1 -0
- package/dist/storage/provider-config-watcher.d.ts +34 -0
- package/dist/storage/provider-config-watcher.d.ts.map +1 -0
- package/dist/storage/queue-store.d.ts +37 -0
- package/dist/storage/queue-store.d.ts.map +1 -0
- package/dist/storage/recovery-lock.d.ts +79 -0
- package/dist/storage/recovery-lock.d.ts.map +1 -0
- package/dist/storage/replay-log-store.d.ts +97 -0
- package/dist/storage/replay-log-store.d.ts.map +1 -0
- package/dist/storage/session-analyzer.d.ts +48 -0
- package/dist/storage/session-analyzer.d.ts.map +1 -0
- package/dist/storage/session-checkpoint-cas.d.ts +37 -0
- package/dist/storage/session-checkpoint-cas.d.ts.map +1 -0
- package/dist/{session-event-bridge-D_z_mBwk.d.ts → storage/session-event-bridge.d.ts} +14 -15
- package/dist/storage/session-event-bridge.d.ts.map +1 -0
- package/dist/storage/session-helpers.d.ts +9 -0
- package/dist/storage/session-helpers.d.ts.map +1 -0
- package/dist/storage/session-id.d.ts +18 -0
- package/dist/storage/session-id.d.ts.map +1 -0
- package/dist/storage/session-reader.d.ts +21 -0
- package/dist/storage/session-reader.d.ts.map +1 -0
- package/dist/storage/session-recovery.d.ts +93 -0
- package/dist/storage/session-recovery.d.ts.map +1 -0
- package/dist/storage/session-resume-validation.d.ts +6 -0
- package/dist/storage/session-resume-validation.d.ts.map +1 -0
- package/dist/storage/session-rewinder.d.ts +21 -0
- package/dist/storage/session-rewinder.d.ts.map +1 -0
- package/dist/storage/session-store.d.ts +210 -0
- package/dist/storage/session-store.d.ts.map +1 -0
- package/dist/storage/session-summary.d.ts +12 -0
- package/dist/storage/session-summary.d.ts.map +1 -0
- package/dist/storage/session-tool-call-ends.d.ts +5 -0
- package/dist/storage/session-tool-call-ends.d.ts.map +1 -0
- package/dist/storage/storage-concurrency.d.ts +2 -0
- package/dist/storage/storage-concurrency.d.ts.map +1 -0
- package/dist/storage/task-store.d.ts +33 -0
- package/dist/storage/task-store.d.ts.map +1 -0
- package/dist/storage/todos-checkpoint.d.ts +39 -0
- package/dist/storage/todos-checkpoint.d.ts.map +1 -0
- package/dist/storage/tool-audit-log.d.ts +141 -0
- package/dist/storage/tool-audit-log.d.ts.map +1 -0
- package/dist/tasking/index.d.ts +3 -124
- package/dist/tasking/index.d.ts.map +1 -0
- package/dist/tasking/index.js +57 -4
- package/dist/tasking/index.js.map +7 -1
- package/dist/tasking/task-store.d.ts +22 -0
- package/dist/tasking/task-store.d.ts.map +1 -0
- package/dist/tasking/task-tracker.d.ts +102 -0
- package/dist/tasking/task-tracker.d.ts.map +1 -0
- package/dist/tools/index.d.ts +2 -59
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +93 -14
- package/dist/tools/index.js.map +7 -1
- package/dist/tools/mcp-control.d.ts +53 -0
- package/dist/tools/mcp-control.d.ts.map +1 -0
- package/dist/tools/mcp-use.d.ts +24 -0
- package/dist/tools/mcp-use.d.ts.map +1 -0
- package/dist/types/agent-bridge.d.ts +42 -0
- package/dist/types/agent-bridge.d.ts.map +1 -0
- package/dist/types/attachment.d.ts +54 -0
- package/dist/types/attachment.d.ts.map +1 -0
- package/dist/types/autonomy.d.ts +5 -0
- package/dist/types/autonomy.d.ts.map +1 -0
- package/dist/types/blocks.d.ts +76 -0
- package/dist/types/blocks.d.ts.map +1 -0
- package/dist/{compactor-DQLL4HTo.d.ts → types/compactor.d.ts} +5 -7
- package/dist/types/compactor.d.ts.map +1 -0
- package/dist/{config-MRqn1V-u.d.ts → types/config.d.ts} +135 -354
- package/dist/types/config.d.ts.map +1 -0
- package/dist/types/context-evidence.d.ts +68 -0
- package/dist/types/context-evidence.d.ts.map +1 -0
- package/dist/types/context-window.d.ts +35 -0
- package/dist/types/context-window.d.ts.map +1 -0
- package/dist/{default-config-B79_gJYv.d.ts → types/default-config.d.ts} +10 -11
- package/dist/types/default-config.d.ts.map +1 -0
- package/dist/types/design-kit.d.ts +91 -0
- package/dist/types/design-kit.d.ts.map +1 -0
- package/dist/{retry-policy-CQ7KwXJa.d.ts → types/error-handler.d.ts} +5 -12
- package/dist/types/error-handler.d.ts.map +1 -0
- package/dist/types/errors.d.ts +277 -0
- package/dist/types/errors.d.ts.map +1 -0
- package/dist/types/hooks.d.ts +167 -0
- package/dist/types/hooks.d.ts.map +1 -0
- package/dist/types/index.d.ts +40 -244
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +90 -12
- package/dist/types/index.js.map +7 -1
- package/dist/{input-reader-E-ffP2ee.d.ts → types/input-reader.d.ts} +3 -4
- package/dist/types/input-reader.d.ts.map +1 -0
- package/dist/{logger-B63L5bTg.d.ts → types/logger.d.ts} +3 -4
- package/dist/types/logger.d.ts.map +1 -0
- package/dist/types/memory.d.ts +89 -0
- package/dist/types/memory.d.ts.map +1 -0
- package/dist/types/messages.d.ts +24 -0
- package/dist/types/messages.d.ts.map +1 -0
- package/dist/types/mode-prompts.d.ts +2 -0
- package/dist/types/mode-prompts.d.ts.map +1 -0
- package/dist/{mode-CZlO9iU1.d.ts → types/mode.d.ts} +6 -7
- package/dist/types/mode.d.ts.map +1 -0
- package/dist/types/models-registry.d.ts +105 -0
- package/dist/types/models-registry.d.ts.map +1 -0
- package/dist/types/multi-agent.d.ts +435 -0
- package/dist/types/multi-agent.d.ts.map +1 -0
- package/dist/{observability-D-HZN_mF.d.ts → types/observability.d.ts} +12 -13
- package/dist/types/observability.d.ts.map +1 -0
- package/dist/{path-resolver-CPRj4bFY.d.ts → types/path-resolver.d.ts} +2 -3
- package/dist/types/path-resolver.d.ts.map +1 -0
- package/dist/{permission-ByDKXEcG.d.ts → types/permission.d.ts} +8 -9
- package/dist/types/permission.d.ts.map +1 -0
- package/dist/types/plugin.d.ts +385 -0
- package/dist/types/plugin.d.ts.map +1 -0
- package/dist/types/prompt-registry.d.ts +81 -0
- package/dist/types/prompt-registry.d.ts.map +1 -0
- package/dist/{prompt-DLd35n4Q.d.ts → types/prompt.d.ts} +14 -15
- package/dist/types/prompt.d.ts.map +1 -0
- package/dist/{provider-runner-ChL-kVg6.d.ts → types/provider-runner.d.ts} +9 -10
- package/dist/types/provider-runner.d.ts.map +1 -0
- package/dist/types/provider.d.ts +387 -0
- package/dist/types/provider.d.ts.map +1 -0
- package/dist/types/renderer.d.ts +23 -0
- package/dist/types/renderer.d.ts.map +1 -0
- package/dist/types/retry-policy.d.ts +7 -0
- package/dist/types/retry-policy.d.ts.map +1 -0
- package/dist/types/secret-scrubber.d.ts +5 -0
- package/dist/types/secret-scrubber.d.ts.map +1 -0
- package/dist/{secret-vault-BAKpgFw_.d.ts → types/secret-vault.d.ts} +13 -7
- package/dist/types/secret-vault.d.ts.map +1 -0
- package/dist/{selector-D8O6B_Rm.d.ts → types/selector.d.ts} +4 -6
- package/dist/types/selector.d.ts.map +1 -0
- package/dist/types/session-reader.d.ts +81 -0
- package/dist/types/session-reader.d.ts.map +1 -0
- package/dist/{session-rewinder-C9HnMkhP.d.ts → types/session-rewinder.d.ts} +5 -6
- package/dist/types/session-rewinder.d.ts.map +1 -0
- package/dist/types/session.d.ts +650 -0
- package/dist/types/session.d.ts.map +1 -0
- package/dist/types/side-effect.d.ts +34 -0
- package/dist/types/side-effect.d.ts.map +1 -0
- package/dist/{skill-DHniprNl.d.ts → types/skill.d.ts} +4 -5
- package/dist/types/skill.d.ts.map +1 -0
- package/dist/types/slash-command.d.ts +59 -0
- package/dist/types/slash-command.d.ts.map +1 -0
- package/dist/types/spec.d.ts +77 -0
- package/dist/types/spec.d.ts.map +1 -0
- package/dist/types/system-prompt-contributor.d.ts +20 -0
- package/dist/types/system-prompt-contributor.d.ts.map +1 -0
- package/dist/types/system-prompt.d.ts +51 -0
- package/dist/types/system-prompt.d.ts.map +1 -0
- package/dist/{task-graph-CH3acNQ7.d.ts → types/task-graph.d.ts} +21 -22
- package/dist/types/task-graph.d.ts.map +1 -0
- package/dist/types/token-counter.d.ts +42 -0
- package/dist/types/token-counter.d.ts.map +1 -0
- package/dist/types/tool-executor.d.ts +133 -0
- package/dist/types/tool-executor.d.ts.map +1 -0
- package/dist/types/tool-markers.d.ts +23 -0
- package/dist/types/tool-markers.d.ts.map +1 -0
- package/dist/types/tool.d.ts +245 -0
- package/dist/types/tool.d.ts.map +1 -0
- package/dist/types/utility-types.d.ts +31 -0
- package/dist/types/utility-types.d.ts.map +1 -0
- package/dist/utils/assert-never.d.ts +14 -0
- package/dist/utils/assert-never.d.ts.map +1 -0
- package/dist/utils/atomic-write.d.ts +12 -0
- package/dist/utils/atomic-write.d.ts.map +1 -0
- package/dist/utils/child-env.d.ts +67 -0
- package/dist/utils/child-env.d.ts.map +1 -0
- package/dist/utils/color.d.ts +20 -0
- package/dist/utils/color.d.ts.map +1 -0
- package/dist/utils/config-json.d.ts +14 -0
- package/dist/utils/config-json.d.ts.map +1 -0
- package/dist/utils/context-evidence.d.ts +47 -0
- package/dist/utils/context-evidence.d.ts.map +1 -0
- package/dist/utils/deep-merge.d.ts +64 -0
- package/dist/utils/deep-merge.d.ts.map +1 -0
- package/dist/utils/diff.d.ts +11 -0
- package/dist/utils/diff.d.ts.map +1 -0
- package/dist/utils/error.d.ts +2 -3
- package/dist/utils/error.d.ts.map +1 -0
- package/dist/utils/error.js +3 -3
- package/dist/utils/error.js.map +7 -1
- package/dist/utils/expect-defined.d.ts +2 -3
- package/dist/utils/expect-defined.d.ts.map +1 -0
- package/dist/utils/expect-defined.js +3 -3
- package/dist/utils/expect-defined.js.map +7 -1
- package/dist/utils/glob-expand.d.ts +10 -0
- package/dist/utils/glob-expand.d.ts.map +1 -0
- package/dist/utils/glob-match.d.ts +4 -0
- package/dist/utils/glob-match.d.ts.map +1 -0
- package/dist/utils/index.d.ts +37 -920
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +242 -33
- package/dist/utils/index.js.map +7 -1
- package/dist/utils/instruction-file.d.ts +3 -0
- package/dist/utils/instruction-file.d.ts.map +1 -0
- package/dist/utils/ip-guard.d.ts +34 -0
- package/dist/utils/ip-guard.d.ts.map +1 -0
- package/dist/utils/json-repair.d.ts +23 -0
- package/dist/utils/json-repair.d.ts.map +1 -0
- package/dist/utils/json-schema-validate.d.ts +42 -0
- package/dist/utils/json-schema-validate.d.ts.map +1 -0
- package/dist/utils/lru-cache.d.ts +29 -0
- package/dist/utils/lru-cache.d.ts.map +1 -0
- package/dist/utils/merge-custom-models.d.ts +12 -0
- package/dist/utils/merge-custom-models.d.ts.map +1 -0
- package/dist/utils/merge-models-payload.d.ts +20 -0
- package/dist/utils/merge-models-payload.d.ts.map +1 -0
- package/dist/utils/message-invariants.d.ts +22 -0
- package/dist/utils/message-invariants.d.ts.map +1 -0
- package/dist/utils/newline-normalize.d.ts +5 -0
- package/dist/utils/newline-normalize.d.ts.map +1 -0
- package/dist/utils/regex-guard.d.ts +21 -0
- package/dist/utils/regex-guard.d.ts.map +1 -0
- package/dist/utils/safe-json.d.ts +31 -0
- package/dist/utils/safe-json.d.ts.map +1 -0
- package/dist/utils/session-scoped-path.d.ts +13 -0
- package/dist/utils/session-scoped-path.d.ts.map +1 -0
- package/dist/utils/sleep.d.ts +5 -0
- package/dist/utils/sleep.d.ts.map +1 -0
- package/dist/utils/slug.d.ts +13 -0
- package/dist/utils/slug.d.ts.map +1 -0
- package/dist/utils/string.d.ts +9 -0
- package/dist/utils/string.d.ts.map +1 -0
- package/dist/utils/task-format.d.ts +22 -0
- package/dist/utils/task-format.d.ts.map +1 -0
- package/dist/utils/term.d.ts +133 -0
- package/dist/utils/term.d.ts.map +1 -0
- package/dist/utils/todos-format.d.ts +30 -0
- package/dist/utils/todos-format.d.ts.map +1 -0
- package/dist/utils/token-estimate.d.ts +112 -0
- package/dist/utils/token-estimate.d.ts.map +1 -0
- package/dist/utils/tool-description-mode.d.ts +28 -0
- package/dist/utils/tool-description-mode.d.ts.map +1 -0
- package/dist/utils/tool-output-serializer.d.ts +40 -0
- package/dist/utils/tool-output-serializer.d.ts.map +1 -0
- package/dist/utils/tool-result-render-mode.d.ts +55 -0
- package/dist/utils/tool-result-render-mode.d.ts.map +1 -0
- package/dist/utils/tool-subject.d.ts +5 -0
- package/dist/utils/tool-subject.d.ts.map +1 -0
- package/dist/utils/tool-wire-compact.d.ts +28 -0
- package/dist/utils/tool-wire-compact.d.ts.map +1 -0
- package/dist/utils/ulid.d.ts +11 -0
- package/dist/utils/ulid.d.ts.map +1 -0
- package/dist/{wstack-paths-C3K40Qst.d.ts → utils/wstack-paths.d.ts} +7 -8
- package/dist/utils/wstack-paths.d.ts.map +1 -0
- package/dist/worktree/index.d.ts +2 -0
- package/dist/worktree/index.d.ts.map +1 -0
- package/dist/{worktree-manager-DzwxKE35.d.ts → worktree/worktree-manager.d.ts} +19 -13
- package/dist/worktree/worktree-manager.d.ts.map +1 -0
- package/instructions/autonomy/active-mission.md +2 -4
- package/instructions/sections/tool/delegation-full.md +1 -1
- package/package.json +4 -5
- package/skills/node-modern/SKILL.md +2 -2
- package/skills/plugin-author/SKILL.md +9 -16
- package/dist/dispatcher-types.d-BBeXBQgS.d.ts +0 -66
- package/dist/global-mailbox-sZwyI6CS.d.ts +0 -959
- package/dist/index--Gm41aBJ.d.ts +0 -671
- package/dist/mcp-servers-DEV4s6Ks.d.ts +0 -259
- package/dist/multi-agent-coordinator-4RCRZKjN.d.ts +0 -1770
- package/dist/null-fleet-bus-CFoNVQEK.d.ts +0 -2127
- package/dist/pipeline-DGDyIohT.d.ts +0 -331
- package/dist/provider-model-resolve-o2hHLs79.d.ts +0 -263
- package/dist/secret-scrubber-3MHDDAtm.d.ts +0 -6
- package/dist/secret-vault-DxohkUBc.d.ts +0 -272
- package/dist/session-reader-7Esxrkpw.d.ts +0 -155
- package/dist/task-format-GX0B1mMC.d.ts +0 -23
- package/dist/todos-checkpoint-FY7PjmMx.d.ts +0 -850
- package/dist/tool-BNlnIJvo.d.ts +0 -2190
- package/dist/tool-executor-CckSCM5E.d.ts +0 -906
package/dist/utils/index.d.ts
CHANGED
|
@@ -1,921 +1,38 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
1
|
+
export * from './assert-never.js';
|
|
2
|
+
export * from './atomic-write.js';
|
|
3
|
+
export * from './child-env.js';
|
|
4
|
+
export * from './color.js';
|
|
5
|
+
export * from './config-json.js';
|
|
6
|
+
export { buildContextEvidenceDigest, COMPLETED_WORK_LEDGER_MARKER, createContextEvidenceState, formatCompletedWorkLedger, markAssistantReferencedEvidence, type RecordCompletedWorkInput, type RecordToolOutputEvidenceInput, recordCompletedWorkEvidence, buildCompletedWorkLedgerBlock, recordToolOutputEvidence, recordUserIntentEvidence, repeatedReadPressure, syncCompletedWorkLedgerBlock, } from './context-evidence.js';
|
|
7
|
+
export { type DeepMergeOptions, deepMerge, FORBIDDEN_PROTO_KEYS, isPrimitiveArray, } from './deep-merge.js';
|
|
8
|
+
export * from './diff.js';
|
|
9
|
+
export type { HttpDispatcher, HttpsAgentAsDispatcher } from './dispatcher-types.js';
|
|
3
10
|
export { toErrorMessage } from './error.js';
|
|
4
|
-
export
|
|
5
|
-
|
|
6
|
-
export
|
|
7
|
-
export {
|
|
8
|
-
export {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
*
|
|
14
|
-
|
|
15
|
-
*
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
*
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
*
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
*
|
|
31
|
-
|
|
32
|
-
declare function computeMessageTokens(msg: Message): number;
|
|
33
|
-
/**
|
|
34
|
-
* Estimate tokens for an array of messages (text + tool I/O), using the shared
|
|
35
|
-
* 3.5 chars/token basis. This is the single canonical message-array estimator —
|
|
36
|
-
* compactors, the context_manager tool, and the `/context` display all route
|
|
37
|
-
* through it so the number a user sees matches the number compaction decides on.
|
|
38
|
-
*
|
|
39
|
-
* When a message carries a pre-computed `_estTokens` field (set by
|
|
40
|
-
* ConversationState on append/replace), it is used directly instead of
|
|
41
|
-
* re-walking the content blocks — turning the O(n·m) scan into an O(n)
|
|
42
|
-
* sum for fully-cached arrays.
|
|
43
|
-
*/
|
|
44
|
-
declare function estimateMessageTokens(messages: readonly Message[]): number;
|
|
45
|
-
/**
|
|
46
|
-
* Rough estimate of tokens in a tool definition (name + description + schema).
|
|
47
|
-
* Accounts for the JSON-serialized inputSchema which is sent to the API
|
|
48
|
-
* but NOT included in roughEstimate(content).
|
|
49
|
-
*/
|
|
50
|
-
declare function estimateToolDefTokens(tool: {
|
|
51
|
-
name: string;
|
|
52
|
-
description?: string | undefined;
|
|
53
|
-
inputSchema: unknown;
|
|
54
|
-
}): number;
|
|
55
|
-
/**
|
|
56
|
-
* Estimate the total API request token count: system prompt + tool definitions
|
|
57
|
-
* + conversation messages. Use this for context-window bar calculations
|
|
58
|
-
* instead of roughEstimate (which only counts messages).
|
|
59
|
-
*
|
|
60
|
-
* The overhead ratio (overhead / messages) varies by conversation length:
|
|
61
|
-
* - Short conversations (< 10 messages): ~30-50% overhead (large system+tools)
|
|
62
|
-
* - Medium (10-50 messages): ~15-30%
|
|
63
|
-
* - Long (> 50 messages): ~5-15%
|
|
64
|
-
*
|
|
65
|
-
* Returns { messages, systemPrompt, tools, total } for debugging display.
|
|
66
|
-
*/
|
|
67
|
-
interface RequestTokenBreakdown {
|
|
68
|
-
messages: number;
|
|
69
|
-
systemPrompt: number;
|
|
70
|
-
tools: number;
|
|
71
|
-
total: number;
|
|
72
|
-
}
|
|
73
|
-
declare function estimateRequestTokens(messages: unknown, systemPrompt: unknown, tools: {
|
|
74
|
-
name: string;
|
|
75
|
-
description?: string | undefined;
|
|
76
|
-
inputSchema: unknown;
|
|
77
|
-
}[], calibrationKey?: string): RequestTokenBreakdown;
|
|
78
|
-
/**
|
|
79
|
-
* Record the actual API input token count after a provider call so
|
|
80
|
-
* `estimateRequestTokensCalibrated` can self-correct on subsequent calls.
|
|
81
|
-
*
|
|
82
|
-
* Prefer passing `estimatedInputTokens` explicitly (the calibrated pre-flight
|
|
83
|
-
* estimate from the middleware) — this avoids race conditions when other code
|
|
84
|
-
* also calls `estimateRequestTokens` between the pre-flight and this call
|
|
85
|
-
* (e.g. audit logging in agent.ts).
|
|
86
|
-
*
|
|
87
|
-
* When `estimatedInputTokens` is omitted, falls back to the keyed bucket's
|
|
88
|
-
* `prevEst` for backward compatibility with callers that don't have the
|
|
89
|
-
* pre-flight value. `calibrationKey` selects the per-(provider,model) bucket
|
|
90
|
-
* (defaults to the shared global bucket).
|
|
91
|
-
*/
|
|
92
|
-
declare function recordActualUsage(actualInputTokens: number, estimatedInputTokens?: number, calibrationKey?: string): void;
|
|
93
|
-
/**
|
|
94
|
-
* Returns the current calibration state for a bucket. Exposed for debugging
|
|
95
|
-
* and tests — not needed by normal callers.
|
|
96
|
-
*/
|
|
97
|
-
declare function getCalibrationState(calibrationKey?: string): {
|
|
98
|
-
ratio: number;
|
|
99
|
-
count: number;
|
|
100
|
-
calibrated: boolean;
|
|
101
|
-
};
|
|
102
|
-
/**
|
|
103
|
-
* Like `estimateRequestTokens` but applies the rolling calibration factor
|
|
104
|
-
* so context pressure readings converge on reality within a few iterations.
|
|
105
|
-
*
|
|
106
|
-
* Before any `recordActualUsage` samples are collected, returns the same
|
|
107
|
-
* result as `estimateRequestTokens` (ratio = 1.0, no distortion).
|
|
108
|
-
* After `MIN_SAMPLES_FOR_CALIBRATION` samples, applies the calibrated
|
|
109
|
-
* multiplier capped to the range [0.5, 1.5] as a sanity bound.
|
|
110
|
-
*/
|
|
111
|
-
declare function estimateRequestTokensCalibrated(messages: unknown, systemPrompt: unknown, tools: {
|
|
112
|
-
name: string;
|
|
113
|
-
description?: string | undefined;
|
|
114
|
-
inputSchema: unknown;
|
|
115
|
-
}[], calibrationKey?: string): RequestTokenBreakdown;
|
|
116
|
-
/**
|
|
117
|
-
* Resets calibration state. Primarily for tests that run in the same
|
|
118
|
-
* process and need a clean slate between suites. With no argument it clears
|
|
119
|
-
* every bucket (including the global one); pass a key to reset just that bucket.
|
|
120
|
-
*/
|
|
121
|
-
declare function resetCalibration(calibrationKey?: string): void;
|
|
122
|
-
|
|
123
|
-
/**
|
|
124
|
-
* Exhaustiveness check for discriminated union switches.
|
|
125
|
-
* Place in the `default` branch of a switch over a union type
|
|
126
|
-
* to get a compile-time error when a new variant is added.
|
|
127
|
-
*
|
|
128
|
-
* @example
|
|
129
|
-
* switch (block.type) {
|
|
130
|
-
* case 'text': return renderText(block);
|
|
131
|
-
* case 'tool_use': return renderToolUse(block);
|
|
132
|
-
* default: return assertNever(block);
|
|
133
|
-
* }
|
|
134
|
-
*/
|
|
135
|
-
declare function assertNever(x: never, message?: string): never;
|
|
136
|
-
|
|
137
|
-
interface AtomicWriteOptions {
|
|
138
|
-
mode?: number | undefined;
|
|
139
|
-
encoding?: BufferEncoding | undefined;
|
|
140
|
-
}
|
|
141
|
-
interface FileLockOptions {
|
|
142
|
-
timeoutMs?: number | undefined;
|
|
143
|
-
staleMs?: number | undefined;
|
|
144
|
-
}
|
|
145
|
-
declare function atomicWrite(targetPath: string, content: string | Uint8Array, opts?: AtomicWriteOptions): Promise<void>;
|
|
146
|
-
declare function ensureDir(dir: string): Promise<void>;
|
|
147
|
-
declare function withFileLock<T>(targetPath: string, fn: () => Promise<T>, opts?: FileLockOptions): Promise<T>;
|
|
148
|
-
|
|
149
|
-
/**
|
|
150
|
-
* Build a sanitized child-process environment.
|
|
151
|
-
*
|
|
152
|
-
* The bash/exec tools and MCP stdio transports execute LLM-generated or
|
|
153
|
-
* configured commands. The parent process carries provider API keys
|
|
154
|
-
* (ANTHROPIC_API_KEY, OPENAI_API_KEY, ...), VCS tokens (GITHUB_TOKEN),
|
|
155
|
-
* and cloud credentials. Forwarding those to a child is an exfiltration
|
|
156
|
-
* vector even with `permission: 'confirm'` — a compromised MCP server
|
|
157
|
-
* or a cleverly composed shell pipeline can leak secrets.
|
|
158
|
-
*
|
|
159
|
-
* Strategy: copy a small, explicit allowlist of variables that real builds
|
|
160
|
-
* need, then copy anything else that does NOT look secret-bearing. This
|
|
161
|
-
* preserves user-friendly behavior (locale, terminal, npm config) while
|
|
162
|
-
* blocking the obvious leak channels. Two value-side guards back up the
|
|
163
|
-
* name-based filter:
|
|
164
|
-
* - any value carrying an embedded URI credential (`scheme://user:pass@host`,
|
|
165
|
-
* e.g. `DATABASE_URL`/`REDIS_URL`/`*_DSN`) is dropped (WS-01);
|
|
166
|
-
* - `NODE_OPTIONS` is forwarded but with module-preload directives
|
|
167
|
-
* (`--require`/`--import`/`--loader`) stripped so a parent-set value can't
|
|
168
|
-
* inject code into node children (WS-02).
|
|
169
|
-
*
|
|
170
|
-
* Override with `WRONGSTACK_CHILD_ENV_PASSTHROUGH=1` to forward the full
|
|
171
|
-
* parent environment unchanged (opt-in for advanced users who understand
|
|
172
|
-
* the risk).
|
|
173
|
-
*/
|
|
174
|
-
/**
|
|
175
|
-
* Strip module-preload directives from a `NODE_OPTIONS` value while preserving
|
|
176
|
-
* benign flags (`--no-warnings`, `--max-old-space-size=…`, etc.). Handles both
|
|
177
|
-
* the `--require=./x.js` and space-separated `--require ./x.js` forms. Returns
|
|
178
|
-
* the sanitized string (possibly empty).
|
|
179
|
-
*/
|
|
180
|
-
declare function sanitizeNodeOptions(value: string): string;
|
|
181
|
-
interface BuildChildEnvOptions {
|
|
182
|
-
/** Session ID to inject as WRONGSTACK_SESSION_ID. */
|
|
183
|
-
sessionId?: string | undefined;
|
|
184
|
-
/** Additional env vars to merge (takes priority over filtered parent env). */
|
|
185
|
-
extra?: NodeJS.ProcessEnv | undefined;
|
|
186
|
-
}
|
|
187
|
-
/**
|
|
188
|
-
* Build a filtered child-process environment suitable for bash, exec, and
|
|
189
|
-
* MCP server subprocesses. Strips API keys, tokens, and other credentials
|
|
190
|
-
* while preserving system/tooling variables.
|
|
191
|
-
*/
|
|
192
|
-
declare function buildChildEnv(optsOrSessionId?: BuildChildEnvOptions | string): NodeJS.ProcessEnv;
|
|
193
|
-
|
|
194
|
-
declare const color: {
|
|
195
|
-
reset: (s: string) => string;
|
|
196
|
-
bold: (s: string) => string;
|
|
197
|
-
dim: (s: string) => string;
|
|
198
|
-
italic: (s: string) => string;
|
|
199
|
-
underline: (s: string) => string;
|
|
200
|
-
red: (s: string) => string;
|
|
201
|
-
green: (s: string) => string;
|
|
202
|
-
yellow: (s: string) => string;
|
|
203
|
-
blue: (s: string) => string;
|
|
204
|
-
magenta: (s: string) => string;
|
|
205
|
-
cyan: (s: string) => string;
|
|
206
|
-
gray: (s: string) => string;
|
|
207
|
-
amber: (s: string) => string;
|
|
208
|
-
pink: (s: string) => string;
|
|
209
|
-
bgRed: (s: string) => string;
|
|
210
|
-
bgGreen: (s: string) => string;
|
|
211
|
-
};
|
|
212
|
-
declare function stripAnsi(s: string): string;
|
|
213
|
-
|
|
214
|
-
type JsonObject = Record<string, unknown>;
|
|
215
|
-
type JsonPathSegment = string | number;
|
|
216
|
-
type JsonPath = readonly JsonPathSegment[];
|
|
217
|
-
declare function readJsonObjectFile(filePath: string): Promise<JsonObject>;
|
|
218
|
-
declare function jsonObjectFileExists(filePath: string): Promise<boolean>;
|
|
219
|
-
declare function writeJsonObjectFile(filePath: string, value: JsonObject): Promise<void>;
|
|
220
|
-
declare function updateJsonObjectFile(filePath: string, mutator: (config: JsonObject) => void | JsonObject | Promise<void | JsonObject>): Promise<JsonObject>;
|
|
221
|
-
declare function getJsonPath(root: unknown, path: JsonPath): unknown;
|
|
222
|
-
declare function setJsonPath(root: JsonObject, path: JsonPath, value: unknown): JsonObject;
|
|
223
|
-
declare function removeJsonPath(root: JsonObject, path: JsonPath): boolean;
|
|
224
|
-
declare function setJsonPathInFile(filePath: string, path: JsonPath, value: unknown): Promise<JsonObject>;
|
|
225
|
-
declare function removeJsonPathInFile(filePath: string, path: JsonPath): Promise<JsonObject>;
|
|
226
|
-
declare function isJsonObject(value: unknown): value is JsonObject;
|
|
227
|
-
|
|
228
|
-
declare function createContextEvidenceState(): ContextEvidenceState;
|
|
229
|
-
interface RecordToolOutputEvidenceInput {
|
|
230
|
-
toolUseId: string;
|
|
231
|
-
toolName: string;
|
|
232
|
-
input: unknown;
|
|
233
|
-
content: string;
|
|
234
|
-
ok: boolean;
|
|
235
|
-
outputBytes?: number | undefined;
|
|
236
|
-
outputTokens?: number | undefined;
|
|
237
|
-
outputLines?: number | undefined;
|
|
238
|
-
}
|
|
239
|
-
declare function recordUserIntentEvidence(ctx: Context, text: string): void;
|
|
240
|
-
declare function recordToolOutputEvidence(ctx: Context, input: RecordToolOutputEvidenceInput): ToolOutputMetadata;
|
|
241
|
-
declare function markAssistantReferencedEvidence(ctx: Context, text: string): void;
|
|
242
|
-
declare function buildContextEvidenceDigest(ctx: Context): string;
|
|
243
|
-
declare function repeatedReadPressure(ctx: Context): number;
|
|
244
|
-
/** Marker prefixing the ledger's system-prompt block (also used to find/replace it). */
|
|
245
|
-
declare const COMPLETED_WORK_LEDGER_MARKER = "[completed_work_ledger]";
|
|
246
|
-
interface RecordCompletedWorkInput {
|
|
247
|
-
/** Stable dedupe key, e.g. `task:<id>` — re-completion updates in place. */
|
|
248
|
-
key: string;
|
|
249
|
-
source: CompletedWorkSource;
|
|
250
|
-
summary: string;
|
|
251
|
-
/** Optional pointer to proof (test run, commit hash, file path). */
|
|
252
|
-
evidence?: string | undefined;
|
|
253
|
-
/** Epoch ms; defaults to now. */
|
|
254
|
-
completedAt?: number | undefined;
|
|
255
|
-
}
|
|
256
|
-
/**
|
|
257
|
-
* Append one finished unit of work to the session ledger. The provider request
|
|
258
|
-
* composer renders this state as a volatile tail block; the stable system-prompt
|
|
259
|
-
* prefix is never mutated here.
|
|
260
|
-
*/
|
|
261
|
-
declare function recordCompletedWorkEvidence(ctx: Context, input: RecordCompletedWorkInput): CompletedWorkEvidence;
|
|
262
|
-
/** Render the ledger's system-prompt block text (marker + newest entries). */
|
|
263
|
-
declare function formatCompletedWorkLedger(items: readonly CompletedWorkEvidence[]): string;
|
|
264
|
-
/** Build the current volatile completed-work block without mutating the prompt. */
|
|
265
|
-
declare function buildCompletedWorkLedgerBlock(ctx: Context): TextBlock | undefined;
|
|
266
|
-
/**
|
|
267
|
-
* @deprecated Volatile state must be composed at request time. Kept as a
|
|
268
|
-
* compatibility no-op for embedders importing the old helper.
|
|
269
|
-
*/
|
|
270
|
-
declare function syncCompletedWorkLedgerBlock(_ctx: Context): void;
|
|
271
|
-
|
|
272
|
-
/**
|
|
273
|
-
* Deep merge utility — safely merges nested objects with configurable
|
|
274
|
-
* conflict resolution, array merging, and prototype-pollution guarding.
|
|
275
|
-
*
|
|
276
|
-
* Used by:
|
|
277
|
-
* - config-loader (config layer merging with primitive-array concatenation)
|
|
278
|
-
* - secret-vault (config patching)
|
|
279
|
-
* - json-path (json_merge tool with prefer-base / prefer-patch semantics)
|
|
280
|
-
*
|
|
281
|
-
* @module utils/deep-merge
|
|
282
|
-
*/
|
|
283
|
-
declare const FORBIDDEN_PROTO_KEYS: Set<string>;
|
|
284
|
-
/** True when every element is a primitive or null (no nested objects/arrays). */
|
|
285
|
-
declare function isPrimitiveArray(a: unknown[]): boolean;
|
|
286
|
-
interface DeepMergeOptions {
|
|
287
|
-
/**
|
|
288
|
-
* Which side wins on collision for scalars and arrays.
|
|
289
|
-
*
|
|
290
|
-
* - `'prefer-patch'` (default): patch value replaces base value.
|
|
291
|
-
* - `'prefer-base'`: base value is kept, patch value is ignored.
|
|
292
|
-
*/
|
|
293
|
-
conflictResolution?: 'prefer-base' | 'prefer-patch';
|
|
294
|
-
/**
|
|
295
|
-
* How to handle array values.
|
|
296
|
-
*
|
|
297
|
-
* - `'replace'` (default): patch array replaces base array entirely.
|
|
298
|
-
* - `'concat-primitives'`: when both values are primitive arrays,
|
|
299
|
-
* they are concatenated and deduped (via Set). Non-primitive
|
|
300
|
-
* arrays still replace the base wholesale.
|
|
301
|
-
*/
|
|
302
|
-
arrayMode?: 'replace' | 'concat-primitives';
|
|
303
|
-
/**
|
|
304
|
-
* Skip prototype-pollution keys (`__proto__`, `constructor`, etc.).
|
|
305
|
-
* Enabled by default. Only disable when you control both inputs
|
|
306
|
-
* and the keyset (e.g. when merging trusted JSON schemas).
|
|
307
|
-
*/
|
|
308
|
-
protectProto?: boolean;
|
|
309
|
-
/**
|
|
310
|
-
* Optional callback fired when a non-primitive (object) array is
|
|
311
|
-
* replaced wholesale (only relevant with `arrayMode: 'concat-primitives'`).
|
|
312
|
-
* Receives the key name, existing array length, and patch array length.
|
|
313
|
-
* Used by config-loader for debug logging.
|
|
314
|
-
*/
|
|
315
|
-
onNonPrimitiveArrayReplace?: (key: string, existingLen: number, patchLen: number) => void;
|
|
316
|
-
}
|
|
317
|
-
/**
|
|
318
|
-
* Recursively merge `patch` into `base`, returning a new object.
|
|
319
|
-
*
|
|
320
|
-
* - Nested plain objects are merged recursively.
|
|
321
|
-
* - Arrays are handled per `options.arrayMode`.
|
|
322
|
-
* - Scalar collisions are resolved per `options.conflictResolution`.
|
|
323
|
-
* - `null` and non-object values in `patch` replace the base value
|
|
324
|
-
* (unless `conflictResolution` is `'prefer-base'`).
|
|
325
|
-
* - Keys in `base` that are absent from `patch` are preserved.
|
|
326
|
-
* - `FORBIDDEN_PROTO_KEYS` are skipped in the patch (unless
|
|
327
|
-
* `options.protectProto` is set to `false`).
|
|
328
|
-
*
|
|
329
|
-
* The function is generic over `T extends Record<string, unknown>` for
|
|
330
|
-
* callers that pass typed config objects, but the runtime signature
|
|
331
|
-
* also accepts `unknown` inputs (used by the json-path plugin).
|
|
332
|
-
*/
|
|
333
|
-
declare function deepMerge<T extends Record<string, unknown>>(base: T, patch: Record<string, unknown>, options?: DeepMergeOptions): T;
|
|
334
|
-
declare function deepMerge(base: unknown, patch: unknown, options?: DeepMergeOptions): unknown;
|
|
335
|
-
|
|
336
|
-
/**
|
|
337
|
-
* Myers diff with unified-format output. No external dependencies.
|
|
338
|
-
* Operates on arrays of lines (newline-terminated or stripped).
|
|
339
|
-
*/
|
|
340
|
-
interface UnifiedDiffOptions {
|
|
341
|
-
context?: number | undefined;
|
|
342
|
-
fromFile?: string | undefined;
|
|
343
|
-
toFile?: string | undefined;
|
|
344
|
-
}
|
|
345
|
-
declare function unifiedDiff(oldText: string, newText: string, opts?: UnifiedDiffOptions): string;
|
|
346
|
-
|
|
347
|
-
/**
|
|
348
|
-
* Resolve `pattern` to the set of concrete file paths it matches.
|
|
349
|
-
* Literal paths (no glob chars) are returned as-is.
|
|
350
|
-
*
|
|
351
|
-
* @example
|
|
352
|
-
* await expandGlob('src/**\/*.ts') // → ['src/a.ts', 'src/b/c.ts', ...]
|
|
353
|
-
* await expandGlob('foo.txt') // → ['foo.txt']
|
|
354
|
-
*/
|
|
355
|
-
declare function expandGlob(pattern: string): Promise<string[]>;
|
|
356
|
-
|
|
357
|
-
declare function compileGlob(pattern: string): RegExp;
|
|
358
|
-
declare function matchGlob(pattern: string, input: string): boolean;
|
|
359
|
-
declare function matchAny(patterns: string[], input: string): boolean;
|
|
360
|
-
|
|
361
|
-
/**
|
|
362
|
-
* Shared IP-address guards for SSRF protection.
|
|
363
|
-
*
|
|
364
|
-
* Exported so `fetch.ts` (tools), `web-search/index.ts` (plugins), and any
|
|
365
|
-
* other package that needs to validate IPs can all consume the same logic.
|
|
366
|
-
* Any future additions (e.g. extra CIDR blocks) need only be made here.
|
|
367
|
-
*/
|
|
368
|
-
/**
|
|
369
|
-
* True if `addr` is in a private / loopback / link-local / reserved / CGNAT /
|
|
370
|
-
* multicast range. `net.isIP` is called by the caller first so `addr` is
|
|
371
|
-
* guaranteed to be a canonical dotted-quad at this point.
|
|
372
|
-
*/
|
|
373
|
-
declare function isPrivateIPv4(addr: string): boolean;
|
|
374
|
-
/**
|
|
375
|
-
* True if `raw` (an IPv6 literal, already lowercased) is loopback / unique-local /
|
|
376
|
-
* link-local / unspecified / IPv4-mapped-private.
|
|
377
|
-
*/
|
|
378
|
-
declare function isPrivateIPv6(raw: string): boolean;
|
|
379
|
-
/**
|
|
380
|
-
* Expand an IPv6 string into exactly 8 16-bit numbers. Handles `::` compression.
|
|
381
|
-
* Returns null on malformed input — caller should treat that as "block".
|
|
382
|
-
*/
|
|
383
|
-
declare function expandIPv6(addr: string): number[] | null;
|
|
384
|
-
/**
|
|
385
|
-
* Convenience: throw if `hostname` resolves to a private / loopback IP.
|
|
386
|
-
* Use as a pre-flight check before opening a socket.
|
|
387
|
-
*
|
|
388
|
-
* ⚠️ This is not sufficient alone — connections must also use a pinned
|
|
389
|
-
* dispatcher (so the OS re-uses the already-resolved address) or the same
|
|
390
|
-
* check must be applied after every redirect hop. See `guardedLookup` in
|
|
391
|
-
* `fetch.ts` for the connection-level enforcement.
|
|
392
|
-
*/
|
|
393
|
-
declare function assertNotPrivateHost(hostname: string): Promise<void>;
|
|
394
|
-
|
|
395
|
-
/**
|
|
396
|
-
* Attempt to close an incomplete JSON object string by auto-closing braces
|
|
397
|
-
* and completing any unclosed double-quoted string values.
|
|
398
|
-
*
|
|
399
|
-
* Strategy:
|
|
400
|
-
* 1. Compute origOpen from the ORIGINAL input (how many braces are unclosed).
|
|
401
|
-
* 2. Add that many closing braces. If result is now valid JSON → return it.
|
|
402
|
-
* 3. If still invalid: trim trailing whitespace, strip trailing backslash.
|
|
403
|
-
* 4. Walk backwards to detect an unclosed string value.
|
|
404
|
-
* - Quote followed by `:` → key-name, skip
|
|
405
|
-
* - Quote followed by `,` `}` or end-of-string → toggle in/out of string
|
|
406
|
-
* 5. If we end INSIDE a string (unclosed opening `"`), append `"` + origOpen `}`.
|
|
407
|
-
*
|
|
408
|
-
* Known limitations:
|
|
409
|
-
* - Strings whose content ends with a `"` character cannot be repaired
|
|
410
|
-
* (algorithm can't distinguish content-`"` from string-terminator `"`).
|
|
411
|
-
* - Input ending in bare `:` (incomplete value expression) can't be meaningfully repaired.
|
|
412
|
-
* - Bare `{` returns unchanged.
|
|
413
|
-
* - If origOpen=0 (braces balanced) but string is unclosed, repair is skipped
|
|
414
|
-
* (the input would be valid JSON per JSON.parse, so it's returned as-is).
|
|
415
|
-
*/
|
|
416
|
-
declare function completePartialObject(s: string): string;
|
|
417
|
-
|
|
418
|
-
/**
|
|
419
|
-
* Minimal JSON Schema validator — covers the subset needed for plugin
|
|
420
|
-
* configSchema validation and tool inputSchema sanity checks. Intentionally
|
|
421
|
-
* small (~80 lines, zero deps) and tolerant: unknown keywords are ignored so
|
|
422
|
-
* authors can mix in non-standard extensions without breaking validation.
|
|
423
|
-
*
|
|
424
|
-
* NOT for full JSON Schema 2020-12 conformance. If a plugin needs $ref,
|
|
425
|
-
* conditional schemas, format validation, or anything else exotic, it should
|
|
426
|
-
* bring its own ajv-based validator and call this only for the cheap path.
|
|
427
|
-
*/
|
|
428
|
-
|
|
429
|
-
interface ValidationError {
|
|
430
|
-
path: string;
|
|
431
|
-
message: string;
|
|
432
|
-
}
|
|
433
|
-
interface ValidationResult {
|
|
434
|
-
ok: boolean;
|
|
435
|
-
errors: ValidationError[];
|
|
436
|
-
}
|
|
437
|
-
declare function validateAgainstSchema(value: unknown, schema: JSONSchema): ValidationResult;
|
|
438
|
-
interface CoercionResult {
|
|
439
|
-
value: unknown;
|
|
440
|
-
/** True when at least one leaf was rewritten. */
|
|
441
|
-
changed: boolean;
|
|
442
|
-
}
|
|
443
|
-
/**
|
|
444
|
-
* Best-effort, lossless coercion of a value toward a JSON Schema. Models —
|
|
445
|
-
* especially through OpenAI-compatible proxies — frequently deliver
|
|
446
|
-
* arguments with the right *content* in the wrong *type*: numbers and
|
|
447
|
-
* booleans encoded as strings ("5", "true"), scalars where a string is
|
|
448
|
-
* expected, or a whole nested object serialized into a JSON string.
|
|
449
|
-
*
|
|
450
|
-
* Only conversions that cannot lose information are applied:
|
|
451
|
-
* - string → number/integer when the whole trimmed string parses cleanly
|
|
452
|
-
* - string "true"/"false" → boolean
|
|
453
|
-
* - number/boolean → string when a string is expected
|
|
454
|
-
* - JSON-serialized string → object/array when the parse yields that shape
|
|
455
|
-
* Recurses into `properties`/`items`. Returns the (possibly new) value and
|
|
456
|
-
* whether anything changed — callers should re-validate before trusting it.
|
|
457
|
-
*/
|
|
458
|
-
declare function coerceAgainstSchema(value: unknown, schema: JSONSchema): CoercionResult;
|
|
459
|
-
|
|
460
|
-
/**
|
|
461
|
-
* Merge per-provider `customModels` into top-level `configModels`.
|
|
462
|
-
*
|
|
463
|
-
* Keys present in `configModels` always win over `providerCustomModels`
|
|
464
|
-
* when the same model id appears in both places. This lets the user
|
|
465
|
-
* override provider-attached definitions from the top-level config.
|
|
466
|
-
*
|
|
467
|
-
* Pure: never mutates its inputs.
|
|
468
|
-
*/
|
|
469
|
-
declare function mergeCustomModelDefs(providerCustomModels: Record<string, CustomModelDefinition> | undefined, configModels: Record<string, CustomModelDefinition> | undefined): Record<string, CustomModelDefinition> | undefined;
|
|
470
|
-
|
|
471
|
-
/**
|
|
472
|
-
* Deep-merge a curated `overlay` payload on top of a `base` payload (both in
|
|
473
|
-
* the models.dev `api.json` shape). The overlay always wins: it can add
|
|
474
|
-
* providers/models the base lacks and override fields the base gets wrong.
|
|
475
|
-
*
|
|
476
|
-
* Precedence rules:
|
|
477
|
-
* - Provider present in both → scalar fields (`name`, `npm`, `api`, `env`,
|
|
478
|
-
* `doc`) come from the overlay when set; `models` maps merge by model id.
|
|
479
|
-
* - Provider only in the overlay → added wholesale.
|
|
480
|
-
* - Model present in both → overlay model fields override base model fields
|
|
481
|
-
* (`{ ...base, ...overlay }`), with the nested `limit` / `cost` /
|
|
482
|
-
* `modalities` objects merged one level deeper so an overlay can fix just
|
|
483
|
-
* `limit.context` without restating the rest of the model.
|
|
484
|
-
* - Model only in the overlay → added.
|
|
485
|
-
*
|
|
486
|
-
* Pure: never mutates its inputs.
|
|
487
|
-
*/
|
|
488
|
-
declare function mergeModelsPayload(base: ModelsDevPayload, overlay: ModelsDevPayload): ModelsDevPayload;
|
|
489
|
-
|
|
490
|
-
interface MessageRepairReport {
|
|
491
|
-
changed: boolean;
|
|
492
|
-
removedToolUses: string[];
|
|
493
|
-
removedToolResults: string[];
|
|
494
|
-
removedMessages: number;
|
|
495
|
-
}
|
|
496
|
-
interface MessageRepairResult {
|
|
497
|
-
messages: Message[];
|
|
498
|
-
report: MessageRepairReport;
|
|
499
|
-
}
|
|
500
|
-
/**
|
|
501
|
-
* Repair provider-level tool-call adjacency invariants.
|
|
502
|
-
*
|
|
503
|
-
* Anthropic requires every assistant `tool_use` block to have a matching
|
|
504
|
-
* `tool_result` block in the immediately following user message. Manual
|
|
505
|
-
* context surgery (summary/prune) can cut through the middle of such an
|
|
506
|
-
* exchange. This function removes only the now-orphaned protocol blocks,
|
|
507
|
-
* preserving surrounding text/images/thinking blocks where possible.
|
|
508
|
-
*/
|
|
509
|
-
declare function repairToolUseAdjacency(messages: Message[]): MessageRepairResult;
|
|
510
|
-
|
|
511
|
-
type NewlineStyle = 'lf' | 'crlf' | 'cr';
|
|
512
|
-
declare function detectNewlineStyle(text: string): NewlineStyle;
|
|
513
|
-
declare function toStyle(text: string, style: NewlineStyle): string;
|
|
514
|
-
declare function normalizeToLf(text: string): string;
|
|
515
|
-
|
|
516
|
-
/**
|
|
517
|
-
* Compile a user-supplied regex with conservative bounds against ReDoS.
|
|
518
|
-
*
|
|
519
|
-
* Duplicated from @wrongstack/tools/_regex.ts to avoid a circular
|
|
520
|
-
* dependency (tools depends on core, not vice versa). Keep both copies
|
|
521
|
-
* in sync if the heuristics change.
|
|
522
|
-
*
|
|
523
|
-
* V8's regex engine is backtracking-based and cannot interrupt a
|
|
524
|
-
* synchronous match — a pattern like `(a+)+$` against a sufficiently
|
|
525
|
-
* long line will pin a worker for seconds.
|
|
526
|
-
*/
|
|
527
|
-
interface CompileResult {
|
|
528
|
-
ok: true;
|
|
529
|
-
regex: RegExp;
|
|
530
|
-
}
|
|
531
|
-
interface CompileFail {
|
|
532
|
-
ok: false;
|
|
533
|
-
reason: string;
|
|
534
|
-
}
|
|
535
|
-
declare function compileUserRegex(pattern: string, flags: string): CompileResult | CompileFail;
|
|
536
|
-
|
|
537
|
-
interface SafeParseResult<T> {
|
|
538
|
-
ok: boolean;
|
|
539
|
-
value?: T | undefined;
|
|
540
|
-
error?: string | undefined;
|
|
541
|
-
}
|
|
542
|
-
declare function safeParse<T = unknown>(input: string, maxBytes?: number): SafeParseResult<T>;
|
|
543
|
-
declare function safeStringify(value: unknown, pretty?: boolean): string;
|
|
544
|
-
/**
|
|
545
|
-
* Attempt to parse JSON5-style input and return a valid JSON string.
|
|
546
|
-
* Handles trailing commas, single-line comments, and unquoted keys
|
|
547
|
-
* that are common in provider output.
|
|
548
|
-
*
|
|
549
|
-
* Returns the sanitized string if it parses successfully as JSON,
|
|
550
|
-
* or `null` if the input cannot be made valid. Callers use this to
|
|
551
|
-
* decide whether to proceed with the parsed result or fall back to
|
|
552
|
-
* raw handling.
|
|
553
|
-
*/
|
|
554
|
-
declare function sanitizeJsonString(s: string): string | null;
|
|
555
|
-
/**
|
|
556
|
-
* Strip a Markdown code-fence wrapper from a payload.
|
|
557
|
-
*
|
|
558
|
-
* Models occasionally return tool-call arguments wrapped in ```json fences
|
|
559
|
-
* (or embedded in prose around one) instead of bare JSON. Returns the inner
|
|
560
|
-
* content when the input starts with a fence (closing fence optional, so a
|
|
561
|
-
* truncated stream still unwraps) or contains one complete fenced block;
|
|
562
|
-
* returns null when no fence is present. Callers should only invoke this
|
|
563
|
-
* after a direct parse failed, so fences inside legitimate string values are
|
|
564
|
-
* never touched.
|
|
565
|
-
*/
|
|
566
|
-
declare function stripCodeFences(s: string): string | null;
|
|
567
|
-
|
|
568
|
-
/**
|
|
569
|
-
* Resolve `<dir>/<sessionId><suffix>` for per-session sidecar files
|
|
570
|
-
* (annotations, audit chain, replay log, the session JSONL itself).
|
|
571
|
-
*
|
|
572
|
-
* Modern session ids are date-sharded ("2026-06-11/sess_<ULID>"),
|
|
573
|
-
* so a forward slash is a legitimate shard separator — NOT traversal.
|
|
574
|
-
* Escape attempts are blocked two ways: an explicit ban on `..` and
|
|
575
|
-
* backslashes, plus a resolved-path containment check that rejects any
|
|
576
|
-
* id whose resolved target leaves `dir`. Character bans alone are how
|
|
577
|
-
* several stores ended up throwing on every modern session id.
|
|
578
|
-
*/
|
|
579
|
-
declare function sessionScopedPath(dir: string, sessionId: string, suffix: string): string;
|
|
580
|
-
|
|
581
|
-
/**
|
|
582
|
-
* Turn an arbitrary string into a filesystem- and URL-safe lowercase slug.
|
|
583
|
-
*
|
|
584
|
-
* Collapses every run of non-alphanumeric characters into a single hyphen,
|
|
585
|
-
* trims leading/trailing hyphens, and caps the length. Returns `fallback`
|
|
586
|
-
* when the input slugifies to the empty string.
|
|
587
|
-
*
|
|
588
|
-
* Used as the stable dedup + registry key for prompts. (Distinct from the
|
|
589
|
-
* project-folder slug in `wstack-paths.ts`, which has its own `'project'`
|
|
590
|
-
* fallback and shorter cap.)
|
|
591
|
-
*/
|
|
592
|
-
declare function slugify(name: string, fallback?: string, maxLen?: number): string;
|
|
593
|
-
|
|
594
|
-
/**
|
|
595
|
-
* Generate a ULID — a 26-char Crockford-base32 identifier whose first 10 chars
|
|
596
|
-
* encode the millisecond timestamp (so IDs sort lexicographically by creation
|
|
597
|
-
* time) followed by 16 chars of randomness. Zero runtime dependencies.
|
|
598
|
-
*
|
|
599
|
-
* The codebase convention is "IDs are ULIDs"; use this for any new store key.
|
|
600
|
-
*/
|
|
601
|
-
declare function ulid(seedTime?: number): string;
|
|
602
|
-
/** True for a well-formed 26-char Crockford-base32 ULID. */
|
|
603
|
-
declare function isUlid(value: string): boolean;
|
|
604
|
-
|
|
605
|
-
/** Resolve a promise after `ms` milliseconds. Prefer this over raw
|
|
606
|
-
* `setTimeout` wrappers so all delay sites use a single implementation
|
|
607
|
-
* and an abortable variant can be introduced without a codebase-wide hunt. */
|
|
608
|
-
declare function sleep(ms: number): Promise<void>;
|
|
609
|
-
|
|
610
|
-
/**
|
|
611
|
-
* String utilities shared across the WrongStack codebase.
|
|
612
|
-
*/
|
|
613
|
-
/**
|
|
614
|
-
* Truncate a string to at most `max` characters, appending an ellipsis if it
|
|
615
|
-
* was longer. Returns the original string unchanged when it fits.
|
|
616
|
-
*/
|
|
617
|
-
declare function truncate(s: string, max: number): string;
|
|
618
|
-
|
|
619
|
-
/**
|
|
620
|
-
* TTY detection helpers — the single source of truth for "is this process
|
|
621
|
-
* running against a real terminal?". Replaces ad-hoc `process.stdin.isTTY`
|
|
622
|
-
* / `process.stdout.isTTY` checks scattered across the codebase so that:
|
|
623
|
-
*
|
|
624
|
-
* 1. test code can mock a single module instead of stubbing `isTTY` on
|
|
625
|
-
* every ReadStream/WriteStream the test happens to touch;
|
|
626
|
-
* 2. a future TTY-detection source (an env var override, a Windows
|
|
627
|
-
* ConPTY workaround, …) lands in one place;
|
|
628
|
-
* 3. `isInteractive()` encodes the rule the project already used inline
|
|
629
|
-
* ("both streams are TTYs AND we're not running under CI") in one
|
|
630
|
-
* testable helper instead of the same 3-condition check in two
|
|
631
|
-
* different files.
|
|
632
|
-
*
|
|
633
|
-
* Scope: detection only. Raw-mode control (`setRawMode`), resize
|
|
634
|
-
* subscriptions, and write-injection belong to a future, larger TTY
|
|
635
|
-
* abstraction; this module is the smallest pull that gives us a
|
|
636
|
-
* testable seam and dedups 20+ call sites.
|
|
637
|
-
*/
|
|
638
|
-
/** True when `process.stdout` is attached to a terminal (not a pipe/file). */
|
|
639
|
-
declare function isStdoutTTY(): boolean;
|
|
640
|
-
/** True when `process.stdin` is attached to a terminal (not a pipe/file). */
|
|
641
|
-
declare function isStdinTTY(): boolean;
|
|
642
|
-
/**
|
|
643
|
-
* True when the current process is an interactive session: both stdin and
|
|
644
|
-
* stdout are TTYs. Callers that also need a "not a single-shot invocation"
|
|
645
|
-
* or "not under CI" check should layer that on top — keeping this helper
|
|
646
|
-
* minimal preserves the original inline checks it replaces.
|
|
647
|
-
*/
|
|
648
|
-
declare function isInteractive(): boolean;
|
|
649
|
-
/** Current terminal size in characters, with a 24×80 fallback for non-TTYs. */
|
|
650
|
-
declare function getTermSize(): {
|
|
651
|
-
rows: number;
|
|
652
|
-
cols: number;
|
|
653
|
-
};
|
|
654
|
-
/**
|
|
655
|
-
* Subscribe to terminal resize events. `cb` is called with the new size each
|
|
656
|
-
* time the underlying stream emits `resize`. Returns a cleanup function the
|
|
657
|
-
* caller MUST call on dispose to remove the listener — leaving a stale
|
|
658
|
-
* `resize` listener on a disposed component leaks the closure (and the
|
|
659
|
-
* component itself, transitively) until the process exits.
|
|
660
|
-
*
|
|
661
|
-
* The stream argument defaults to `process.stdout`. Pass an explicit
|
|
662
|
-
* `NodeJS.WriteStream` when the caller already owns one (e.g. a status line
|
|
663
|
-
* that targets an injected `out` for testability). For non-TTY streams no
|
|
664
|
-
* listener is registered and the returned cleanup is a no-op.
|
|
665
|
-
*/
|
|
666
|
-
declare function onResize(cb: (size: {
|
|
667
|
-
rows: number;
|
|
668
|
-
cols: number;
|
|
669
|
-
}) => void, stream?: NodeJS.WriteStream): () => void;
|
|
670
|
-
/**
|
|
671
|
-
* Toggle raw mode on a TTY stdin stream. Returns `true` when the toggle was
|
|
672
|
-
* applied, `false` when the stream is null, not a TTY, or doesn't expose
|
|
673
|
-
* `setRawMode` (pipes, file descriptors, Windows ConPTY edge cases). Callers
|
|
674
|
-
* that need to restore the previous mode should snapshot `input.isRaw`
|
|
675
|
-
* BEFORE the call and pass the value to a second call to flip back.
|
|
676
|
-
*
|
|
677
|
-
* Use this helper to drop the now-redundant
|
|
678
|
-
* `if (input.isTTY) input.setRawMode(...)` ceremony at every call site.
|
|
679
|
-
*/
|
|
680
|
-
declare function setRawMode(input: NodeJS.ReadStream, mode: boolean): boolean;
|
|
681
|
-
/**
|
|
682
|
-
* Bracket installed by the interactive input reader while a `readline`
|
|
683
|
-
* prompt is on screen. Out-of-band terminal writes — logger WARN/INFO
|
|
684
|
-
* lines, async activity from the Telegram bridge, etc. — go to the same
|
|
685
|
-
* physical terminal as the half-typed prompt but readline has no idea they
|
|
686
|
-
* happened, so it never repaints. The result is the classic corruption the
|
|
687
|
-
* user sees: every async line strands the in-progress draft as a fresh
|
|
688
|
-
* scrollback row (sometimes with its cursor underline).
|
|
689
|
-
*
|
|
690
|
-
* The guard closes that gap. `suspend()` wipes the draft row so the message
|
|
691
|
-
* prints clean; `resume()` repaints the prompt + draft (cursor preserved).
|
|
692
|
-
* When no prompt is active the guard is `null` and writes pass straight
|
|
693
|
-
* through — so agent-turn output (spinner, renderer) is untouched.
|
|
694
|
-
*/
|
|
695
|
-
interface OutputLineGuard {
|
|
696
|
-
/** Clear the current input row right before an out-of-band write. */
|
|
697
|
-
suspend(): void;
|
|
698
|
-
/** Repaint the prompt + in-progress draft right after the write. */
|
|
699
|
-
resume(): void;
|
|
700
|
-
}
|
|
701
|
-
/**
|
|
702
|
-
* Register (or clear, with `null`) the guard that brackets out-of-band
|
|
703
|
-
* writes. Installed by {@link writeOut}/{@link writeErr} consumers — in
|
|
704
|
-
* practice the CLI's readline input reader — only while a prompt is live.
|
|
705
|
-
* Idempotent; the most recent caller wins.
|
|
706
|
-
*/
|
|
707
|
-
declare function setOutputLineGuard(guard: OutputLineGuard | null): void;
|
|
708
|
-
/**
|
|
709
|
-
* Write `s` to `stream` (defaults to `process.stdout`). Returns `false`
|
|
710
|
-
* when the stream is missing or doesn't expose `write` so callers can
|
|
711
|
-
* degrade silently under hostile host environments (closed pipe, mock
|
|
712
|
-
* injects `null`, test replaces the stream with a stub).
|
|
713
|
-
*
|
|
714
|
-
* Why a helper:
|
|
715
|
-
* 1. **Single seam for output capture in tests** — stub `writeOut` once
|
|
716
|
-
* and assert on what the rest of the codebase intended to print,
|
|
717
|
-
* without spying on `process.stdout.write` (which is brittle and
|
|
718
|
-
* leaks across parallel test files).
|
|
719
|
-
* 2. **Stream swap without grep** — routing the CLI's output to a
|
|
720
|
-
* logger or `out.log` becomes a one-line change at process boot.
|
|
721
|
-
* 3. **Defensive default** — closes the "what if `process.stdout` is
|
|
722
|
-
* `null`" gap that currently exists at ~50 call sites that just
|
|
723
|
-
* call `process.stdout.write(s)` and crash on certain Windows
|
|
724
|
-
* redirect invocations.
|
|
725
|
-
*
|
|
726
|
-
* Call-site migration is staged: this commit introduces the helper, a
|
|
727
|
-
* follow-up commit replaces the 50+ `process.stdout.write(...)` sites
|
|
728
|
-
* with `writeOut(...)`. Until that migration lands, both forms coexist
|
|
729
|
-
* and `writeOut` is the preferred form for new code.
|
|
730
|
-
*/
|
|
731
|
-
declare function writeOut(s: string, stream?: NodeJS.WriteStream): boolean;
|
|
732
|
-
/**
|
|
733
|
-
* Symmetric partner of `writeOut` for the standard error stream. Same shape,
|
|
734
|
-
* same defensive contract, same single-seam-for-tests story — just defaults to
|
|
735
|
-
* `process.stderr` instead of `process.stdout`.
|
|
736
|
-
*
|
|
737
|
-
* Use this in code paths that emit error/diagnostic/warning text. Keeping
|
|
738
|
-
* these two helpers split (rather than a single `writeTo(s, stream)`) means
|
|
739
|
-
* the call site reads as a clear intent signal: "I am writing an error" vs.
|
|
740
|
-
* "I am writing a result" — which matters for callers that decide between
|
|
741
|
-
* stdout/stderr routing (e.g. `--quiet` flags, log-level filtering,
|
|
742
|
-
* structured-log rewriters that fork on stream).
|
|
743
|
-
*
|
|
744
|
-
* Stderr writes from the core logger (see `infrastructure/logger.ts`) and from
|
|
745
|
-
* the TUI guard (see `tui/run-tui.ts`) used to call `process.stderr.write`
|
|
746
|
-
* directly. Routing them through this helper lets tests stub the stream at
|
|
747
|
-
* one boundary and lets future logging middleware (e.g. a JSON-line rewriter)
|
|
748
|
-
* swap the destination for the entire process in one place.
|
|
749
|
-
*/
|
|
750
|
-
declare function writeErr(s: string, stream?: NodeJS.WriteStream): boolean;
|
|
751
|
-
|
|
752
|
-
/**
|
|
753
|
-
* Canonical text rendering of the live todo list, shared by the CLI's
|
|
754
|
-
* `/todos` slash command and the TUI's auto-echo (which prints the same
|
|
755
|
-
* snapshot to chat history each time the `todo` tool mutates the list).
|
|
756
|
-
*
|
|
757
|
-
* Layout: a header line with the `done/total done` count, then one row
|
|
758
|
-
* per item — `[ ]` pending, `[~]` in-progress, `[x]` completed. In-
|
|
759
|
-
* progress rows prefer `activeForm` ("Building the project") over the
|
|
760
|
-
* imperative `content` ("Build the project") when present.
|
|
761
|
-
*
|
|
762
|
-
* Returned as a single newline-joined string so callers can hand it
|
|
763
|
-
* straight to a history dispatcher or stdout.
|
|
764
|
-
*/
|
|
765
|
-
declare function formatTodosList(todos: TodoItem[]): string;
|
|
766
|
-
/**
|
|
767
|
-
* True when the todos list still has at least one unfinished item — either
|
|
768
|
-
* `pending` (not started) or `in_progress` (underway). The REPL and other
|
|
769
|
-
* post-turn handlers call this to decide whether to surface `<nextsteps>`
|
|
770
|
-
* suggestions to the user: as long as the agent has open todos, finishing
|
|
771
|
-
* them takes priority over offering new prompt options. Surfacing
|
|
772
|
-
* `<nextsteps>` mid-task is what causes YOLO+auto mode and the autonomy
|
|
773
|
-
* 'auto' loop to prematurely pivot away from the in-flight todo list.
|
|
774
|
-
*
|
|
775
|
-
* Returns false for an empty / undefined list (nothing pending, nothing to
|
|
776
|
-
* block on) and false for an all-completed list. Treats any non-array input
|
|
777
|
-
* (legacy contexts, mocks) as "no todos" rather than throwing.
|
|
778
|
-
*/
|
|
779
|
-
declare function hasOpenTodos(todos: readonly TodoItem[] | undefined | null): boolean;
|
|
780
|
-
|
|
781
|
-
declare function escapeGlobSubject(value: string): string;
|
|
782
|
-
declare function normalizePathSubject(value: string): string;
|
|
783
|
-
declare function isPathSubjectKey(subjectKey: string): boolean;
|
|
784
|
-
declare function subjectForToolInput(toolName: string, input: unknown, subjectKey?: string): string | undefined;
|
|
785
|
-
|
|
786
|
-
/**
|
|
787
|
-
* Tool output serialization utilities.
|
|
788
|
-
* Extracted from Agent.executeTools to allow reuse and consistent output handling.
|
|
789
|
-
*/
|
|
790
|
-
interface ToolOutputSerializerOptions {
|
|
791
|
-
perIterationOutputCapBytes?: number | undefined;
|
|
792
|
-
estimator?: ((text: string) => number) | undefined;
|
|
793
|
-
}
|
|
794
|
-
interface ToolOutputSerializeContext {
|
|
795
|
-
toolName?: string | undefined;
|
|
796
|
-
input?: unknown;
|
|
797
|
-
/**
|
|
798
|
-
* Optional reference to the Tool object. When present and the tool defines
|
|
799
|
-
* a `serialize()` method, the serializer delegates to it instead of the
|
|
800
|
-
* central `renderToolObject()` switch (P3 #21).
|
|
801
|
-
*/
|
|
802
|
-
tool?: {
|
|
803
|
-
serialize?: (output: unknown, input: unknown) => string;
|
|
804
|
-
} | undefined;
|
|
805
|
-
}
|
|
806
|
-
declare function createToolOutputSerializer(opts?: ToolOutputSerializerOptions): {
|
|
807
|
-
serialize: (value: unknown, context?: ToolOutputSerializeContext) => string;
|
|
808
|
-
enforceCap: (text: string, remainingBudget: number) => {
|
|
809
|
-
text: string;
|
|
810
|
-
newBudget: number;
|
|
811
|
-
};
|
|
812
|
-
capBytes: number;
|
|
813
|
-
};
|
|
814
|
-
|
|
815
|
-
declare const DEFAULT_TOOL_DESCRIPTION_MODE: ToolDescriptionMode;
|
|
816
|
-
interface ToolDescriptionRegistryLike {
|
|
817
|
-
get(name: string): Tool | undefined;
|
|
818
|
-
list(): Tool[];
|
|
819
|
-
wrap?(name: string, wrapper: (tool: Tool) => Tool, owner?: string): void;
|
|
820
|
-
setDescriptionMode?(name: string, mode: ToolDescriptionMode): boolean;
|
|
821
|
-
applyDescriptionModes?(modes?: ToolDescriptionModeConfig): {
|
|
822
|
-
applied: number;
|
|
823
|
-
missing: string[];
|
|
824
|
-
};
|
|
825
|
-
getDescriptionMode?(name: string): ToolDescriptionMode;
|
|
826
|
-
}
|
|
827
|
-
declare function normalizeToolDescriptionMode(value: unknown): ToolDescriptionMode | undefined;
|
|
828
|
-
declare function resolveToolDescriptionMode(modes: ToolDescriptionModeConfig | undefined, toolName: string): ToolDescriptionMode;
|
|
829
|
-
declare function simplifyToolDescription(text: string, opts?: {
|
|
830
|
-
maxSentences?: number | undefined;
|
|
831
|
-
maxChars?: number | undefined;
|
|
832
|
-
}): string;
|
|
833
|
-
declare function applyToolDescriptionModeToTool(tool: Tool, mode: ToolDescriptionMode): Tool;
|
|
834
|
-
declare function setToolDescriptionMode(registry: ToolDescriptionRegistryLike, name: string, mode: ToolDescriptionMode): boolean;
|
|
835
|
-
declare function getToolDescriptionMode(registry: ToolDescriptionRegistryLike, name: string): ToolDescriptionMode;
|
|
836
|
-
declare function applyToolDescriptionModes(registry: ToolDescriptionRegistryLike, modes?: ToolDescriptionModeConfig): {
|
|
837
|
-
applied: number;
|
|
838
|
-
missing: string[];
|
|
839
|
-
};
|
|
840
|
-
|
|
841
|
-
declare const DEFAULT_TOOL_RESULT_RENDER_MODE: ToolResultRenderMode;
|
|
842
|
-
/**
|
|
843
|
-
* Normalize a raw value to a {@link ToolResultRenderMode}. Accepts the
|
|
844
|
-
* canonical strings (`'extend' | 'simple'`) plus a few synonyms so the
|
|
845
|
-
* slash command feels forgiving (`extended`/`full` → `extend`,
|
|
846
|
-
* `short`/`brief` → `simple`). Returns `undefined` for anything else so
|
|
847
|
-
* the caller can reject unknown input without throwing.
|
|
848
|
-
*/
|
|
849
|
-
declare function normalizeToolResultRenderMode(value: unknown): ToolResultRenderMode | undefined;
|
|
850
|
-
/**
|
|
851
|
-
* Look up the result-render mode for `toolName` from a config map. Falls
|
|
852
|
-
* back to the default `'extend'` when the map is missing the entry.
|
|
853
|
-
*/
|
|
854
|
-
declare function resolveToolResultRenderMode(modes: ToolResultRenderModeConfig | undefined, toolName: string): ToolResultRenderMode;
|
|
855
|
-
/**
|
|
856
|
-
* Subset of {@link import('../registry/tool-registry.js').ToolRegistry}
|
|
857
|
-
* the result-render-mode setters need. Decouples this module from the
|
|
858
|
-
* concrete registry class so it can be reused by tests and by tools
|
|
859
|
-
* that wrap their own registry.
|
|
860
|
-
*/
|
|
861
|
-
interface ToolResultRenderModeRegistryLike {
|
|
862
|
-
get(name: string): Tool | undefined;
|
|
863
|
-
setResultRenderMode?(name: string, mode: ToolResultRenderMode): boolean;
|
|
864
|
-
applyResultRenderModes?(modes?: ToolResultRenderModeConfig): {
|
|
865
|
-
applied: number;
|
|
866
|
-
missing: string[];
|
|
867
|
-
};
|
|
868
|
-
getResultRenderMode?(name: string): ToolResultRenderMode;
|
|
869
|
-
}
|
|
870
|
-
/**
|
|
871
|
-
* Set a single tool's result-render mode on a registry. Prefers the
|
|
872
|
-
* registry's native accessor (so it can update any internal state, e.g.
|
|
873
|
-
* usage caches); falls back to a no-op so callers stay decoupled from
|
|
874
|
-
* the registry implementation.
|
|
875
|
-
*/
|
|
876
|
-
declare function setToolResultRenderMode(registry: ToolResultRenderModeRegistryLike, name: string, mode: ToolResultRenderMode): boolean;
|
|
877
|
-
/**
|
|
878
|
-
* Look up the current result-render mode for a single tool. Returns the
|
|
879
|
-
* registry's view if it has one, otherwise the default. This is what the
|
|
880
|
-
* tool-executor calls on each tool invocation to decide whether the next
|
|
881
|
-
* `writeToolResult` should be `simple` or `extend`.
|
|
882
|
-
*/
|
|
883
|
-
declare function getToolResultRenderMode(registry: ToolResultRenderModeRegistryLike, name: string): ToolResultRenderMode;
|
|
884
|
-
/**
|
|
885
|
-
* Bulk-apply a config map (`tools.resultRenderMode`) to a registry.
|
|
886
|
-
* Mirrors {@link import('./tool-description-mode.js').applyToolDescriptionModes}
|
|
887
|
-
* for symmetry with the LLM-side description mode.
|
|
888
|
-
*/
|
|
889
|
-
declare function applyToolResultRenderModes(registry: ToolResultRenderModeRegistryLike, modes?: ToolResultRenderModeConfig): {
|
|
890
|
-
applied: number;
|
|
891
|
-
missing: string[];
|
|
892
|
-
};
|
|
893
|
-
|
|
894
|
-
interface ToolWireDefinitionLike {
|
|
895
|
-
name: string;
|
|
896
|
-
description?: string | undefined;
|
|
897
|
-
inputSchema: unknown;
|
|
898
|
-
}
|
|
899
|
-
interface CompactToolDefinitionForWireOptions {
|
|
900
|
-
/** Top-level tool description budget. */
|
|
901
|
-
descriptionMaxChars?: number | undefined;
|
|
902
|
-
/** Per-JSON-Schema `description` annotation budget. */
|
|
903
|
-
schemaDescriptionMaxChars?: number | undefined;
|
|
904
|
-
}
|
|
905
|
-
interface CompactWireToolDefinition {
|
|
906
|
-
name: string;
|
|
907
|
-
description: string;
|
|
908
|
-
inputSchema: Record<string, unknown>;
|
|
909
|
-
}
|
|
910
|
-
/**
|
|
911
|
-
* Return the provider-wire version of a tool definition.
|
|
912
|
-
*
|
|
913
|
-
* Tool schemas remain structurally intact: validation keywords, property
|
|
914
|
-
* names, required fields, enum values, and nested shapes are preserved. The
|
|
915
|
-
* only reduction is on human prose annotations (`description`), which are the
|
|
916
|
-
* largest repeated cost in provider tool declarations.
|
|
917
|
-
*/
|
|
918
|
-
declare function compactToolDefinitionForWire(tool: ToolWireDefinitionLike, opts?: CompactToolDefinitionForWireOptions): CompactWireToolDefinition;
|
|
919
|
-
declare function compactSchemaDescriptions(schema: unknown, maxDescriptionChars?: number): Record<string, unknown>;
|
|
920
|
-
|
|
921
|
-
export { type AtomicWriteOptions, type BuildChildEnvOptions, COMPLETED_WORK_LEDGER_MARKER, type CoercionResult, type CompactToolDefinitionForWireOptions, type CompactWireToolDefinition, type CompileFail, type CompileResult, DEFAULT_TOOL_DESCRIPTION_MODE, DEFAULT_TOOL_RESULT_RENDER_MODE, type DeepMergeOptions, FORBIDDEN_PROTO_KEYS, type FileLockOptions, type JsonObject, type JsonPath, type JsonPathSegment, type MessageRepairReport, type MessageRepairResult, type NewlineStyle, type OutputLineGuard, type RecordCompletedWorkInput, type RecordToolOutputEvidenceInput, type RequestTokenBreakdown, type SafeParseResult, type ToolDescriptionRegistryLike, type ToolOutputSerializerOptions, type ToolResultRenderModeRegistryLike, type ToolWireDefinitionLike, type UnifiedDiffOptions, type ValidationError, type ValidationResult, applyToolDescriptionModeToTool, applyToolDescriptionModes, applyToolResultRenderModes, assertNever, assertNotPrivateHost, atomicWrite, buildChildEnv, buildCompletedWorkLedgerBlock, buildContextEvidenceDigest, coerceAgainstSchema, color, compactSchemaDescriptions, compactToolDefinitionForWire, compileGlob, compileUserRegex, completePartialObject, computeMessageTokens, createContextEvidenceState, createToolOutputSerializer, deepMerge, detectNewlineStyle, ensureDir, escapeGlobSubject, estimateMessageTokens, estimateRequestTokens, estimateRequestTokensCalibrated, estimateTextTokens, estimateToolDefTokens, estimateToolInputTokens, estimateToolResultTokens, expandGlob, expandIPv6, formatCompletedWorkLedger, formatTodosList, getCalibrationState, getJsonPath, getTermSize, getToolDescriptionMode, getToolResultRenderMode, hasOpenTodos, isInteractive, isJsonObject, isPathSubjectKey, isPrimitiveArray, isPrivateIPv4, isPrivateIPv6, isStdinTTY, isStdoutTTY, isUlid, jsonObjectFileExists, markAssistantReferencedEvidence, matchAny, matchGlob, mergeCustomModelDefs, mergeModelsPayload, normalizePathSubject, normalizeToLf, normalizeToolDescriptionMode, normalizeToolResultRenderMode, onResize, readJsonObjectFile, recordActualUsage, recordCompletedWorkEvidence, recordToolOutputEvidence, recordUserIntentEvidence, removeJsonPath, removeJsonPathInFile, repairToolUseAdjacency, repeatedReadPressure, resetCalibration, resolveToolDescriptionMode, resolveToolResultRenderMode, safeParse, safeStringify, sanitizeJsonString, sanitizeNodeOptions, sessionScopedPath, setJsonPath, setJsonPathInFile, setOutputLineGuard, setRawMode, setToolDescriptionMode, setToolResultRenderMode, simplifyToolDescription, sleep, slugify, stripAnsi, stripCodeFences, subjectForToolInput, syncCompletedWorkLedgerBlock, toStyle, truncate, ulid, unifiedDiff, updateJsonObjectFile, validateAgainstSchema, withFileLock, writeErr, writeJsonObjectFile, writeOut };
|
|
11
|
+
export * from './expect-defined.js';
|
|
12
|
+
export { expandGlob } from './glob-expand.js';
|
|
13
|
+
export * from './glob-match.js';
|
|
14
|
+
export { assertNotPrivateHost, expandIPv6, isPrivateIPv4, isPrivateIPv6 } from './ip-guard.js';
|
|
15
|
+
export { completePartialObject } from './json-repair.js';
|
|
16
|
+
export { type CoercionResult, type ValidationError, type ValidationResult, coerceAgainstSchema, validateAgainstSchema, } from './json-schema-validate.js';
|
|
17
|
+
export { mergeCustomModelDefs } from './merge-custom-models.js';
|
|
18
|
+
export { mergeModelsPayload } from './merge-models-payload.js';
|
|
19
|
+
export { type MessageRepairReport, type MessageRepairResult, repairToolUseAdjacency, } from './message-invariants.js';
|
|
20
|
+
export * from './newline-normalize.js';
|
|
21
|
+
export { type CompileFail, type CompileResult, compileUserRegex } from './regex-guard.js';
|
|
22
|
+
export * from './safe-json.js';
|
|
23
|
+
export { sessionScopedPath } from './session-scoped-path.js';
|
|
24
|
+
export { slugify } from './slug.js';
|
|
25
|
+
export { ulid, isUlid } from './ulid.js';
|
|
26
|
+
export * from './sleep.js';
|
|
27
|
+
export * from './string.js';
|
|
28
|
+
export * from './task-format.js';
|
|
29
|
+
export * from './term.js';
|
|
30
|
+
export * from './todos-format.js';
|
|
31
|
+
export * from './tool-subject.js';
|
|
32
|
+
export { computeMessageTokens, estimateMessageTokens, estimateRequestTokens, estimateRequestTokensCalibrated, estimateTextTokens, estimateToolDefTokens, estimateToolInputTokens, estimateToolResultTokens, getCalibrationState, type RequestTokenBreakdown, recordActualUsage, resetCalibration, } from './token-estimate.js';
|
|
33
|
+
export { createToolOutputSerializer, type ToolOutputSerializerOptions, } from './tool-output-serializer.js';
|
|
34
|
+
export { DEFAULT_TOOL_DESCRIPTION_MODE, applyToolDescriptionModeToTool, applyToolDescriptionModes, getToolDescriptionMode, normalizeToolDescriptionMode, resolveToolDescriptionMode, setToolDescriptionMode, simplifyToolDescription, type ToolDescriptionRegistryLike, } from './tool-description-mode.js';
|
|
35
|
+
export { DEFAULT_TOOL_RESULT_RENDER_MODE, applyToolResultRenderModes, getToolResultRenderMode, normalizeToolResultRenderMode, resolveToolResultRenderMode, setToolResultRenderMode, type ToolResultRenderModeRegistryLike, } from './tool-result-render-mode.js';
|
|
36
|
+
export { type CompactToolDefinitionForWireOptions, type CompactWireToolDefinition, compactSchemaDescriptions, compactToolDefinitionForWire, type ToolWireDefinitionLike, } from './tool-wire-compact.js';
|
|
37
|
+
export * from './wstack-paths.js';
|
|
38
|
+
//# sourceMappingURL=index.d.ts.map
|