@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/execution/index.js
CHANGED
|
@@ -1,25 +1,20 @@
|
|
|
1
|
-
import { randomUUID, randomInt, createHash, randomBytes } from 'crypto';
|
|
2
|
-
import * as fs from 'fs/promises';
|
|
3
|
-
import * as path3 from 'path';
|
|
4
|
-
import * as os from 'os';
|
|
5
|
-
import { readFileSync, statSync, existsSync } from 'fs';
|
|
6
|
-
import { fileURLToPath } from 'url';
|
|
7
|
-
import { execFile } from 'child_process';
|
|
8
|
-
import { promisify, isDeepStrictEqual } from 'util';
|
|
9
|
-
import { EventEmitter } from 'events';
|
|
10
|
-
|
|
11
1
|
// src/utils/assert-never.ts
|
|
12
2
|
function assertNever(x, message) {
|
|
13
3
|
const err = new Error(
|
|
14
|
-
`Unhandled case: ${JSON.stringify(x)}`
|
|
4
|
+
message ?? `Unhandled case: ${JSON.stringify(x)}`
|
|
15
5
|
);
|
|
16
6
|
err.name = "AssertNeverError";
|
|
17
7
|
throw err;
|
|
18
8
|
}
|
|
9
|
+
|
|
10
|
+
// src/utils/atomic-write.ts
|
|
11
|
+
import { randomBytes } from "node:crypto";
|
|
12
|
+
import * as fs from "node:fs/promises";
|
|
13
|
+
import * as path from "node:path";
|
|
19
14
|
async function atomicWrite(targetPath, content, opts = {}) {
|
|
20
|
-
const dir =
|
|
15
|
+
const dir = path.dirname(targetPath);
|
|
21
16
|
await fs.mkdir(dir, { recursive: true });
|
|
22
|
-
const tmp =
|
|
17
|
+
const tmp = path.join(dir, `.${path.basename(targetPath)}.${randomBytes(6).toString("hex")}.tmp`);
|
|
23
18
|
try {
|
|
24
19
|
if (typeof content === "string") {
|
|
25
20
|
await fs.writeFile(tmp, content, { flag: "wx", encoding: opts.encoding ?? "utf8" });
|
|
@@ -81,11 +76,13 @@ async function renameWithRetry(from, to) {
|
|
|
81
76
|
if (!code || !TRANSIENT_RENAME_CODES.has(code) || i === delays.length) {
|
|
82
77
|
throw err;
|
|
83
78
|
}
|
|
84
|
-
await new Promise((
|
|
79
|
+
await new Promise((resolve4) => setTimeout(resolve4, delays[i]));
|
|
85
80
|
}
|
|
86
81
|
}
|
|
87
82
|
throw lastErr;
|
|
88
83
|
}
|
|
84
|
+
|
|
85
|
+
// src/utils/context-evidence.ts
|
|
89
86
|
var MAX_DIGEST_CHARS = 4e3;
|
|
90
87
|
function createContextEvidenceState() {
|
|
91
88
|
return {
|
|
@@ -170,7 +167,7 @@ function toErrorMessage(err) {
|
|
|
170
167
|
// src/utils/expect-defined.ts
|
|
171
168
|
function expectDefined(value, label) {
|
|
172
169
|
if (value === null || value === void 0) {
|
|
173
|
-
const err = new Error("Expected value to be defined");
|
|
170
|
+
const err = new Error(label ? `Expected ${label} to be defined` : "Expected value to be defined");
|
|
174
171
|
err.name = "ExpectDefinedError";
|
|
175
172
|
throw err;
|
|
176
173
|
}
|
|
@@ -184,10 +181,10 @@ function validateAgainstSchema(value, schema) {
|
|
|
184
181
|
return { ok: errors.length === 0, errors };
|
|
185
182
|
}
|
|
186
183
|
var MAX_SCHEMA_DEPTH = 64;
|
|
187
|
-
function walk(value, schema,
|
|
184
|
+
function walk(value, schema, path11, errors, depth) {
|
|
188
185
|
if (depth > MAX_SCHEMA_DEPTH) {
|
|
189
186
|
errors.push({
|
|
190
|
-
path:
|
|
187
|
+
path: path11 || "<root>",
|
|
191
188
|
message: `schema nesting exceeds maximum depth (${MAX_SCHEMA_DEPTH})`
|
|
192
189
|
});
|
|
193
190
|
return;
|
|
@@ -195,7 +192,7 @@ function walk(value, schema, path12, errors, depth) {
|
|
|
195
192
|
if (schema.enum !== void 0) {
|
|
196
193
|
if (!enumIncludes(schema.enum, value)) {
|
|
197
194
|
errors.push({
|
|
198
|
-
path:
|
|
195
|
+
path: path11 || "<root>",
|
|
199
196
|
message: `expected one of ${JSON.stringify(schema.enum)}, got ${JSON.stringify(value)}`
|
|
200
197
|
});
|
|
201
198
|
return;
|
|
@@ -204,7 +201,7 @@ function walk(value, schema, path12, errors, depth) {
|
|
|
204
201
|
if (typeof schema.type === "string") {
|
|
205
202
|
if (!checkType(value, schema.type)) {
|
|
206
203
|
errors.push({
|
|
207
|
-
path:
|
|
204
|
+
path: path11 || "<root>",
|
|
208
205
|
message: `expected ${schema.type}, got ${describeType(value)} (${previewValue(value)})`
|
|
209
206
|
});
|
|
210
207
|
return;
|
|
@@ -216,7 +213,7 @@ function walk(value, schema, path12, errors, depth) {
|
|
|
216
213
|
if (!(req in obj)) {
|
|
217
214
|
const expected = schema.properties?.[req]?.type;
|
|
218
215
|
errors.push({
|
|
219
|
-
path: joinPath(
|
|
216
|
+
path: joinPath(path11, req),
|
|
220
217
|
message: `required property missing${typeof expected === "string" ? ` (expected ${expected})` : ""}`
|
|
221
218
|
});
|
|
222
219
|
}
|
|
@@ -224,14 +221,14 @@ function walk(value, schema, path12, errors, depth) {
|
|
|
224
221
|
if (schema.properties) {
|
|
225
222
|
for (const [key, subSchema] of Object.entries(schema.properties)) {
|
|
226
223
|
if (key in obj) {
|
|
227
|
-
walk(obj[key], subSchema, joinPath(
|
|
224
|
+
walk(obj[key], subSchema, joinPath(path11, key), errors, depth + 1);
|
|
228
225
|
}
|
|
229
226
|
}
|
|
230
227
|
}
|
|
231
228
|
}
|
|
232
229
|
if (schema.type === "array" && Array.isArray(value) && schema.items) {
|
|
233
230
|
for (let i = 0; i < value.length; i++) {
|
|
234
|
-
walk(value[i], schema.items, `${
|
|
231
|
+
walk(value[i], schema.items, `${path11}[${i}]`, errors, depth + 1);
|
|
235
232
|
}
|
|
236
233
|
}
|
|
237
234
|
}
|
|
@@ -508,6 +505,9 @@ function safeParse(input, maxBytes = 5e6) {
|
|
|
508
505
|
function slugify(name, fallback = "prompt", maxLen = 64) {
|
|
509
506
|
return name.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, maxLen).replace(/-+$/g, "") || fallback;
|
|
510
507
|
}
|
|
508
|
+
|
|
509
|
+
// src/utils/ulid.ts
|
|
510
|
+
import { randomBytes as randomBytes2 } from "node:crypto";
|
|
511
511
|
var ENCODING = "0123456789ABCDEFGHJKMNPQRSTVWXYZ";
|
|
512
512
|
var ENCODING_LEN = ENCODING.length;
|
|
513
513
|
var TIME_LEN = 10;
|
|
@@ -523,7 +523,7 @@ function encodeTime(now, len) {
|
|
|
523
523
|
return str;
|
|
524
524
|
}
|
|
525
525
|
function encodeRandom(len) {
|
|
526
|
-
const bytes =
|
|
526
|
+
const bytes = randomBytes2(len);
|
|
527
527
|
let str = "";
|
|
528
528
|
for (let i = 0; i < len; i++) {
|
|
529
529
|
str += ENCODING[bytes[i] % ENCODING_LEN];
|
|
@@ -536,7 +536,7 @@ function ulid(seedTime = Date.now()) {
|
|
|
536
536
|
|
|
537
537
|
// src/utils/sleep.ts
|
|
538
538
|
function sleep(ms) {
|
|
539
|
-
return new Promise((
|
|
539
|
+
return new Promise((resolve4) => setTimeout(resolve4, ms));
|
|
540
540
|
}
|
|
541
541
|
|
|
542
542
|
// src/utils/string.ts
|
|
@@ -1498,12 +1498,17 @@ function normalizeToolResultRenderMode(value) {
|
|
|
1498
1498
|
function resolveToolResultRenderMode(modes, toolName) {
|
|
1499
1499
|
return normalizeToolResultRenderMode(modes?.[toolName]) ?? DEFAULT_TOOL_RESULT_RENDER_MODE;
|
|
1500
1500
|
}
|
|
1501
|
+
|
|
1502
|
+
// src/utils/wstack-paths.ts
|
|
1503
|
+
import { createHash } from "node:crypto";
|
|
1504
|
+
import * as os from "node:os";
|
|
1505
|
+
import * as path2 from "node:path";
|
|
1501
1506
|
function projectHash(absRoot) {
|
|
1502
|
-
return createHash("sha256").update(
|
|
1507
|
+
return createHash("sha256").update(path2.resolve(absRoot)).digest("hex").slice(0, 12);
|
|
1503
1508
|
}
|
|
1504
1509
|
function projectSlug(absRoot) {
|
|
1505
|
-
const base = slugify2(
|
|
1506
|
-
const hash = createHash("sha256").update(
|
|
1510
|
+
const base = slugify2(path2.basename(absRoot));
|
|
1511
|
+
const hash = createHash("sha256").update(path2.resolve(absRoot)).digest("hex").slice(0, 6);
|
|
1507
1512
|
return `${base}-${hash}`;
|
|
1508
1513
|
}
|
|
1509
1514
|
function slugify2(name) {
|
|
@@ -1511,61 +1516,61 @@ function slugify2(name) {
|
|
|
1511
1516
|
}
|
|
1512
1517
|
function wstackGlobalRoot() {
|
|
1513
1518
|
const fromEnv = process.env["WRONGSTACK_HOME"];
|
|
1514
|
-
if (fromEnv && fromEnv.trim().length > 0) return
|
|
1515
|
-
return
|
|
1519
|
+
if (fromEnv && fromEnv.trim().length > 0) return path2.resolve(fromEnv);
|
|
1520
|
+
return path2.join(os.homedir(), ".wrongstack");
|
|
1516
1521
|
}
|
|
1517
1522
|
function resolveWstackPaths(opts) {
|
|
1518
|
-
const globalRoot = opts.globalRoot ?? (opts.userHome ?
|
|
1523
|
+
const globalRoot = opts.globalRoot ?? (opts.userHome ? path2.join(opts.userHome, ".wrongstack") : wstackGlobalRoot());
|
|
1519
1524
|
const homeDir = opts.userHome ?? os.homedir();
|
|
1520
1525
|
const hash = projectHash(opts.projectRoot);
|
|
1521
1526
|
const slug = projectSlug(opts.projectRoot);
|
|
1522
|
-
const projectDir =
|
|
1527
|
+
const projectDir = path2.join(globalRoot, "projects", slug);
|
|
1523
1528
|
return {
|
|
1524
1529
|
globalRoot,
|
|
1525
1530
|
projectRoot: opts.projectRoot,
|
|
1526
1531
|
homeDir,
|
|
1527
1532
|
configDir: globalRoot,
|
|
1528
|
-
globalConfig:
|
|
1529
|
-
secretsKey:
|
|
1530
|
-
globalMemory:
|
|
1531
|
-
globalSkills:
|
|
1532
|
-
globalClaudeSkills:
|
|
1533
|
-
globalDesignKits:
|
|
1534
|
-
globalPrompts:
|
|
1535
|
-
globalInstructions:
|
|
1536
|
-
promptUsage:
|
|
1537
|
-
cacheDir:
|
|
1538
|
-
modelsCache:
|
|
1539
|
-
modelsOverlayCache:
|
|
1540
|
-
historyFile:
|
|
1541
|
-
logFile:
|
|
1533
|
+
globalConfig: path2.join(globalRoot, "config.json"),
|
|
1534
|
+
secretsKey: path2.join(globalRoot, ".key"),
|
|
1535
|
+
globalMemory: path2.join(globalRoot, "memory.md"),
|
|
1536
|
+
globalSkills: path2.join(globalRoot, "skills"),
|
|
1537
|
+
globalClaudeSkills: path2.join(homeDir, ".claude", "skills"),
|
|
1538
|
+
globalDesignKits: path2.join(globalRoot, "design-kits"),
|
|
1539
|
+
globalPrompts: path2.join(globalRoot, "prompts"),
|
|
1540
|
+
globalInstructions: path2.join(globalRoot, "instructions"),
|
|
1541
|
+
promptUsage: path2.join(globalRoot, "prompt-usage.json"),
|
|
1542
|
+
cacheDir: path2.join(globalRoot, "cache"),
|
|
1543
|
+
modelsCache: path2.join(globalRoot, "cache", "models.dev.json"),
|
|
1544
|
+
modelsOverlayCache: path2.join(globalRoot, "cache", "models-overlay.json"),
|
|
1545
|
+
historyFile: path2.join(globalRoot, "history"),
|
|
1546
|
+
logFile: path2.join(globalRoot, "logs", "wrongstack.log"),
|
|
1542
1547
|
projectDir,
|
|
1543
|
-
projectCodebaseIndex:
|
|
1544
|
-
projectMemory:
|
|
1545
|
-
projectSessions:
|
|
1546
|
-
projectTrust:
|
|
1547
|
-
projectMeta:
|
|
1548
|
-
projectLocalConfig:
|
|
1549
|
-
inProjectConfig:
|
|
1550
|
-
inProjectAgentsFile:
|
|
1551
|
-
inProjectSkills:
|
|
1552
|
-
inProjectClaudeSkills:
|
|
1553
|
-
inProjectPrompts:
|
|
1554
|
-
inProjectInstructions:
|
|
1555
|
-
inProjectDesignKits:
|
|
1556
|
-
inProjectWorktrees:
|
|
1548
|
+
projectCodebaseIndex: path2.join(projectDir, "codebase-index"),
|
|
1549
|
+
projectMemory: path2.join(projectDir, "memory.md"),
|
|
1550
|
+
projectSessions: path2.join(projectDir, "sessions"),
|
|
1551
|
+
projectTrust: path2.join(projectDir, "trust.json"),
|
|
1552
|
+
projectMeta: path2.join(projectDir, "meta.json"),
|
|
1553
|
+
projectLocalConfig: path2.join(projectDir, "config.local.json"),
|
|
1554
|
+
inProjectConfig: path2.join(opts.projectRoot, ".wrongstack", "config.json"),
|
|
1555
|
+
inProjectAgentsFile: path2.join(opts.projectRoot, ".wrongstack", "AGENTS.md"),
|
|
1556
|
+
inProjectSkills: path2.join(opts.projectRoot, ".wrongstack", "skills"),
|
|
1557
|
+
inProjectClaudeSkills: path2.join(opts.projectRoot, ".claude", "skills"),
|
|
1558
|
+
inProjectPrompts: path2.join(opts.projectRoot, ".wrongstack", "prompts"),
|
|
1559
|
+
inProjectInstructions: path2.join(opts.projectRoot, ".wrongstack", "instructions"),
|
|
1560
|
+
inProjectDesignKits: path2.join(opts.projectRoot, ".wrongstack", "design-kits"),
|
|
1561
|
+
inProjectWorktrees: path2.join(opts.projectRoot, ".wrongstack", "worktrees"),
|
|
1557
1562
|
projectHash: hash,
|
|
1558
1563
|
projectSlug: slug,
|
|
1559
|
-
projectGoal:
|
|
1560
|
-
projectInputHistory:
|
|
1561
|
-
projectSpecs:
|
|
1562
|
-
projectTaskGraphs:
|
|
1563
|
-
projectSddSession:
|
|
1564
|
-
projectPlan:
|
|
1565
|
-
projectAutophase:
|
|
1566
|
-
projectSddBoards:
|
|
1567
|
-
syncConfig:
|
|
1568
|
-
projectStatus: (projectHash2) =>
|
|
1564
|
+
projectGoal: path2.join(projectDir, "goal.json"),
|
|
1565
|
+
projectInputHistory: path2.join(projectDir, "input-history.json"),
|
|
1566
|
+
projectSpecs: path2.join(projectDir, "specs"),
|
|
1567
|
+
projectTaskGraphs: path2.join(projectDir, "task-graphs"),
|
|
1568
|
+
projectSddSession: path2.join(projectDir, "sdd-session.json"),
|
|
1569
|
+
projectPlan: path2.join(projectDir, "plan.json"),
|
|
1570
|
+
projectAutophase: path2.join(projectDir, "autophase"),
|
|
1571
|
+
projectSddBoards: path2.join(projectDir, "sdd-boards"),
|
|
1572
|
+
syncConfig: path2.join(globalRoot, "sync.json"),
|
|
1573
|
+
projectStatus: (projectHash2) => path2.join(globalRoot, "projects", projectHash2, "status.json")
|
|
1569
1574
|
};
|
|
1570
1575
|
}
|
|
1571
1576
|
|
|
@@ -2238,6 +2243,11 @@ var AutonomousRunner = class {
|
|
|
2238
2243
|
this.stopped = true;
|
|
2239
2244
|
}
|
|
2240
2245
|
};
|
|
2246
|
+
|
|
2247
|
+
// src/utils/instruction-file.ts
|
|
2248
|
+
import { readFileSync, statSync } from "node:fs";
|
|
2249
|
+
import * as path3 from "node:path";
|
|
2250
|
+
import { fileURLToPath } from "node:url";
|
|
2241
2251
|
var textCache = /* @__PURE__ */ new Map();
|
|
2242
2252
|
var rootCandidates;
|
|
2243
2253
|
function readBundledInstructionText(relativePath) {
|
|
@@ -2461,6 +2471,9 @@ function extractText(result) {
|
|
|
2461
2471
|
}
|
|
2462
2472
|
return typeof r.text === "string" ? r.text : "";
|
|
2463
2473
|
}
|
|
2474
|
+
|
|
2475
|
+
// src/storage/goal-store.ts
|
|
2476
|
+
import * as fsp from "node:fs/promises";
|
|
2464
2477
|
var MAX_JOURNAL_ENTRIES = 500;
|
|
2465
2478
|
function goalFilePath(projectRoot) {
|
|
2466
2479
|
return resolveWstackPaths({ projectRoot }).projectGoal;
|
|
@@ -2469,7 +2482,7 @@ async function loadGoal(filePath, events) {
|
|
|
2469
2482
|
const t0 = Date.now();
|
|
2470
2483
|
let raw;
|
|
2471
2484
|
try {
|
|
2472
|
-
raw = await
|
|
2485
|
+
raw = await fsp.readFile(filePath, "utf8");
|
|
2473
2486
|
} catch (err) {
|
|
2474
2487
|
const code = err.code;
|
|
2475
2488
|
if (code === "ENOENT") {
|
|
@@ -3231,6 +3244,12 @@ var DESIGN_STACKS = ["web", "react-native", "flutter", "swiftui", "compose"];
|
|
|
3231
3244
|
function isDesignStack(v) {
|
|
3232
3245
|
return DESIGN_STACKS.includes(v);
|
|
3233
3246
|
}
|
|
3247
|
+
|
|
3248
|
+
// src/execution/design-kit-loader.ts
|
|
3249
|
+
import { existsSync } from "node:fs";
|
|
3250
|
+
import * as fs2 from "node:fs/promises";
|
|
3251
|
+
import * as path4 from "node:path";
|
|
3252
|
+
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
3234
3253
|
var KIT_FILE = "KIT.md";
|
|
3235
3254
|
var TOKENS_FILE = "tokens.json";
|
|
3236
3255
|
var FOUNDATIONS_ID = "_foundations";
|
|
@@ -3337,15 +3356,15 @@ var DefaultDesignKitLoader = class {
|
|
|
3337
3356
|
for (const { dir, source } of this.dirs) {
|
|
3338
3357
|
let entries;
|
|
3339
3358
|
try {
|
|
3340
|
-
entries = await
|
|
3359
|
+
entries = await fs2.readdir(dir, { withFileTypes: true });
|
|
3341
3360
|
} catch {
|
|
3342
3361
|
continue;
|
|
3343
3362
|
}
|
|
3344
3363
|
for (const e of entries) {
|
|
3345
3364
|
if (!e.isDirectory()) continue;
|
|
3346
|
-
const kitFile =
|
|
3365
|
+
const kitFile = path4.join(dir, e.name, KIT_FILE);
|
|
3347
3366
|
try {
|
|
3348
|
-
const raw = await
|
|
3367
|
+
const raw = await fs2.readFile(kitFile, "utf8");
|
|
3349
3368
|
const fm = parseKitFrontmatter(raw);
|
|
3350
3369
|
const id = fm.id ?? e.name;
|
|
3351
3370
|
if (!fm.name) continue;
|
|
@@ -3406,7 +3425,7 @@ var DefaultDesignKitLoader = class {
|
|
|
3406
3425
|
if (cached !== void 0) return cached;
|
|
3407
3426
|
const m = await this.find(id);
|
|
3408
3427
|
if (!m) throw new Error(`Design kit "${id}" not found`);
|
|
3409
|
-
const raw = await
|
|
3428
|
+
const raw = await fs2.readFile(m.path, "utf8");
|
|
3410
3429
|
const body = narrowStackSections(stripFrontmatter(raw), stack);
|
|
3411
3430
|
this.bodyCache.set(key, body);
|
|
3412
3431
|
return body;
|
|
@@ -3417,9 +3436,9 @@ var DefaultDesignKitLoader = class {
|
|
|
3417
3436
|
const m = await this.find(id);
|
|
3418
3437
|
let tokens;
|
|
3419
3438
|
if (m) {
|
|
3420
|
-
const tokensPath =
|
|
3439
|
+
const tokensPath = path4.join(path4.dirname(m.path), TOKENS_FILE);
|
|
3421
3440
|
try {
|
|
3422
|
-
const raw = await
|
|
3441
|
+
const raw = await fs2.readFile(tokensPath, "utf8");
|
|
3423
3442
|
const parsed = JSON.parse(raw);
|
|
3424
3443
|
tokens = parsed;
|
|
3425
3444
|
} catch {
|
|
@@ -3444,12 +3463,12 @@ var DefaultDesignKitLoader = class {
|
|
|
3444
3463
|
};
|
|
3445
3464
|
function resolveBundledDesignKitsDir() {
|
|
3446
3465
|
try {
|
|
3447
|
-
const here =
|
|
3466
|
+
const here = path4.dirname(fileURLToPath2(import.meta.url));
|
|
3448
3467
|
const candidates = [
|
|
3449
|
-
|
|
3450
|
-
|
|
3451
|
-
|
|
3452
|
-
|
|
3468
|
+
path4.join(here, "design-kits"),
|
|
3469
|
+
path4.join(here, "..", "design-kits"),
|
|
3470
|
+
path4.join(here, "..", "..", "design-kits"),
|
|
3471
|
+
path4.join(here, "..", "..", "..", "design-kits")
|
|
3453
3472
|
];
|
|
3454
3473
|
for (const c of candidates) {
|
|
3455
3474
|
if (existsSync(c)) return c;
|
|
@@ -3474,9 +3493,14 @@ function getDesignKitLoader(projectRoot) {
|
|
|
3474
3493
|
function _resetDesignKitLoaderMemo() {
|
|
3475
3494
|
loaderMemo.clear();
|
|
3476
3495
|
}
|
|
3496
|
+
|
|
3497
|
+
// src/execution/design-project-store.ts
|
|
3498
|
+
import { existsSync as existsSync2 } from "node:fs";
|
|
3499
|
+
import * as fs3 from "node:fs/promises";
|
|
3500
|
+
import * as path5 from "node:path";
|
|
3477
3501
|
var DESIGN_DIR = ".design";
|
|
3478
3502
|
function designProjectDir(projectRoot) {
|
|
3479
|
-
return
|
|
3503
|
+
return path5.join(projectRoot, DESIGN_DIR);
|
|
3480
3504
|
}
|
|
3481
3505
|
var RULE_FILES = ["rules.md", "RULES.md", "design.md"];
|
|
3482
3506
|
var rulesCache = /* @__PURE__ */ new Map();
|
|
@@ -3485,7 +3509,7 @@ async function loadProjectDesignRules(projectRoot) {
|
|
|
3485
3509
|
let rules;
|
|
3486
3510
|
for (const name of RULE_FILES) {
|
|
3487
3511
|
try {
|
|
3488
|
-
const txt = await
|
|
3512
|
+
const txt = await fs3.readFile(path5.join(designProjectDir(projectRoot), name), "utf8");
|
|
3489
3513
|
if (txt.trim()) {
|
|
3490
3514
|
rules = txt.trim();
|
|
3491
3515
|
break;
|
|
@@ -3506,7 +3530,7 @@ function parseOverrides(value) {
|
|
|
3506
3530
|
}
|
|
3507
3531
|
async function loadActiveKit(projectRoot) {
|
|
3508
3532
|
try {
|
|
3509
|
-
const raw = await
|
|
3533
|
+
const raw = await fs3.readFile(path5.join(designProjectDir(projectRoot), "active.json"), "utf8");
|
|
3510
3534
|
const parsed = JSON.parse(raw);
|
|
3511
3535
|
if (parsed && typeof parsed.kit === "string") {
|
|
3512
3536
|
return {
|
|
@@ -3539,11 +3563,11 @@ function applyTokenOverrides(tokens, overrides) {
|
|
|
3539
3563
|
}
|
|
3540
3564
|
async function ensureDesignDir(projectRoot) {
|
|
3541
3565
|
const dir = designProjectDir(projectRoot);
|
|
3542
|
-
await
|
|
3543
|
-
const gi =
|
|
3544
|
-
if (!
|
|
3566
|
+
await fs3.mkdir(dir, { recursive: true });
|
|
3567
|
+
const gi = path5.join(dir, ".gitignore");
|
|
3568
|
+
if (!existsSync2(gi)) {
|
|
3545
3569
|
try {
|
|
3546
|
-
await
|
|
3570
|
+
await fs3.writeFile(gi, "*\n");
|
|
3547
3571
|
} catch {
|
|
3548
3572
|
}
|
|
3549
3573
|
}
|
|
@@ -3554,17 +3578,17 @@ async function recordKitChoice(projectRoot, kit, stack, source, isoTime, overrid
|
|
|
3554
3578
|
const dir = await ensureDesignDir(projectRoot);
|
|
3555
3579
|
const record = { kit, stack: stack ?? null };
|
|
3556
3580
|
if (overrides && Object.keys(overrides).length > 0) record.overrides = overrides;
|
|
3557
|
-
await
|
|
3581
|
+
await fs3.writeFile(path5.join(dir, "active.json"), `${JSON.stringify(record, null, 2)}
|
|
3558
3582
|
`);
|
|
3559
3583
|
const line = `- ${isoTime} \xB7 kit=${kit}${stack ? ` stack=${stack}` : ""} \xB7 via=${source}
|
|
3560
3584
|
`;
|
|
3561
|
-
await
|
|
3585
|
+
await fs3.appendFile(path5.join(dir, "decisions.md"), line);
|
|
3562
3586
|
} catch {
|
|
3563
3587
|
}
|
|
3564
3588
|
}
|
|
3565
3589
|
async function clearPersistedActiveKit(projectRoot) {
|
|
3566
3590
|
try {
|
|
3567
|
-
await
|
|
3591
|
+
await fs3.rm(path5.join(designProjectDir(projectRoot), "active.json"), { force: true });
|
|
3568
3592
|
} catch {
|
|
3569
3593
|
}
|
|
3570
3594
|
}
|
|
@@ -3680,12 +3704,12 @@ function verifyFiles(tokens, files) {
|
|
|
3680
3704
|
const violations = [];
|
|
3681
3705
|
let onPalette = 0;
|
|
3682
3706
|
let offPalette = 0;
|
|
3683
|
-
for (const { path:
|
|
3707
|
+
for (const { path: path11, text } of files) {
|
|
3684
3708
|
const lines = text.split("\n");
|
|
3685
3709
|
lines.forEach((lineText, i) => {
|
|
3686
3710
|
const lineNo = i + 1;
|
|
3687
3711
|
const flag = (snippet, reason) => {
|
|
3688
|
-
violations.push({ file:
|
|
3712
|
+
violations.push({ file: path11, line: lineNo, snippet: snippet.slice(0, 80), reason });
|
|
3689
3713
|
};
|
|
3690
3714
|
for (const re of [HEX_RE, FUNC_COLOR_RE]) {
|
|
3691
3715
|
re.lastIndex = 0;
|
|
@@ -3845,8 +3869,8 @@ function makeDesignVerifyToolCallMiddleware() {
|
|
|
3845
3869
|
const p = typeof input?.path === "string" ? input.path : "";
|
|
3846
3870
|
if (!p || !detectFrontendFile(p)) return out;
|
|
3847
3871
|
const ctx = out.ctx;
|
|
3848
|
-
const { default: fs8 } = await import(
|
|
3849
|
-
const { default: nodePath } = await import(
|
|
3872
|
+
const { default: fs8 } = await import("node:fs/promises");
|
|
3873
|
+
const { default: nodePath } = await import("node:path");
|
|
3850
3874
|
const abs = nodePath.isAbsolute(p) ? p : nodePath.join(ctx.projectRoot, p);
|
|
3851
3875
|
const text = await fs8.readFile(abs, "utf8").catch(() => "");
|
|
3852
3876
|
if (!text) return out;
|
|
@@ -4219,6 +4243,10 @@ var DefaultErrorHandler = class {
|
|
|
4219
4243
|
return null;
|
|
4220
4244
|
}
|
|
4221
4245
|
};
|
|
4246
|
+
|
|
4247
|
+
// src/execution/eternal-autonomy.ts
|
|
4248
|
+
import { execFile } from "node:child_process";
|
|
4249
|
+
import { promisify } from "node:util";
|
|
4222
4250
|
var execFileP = promisify(execFile);
|
|
4223
4251
|
var BRAINSTORM_DONE = /* @__PURE__ */ Symbol("brainstorm-done");
|
|
4224
4252
|
var GOAL_COMPLETE_MARKER = /^\s*\[goal[_\s-]*complete\]\s*$/im;
|
|
@@ -4697,8 +4725,8 @@ ${recentJournal}` : "No prior iterations.",
|
|
|
4697
4725
|
" \u2022 When this iteration's Task is finished (real artifact / passing",
|
|
4698
4726
|
" test / applied diff / clean output), emit `[done]` on its own line.",
|
|
4699
4727
|
" \u2022 Do not stop on the first obstacle \u2014 try at least 3 distinct",
|
|
4700
|
-
" approaches before giving up. YOLO is active
|
|
4701
|
-
"
|
|
4728
|
+
" approaches before giving up. YOLO is active unless an explicit",
|
|
4729
|
+
" deny rule blocks the call.",
|
|
4702
4730
|
"",
|
|
4703
4731
|
"2. UPDATE TODO STATE (when Source is `todo`)",
|
|
4704
4732
|
" \u2022 Mark this todo `in_progress` via the todos tool before tool work.",
|
|
@@ -4805,7 +4833,7 @@ ${recentJournal}` : "No prior iterations.",
|
|
|
4805
4833
|
await saveGoal(this.goalPath, abandoned, this.opts.events);
|
|
4806
4834
|
}
|
|
4807
4835
|
try {
|
|
4808
|
-
const { unlink: unlink4 } = await import(
|
|
4836
|
+
const { unlink: unlink4 } = await import("node:fs/promises");
|
|
4809
4837
|
await unlink4(this.goalPath);
|
|
4810
4838
|
} catch {
|
|
4811
4839
|
}
|
|
@@ -5063,8 +5091,8 @@ function resolveModelRuntime(settings, reasoning, capabilities) {
|
|
|
5063
5091
|
return { reasoning: void 0, cache: void 0, parameters: void 0, warnings };
|
|
5064
5092
|
}
|
|
5065
5093
|
const reasoningField = resolveReasoningForRequest(settings, reasoning, warnings);
|
|
5066
|
-
const cacheField = resolveCacheForRequest(settings);
|
|
5067
|
-
const paramsField = resolveParametersForRequest(settings.parameters, capabilities);
|
|
5094
|
+
const cacheField = resolveCacheForRequest(settings, warnings);
|
|
5095
|
+
const paramsField = resolveParametersForRequest(settings.parameters, capabilities, warnings);
|
|
5068
5096
|
return {
|
|
5069
5097
|
reasoning: reasoningField,
|
|
5070
5098
|
cache: cacheField,
|
|
@@ -5089,7 +5117,8 @@ function resolveReasoningForRequest(settings, rc, warnings) {
|
|
|
5089
5117
|
warnings.push('reasoning "off" requested, but this model does not support disabling thinking; the setting was omitted.');
|
|
5090
5118
|
}
|
|
5091
5119
|
} else if (cfg.mode === "on") {
|
|
5092
|
-
if (!capKnown)
|
|
5120
|
+
if (!capKnown) {
|
|
5121
|
+
} else if (!supportsReasoning && rc?.default === "disabled") {
|
|
5093
5122
|
warnings.push('reasoning "on" requested, but this model has reasoning disabled by default and does not advertise support; the setting was omitted.');
|
|
5094
5123
|
} else {
|
|
5095
5124
|
out.enabled = true;
|
|
@@ -5168,6 +5197,9 @@ function applyModelRuntime(req, opts) {
|
|
|
5168
5197
|
return next;
|
|
5169
5198
|
}
|
|
5170
5199
|
|
|
5200
|
+
// src/execution/parallel-eternal-engine.ts
|
|
5201
|
+
import { randomUUID as randomUUID2 } from "node:crypto";
|
|
5202
|
+
|
|
5171
5203
|
// src/coordination/subagent-budget.ts
|
|
5172
5204
|
var TIMEOUT_PREEMPT_FRACTION = 0.85;
|
|
5173
5205
|
var DECISION_TIMEOUT_MS = 6e4;
|
|
@@ -5475,13 +5507,13 @@ var SubagentBudget = class _SubagentBudget {
|
|
|
5475
5507
|
if (!bus?.hasListenerFor("budget.threshold_reached")) {
|
|
5476
5508
|
return Promise.resolve("stop");
|
|
5477
5509
|
}
|
|
5478
|
-
return new Promise((
|
|
5510
|
+
return new Promise((resolve4) => {
|
|
5479
5511
|
let resolved = false;
|
|
5480
5512
|
const respond = (d) => {
|
|
5481
5513
|
if (resolved) return;
|
|
5482
5514
|
resolved = true;
|
|
5483
5515
|
clearTimeout(fallback);
|
|
5484
|
-
|
|
5516
|
+
resolve4(d);
|
|
5485
5517
|
};
|
|
5486
5518
|
const fallback = setTimeout(() => respond("stop"), _SubagentBudget.DECISION_TIMEOUT_MS);
|
|
5487
5519
|
const sessionId = this.currentSessionId();
|
|
@@ -5624,12 +5656,24 @@ var ToolCapabilities = {
|
|
|
5624
5656
|
SHELL_RESTRICTED: "shell.restricted",
|
|
5625
5657
|
/** Can run a restricted project formatter/linter-style command. */
|
|
5626
5658
|
SHELL_EXEC: "shell.exec",
|
|
5659
|
+
/** Can read files inside the project (and possibly outside via symlinks if not guarded). */
|
|
5660
|
+
FS_READ: "fs.read",
|
|
5627
5661
|
/** Can write / modify / delete files inside the project. */
|
|
5628
5662
|
FS_WRITE: "fs.write",
|
|
5629
5663
|
/** Can write files outside the current project root (very high risk). */
|
|
5630
5664
|
FS_WRITE_OUTSIDE_PROJECT: "fs.write.outside-project",
|
|
5665
|
+
/** Can perform outbound network requests. */
|
|
5666
|
+
NET_OUTBOUND: "net.outbound",
|
|
5667
|
+
/** Can mutate in-memory session todos only. */
|
|
5668
|
+
SESSION_TODO: "session.todo",
|
|
5669
|
+
/** Can mutate in-memory session mode only. */
|
|
5670
|
+
SESSION_MODE: "session.mode",
|
|
5671
|
+
/** Can inspect registered tool metadata. */
|
|
5672
|
+
TOOL_META: "tool.meta",
|
|
5631
5673
|
/** Can invoke arbitrary registered tools through a meta-tool. */
|
|
5632
5674
|
TOOL_MUTATE_ANY: "tool.mutate.any",
|
|
5675
|
+
/** Can read persistent memory. */
|
|
5676
|
+
MEMORY_READ: "memory.read",
|
|
5633
5677
|
/** Can write persistent memory. */
|
|
5634
5678
|
MEMORY_WRITE: "memory.write",
|
|
5635
5679
|
/** Can delete persistent memory. */
|
|
@@ -5638,6 +5682,16 @@ var ToolCapabilities = {
|
|
|
5638
5682
|
MCP_PROXY: "mcp.proxy",
|
|
5639
5683
|
/** Can spawn or manage subagents / multi-agent tasks. */
|
|
5640
5684
|
SUBAGENT_SPAWN: "subagent.spawn",
|
|
5685
|
+
/** Can inspect fleet/subagent coordination state without mutating it. */
|
|
5686
|
+
COORDINATION_FLEET_READ: "coordination.fleet.read",
|
|
5687
|
+
/** Can publish attributed, schema-checked events onto the fleet bus. */
|
|
5688
|
+
COORDINATION_FLEET_EMIT: "coordination.fleet.emit",
|
|
5689
|
+
/** Can submit a task-local structured result to the parent Director. */
|
|
5690
|
+
COORDINATION_RESULT_SUBMIT: "coordination.result.submit",
|
|
5691
|
+
/** Can read or write inter-agent mailbox messages. */
|
|
5692
|
+
COORDINATION_MAIL: "coordination.mail",
|
|
5693
|
+
/** Can schedule, inspect, or cancel in-session cron jobs. */
|
|
5694
|
+
COORDINATION_CRON: "coordination.cron",
|
|
5641
5695
|
/** Can mutate global or session configuration / trust state. */
|
|
5642
5696
|
CONFIG_MUTATE: "config.mutate",
|
|
5643
5697
|
/** Can install packages or run package managers with side effects. */
|
|
@@ -5657,6 +5711,22 @@ var DANGEROUS_FOR_SUBAGENTS = [
|
|
|
5657
5711
|
ToolCapabilities.CONFIG_MUTATE,
|
|
5658
5712
|
ToolCapabilities.PACKAGE_INSTALL
|
|
5659
5713
|
];
|
|
5714
|
+
var WIDE_SUBAGENT_CAPABILITIES = [
|
|
5715
|
+
ToolCapabilities.FS_READ,
|
|
5716
|
+
ToolCapabilities.FS_WRITE,
|
|
5717
|
+
ToolCapabilities.NET_OUTBOUND,
|
|
5718
|
+
ToolCapabilities.SESSION_TODO,
|
|
5719
|
+
ToolCapabilities.TOOL_META,
|
|
5720
|
+
ToolCapabilities.MEMORY_READ,
|
|
5721
|
+
ToolCapabilities.SHELL_ARBITRARY,
|
|
5722
|
+
ToolCapabilities.SHELL_RESTRICTED,
|
|
5723
|
+
ToolCapabilities.SHELL_EXEC,
|
|
5724
|
+
ToolCapabilities.PACKAGE_INSTALL,
|
|
5725
|
+
// Read-only fleet visibility (fleet_status) — peer awareness has no blast
|
|
5726
|
+
// radius and every fleet worker should coordinate around its peers.
|
|
5727
|
+
ToolCapabilities.COORDINATION_FLEET_READ,
|
|
5728
|
+
ToolCapabilities.COORDINATION_RESULT_SUBMIT
|
|
5729
|
+
];
|
|
5660
5730
|
function hasDangerousCapabilityForSubagents(toolOrCaps) {
|
|
5661
5731
|
if (!toolOrCaps) return false;
|
|
5662
5732
|
const input = toolOrCaps;
|
|
@@ -5990,6 +6060,12 @@ var TOOLS = {
|
|
|
5990
6060
|
/** Web research. */
|
|
5991
6061
|
research: ["read", "grep", "glob", "search", "fetch", "mailbox"]
|
|
5992
6062
|
};
|
|
6063
|
+
|
|
6064
|
+
// src/coordination/agents/agent-prompts.ts
|
|
6065
|
+
import { readFileSync as readFileSync2, statSync as statSync2 } from "node:fs";
|
|
6066
|
+
import * as os2 from "node:os";
|
|
6067
|
+
import * as path6 from "node:path";
|
|
6068
|
+
import { fileURLToPath as fileURLToPath3 } from "node:url";
|
|
5993
6069
|
var promptCache = /* @__PURE__ */ new Map();
|
|
5994
6070
|
var candidateCache = /* @__PURE__ */ new Map();
|
|
5995
6071
|
function agentPrompt(id) {
|
|
@@ -6001,7 +6077,7 @@ function agentPrompt(id) {
|
|
|
6001
6077
|
let resolved = "";
|
|
6002
6078
|
for (const dir of agentPromptDirCandidates(envDir)) {
|
|
6003
6079
|
try {
|
|
6004
|
-
resolved =
|
|
6080
|
+
resolved = readFileSync2(path6.join(dir, fileName), "utf8").trimEnd();
|
|
6005
6081
|
break;
|
|
6006
6082
|
} catch {
|
|
6007
6083
|
}
|
|
@@ -6010,20 +6086,20 @@ function agentPrompt(id) {
|
|
|
6010
6086
|
return resolved;
|
|
6011
6087
|
}
|
|
6012
6088
|
function agentPromptDirCandidates(envDir) {
|
|
6013
|
-
const globalRoot = process.env["WRONGSTACK_HOME"] ||
|
|
6089
|
+
const globalRoot = process.env["WRONGSTACK_HOME"] || path6.join(os2.homedir(), ".wrongstack");
|
|
6014
6090
|
const candKey = `${envDir}\0${globalRoot}`;
|
|
6015
6091
|
const cached = candidateCache.get(candKey);
|
|
6016
6092
|
if (cached !== void 0) return cached;
|
|
6017
|
-
const here =
|
|
6093
|
+
const here = path6.dirname(fileURLToPath3(import.meta.url));
|
|
6018
6094
|
const explicitDir = envDir || void 0;
|
|
6019
6095
|
const candidates = [
|
|
6020
|
-
...explicitDir ? [
|
|
6021
|
-
|
|
6022
|
-
|
|
6023
|
-
|
|
6024
|
-
|
|
6025
|
-
|
|
6026
|
-
|
|
6096
|
+
...explicitDir ? [path6.resolve(explicitDir)] : [],
|
|
6097
|
+
path6.join(globalRoot, "instructions", "agents"),
|
|
6098
|
+
path6.resolve(here, "../../../../instructions/agents"),
|
|
6099
|
+
path6.resolve(here, "../../../instructions/agents"),
|
|
6100
|
+
path6.resolve(here, "../../instructions/agents"),
|
|
6101
|
+
path6.resolve(here, "../instructions/agents"),
|
|
6102
|
+
path6.resolve(here, "instructions/agents")
|
|
6027
6103
|
];
|
|
6028
6104
|
const ordered = candidates.sort((a, b) => Number(!isDirectory2(a)) - Number(!isDirectory2(b)));
|
|
6029
6105
|
candidateCache.set(candKey, ordered);
|
|
@@ -6031,7 +6107,7 @@ function agentPromptDirCandidates(envDir) {
|
|
|
6031
6107
|
}
|
|
6032
6108
|
function isDirectory2(candidate) {
|
|
6033
6109
|
try {
|
|
6034
|
-
return
|
|
6110
|
+
return statSync2(candidate).isDirectory();
|
|
6035
6111
|
} catch {
|
|
6036
6112
|
return false;
|
|
6037
6113
|
}
|
|
@@ -7609,6 +7685,10 @@ async function dispatchAgent(task, opts = {}) {
|
|
|
7609
7685
|
};
|
|
7610
7686
|
}
|
|
7611
7687
|
|
|
7688
|
+
// src/coordination/multi-agent-coordinator.ts
|
|
7689
|
+
import { randomUUID } from "node:crypto";
|
|
7690
|
+
import { EventEmitter } from "node:events";
|
|
7691
|
+
|
|
7612
7692
|
// src/coordination/coordinator/error-classifier.ts
|
|
7613
7693
|
function classifySubagentError(err, hints = {}) {
|
|
7614
7694
|
if (err instanceof AgentError && err.cause) {
|
|
@@ -7689,39 +7769,63 @@ function providerErrorToSubagentError(err, message, cause) {
|
|
|
7689
7769
|
}
|
|
7690
7770
|
|
|
7691
7771
|
// src/coordination/fleet.ts
|
|
7692
|
-
|
|
7772
|
+
var AUDIT_LOG_AGENT = {
|
|
7773
|
+
id: "audit-log",
|
|
7774
|
+
name: "Audit Log",
|
|
7775
|
+
role: "audit-log",
|
|
7693
7776
|
prompt: agentPrompt("audit-log")
|
|
7694
7777
|
// No hardcoded budgets — the orchestrator (delegate tool or
|
|
7695
7778
|
// spawn_subagent) decides per-task how much room a subagent gets.
|
|
7696
7779
|
// A monorepo audit needs hours; a single-file lint check needs
|
|
7697
7780
|
// seconds. Pinning a number here forces the orchestrator to fight
|
|
7698
7781
|
// the role's default instead of just asking for what it needs.
|
|
7699
|
-
}
|
|
7700
|
-
|
|
7782
|
+
};
|
|
7783
|
+
var BUG_HUNTER_AGENT = {
|
|
7784
|
+
id: "bug-hunter",
|
|
7785
|
+
name: "Bug Hunter",
|
|
7786
|
+
role: "bug-hunter",
|
|
7701
7787
|
prompt: agentPrompt("bug-hunter")
|
|
7702
7788
|
// Budgets are set by the orchestrator per task — see fleet.ts header.
|
|
7703
|
-
}
|
|
7704
|
-
|
|
7789
|
+
};
|
|
7790
|
+
var REFACTOR_PLANNER_AGENT = {
|
|
7791
|
+
id: "refactor-planner",
|
|
7792
|
+
name: "Refactor Planner",
|
|
7793
|
+
role: "refactor-planner",
|
|
7705
7794
|
prompt: agentPrompt("refactor-planner")
|
|
7706
7795
|
// Budgets are set by the orchestrator per task — see fleet.ts header.
|
|
7707
|
-
}
|
|
7708
|
-
|
|
7796
|
+
};
|
|
7797
|
+
var SECURITY_SCANNER_AGENT = {
|
|
7798
|
+
id: "security-scanner",
|
|
7799
|
+
name: "Security Scanner",
|
|
7800
|
+
role: "security-scanner",
|
|
7709
7801
|
prompt: agentPrompt("security-scanner")
|
|
7710
7802
|
// Budgets are set by the orchestrator per task — see fleet.ts header.
|
|
7711
|
-
}
|
|
7712
|
-
|
|
7803
|
+
};
|
|
7804
|
+
var SHADOW_AGENT = {
|
|
7805
|
+
id: "shadow-agent",
|
|
7806
|
+
name: "Shadow",
|
|
7807
|
+
role: "shadow-agent",
|
|
7713
7808
|
prompt: agentPrompt("shadow-agent")
|
|
7714
7809
|
// Budgets are set by the orchestrator per task — see fleet.ts header.
|
|
7715
|
-
}
|
|
7716
|
-
|
|
7810
|
+
};
|
|
7811
|
+
var CRITIC_AGENT = {
|
|
7812
|
+
id: "critic",
|
|
7813
|
+
name: "Critic",
|
|
7814
|
+
role: "critic",
|
|
7717
7815
|
prompt: agentPrompt("critic")
|
|
7718
7816
|
// Budgets are set by the orchestrator per task — see fleet.ts header.
|
|
7719
|
-
}
|
|
7720
|
-
|
|
7817
|
+
};
|
|
7818
|
+
var FLEET_ROSTER = {
|
|
7819
|
+
"audit-log": AUDIT_LOG_AGENT,
|
|
7820
|
+
"bug-hunter": BUG_HUNTER_AGENT,
|
|
7821
|
+
"refactor-planner": REFACTOR_PLANNER_AGENT,
|
|
7822
|
+
"security-scanner": SECURITY_SCANNER_AGENT,
|
|
7823
|
+
"critic": CRITIC_AGENT,
|
|
7824
|
+
"shadow-agent": SHADOW_AGENT,
|
|
7721
7825
|
...Object.fromEntries(
|
|
7722
7826
|
ALL_AGENT_DEFINITIONS.map((d) => [d.config.role, d.config])
|
|
7723
7827
|
)
|
|
7724
|
-
}
|
|
7828
|
+
};
|
|
7725
7829
|
var DEFAULT_IDLE_TIMEOUT_MS = 15 * 60 * 1e3;
|
|
7726
7830
|
var FLEET_ROSTER_BUDGETS = {
|
|
7727
7831
|
"audit-log": { timeoutMs: 7.5 * 60 * 60 * 1e3, maxIterations: 5e3, maxToolCalls: 15e3 },
|
|
@@ -7764,6 +7868,7 @@ function applyRosterBudget(cfg) {
|
|
|
7764
7868
|
maxCostUsd: cfg.maxCostUsd ?? defaultBudget.maxCostUsd
|
|
7765
7869
|
};
|
|
7766
7870
|
}
|
|
7871
|
+
var ALL_FLEET_AGENTS = Object.values(FLEET_ROSTER);
|
|
7767
7872
|
var CLINE_AGENT = {
|
|
7768
7873
|
id: "cline",
|
|
7769
7874
|
name: "Cline",
|
|
@@ -7811,9 +7916,10 @@ FLEET_ROSTER_BUDGETS["gemini-cli"] = { timeoutMs: 10 * 60 * 60 * 1e3, maxIterati
|
|
|
7811
7916
|
FLEET_ROSTER_BUDGETS["copilot"] = { timeoutMs: 10 * 60 * 60 * 1e3, maxIterations: 8e3, maxToolCalls: 2e4 };
|
|
7812
7917
|
FLEET_ROSTER_BUDGETS["openhands"] = { timeoutMs: 10 * 60 * 60 * 1e3, maxIterations: 8e3, maxToolCalls: 2e4 };
|
|
7813
7918
|
FLEET_ROSTER_BUDGETS["goose"] = { timeoutMs: 10 * 60 * 60 * 1e3, maxIterations: 8e3, maxToolCalls: 2e4 };
|
|
7814
|
-
|
|
7919
|
+
var FLEET_ROSTER_WITHACP = {
|
|
7920
|
+
...FLEET_ROSTER,
|
|
7815
7921
|
...Object.fromEntries(ACP_AGENTS.map((a) => [a.role, a]))
|
|
7816
|
-
}
|
|
7922
|
+
};
|
|
7817
7923
|
|
|
7818
7924
|
// src/coordination/subagent-nicknames.ts
|
|
7819
7925
|
var NICKNAME_POOL = {
|
|
@@ -7872,7 +7978,7 @@ var NICKNAME_POOL = {
|
|
|
7872
7978
|
"mendeleev": { name: "Mendeleev", domain: "chemistry" }
|
|
7873
7979
|
};
|
|
7874
7980
|
var ALL_NICKNAMES = Object.entries(NICKNAME_POOL);
|
|
7875
|
-
Object.fromEntries(
|
|
7981
|
+
var NAME_TO_KEY = Object.fromEntries(
|
|
7876
7982
|
ALL_NICKNAMES.map(([key, entry]) => [entry.name, key])
|
|
7877
7983
|
);
|
|
7878
7984
|
var DOMAIN_PREFERENCES = {
|
|
@@ -8190,7 +8296,7 @@ var DefaultMultiAgentCoordinator = class _DefaultMultiAgentCoordinator extends E
|
|
|
8190
8296
|
taskIds.map((id) => {
|
|
8191
8297
|
const cached = this.completedResults.find((r) => r.taskId === id);
|
|
8192
8298
|
if (cached) return cached;
|
|
8193
|
-
return new Promise((
|
|
8299
|
+
return new Promise((resolve4, reject) => {
|
|
8194
8300
|
const timeout = setTimeout(() => {
|
|
8195
8301
|
this.off("task.completed", handler);
|
|
8196
8302
|
reject(new Error(`awaitTasks timed out waiting for task "${id}"`));
|
|
@@ -8199,7 +8305,7 @@ var DefaultMultiAgentCoordinator = class _DefaultMultiAgentCoordinator extends E
|
|
|
8199
8305
|
if (result.taskId === id) {
|
|
8200
8306
|
clearTimeout(timeout);
|
|
8201
8307
|
this.off("task.completed", handler);
|
|
8202
|
-
|
|
8308
|
+
resolve4(result);
|
|
8203
8309
|
}
|
|
8204
8310
|
};
|
|
8205
8311
|
this.on("task.completed", handler);
|
|
@@ -8224,13 +8330,13 @@ var DefaultMultiAgentCoordinator = class _DefaultMultiAgentCoordinator extends E
|
|
|
8224
8330
|
const done = new Set(completed.map((r) => r.taskId));
|
|
8225
8331
|
return { completed, pending: taskIds.filter((id) => !done.has(id)) };
|
|
8226
8332
|
}
|
|
8227
|
-
return new Promise((
|
|
8333
|
+
return new Promise((resolve4) => {
|
|
8228
8334
|
let timer;
|
|
8229
8335
|
const handler = ({ result }) => {
|
|
8230
8336
|
if (!ids.has(result.taskId)) return;
|
|
8231
8337
|
if (timer) clearTimeout(timer);
|
|
8232
8338
|
this.off("task.completed", handler);
|
|
8233
|
-
|
|
8339
|
+
resolve4({
|
|
8234
8340
|
completed: [result],
|
|
8235
8341
|
pending: taskIds.filter((id) => id !== result.taskId)
|
|
8236
8342
|
});
|
|
@@ -8238,7 +8344,7 @@ var DefaultMultiAgentCoordinator = class _DefaultMultiAgentCoordinator extends E
|
|
|
8238
8344
|
if (opts?.timeoutMs !== void 0) {
|
|
8239
8345
|
timer = setTimeout(() => {
|
|
8240
8346
|
this.off("task.completed", handler);
|
|
8241
|
-
|
|
8347
|
+
resolve4({ completed: [], pending: [...taskIds], timedOut: true });
|
|
8242
8348
|
}, opts.timeoutMs);
|
|
8243
8349
|
}
|
|
8244
8350
|
this.on("task.completed", handler);
|
|
@@ -8520,12 +8626,12 @@ var DefaultMultiAgentCoordinator = class _DefaultMultiAgentCoordinator extends E
|
|
|
8520
8626
|
}
|
|
8521
8627
|
return new Promise((resolveDecision) => {
|
|
8522
8628
|
let settled = false;
|
|
8523
|
-
const
|
|
8629
|
+
const resolve4 = (d) => {
|
|
8524
8630
|
if (settled) return;
|
|
8525
8631
|
settled = true;
|
|
8526
8632
|
resolveDecision(d);
|
|
8527
8633
|
};
|
|
8528
|
-
const fallback = setTimeout(() =>
|
|
8634
|
+
const fallback = setTimeout(() => resolve4("stop"), DECISION_TIMEOUT_MS);
|
|
8529
8635
|
const sessionId = this.currentSessionId();
|
|
8530
8636
|
budget._events?.emit("budget.threshold_reached", {
|
|
8531
8637
|
...sessionId ? { sessionId } : {},
|
|
@@ -8543,11 +8649,11 @@ var DefaultMultiAgentCoordinator = class _DefaultMultiAgentCoordinator extends E
|
|
|
8543
8649
|
// disagreeing, resolves as a stop). Async grants still resolve.
|
|
8544
8650
|
extend: (extra) => {
|
|
8545
8651
|
clearTimeout(fallback);
|
|
8546
|
-
queueMicrotask(() =>
|
|
8652
|
+
queueMicrotask(() => resolve4({ extend: extra }));
|
|
8547
8653
|
},
|
|
8548
8654
|
deny: () => {
|
|
8549
8655
|
clearTimeout(fallback);
|
|
8550
|
-
|
|
8656
|
+
resolve4("stop");
|
|
8551
8657
|
}
|
|
8552
8658
|
});
|
|
8553
8659
|
});
|
|
@@ -8683,8 +8789,9 @@ var DefaultMultiAgentCoordinator = class _DefaultMultiAgentCoordinator extends E
|
|
|
8683
8789
|
}
|
|
8684
8790
|
const subagent = this.subagents.get(result.subagentId);
|
|
8685
8791
|
if (subagent && subagent.status !== "stopped") {
|
|
8686
|
-
result.status === "failed" || result.status === "timeout";
|
|
8792
|
+
const failed = result.status === "failed" || result.status === "timeout";
|
|
8687
8793
|
subagent.status = "idle";
|
|
8794
|
+
void failed;
|
|
8688
8795
|
subagent.currentTask = void 0;
|
|
8689
8796
|
if (subagent.abortController.signal.aborted) {
|
|
8690
8797
|
subagent.abortController = new AbortController();
|
|
@@ -8833,7 +8940,7 @@ var ParallelEternalEngine = class {
|
|
|
8833
8940
|
this.state = "running";
|
|
8834
8941
|
await this.persistState("running");
|
|
8835
8942
|
const config = {
|
|
8836
|
-
coordinatorId: `parallel-${
|
|
8943
|
+
coordinatorId: `parallel-${randomUUID2().slice(0, 8)}`,
|
|
8837
8944
|
maxConcurrent: this.slots,
|
|
8838
8945
|
doneCondition: { type: "all_tasks_done" }
|
|
8839
8946
|
};
|
|
@@ -8887,7 +8994,7 @@ var ParallelEternalEngine = class {
|
|
|
8887
8994
|
}
|
|
8888
8995
|
if (!this.coordinator) {
|
|
8889
8996
|
const config = {
|
|
8890
|
-
coordinatorId: `parallel-${
|
|
8997
|
+
coordinatorId: `parallel-${randomUUID2().slice(0, 8)}`,
|
|
8891
8998
|
maxConcurrent: this.slots,
|
|
8892
8999
|
doneCondition: { type: "all_tasks_done" }
|
|
8893
9000
|
};
|
|
@@ -8961,8 +9068,7 @@ ${recentJournal}` : "No prior iterations.",
|
|
|
8961
9068
|
"\u2500\u2500 EXECUTION PROTOCOL \u2500\u2500",
|
|
8962
9069
|
"\u2022 Execute the assigned task end-to-end using multiple tool calls.",
|
|
8963
9070
|
"\u2022 Emit `[done]` on its own line when the task is complete.",
|
|
8964
|
-
"\u2022 Do not ask before
|
|
8965
|
-
"\u2022 If a destructive-gated confirmation appears, wait for the permission flow.",
|
|
9071
|
+
"\u2022 Do not ask before tool use \u2014 YOLO is active unless an explicit deny rule blocks the call.",
|
|
8966
9072
|
"\u2022 If the overall Mission is accomplished, emit `[GOAL_COMPLETE]` followed by a verification recipe.",
|
|
8967
9073
|
"\u2022 Keep output concise \u2014 summarize findings, do not transcribe files."
|
|
8968
9074
|
].join("\n");
|
|
@@ -8974,7 +9080,7 @@ ${recentJournal}` : "No prior iterations.",
|
|
|
8974
9080
|
const task = expectDefined(tasks[i]);
|
|
8975
9081
|
const route = routes[i] ?? null;
|
|
8976
9082
|
const subagentId = `parallel-${this.iterations}-${i}`;
|
|
8977
|
-
const taskId =
|
|
9083
|
+
const taskId = randomUUID2();
|
|
8978
9084
|
const personaLine = route ? `Acting agent: ${route.definition.config.name} \u2014 ${route.definition.capability.summary}
|
|
8979
9085
|
` : "";
|
|
8980
9086
|
const spec = {
|
|
@@ -9109,8 +9215,8 @@ ${personaLine}Task: ${task}
|
|
|
9109
9215
|
return tasks.length > 0 ? tasks.slice(0, this.slots) : null;
|
|
9110
9216
|
}
|
|
9111
9217
|
async readGitStatus() {
|
|
9112
|
-
const { execFile: execFile2 } = await import(
|
|
9113
|
-
const { promisify: promisify2 } = await import(
|
|
9218
|
+
const { execFile: execFile2 } = await import("node:child_process");
|
|
9219
|
+
const { promisify: promisify2 } = await import("node:util");
|
|
9114
9220
|
const execFileP2 = promisify2(execFile2);
|
|
9115
9221
|
const { stdout } = await execFileP2("git", ["status", "--porcelain"], {
|
|
9116
9222
|
cwd: this.opts.projectRoot,
|
|
@@ -9200,6 +9306,9 @@ ${lastFew}` : "No prior iterations.",
|
|
|
9200
9306
|
await saveGoal(this.goalPath, { ...current, engineState: state }, this.opts.events);
|
|
9201
9307
|
}
|
|
9202
9308
|
};
|
|
9309
|
+
|
|
9310
|
+
// src/execution/retry-policy.ts
|
|
9311
|
+
import { randomInt } from "node:crypto";
|
|
9203
9312
|
var MAX_RETRY_AFTER_MS = 6e4;
|
|
9204
9313
|
var MAX_ATTEMPTS_BY_KIND = {
|
|
9205
9314
|
rate_limit: 5,
|
|
@@ -9653,6 +9762,10 @@ Summarize the following message range:`;
|
|
|
9653
9762
|
}
|
|
9654
9763
|
};
|
|
9655
9764
|
|
|
9765
|
+
// src/execution/skill-loader.ts
|
|
9766
|
+
import * as fs4 from "node:fs/promises";
|
|
9767
|
+
import * as path7 from "node:path";
|
|
9768
|
+
|
|
9656
9769
|
// src/skills/foreign-sources.ts
|
|
9657
9770
|
var FOREIGN_SKILL_TOOLS = [
|
|
9658
9771
|
{ id: "agents", subdir: "skills" },
|
|
@@ -9768,6 +9881,56 @@ function isValidSkillNameFormat(name) {
|
|
|
9768
9881
|
|
|
9769
9882
|
// src/skills/limits.ts
|
|
9770
9883
|
var SKILL_LIMITS = {
|
|
9884
|
+
/**
|
|
9885
|
+
* Per-skill body cap when injecting a full skill body into the system prompt
|
|
9886
|
+
* (eager mode), and when returning a skill body from the `skill` tool.
|
|
9887
|
+
* ~4k tokens. Oversized bodies are truncated at a paragraph boundary.
|
|
9888
|
+
*
|
|
9889
|
+
* Consumers: `system-prompt-builder.capSkillBody`, `skill` tool body return.
|
|
9890
|
+
*/
|
|
9891
|
+
MAX_SKILL_BODY_CHARS: 16e3,
|
|
9892
|
+
/**
|
|
9893
|
+
* Per-resource cap when the `skill` tool loads a bundled file
|
|
9894
|
+
* (`scripts/`, `references/`, `assets/`). ~8k tokens.
|
|
9895
|
+
*
|
|
9896
|
+
* Consumer: `skill` tool `loadResource`.
|
|
9897
|
+
*/
|
|
9898
|
+
MAX_RESOURCE_CHARS: 32e3,
|
|
9899
|
+
/**
|
|
9900
|
+
* Maximum number of bundled resource paths the `skill` tool lists in one
|
|
9901
|
+
* response. Caps a pathological skill (huge `assets/` tree) from blowing up
|
|
9902
|
+
* the tool result.
|
|
9903
|
+
*
|
|
9904
|
+
* Consumer: `skill` tool resource listing.
|
|
9905
|
+
*/
|
|
9906
|
+
MAX_LISTED_RESOURCES: 100,
|
|
9907
|
+
/**
|
|
9908
|
+
* Max size of a single installed skill file (SKILL.md or a bundled resource).
|
|
9909
|
+
* Guards against a malicious registry skill shipping a multi-MB blob that
|
|
9910
|
+
* then flows into the prompt. 100KB.
|
|
9911
|
+
*
|
|
9912
|
+
* Consumer: `SkillInstaller.install` / `importFromDir`.
|
|
9913
|
+
*/
|
|
9914
|
+
MAX_SKILL_FILE_SIZE: 100 * 1024,
|
|
9915
|
+
/**
|
|
9916
|
+
* Max size of a GitHub tarball downloaded by the skill installer. Guards
|
|
9917
|
+
* against a repo accidentally (or maliciously) shipping a giant tarball that
|
|
9918
|
+
* would be extracted into a temp dir. 50MB.
|
|
9919
|
+
*
|
|
9920
|
+
* Consumer: `downloadGitHubTarball`.
|
|
9921
|
+
*/
|
|
9922
|
+
MAX_TARBALL_SIZE: 50 * 1024 * 1024,
|
|
9923
|
+
/**
|
|
9924
|
+
* Default total char budget for skill bodies injected in eager mode when
|
|
9925
|
+
* `config.skills.eagerMaxChars` is unset. ~6k tokens. Skills are injected
|
|
9926
|
+
* highest-priority first; once the budget is exhausted the remaining skills
|
|
9927
|
+
* are listed as a manifest the agent loads via the `skill` tool. Set very
|
|
9928
|
+
* high to effectively disable budgeting.
|
|
9929
|
+
*
|
|
9930
|
+
* Consumer: `DefaultSystemPromptBuilder.buildMemoryAndSkills` (default for
|
|
9931
|
+
* `skillEagerMaxChars`).
|
|
9932
|
+
*/
|
|
9933
|
+
EAGER_DEFAULT_MAX_CHARS: 24e3,
|
|
9771
9934
|
/**
|
|
9772
9935
|
* Auto-compact body limits (the token-saving fallback used when a skill has
|
|
9773
9936
|
* no hand-crafted `SKILL.save.md`). The Overview and Rules sections are
|
|
@@ -9777,7 +9940,24 @@ var SKILL_LIMITS = {
|
|
|
9777
9940
|
*/
|
|
9778
9941
|
COMPACT_OVERVIEW_MAX: 200,
|
|
9779
9942
|
COMPACT_RULES_MAX: 350,
|
|
9780
|
-
COMPACT_TOTAL_MAX: 450
|
|
9943
|
+
COMPACT_TOTAL_MAX: 450,
|
|
9944
|
+
/**
|
|
9945
|
+
* Max length of a skill name (agentskills.io spec). Enforced by the
|
|
9946
|
+
* frontmatter validator's format regex plus this length bound.
|
|
9947
|
+
*
|
|
9948
|
+
* Consumer: `isValidSkillNameFormat`.
|
|
9949
|
+
*/
|
|
9950
|
+
SKILL_NAME_MAX_LEN: 64,
|
|
9951
|
+
/**
|
|
9952
|
+
* Soft line limit for a SKILL.md body, per the bundled `skill-creator` rule.
|
|
9953
|
+
* Not enforced in code (a skill can exceed it) — surfaced by `/skill-gen
|
|
9954
|
+
* validate` and the `skill-creator` skill as guidance to move deep material
|
|
9955
|
+
* into `references/`.
|
|
9956
|
+
*
|
|
9957
|
+
* Consumer: `skill-creator` skill, `/skill-gen validate` advisory.
|
|
9958
|
+
*/
|
|
9959
|
+
SKILL_BODY_LINE_LIMIT: 500
|
|
9960
|
+
};
|
|
9781
9961
|
|
|
9782
9962
|
// src/execution/skill-loader.ts
|
|
9783
9963
|
function stripFrontmatter2(raw) {
|
|
@@ -9814,7 +9994,7 @@ async function entryIsDirectory(dir, entry) {
|
|
|
9814
9994
|
if (entry.isDirectory()) return true;
|
|
9815
9995
|
if (entry.isSymbolicLink()) {
|
|
9816
9996
|
try {
|
|
9817
|
-
return (await
|
|
9997
|
+
return (await fs4.stat(path7.join(dir, entry.name))).isDirectory();
|
|
9818
9998
|
} catch {
|
|
9819
9999
|
return false;
|
|
9820
10000
|
}
|
|
@@ -9835,7 +10015,7 @@ var DefaultSkillLoader = class {
|
|
|
9835
10015
|
for (const tool of FOREIGN_SKILL_TOOLS) {
|
|
9836
10016
|
if (!foreignIds.includes(tool.id)) continue;
|
|
9837
10017
|
dirs.push({
|
|
9838
|
-
dir:
|
|
10018
|
+
dir: path7.join(root, "." + tool.id, tool.subdir),
|
|
9839
10019
|
source: "foreign",
|
|
9840
10020
|
originTool: tool.id
|
|
9841
10021
|
});
|
|
@@ -9857,12 +10037,12 @@ var DefaultSkillLoader = class {
|
|
|
9857
10037
|
const seen = /* @__PURE__ */ new Set();
|
|
9858
10038
|
for (const { dir, source, originTool } of this.dirs) {
|
|
9859
10039
|
try {
|
|
9860
|
-
const entries = await
|
|
10040
|
+
const entries = await fs4.readdir(dir, { withFileTypes: true });
|
|
9861
10041
|
for (const e of entries) {
|
|
9862
10042
|
if (!await entryIsDirectory(dir, e)) continue;
|
|
9863
|
-
const skillFile =
|
|
10043
|
+
const skillFile = path7.join(dir, e.name, "SKILL.md");
|
|
9864
10044
|
try {
|
|
9865
|
-
const raw = await
|
|
10045
|
+
const raw = await fs4.readFile(skillFile, "utf8");
|
|
9866
10046
|
const fm = parseSkillFrontmatter(raw);
|
|
9867
10047
|
if (!fm.name || !fm.description) continue;
|
|
9868
10048
|
if (!isValidSkillNameFormat(fm.name)) continue;
|
|
@@ -9934,7 +10114,7 @@ var DefaultSkillLoader = class {
|
|
|
9934
10114
|
if (cached !== void 0) return cached;
|
|
9935
10115
|
const m = await this.find(name);
|
|
9936
10116
|
if (!m) throw new Error(`Skill "${name}" not found`);
|
|
9937
|
-
const body = await
|
|
10117
|
+
const body = await fs4.readFile(m.path, "utf8");
|
|
9938
10118
|
this.bodyCache.set(key, body);
|
|
9939
10119
|
return body;
|
|
9940
10120
|
}
|
|
@@ -9944,12 +10124,12 @@ var DefaultSkillLoader = class {
|
|
|
9944
10124
|
if (cached !== void 0) return cached;
|
|
9945
10125
|
const m = await this.find(name);
|
|
9946
10126
|
if (!m) throw new Error(`Skill "${name}" not found`);
|
|
9947
|
-
const savePath =
|
|
10127
|
+
const savePath = path7.join(path7.dirname(m.path), "SKILL.save.md");
|
|
9948
10128
|
let result;
|
|
9949
10129
|
try {
|
|
9950
|
-
result = await
|
|
10130
|
+
result = await fs4.readFile(savePath, "utf8");
|
|
9951
10131
|
} catch {
|
|
9952
|
-
const full = await
|
|
10132
|
+
const full = await fs4.readFile(m.path, "utf8");
|
|
9953
10133
|
const body = stripFrontmatter2(full);
|
|
9954
10134
|
const compact = compactSkillBody(body);
|
|
9955
10135
|
if (compact) {
|
|
@@ -9975,6 +10155,14 @@ function parseDescriptionFromText(desc) {
|
|
|
9975
10155
|
}
|
|
9976
10156
|
return { trigger, scope };
|
|
9977
10157
|
}
|
|
10158
|
+
|
|
10159
|
+
// src/execution/prompt-loader.ts
|
|
10160
|
+
import * as fs6 from "node:fs/promises";
|
|
10161
|
+
import * as path9 from "node:path";
|
|
10162
|
+
|
|
10163
|
+
// src/storage/prompt-store.ts
|
|
10164
|
+
import * as fs5 from "node:fs/promises";
|
|
10165
|
+
import * as path8 from "node:path";
|
|
9978
10166
|
var SCHEMA_VERSION = 2;
|
|
9979
10167
|
function migratePromptEntry(raw) {
|
|
9980
10168
|
if (!raw || typeof raw !== "object") return null;
|
|
@@ -10035,12 +10223,12 @@ var DefaultPromptStore = class {
|
|
|
10035
10223
|
await ensureDir(this.dir);
|
|
10036
10224
|
const entries = [];
|
|
10037
10225
|
try {
|
|
10038
|
-
const files = await
|
|
10226
|
+
const files = await fs5.readdir(this.dir);
|
|
10039
10227
|
for (const file of files) {
|
|
10040
10228
|
if (!file.endsWith(".json")) continue;
|
|
10041
10229
|
try {
|
|
10042
10230
|
const raw = JSON.parse(
|
|
10043
|
-
await
|
|
10231
|
+
await fs5.readFile(path8.join(this.dir, file), "utf8")
|
|
10044
10232
|
);
|
|
10045
10233
|
const migrated = migratePromptEntry(raw.entry);
|
|
10046
10234
|
if (migrated) entries.push(migrated);
|
|
@@ -10054,9 +10242,9 @@ var DefaultPromptStore = class {
|
|
|
10054
10242
|
);
|
|
10055
10243
|
}
|
|
10056
10244
|
async get(id) {
|
|
10057
|
-
const file =
|
|
10245
|
+
const file = path8.join(this.dir, `${id}.json`);
|
|
10058
10246
|
try {
|
|
10059
|
-
const raw = JSON.parse(await
|
|
10247
|
+
const raw = JSON.parse(await fs5.readFile(file, "utf8"));
|
|
10060
10248
|
return migratePromptEntry(raw.entry);
|
|
10061
10249
|
} catch {
|
|
10062
10250
|
return null;
|
|
@@ -10064,14 +10252,14 @@ var DefaultPromptStore = class {
|
|
|
10064
10252
|
}
|
|
10065
10253
|
async save(entry) {
|
|
10066
10254
|
await ensureDir(this.dir);
|
|
10067
|
-
const file =
|
|
10255
|
+
const file = path8.join(this.dir, `${entry.id}.json`);
|
|
10068
10256
|
const raw = { version: SCHEMA_VERSION, entry };
|
|
10069
10257
|
await atomicWrite(file, JSON.stringify(raw, null, 2));
|
|
10070
10258
|
}
|
|
10071
10259
|
async delete(id) {
|
|
10072
|
-
const file =
|
|
10260
|
+
const file = path8.join(this.dir, `${id}.json`);
|
|
10073
10261
|
try {
|
|
10074
|
-
await
|
|
10262
|
+
await fs5.unlink(file);
|
|
10075
10263
|
return true;
|
|
10076
10264
|
} catch {
|
|
10077
10265
|
return false;
|
|
@@ -10158,7 +10346,7 @@ var DefaultPromptLoader = class {
|
|
|
10158
10346
|
constructor(opts) {
|
|
10159
10347
|
this.projectStore = typeof opts.paths.inProjectPrompts === "string" ? new DefaultPromptStore(opts.paths.inProjectPrompts) : void 0;
|
|
10160
10348
|
this.userStore = typeof opts.paths.globalPrompts === "string" ? new DefaultPromptStore(opts.paths.globalPrompts) : void 0;
|
|
10161
|
-
this.builtinDir = opts.bundledDir ?
|
|
10349
|
+
this.builtinDir = opts.bundledDir ? path9.join(opts.bundledDir, "prompts") : void 0;
|
|
10162
10350
|
}
|
|
10163
10351
|
async list() {
|
|
10164
10352
|
if (this.cache) return this.cache;
|
|
@@ -10271,7 +10459,7 @@ var DefaultPromptLoader = class {
|
|
|
10271
10459
|
const files = await walkJson(dir);
|
|
10272
10460
|
for (const file of files) {
|
|
10273
10461
|
try {
|
|
10274
|
-
const parsed = JSON.parse(await
|
|
10462
|
+
const parsed = JSON.parse(await fs6.readFile(file, "utf8"));
|
|
10275
10463
|
const migrated = migratePromptEntry(parsed);
|
|
10276
10464
|
if (migrated) out.push({ ...migrated, source: "builtin" });
|
|
10277
10465
|
} catch {
|
|
@@ -10285,12 +10473,12 @@ async function walkJson(dir) {
|
|
|
10285
10473
|
const out = [];
|
|
10286
10474
|
let entries;
|
|
10287
10475
|
try {
|
|
10288
|
-
entries = await
|
|
10476
|
+
entries = await fs6.readdir(dir, { withFileTypes: true });
|
|
10289
10477
|
} catch {
|
|
10290
10478
|
return out;
|
|
10291
10479
|
}
|
|
10292
10480
|
for (const e of entries) {
|
|
10293
|
-
const full =
|
|
10481
|
+
const full = path9.join(dir, e.name);
|
|
10294
10482
|
if (e.isDirectory()) {
|
|
10295
10483
|
out.push(...await walkJson(full));
|
|
10296
10484
|
} else if (e.name.endsWith(".json") && e.name !== "index.json" && e.name !== "schema.json") {
|
|
@@ -10474,6 +10662,12 @@ function readPolicy(ctx) {
|
|
|
10474
10662
|
return candidate;
|
|
10475
10663
|
}
|
|
10476
10664
|
|
|
10665
|
+
// src/execution/tool-executor.ts
|
|
10666
|
+
import { randomUUID as randomUUID3 } from "node:crypto";
|
|
10667
|
+
import { isDeepStrictEqual } from "node:util";
|
|
10668
|
+
import * as fs7 from "node:fs/promises";
|
|
10669
|
+
import * as path10 from "node:path";
|
|
10670
|
+
|
|
10477
10671
|
// src/types/tool-markers.ts
|
|
10478
10672
|
var MALFORMED_ARG_MARKERS = ["__raw", "__raw_arguments", "_raw"];
|
|
10479
10673
|
|
|
@@ -10693,12 +10887,33 @@ ${errorDetails}`,
|
|
|
10693
10887
|
}
|
|
10694
10888
|
if (effectivePermission === "confirm") {
|
|
10695
10889
|
if (this.opts.confirmAwaiter) {
|
|
10696
|
-
const
|
|
10890
|
+
const awaiter = this.opts.confirmAwaiter;
|
|
10891
|
+
const choice = await new Promise(
|
|
10892
|
+
(resolve4, reject) => {
|
|
10893
|
+
const signal = ctx.signal;
|
|
10894
|
+
const onAbort = () => resolve4("abort");
|
|
10895
|
+
if (signal.aborted) {
|
|
10896
|
+
resolve4("abort");
|
|
10897
|
+
return;
|
|
10898
|
+
}
|
|
10899
|
+
signal.addEventListener("abort", onAbort, { once: true });
|
|
10900
|
+
awaiter(tool, use.input, use.id, tool.name).then(
|
|
10901
|
+
(c) => {
|
|
10902
|
+
signal.removeEventListener("abort", onAbort);
|
|
10903
|
+
resolve4(c);
|
|
10904
|
+
},
|
|
10905
|
+
(e) => {
|
|
10906
|
+
signal.removeEventListener("abort", onAbort);
|
|
10907
|
+
reject(e);
|
|
10908
|
+
}
|
|
10909
|
+
);
|
|
10910
|
+
}
|
|
10911
|
+
);
|
|
10697
10912
|
if (choice !== "yes" && choice !== "always") {
|
|
10698
10913
|
const result = {
|
|
10699
10914
|
type: "tool_result",
|
|
10700
10915
|
tool_use_id: use.id,
|
|
10701
|
-
content: `Tool "${tool.name}" denied by user.`,
|
|
10916
|
+
content: choice === "abort" ? `Tool "${tool.name}" was not executed \u2014 the run was aborted while awaiting confirmation.` : `Tool "${tool.name}" denied by user.`,
|
|
10702
10917
|
is_error: true
|
|
10703
10918
|
};
|
|
10704
10919
|
budget = this.budgetForString(result.content, budget);
|
|
@@ -10804,6 +11019,9 @@ ${post.additionalContext}`;
|
|
|
10804
11019
|
is_error: true
|
|
10805
11020
|
};
|
|
10806
11021
|
budget = this.budgetForString(result.content, budget);
|
|
11022
|
+
void category;
|
|
11023
|
+
void retryable;
|
|
11024
|
+
void detail;
|
|
10807
11025
|
return { result, tool, durationMs: 0 };
|
|
10808
11026
|
}
|
|
10809
11027
|
};
|
|
@@ -10910,15 +11128,33 @@ ${post.additionalContext}`;
|
|
|
10910
11128
|
const timeoutSignal = AbortSignal.timeout(timeoutMs);
|
|
10911
11129
|
const combined = AbortSignal.any([parentSignal, timeoutSignal]);
|
|
10912
11130
|
let output;
|
|
11131
|
+
const toolPromise = typeof tool.executeStream === "function" ? this.runStreamedTool(tool, input, ctx, combined, toolUseId) : (async () => tool.execute(input, ctx, { signal: combined }))();
|
|
11132
|
+
toolPromise.catch(() => {
|
|
11133
|
+
});
|
|
10913
11134
|
try {
|
|
10914
|
-
output =
|
|
11135
|
+
output = await new Promise((resolve4, reject) => {
|
|
11136
|
+
const onAbort = () => {
|
|
11137
|
+
setTimeout(() => reject(abortReasonToError(combined.reason)), 0);
|
|
11138
|
+
};
|
|
11139
|
+
combined.addEventListener("abort", onAbort, { once: true });
|
|
11140
|
+
toolPromise.then(
|
|
11141
|
+
(v) => {
|
|
11142
|
+
combined.removeEventListener("abort", onAbort);
|
|
11143
|
+
resolve4(v);
|
|
11144
|
+
},
|
|
11145
|
+
(e) => {
|
|
11146
|
+
combined.removeEventListener("abort", onAbort);
|
|
11147
|
+
reject(e);
|
|
11148
|
+
}
|
|
11149
|
+
);
|
|
11150
|
+
});
|
|
10915
11151
|
} catch (err) {
|
|
10916
11152
|
if (combined.aborted) await this.runToolCleanup(tool, input, ctx);
|
|
10917
11153
|
throw err;
|
|
10918
11154
|
}
|
|
10919
11155
|
if (combined.aborted) {
|
|
10920
11156
|
await this.runToolCleanup(tool, input, ctx);
|
|
10921
|
-
throw
|
|
11157
|
+
throw abortReasonToError(combined.reason);
|
|
10922
11158
|
}
|
|
10923
11159
|
return output;
|
|
10924
11160
|
}
|
|
@@ -11079,6 +11315,9 @@ function clampTimeoutMs(timeoutMs, maxTimeoutMs) {
|
|
|
11079
11315
|
const finiteMax = Number.isFinite(maxTimeoutMs) && maxTimeoutMs > 0 ? maxTimeoutMs : fallback;
|
|
11080
11316
|
return Math.max(1, Math.min(finiteTimeout, finiteMax));
|
|
11081
11317
|
}
|
|
11318
|
+
function abortReasonToError(reason) {
|
|
11319
|
+
return reason instanceof Error ? reason : new Error(typeof reason === "string" ? reason : "tool timeout");
|
|
11320
|
+
}
|
|
11082
11321
|
function hasMalformedArguments(input) {
|
|
11083
11322
|
if (!input || typeof input !== "object" || Array.isArray(input)) return false;
|
|
11084
11323
|
const obj = input;
|
|
@@ -11177,12 +11416,12 @@ async function maybePersistLargeToolOutput(toolName, content, budget) {
|
|
|
11177
11416
|
return content;
|
|
11178
11417
|
}
|
|
11179
11418
|
try {
|
|
11180
|
-
const dir =
|
|
11181
|
-
await
|
|
11419
|
+
const dir = path10.join(wstackGlobalRoot(), "tool-output");
|
|
11420
|
+
await fs7.mkdir(dir, { recursive: true });
|
|
11182
11421
|
const safeTool = toolName.replace(/[^a-zA-Z0-9._-]+/g, "_").slice(0, 40) || "tool";
|
|
11183
11422
|
const stamp = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-");
|
|
11184
|
-
const filePath =
|
|
11185
|
-
await
|
|
11423
|
+
const filePath = path10.join(dir, `${stamp}-${safeTool}-${randomUUID3()}.log`);
|
|
11424
|
+
await fs7.writeFile(filePath, content, "utf8");
|
|
11186
11425
|
const marker = `[full tool output: ${bytes} bytes at ${filePath}; read/grep that file selectively instead of re-running or requesting more output]`;
|
|
11187
11426
|
const fixedBytes = Buffer.byteLength(marker + TOOL_OUTPUT_ARTIFACT_OMISSION, "utf8");
|
|
11188
11427
|
const previewBytes = Math.min(
|
|
@@ -11230,7 +11469,53 @@ function sliceUtf8Suffix(text, maxBytes) {
|
|
|
11230
11469
|
if (first >= 56320 && first <= 57343) start++;
|
|
11231
11470
|
return text.slice(start);
|
|
11232
11471
|
}
|
|
11233
|
-
|
|
11234
|
-
|
|
11472
|
+
export {
|
|
11473
|
+
AutoCompactionMiddleware,
|
|
11474
|
+
AutonomousRunner,
|
|
11475
|
+
DEFAULT_RECOVERY_STRATEGIES,
|
|
11476
|
+
DefaultDesignKitLoader,
|
|
11477
|
+
DefaultErrorHandler,
|
|
11478
|
+
DefaultPromptLoader,
|
|
11479
|
+
DefaultRetryPolicy,
|
|
11480
|
+
DefaultSkillLoader,
|
|
11481
|
+
DoneConditionChecker,
|
|
11482
|
+
EternalAutonomyEngine,
|
|
11483
|
+
HybridCompactor,
|
|
11484
|
+
IntelligentCompactor,
|
|
11485
|
+
ParallelEternalEngine,
|
|
11486
|
+
SelectiveCompactor,
|
|
11487
|
+
ToolExecutor,
|
|
11488
|
+
_resetDesignKitLoaderMemo,
|
|
11489
|
+
_resetDesignRulesCache,
|
|
11490
|
+
activateDesign,
|
|
11491
|
+
applyModelRuntime,
|
|
11492
|
+
buildGoalPreamble,
|
|
11493
|
+
buildRecoveryStrategies,
|
|
11494
|
+
clearActiveKit,
|
|
11495
|
+
clearPersistedActiveKit,
|
|
11496
|
+
createAutonomyBrain,
|
|
11497
|
+
createStrategyCompactor,
|
|
11498
|
+
createTieredBrainArbiter,
|
|
11499
|
+
designProjectDir,
|
|
11500
|
+
detectFrontendFile,
|
|
11501
|
+
detectFrontendIntent,
|
|
11502
|
+
formatDecisionSummary,
|
|
11503
|
+
getDesignKitLoader,
|
|
11504
|
+
getDesignState,
|
|
11505
|
+
installDesignStudioMiddleware,
|
|
11506
|
+
loadActiveKit,
|
|
11507
|
+
loadProjectDesignRules,
|
|
11508
|
+
makeAutonomyPromptContributor,
|
|
11509
|
+
makeDesignDetectToolCallMiddleware,
|
|
11510
|
+
makeDesignDetectUserInputMiddleware,
|
|
11511
|
+
makeDesignStudioRequestMiddleware,
|
|
11512
|
+
mergeModelRuntime,
|
|
11513
|
+
recordKitChoice,
|
|
11514
|
+
renderPrompt,
|
|
11515
|
+
resolveBundledDesignKitsDir,
|
|
11516
|
+
resolveCacheForRequest,
|
|
11517
|
+
resolveModelRuntime,
|
|
11518
|
+
resolveReasoningForRequest,
|
|
11519
|
+
setActiveKit
|
|
11520
|
+
};
|
|
11235
11521
|
//# sourceMappingURL=index.js.map
|
|
11236
|
-
//# sourceMappingURL=index.js.map
|