@wrongstack/core 0.284.1 → 0.286.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent-status-tracker.d.ts +74 -0
- package/dist/agent-status-tracker.d.ts.map +1 -0
- package/dist/autophase/auto-phase-planner.d.ts +79 -0
- package/dist/autophase/auto-phase-planner.d.ts.map +1 -0
- package/dist/autophase/auto-phase-runner.d.ts +79 -0
- package/dist/autophase/auto-phase-runner.d.ts.map +1 -0
- package/dist/autophase/checkpoint.d.ts +49 -0
- package/dist/autophase/checkpoint.d.ts.map +1 -0
- package/dist/autophase/index.d.ts +9 -0
- package/dist/autophase/index.d.ts.map +1 -0
- package/dist/autophase/phase-graph-builder.d.ts +46 -0
- package/dist/autophase/phase-graph-builder.d.ts.map +1 -0
- package/dist/autophase/phase-orchestrator.d.ts +150 -0
- package/dist/autophase/phase-orchestrator.d.ts.map +1 -0
- package/dist/autophase/phase-store.d.ts +29 -0
- package/dist/autophase/phase-store.d.ts.map +1 -0
- package/dist/autophase/types.d.ts +329 -0
- package/dist/autophase/types.d.ts.map +1 -0
- package/dist/boot.d.ts +73 -0
- package/dist/boot.d.ts.map +1 -0
- package/dist/coordination/adaptive-concurrency.d.ts +63 -0
- package/dist/coordination/adaptive-concurrency.d.ts.map +1 -0
- package/dist/coordination/agent-bridge.d.ts +24 -0
- package/dist/coordination/agent-bridge.d.ts.map +1 -0
- package/dist/coordination/agent-monitor.d.ts +129 -0
- package/dist/coordination/agent-monitor.d.ts.map +1 -0
- package/dist/coordination/agent-subagent-runner.d.ts +74 -0
- package/dist/coordination/agent-subagent-runner.d.ts.map +1 -0
- package/dist/coordination/agents/agent-prompts.d.ts +2 -0
- package/dist/coordination/agents/agent-prompts.d.ts.map +1 -0
- package/dist/coordination/agents/index.d.ts +35 -0
- package/dist/coordination/agents/index.d.ts.map +1 -0
- package/dist/coordination/agents/phase1-discovery.d.ts +4 -0
- package/dist/coordination/agents/phase1-discovery.d.ts.map +1 -0
- package/dist/coordination/agents/phase2-planning.d.ts +4 -0
- package/dist/coordination/agents/phase2-planning.d.ts.map +1 -0
- package/dist/coordination/agents/phase3-build.d.ts +4 -0
- package/dist/coordination/agents/phase3-build.d.ts.map +1 -0
- package/dist/coordination/agents/phase3-techstack.d.ts +13 -0
- package/dist/coordination/agents/phase3-techstack.d.ts.map +1 -0
- package/dist/coordination/agents/phase4-verify.d.ts +4 -0
- package/dist/coordination/agents/phase4-verify.d.ts.map +1 -0
- package/dist/coordination/agents/phase5-review.d.ts +4 -0
- package/dist/coordination/agents/phase5-review.d.ts.map +1 -0
- package/dist/coordination/agents/phase6-domain.d.ts +4 -0
- package/dist/coordination/agents/phase6-domain.d.ts.map +1 -0
- package/dist/coordination/agents/phase7-knowledge.d.ts +4 -0
- package/dist/coordination/agents/phase7-knowledge.d.ts.map +1 -0
- package/dist/coordination/agents/phase8-delivery.d.ts +4 -0
- package/dist/coordination/agents/phase8-delivery.d.ts.map +1 -0
- package/dist/coordination/agents/phase9-meta.d.ts +4 -0
- package/dist/coordination/agents/phase9-meta.d.ts.map +1 -0
- package/dist/coordination/agents/types.d.ts +79 -0
- package/dist/coordination/agents/types.d.ts.map +1 -0
- package/dist/coordination/agents.d.ts +8 -0
- package/dist/coordination/agents.d.ts.map +1 -0
- package/dist/coordination/auto-extend.d.ts +46 -0
- package/dist/coordination/auto-extend.d.ts.map +1 -0
- package/dist/coordination/autonomous-brain.d.ts +152 -0
- package/dist/coordination/autonomous-brain.d.ts.map +1 -0
- package/dist/coordination/autonomous-coordinator.d.ts +243 -0
- package/dist/coordination/autonomous-coordinator.d.ts.map +1 -0
- package/dist/coordination/brain-ledger.d.ts +142 -0
- package/dist/coordination/brain-ledger.d.ts.map +1 -0
- package/dist/coordination/brain-monitor.d.ts +103 -0
- package/dist/coordination/brain-monitor.d.ts.map +1 -0
- package/dist/coordination/brain.d.ts +147 -0
- package/dist/coordination/brain.d.ts.map +1 -0
- package/dist/coordination/change-manager.d.ts +151 -0
- package/dist/coordination/change-manager.d.ts.map +1 -0
- package/dist/coordination/checkpoint-wiring.d.ts +61 -0
- package/dist/coordination/checkpoint-wiring.d.ts.map +1 -0
- package/dist/coordination/collab-bus.d.ts +132 -0
- package/dist/coordination/collab-bus.d.ts.map +1 -0
- package/dist/coordination/collab-debug.d.ts +302 -0
- package/dist/coordination/collab-debug.d.ts.map +1 -0
- package/dist/coordination/commit-safety.d.ts +72 -0
- package/dist/coordination/commit-safety.d.ts.map +1 -0
- package/dist/coordination/consensus-protocol.d.ts +106 -0
- package/dist/coordination/consensus-protocol.d.ts.map +1 -0
- package/dist/coordination/coordinator/error-classifier.d.ts +15 -0
- package/dist/coordination/coordinator/error-classifier.d.ts.map +1 -0
- package/dist/coordination/delegate-tool.d.ts +101 -0
- package/dist/coordination/delegate-tool.d.ts.map +1 -0
- package/dist/coordination/dep-watcher-bridge.d.ts +47 -0
- package/dist/coordination/dep-watcher-bridge.d.ts.map +1 -0
- package/dist/coordination/dep-watcher.d.ts +74 -0
- package/dist/coordination/dep-watcher.d.ts.map +1 -0
- package/dist/coordination/director/director-errors.d.ts +29 -0
- package/dist/coordination/director/director-errors.d.ts.map +1 -0
- package/dist/coordination/director-construction.d.ts +90 -0
- package/dist/coordination/director-construction.d.ts.map +1 -0
- package/dist/coordination/director-prompts.d.ts +119 -0
- package/dist/coordination/director-prompts.d.ts.map +1 -0
- package/dist/coordination/director-session.d.ts +68 -0
- package/dist/coordination/director-session.d.ts.map +1 -0
- package/dist/coordination/director-tools.d.ts +65 -0
- package/dist/coordination/director-tools.d.ts.map +1 -0
- package/dist/coordination/director.d.ts +802 -0
- package/dist/coordination/director.d.ts.map +1 -0
- package/dist/coordination/dispatcher.d.ts +82 -0
- package/dist/coordination/dispatcher.d.ts.map +1 -0
- package/dist/coordination/file-author-tracker.d.ts +76 -0
- package/dist/coordination/file-author-tracker.d.ts.map +1 -0
- package/dist/coordination/fleet-bus.d.ts +122 -0
- package/dist/coordination/fleet-bus.d.ts.map +1 -0
- package/dist/coordination/fleet-event-validation.d.ts +10 -0
- package/dist/coordination/fleet-event-validation.d.ts.map +1 -0
- package/dist/coordination/fleet-manager.d.ts +234 -0
- package/dist/coordination/fleet-manager.d.ts.map +1 -0
- package/dist/coordination/fleet-spawn.d.ts +102 -0
- package/dist/coordination/fleet-spawn.d.ts.map +1 -0
- package/dist/coordination/fleet-status-tool.d.ts +36 -0
- package/dist/coordination/fleet-status-tool.d.ts.map +1 -0
- package/dist/coordination/fleet-supervisor.d.ts +157 -0
- package/dist/coordination/fleet-supervisor.d.ts.map +1 -0
- package/dist/coordination/fleet.d.ts +96 -0
- package/dist/coordination/fleet.d.ts.map +1 -0
- package/dist/coordination/global-mailbox.d.ts +295 -0
- package/dist/coordination/global-mailbox.d.ts.map +1 -0
- package/dist/coordination/icoordinator.d.ts +97 -0
- package/dist/coordination/icoordinator.d.ts.map +1 -0
- package/dist/coordination/ifleet-manager.d.ts +177 -0
- package/dist/coordination/ifleet-manager.d.ts.map +1 -0
- package/dist/coordination/in-memory-transport.d.ts +12 -0
- package/dist/coordination/in-memory-transport.d.ts.map +1 -0
- package/dist/coordination/index.d.ts +79 -2587
- package/dist/coordination/index.d.ts.map +1 -0
- package/dist/coordination/index.js +2262 -673
- package/dist/coordination/index.js.map +7 -1
- package/dist/coordination/knowledge-graph.d.ts +229 -0
- package/dist/coordination/knowledge-graph.d.ts.map +1 -0
- package/dist/coordination/large-answer-store.d.ts +61 -0
- package/dist/coordination/large-answer-store.d.ts.map +1 -0
- package/dist/coordination/mail-tools.d.ts +34 -0
- package/dist/coordination/mail-tools.d.ts.map +1 -0
- package/dist/coordination/mailbox-actions.d.ts +67 -0
- package/dist/coordination/mailbox-actions.d.ts.map +1 -0
- package/dist/coordination/mailbox-constants.d.ts +64 -0
- package/dist/coordination/mailbox-constants.d.ts.map +1 -0
- package/dist/coordination/mailbox-events.d.ts +32 -0
- package/dist/coordination/mailbox-events.d.ts.map +1 -0
- package/dist/coordination/mailbox-health.d.ts +131 -0
- package/dist/coordination/mailbox-health.d.ts.map +1 -0
- package/dist/coordination/mailbox-hooks.d.ts +55 -0
- package/dist/coordination/mailbox-hooks.d.ts.map +1 -0
- package/dist/coordination/mailbox-message-codec.d.ts +8 -0
- package/dist/coordination/mailbox-message-codec.d.ts.map +1 -0
- package/dist/coordination/mailbox-tool.d.ts +75 -0
- package/dist/coordination/mailbox-tool.d.ts.map +1 -0
- package/dist/{mailbox-types-BGZWrYTJ.d.ts → coordination/mailbox-types.d.ts} +125 -26
- package/dist/coordination/mailbox-types.d.ts.map +1 -0
- package/dist/coordination/mailbox.d.ts +88 -0
- package/dist/coordination/mailbox.d.ts.map +1 -0
- package/dist/coordination/model-matrix.d.ts +98 -0
- package/dist/coordination/model-matrix.d.ts.map +1 -0
- package/dist/coordination/multi-agent-coordinator.d.ts +202 -0
- package/dist/coordination/multi-agent-coordinator.d.ts.map +1 -0
- package/dist/coordination/null-fleet-bus.d.ts +10 -0
- package/dist/coordination/null-fleet-bus.d.ts.map +1 -0
- package/dist/coordination/package-author-tracker.d.ts +87 -0
- package/dist/coordination/package-author-tracker.d.ts.map +1 -0
- package/dist/coordination/package-outdated-watcher.d.ts +83 -0
- package/dist/coordination/package-outdated-watcher.d.ts.map +1 -0
- package/dist/coordination/single-instance-mailbox.d.ts +154 -0
- package/dist/coordination/single-instance-mailbox.d.ts.map +1 -0
- package/dist/coordination/spawn-budget.d.ts +6 -0
- package/dist/coordination/spawn-budget.d.ts.map +1 -0
- package/dist/coordination/subagent-budget.d.ts +323 -0
- package/dist/coordination/subagent-budget.d.ts.map +1 -0
- package/dist/coordination/subagent-nicknames.d.ts +42 -0
- package/dist/coordination/subagent-nicknames.d.ts.map +1 -0
- package/dist/coordination/subagent-result-tool.d.ts +20 -0
- package/dist/coordination/subagent-result-tool.d.ts.map +1 -0
- package/dist/coordination/task-auctioneer.d.ts +143 -0
- package/dist/coordination/task-auctioneer.d.ts.map +1 -0
- package/dist/coordination/task-dag.d.ts +147 -0
- package/dist/coordination/task-dag.d.ts.map +1 -0
- package/dist/coordination/techstack-mailbox-consumer.d.ts +50 -0
- package/dist/coordination/techstack-mailbox-consumer.d.ts.map +1 -0
- package/dist/coordination/transport.d.ts +2 -0
- package/dist/coordination/transport.d.ts.map +1 -0
- package/dist/coordination/worktree-task-runner.d.ts +45 -0
- package/dist/coordination/worktree-task-runner.d.ts.map +1 -0
- package/dist/core/agent-internals.d.ts +41 -0
- package/dist/core/agent-internals.d.ts.map +1 -0
- package/dist/core/agent-loop.d.ts +18 -0
- package/dist/core/agent-loop.d.ts.map +1 -0
- package/dist/core/agent-response.d.ts +21 -0
- package/dist/core/agent-response.d.ts.map +1 -0
- package/dist/core/agent-tools.d.ts +21 -0
- package/dist/core/agent-tools.d.ts.map +1 -0
- package/dist/core/agent-types.d.ts +95 -0
- package/dist/core/agent-types.d.ts.map +1 -0
- package/dist/core/agent.d.ts +54 -0
- package/dist/core/agent.d.ts.map +1 -0
- package/dist/core/btw.d.ts +40 -0
- package/dist/core/btw.d.ts.map +1 -0
- package/dist/core/context.d.ts +269 -0
- package/dist/core/context.d.ts.map +1 -0
- package/dist/core/continue-intent.d.ts +92 -0
- package/dist/core/continue-intent.d.ts.map +1 -0
- package/dist/core/continue-to-next-iteration.d.ts +96 -0
- package/dist/core/continue-to-next-iteration.d.ts.map +1 -0
- package/dist/core/conversation-state.d.ts +96 -0
- package/dist/core/conversation-state.d.ts.map +1 -0
- package/dist/core/fallback-model.d.ts +94 -0
- package/dist/core/fallback-model.d.ts.map +1 -0
- package/dist/core/fleet-pulse.d.ts +42 -0
- package/dist/core/fleet-pulse.d.ts.map +1 -0
- package/dist/core/input-builder.d.ts +95 -0
- package/dist/core/input-builder.d.ts.map +1 -0
- package/dist/core/instruction-bundle.d.ts +22 -0
- package/dist/core/instruction-bundle.d.ts.map +1 -0
- package/dist/core/iteration-limit.d.ts +35 -0
- package/dist/core/iteration-limit.d.ts.map +1 -0
- package/dist/core/mailbox-loop.d.ts +63 -0
- package/dist/core/mailbox-loop.d.ts.map +1 -0
- package/dist/core/modes/brief.d.ts +2 -0
- package/dist/core/modes/brief.d.ts.map +1 -0
- package/dist/core/modes/default.d.ts +8 -0
- package/dist/core/modes/default.d.ts.map +1 -0
- package/dist/core/modes/teach.d.ts +2 -0
- package/dist/core/modes/teach.d.ts.map +1 -0
- package/dist/core/provider-runner.d.ts +24 -0
- package/dist/core/provider-runner.d.ts.map +1 -0
- package/dist/core/queued-messages.d.ts +55 -0
- package/dist/core/queued-messages.d.ts.map +1 -0
- package/dist/core/run-env.d.ts +49 -0
- package/dist/core/run-env.d.ts.map +1 -0
- package/dist/core/streaming-response-builder.d.ts +78 -0
- package/dist/core/streaming-response-builder.d.ts.map +1 -0
- package/dist/core/system-prompt-builder.d.ts +213 -0
- package/dist/core/system-prompt-builder.d.ts.map +1 -0
- package/dist/defaults/index.d.ts +68 -158
- package/dist/defaults/index.d.ts.map +1 -0
- package/dist/defaults/index.js +2061 -1300
- package/dist/defaults/index.js.map +7 -1
- package/dist/execution/auto-compaction-middleware.d.ts +123 -0
- package/dist/execution/auto-compaction-middleware.d.ts.map +1 -0
- package/dist/execution/autonomous-runner.d.ts +61 -0
- package/dist/execution/autonomous-runner.d.ts.map +1 -0
- package/dist/execution/autonomy-brain.d.ts +151 -0
- package/dist/execution/autonomy-brain.d.ts.map +1 -0
- package/dist/execution/autonomy-prompt-contributor.d.ts +39 -0
- package/dist/execution/autonomy-prompt-contributor.d.ts.map +1 -0
- package/dist/execution/brain-chain.d.ts +53 -0
- package/dist/execution/brain-chain.d.ts.map +1 -0
- package/dist/execution/brain-evaluation.d.ts +66 -0
- package/dist/execution/brain-evaluation.d.ts.map +1 -0
- package/dist/execution/brain-runtime.d.ts +171 -0
- package/dist/execution/brain-runtime.d.ts.map +1 -0
- package/dist/execution/compaction-core.d.ts +103 -0
- package/dist/execution/compaction-core.d.ts.map +1 -0
- package/dist/execution/compactor.d.ts +56 -0
- package/dist/execution/compactor.d.ts.map +1 -0
- package/dist/execution/council-brain.d.ts +79 -0
- package/dist/execution/council-brain.d.ts.map +1 -0
- package/dist/execution/design-color.d.ts +31 -0
- package/dist/execution/design-color.d.ts.map +1 -0
- package/dist/execution/design-detect.d.ts +96 -0
- package/dist/execution/design-detect.d.ts.map +1 -0
- package/dist/execution/design-kit-loader.d.ts +53 -0
- package/dist/execution/design-kit-loader.d.ts.map +1 -0
- package/dist/execution/design-materialize.d.ts +32 -0
- package/dist/execution/design-materialize.d.ts.map +1 -0
- package/dist/execution/design-project-store.d.ts +57 -0
- package/dist/execution/design-project-store.d.ts.map +1 -0
- package/dist/execution/design-verify.d.ts +44 -0
- package/dist/execution/design-verify.d.ts.map +1 -0
- package/dist/execution/error-handler.d.ts +34 -0
- package/dist/execution/error-handler.d.ts.map +1 -0
- package/dist/{parallel-eternal-engine-HUrtePLd.d.ts → execution/eternal-autonomy.d.ts} +22 -225
- package/dist/execution/eternal-autonomy.d.ts.map +1 -0
- package/dist/execution/goal-preamble.d.ts +2 -0
- package/dist/execution/goal-preamble.d.ts.map +1 -0
- package/dist/execution/index.d.ts +25 -180
- package/dist/execution/index.d.ts.map +1 -0
- package/dist/execution/index.js +1748 -490
- package/dist/execution/index.js.map +7 -1
- package/dist/execution/intelligent-compactor.d.ts +85 -0
- package/dist/execution/intelligent-compactor.d.ts.map +1 -0
- package/dist/execution/model-runtime.d.ts +75 -0
- package/dist/execution/model-runtime.d.ts.map +1 -0
- package/dist/execution/parallel-eternal-engine.d.ts +142 -0
- package/dist/execution/parallel-eternal-engine.d.ts.map +1 -0
- package/dist/execution/prompt-enhancer.d.ts +12 -13
- package/dist/execution/prompt-enhancer.d.ts.map +1 -0
- package/dist/execution/prompt-enhancer.js +13 -7
- package/dist/execution/prompt-enhancer.js.map +7 -1
- package/dist/execution/prompt-loader.d.ts +52 -0
- package/dist/execution/prompt-loader.d.ts.map +1 -0
- package/dist/execution/provider-runner-impl.d.ts +14 -0
- package/dist/execution/provider-runner-impl.d.ts.map +1 -0
- package/dist/execution/regex-patterns.d.ts +7 -0
- package/dist/execution/regex-patterns.d.ts.map +1 -0
- package/dist/execution/retry-policy.d.ts +35 -0
- package/dist/execution/retry-policy.d.ts.map +1 -0
- package/dist/execution/selective-compactor.d.ts +94 -0
- package/dist/execution/selective-compactor.d.ts.map +1 -0
- package/dist/execution/skill-loader.d.ts +43 -0
- package/dist/execution/skill-loader.d.ts.map +1 -0
- package/dist/execution/strategy-compactor.d.ts +43 -0
- package/dist/execution/strategy-compactor.d.ts.map +1 -0
- package/dist/execution/tool-executor.d.ts +112 -0
- package/dist/execution/tool-executor.d.ts.map +1 -0
- package/dist/extension/extension-points.d.ts +121 -0
- package/dist/extension/extension-points.d.ts.map +1 -0
- package/dist/extension/index.d.ts +3 -10
- package/dist/extension/index.d.ts.map +1 -0
- package/dist/extension/index.js +59 -5
- package/dist/extension/index.js.map +7 -1
- package/dist/extension/registry.d.ts +86 -0
- package/dist/extension/registry.d.ts.map +1 -0
- package/dist/fleet-notifier.d.ts +28 -0
- package/dist/fleet-notifier.d.ts.map +1 -0
- package/dist/hooks/http-executor.d.ts +11 -0
- package/dist/hooks/http-executor.d.ts.map +1 -0
- package/dist/hooks/index.d.ts +10 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/registry.d.ts +71 -0
- package/dist/hooks/registry.d.ts.map +1 -0
- package/dist/hooks/runner.d.ts +65 -0
- package/dist/hooks/runner.d.ts.map +1 -0
- package/dist/hooks/shell-executor.d.ts +33 -0
- package/dist/hooks/shell-executor.d.ts.map +1 -0
- package/dist/hooks/shell-hooks-equal.d.ts +15 -0
- package/dist/hooks/shell-hooks-equal.d.ts.map +1 -0
- package/dist/hq/agent-bridge.d.ts +27 -0
- package/dist/hq/agent-bridge.d.ts.map +1 -0
- package/dist/hq/alerts.d.ts +67 -0
- package/dist/hq/alerts.d.ts.map +1 -0
- package/dist/hq/auth-store.d.ts +179 -0
- package/dist/hq/auth-store.d.ts.map +1 -0
- package/dist/hq/brain-bridge.d.ts +37 -0
- package/dist/hq/brain-bridge.d.ts.map +1 -0
- package/dist/hq/commands.d.ts +122 -0
- package/dist/hq/commands.d.ts.map +1 -0
- package/dist/hq/cost-bridge.d.ts +36 -0
- package/dist/hq/cost-bridge.d.ts.map +1 -0
- package/dist/hq/factory.d.ts +69 -0
- package/dist/hq/factory.d.ts.map +1 -0
- package/dist/hq/fleet-bridge.d.ts +39 -0
- package/dist/hq/fleet-bridge.d.ts.map +1 -0
- package/dist/hq/index.d.ts +18 -816
- package/dist/hq/index.d.ts.map +1 -0
- package/dist/hq/index.js +1043 -192
- package/dist/hq/index.js.map +7 -1
- package/dist/hq/mailbox-mapper.d.ts +27 -0
- package/dist/hq/mailbox-mapper.d.ts.map +1 -0
- package/dist/hq/persistence.d.ts +121 -0
- package/dist/hq/persistence.d.ts.map +1 -0
- package/dist/hq/protocol.d.ts +612 -0
- package/dist/hq/protocol.d.ts.map +1 -0
- package/dist/hq/publisher.d.ts +181 -0
- package/dist/hq/publisher.d.ts.map +1 -0
- package/dist/hq/redaction.d.ts +30 -0
- package/dist/hq/redaction.d.ts.map +1 -0
- package/dist/hq/session-bridge.d.ts +29 -0
- package/dist/hq/session-bridge.d.ts.map +1 -0
- package/dist/hq/tool-bridge.d.ts +41 -0
- package/dist/hq/tool-bridge.d.ts.map +1 -0
- package/dist/hq/transcript-mapper.d.ts +36 -0
- package/dist/hq/transcript-mapper.d.ts.map +1 -0
- package/dist/hq/worktree-bridge.d.ts +34 -0
- package/dist/hq/worktree-bridge.d.ts.map +1 -0
- package/dist/index.d.ts +114 -2872
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6104 -2737
- package/dist/index.js.map +7 -1
- package/dist/infrastructure/context-manager.d.ts +92 -0
- package/dist/infrastructure/context-manager.d.ts.map +1 -0
- package/dist/infrastructure/index.d.ts +6 -64
- package/dist/infrastructure/index.d.ts.map +1 -0
- package/dist/infrastructure/index.js +39 -12
- package/dist/infrastructure/index.js.map +7 -1
- package/dist/infrastructure/logger.d.ts +99 -0
- package/dist/infrastructure/logger.d.ts.map +1 -0
- package/dist/infrastructure/mcp-servers.d.ts +83 -0
- package/dist/infrastructure/mcp-servers.d.ts.map +1 -0
- package/dist/{path-resolver-CMS5307d.d.ts → infrastructure/path-resolver.d.ts} +3 -5
- package/dist/infrastructure/path-resolver.d.ts.map +1 -0
- package/dist/infrastructure/token-counter.d.ts +57 -0
- package/dist/infrastructure/token-counter.d.ts.map +1 -0
- package/dist/kernel/container.d.ts +84 -0
- package/dist/kernel/container.d.ts.map +1 -0
- package/dist/{events-Bgnh43r9.d.ts → kernel/events.d.ts} +134 -210
- package/dist/kernel/events.d.ts.map +1 -0
- package/dist/kernel/index.d.ts +6 -107
- package/dist/kernel/index.d.ts.map +1 -0
- package/dist/kernel/index.js +56 -4
- package/dist/kernel/index.js.map +7 -1
- package/dist/kernel/pipeline.d.ts +105 -0
- package/dist/kernel/pipeline.d.ts.map +1 -0
- package/dist/kernel/run-controller.d.ts +55 -0
- package/dist/kernel/run-controller.d.ts.map +1 -0
- package/dist/kernel/tokens.d.ts +53 -0
- package/dist/kernel/tokens.d.ts.map +1 -0
- package/dist/mailbox-attach.d.ts +27 -0
- package/dist/mailbox-attach.d.ts.map +1 -0
- package/dist/middleware/collab-pause.d.ts +73 -0
- package/dist/middleware/collab-pause.d.ts.map +1 -0
- package/dist/models/codex-catalog.d.ts +41 -0
- package/dist/models/codex-catalog.d.ts.map +1 -0
- package/dist/models/index.d.ts +8 -163
- package/dist/models/index.d.ts.map +1 -0
- package/dist/models/index.js +150 -51
- package/dist/models/index.js.map +7 -1
- package/dist/models/llm-selector.d.ts +47 -0
- package/dist/models/llm-selector.d.ts.map +1 -0
- package/dist/models/mode-store.d.ts +22 -0
- package/dist/models/mode-store.d.ts.map +1 -0
- package/dist/models/model-intelligence.d.ts +56 -0
- package/dist/models/model-intelligence.d.ts.map +1 -0
- package/dist/models/model-router.d.ts +100 -0
- package/dist/models/model-router.d.ts.map +1 -0
- package/dist/models/models-registry.d.ts +106 -0
- package/dist/models/models-registry.d.ts.map +1 -0
- package/dist/models/provider-model-resolve.d.ts +69 -0
- package/dist/models/provider-model-resolve.d.ts.map +1 -0
- package/dist/observability/event-bridge.d.ts +10 -0
- package/dist/observability/event-bridge.d.ts.map +1 -0
- package/dist/observability/health.d.ts +18 -0
- package/dist/observability/health.d.ts.map +1 -0
- package/dist/observability/index.d.ts +9 -354
- package/dist/observability/index.d.ts.map +1 -0
- package/dist/observability/index.js +37 -23
- package/dist/observability/index.js.map +7 -1
- package/dist/observability/metrics.d.ts +26 -0
- package/dist/observability/metrics.d.ts.map +1 -0
- package/dist/observability/otel-tracer.d.ts +41 -0
- package/dist/observability/otel-tracer.d.ts.map +1 -0
- package/dist/observability/otlp-metrics.d.ts +111 -0
- package/dist/observability/otlp-metrics.d.ts.map +1 -0
- package/dist/observability/otlp-traces.d.ts +95 -0
- package/dist/observability/otlp-traces.d.ts.map +1 -0
- package/dist/observability/prometheus.d.ts +49 -0
- package/dist/observability/prometheus.d.ts.map +1 -0
- package/dist/observability/tracer.d.ts +9 -0
- package/dist/observability/tracer.d.ts.map +1 -0
- package/dist/plugin/api.d.ts +226 -0
- package/dist/plugin/api.d.ts.map +1 -0
- package/dist/plugin/loader.d.ts +73 -0
- package/dist/plugin/loader.d.ts.map +1 -0
- package/dist/plugins/chimera-plugin.d.ts +37 -0
- package/dist/plugins/chimera-plugin.d.ts.map +1 -0
- package/dist/plugins/prompts-plugin.d.ts +26 -0
- package/dist/plugins/prompts-plugin.d.ts.map +1 -0
- package/dist/plugins/security-plugin.d.ts +19 -0
- package/dist/plugins/security-plugin.d.ts.map +1 -0
- package/dist/plugins/skills-plugin.d.ts +42 -0
- package/dist/plugins/skills-plugin.d.ts.map +1 -0
- package/dist/plugins/sync-plugin.d.ts +22 -0
- package/dist/plugins/sync-plugin.d.ts.map +1 -0
- package/dist/prompts/index.d.ts +3 -0
- package/dist/prompts/index.d.ts.map +1 -0
- package/dist/prompts/prompt-installer.d.ts +50 -0
- package/dist/prompts/prompt-installer.d.ts.map +1 -0
- package/dist/prompts/prompt-manifest-store.d.ts +18 -0
- package/dist/prompts/prompt-manifest-store.d.ts.map +1 -0
- package/dist/registry/provider-registry.d.ts +51 -0
- package/dist/registry/provider-registry.d.ts.map +1 -0
- package/dist/registry/slash-command-registry.d.ts +61 -0
- package/dist/registry/slash-command-registry.d.ts.map +1 -0
- package/dist/registry/tool-registry.d.ts +154 -0
- package/dist/registry/tool-registry.d.ts.map +1 -0
- package/dist/replay/hash.d.ts +31 -0
- package/dist/replay/hash.d.ts.map +1 -0
- package/dist/replay/replay-provider-runner.d.ts +53 -0
- package/dist/replay/replay-provider-runner.d.ts.map +1 -0
- package/dist/{index-CbyuOE5y.d.ts → security/capabilities.d.ts} +31 -34
- package/dist/security/capabilities.d.ts.map +1 -0
- package/dist/security/config-secrets.d.ts +25 -0
- package/dist/security/config-secrets.d.ts.map +1 -0
- package/dist/security/index.d.ts +7 -8
- package/dist/security/index.d.ts.map +1 -0
- package/dist/security/index.js +354 -401
- package/dist/security/index.js.map +7 -1
- package/dist/security/permission-policy-schema.d.ts +77 -0
- package/dist/security/permission-policy-schema.d.ts.map +1 -0
- package/dist/security/permission-policy.d.ts +158 -0
- package/dist/security/permission-policy.d.ts.map +1 -0
- package/dist/security/secret-scrubber.d.ts +14 -0
- package/dist/security/secret-scrubber.d.ts.map +1 -0
- package/dist/security/secret-vault.d.ts +96 -0
- package/dist/security/secret-vault.d.ts.map +1 -0
- package/dist/security/yolo-risk.d.ts +11 -0
- package/dist/security/yolo-risk.d.ts.map +1 -0
- package/dist/{session-registry-Dvg7i_IA.d.ts → session-registry.d.ts} +8 -9
- package/dist/session-registry.d.ts.map +1 -0
- package/dist/skills/foreign-sources.d.ts +59 -0
- package/dist/skills/foreign-sources.d.ts.map +1 -0
- package/dist/skills/frontmatter.d.ts +44 -0
- package/dist/skills/frontmatter.d.ts.map +1 -0
- package/dist/skills/github-fetcher.d.ts +38 -0
- package/dist/skills/github-fetcher.d.ts.map +1 -0
- package/dist/skills/index.d.ts +11 -582
- package/dist/skills/index.d.ts.map +1 -0
- package/dist/skills/index.js +81 -43
- package/dist/skills/index.js.map +7 -1
- package/dist/skills/limits.d.ts +92 -0
- package/dist/skills/limits.d.ts.map +1 -0
- package/dist/skills/manifest-store.d.ts +42 -0
- package/dist/skills/manifest-store.d.ts.map +1 -0
- package/dist/skills/registry/github-direct-adapter.d.ts +17 -0
- package/dist/skills/registry/github-direct-adapter.d.ts.map +1 -0
- package/dist/skills/registry/registry-adapter.d.ts +84 -0
- package/dist/skills/registry/registry-adapter.d.ts.map +1 -0
- package/dist/skills/registry/skills-sh-adapter.d.ts +13 -0
- package/dist/skills/registry/skills-sh-adapter.d.ts.map +1 -0
- package/dist/skills/skill-generator.d.ts +82 -0
- package/dist/skills/skill-generator.d.ts.map +1 -0
- package/dist/skills/skill-installer.d.ts +124 -0
- package/dist/skills/skill-installer.d.ts.map +1 -0
- package/dist/storage/annotations-store.d.ts +118 -0
- package/dist/storage/annotations-store.d.ts.map +1 -0
- package/dist/storage/attachment-store.d.ts +31 -0
- package/dist/storage/attachment-store.d.ts.map +1 -0
- package/dist/storage/cloud-sync.d.ts +44 -0
- package/dist/storage/cloud-sync.d.ts.map +1 -0
- package/dist/storage/completed-work-checkpoint.d.ts +11 -0
- package/dist/storage/completed-work-checkpoint.d.ts.map +1 -0
- package/dist/storage/config-loader.d.ts +114 -0
- package/dist/storage/config-loader.d.ts.map +1 -0
- package/dist/storage/config-migration.d.ts +87 -0
- package/dist/storage/config-migration.d.ts.map +1 -0
- package/dist/storage/config-store.d.ts +22 -0
- package/dist/storage/config-store.d.ts.map +1 -0
- package/dist/{director-state-CMS_bMs4.d.ts → storage/director-state.d.ts} +28 -8
- package/dist/storage/director-state.d.ts.map +1 -0
- package/dist/storage/file-session-writer.d.ts +169 -0
- package/dist/storage/file-session-writer.d.ts.map +1 -0
- package/dist/{goal-store-Datpp-ar.d.ts → storage/goal-store.d.ts} +26 -19
- package/dist/storage/goal-store.d.ts.map +1 -0
- package/dist/storage/index.d.ts +39 -1031
- package/dist/storage/index.d.ts.map +1 -0
- package/dist/storage/index.js +783 -443
- package/dist/storage/index.js.map +7 -1
- package/dist/storage/input-history-store.d.ts +56 -0
- package/dist/storage/input-history-store.d.ts.map +1 -0
- package/dist/storage/memory-backend.d.ts +66 -0
- package/dist/storage/memory-backend.d.ts.map +1 -0
- package/dist/storage/memory-consolidator.d.ts +50 -0
- package/dist/storage/memory-consolidator.d.ts.map +1 -0
- package/dist/storage/memory-graph-backend.d.ts +117 -0
- package/dist/storage/memory-graph-backend.d.ts.map +1 -0
- package/dist/storage/memory-store.d.ts +119 -0
- package/dist/storage/memory-store.d.ts.map +1 -0
- package/dist/storage/plan-store.d.ts +78 -0
- package/dist/storage/plan-store.d.ts.map +1 -0
- package/dist/storage/plan-templates.d.ts +21 -0
- package/dist/storage/plan-templates.d.ts.map +1 -0
- package/dist/storage/prompt-store.d.ts +37 -0
- package/dist/storage/prompt-store.d.ts.map +1 -0
- package/dist/storage/prompt-usage-store.d.ts +29 -0
- package/dist/storage/prompt-usage-store.d.ts.map +1 -0
- package/dist/storage/provider-config-watcher.d.ts +34 -0
- package/dist/storage/provider-config-watcher.d.ts.map +1 -0
- package/dist/storage/queue-store.d.ts +41 -0
- package/dist/storage/queue-store.d.ts.map +1 -0
- package/dist/storage/recovery-lock.d.ts +79 -0
- package/dist/storage/recovery-lock.d.ts.map +1 -0
- package/dist/storage/replay-log-store.d.ts +97 -0
- package/dist/storage/replay-log-store.d.ts.map +1 -0
- package/dist/storage/session-analyzer.d.ts +48 -0
- package/dist/storage/session-analyzer.d.ts.map +1 -0
- package/dist/storage/session-checkpoint-cas.d.ts +37 -0
- package/dist/storage/session-checkpoint-cas.d.ts.map +1 -0
- package/dist/{session-event-bridge-D_z_mBwk.d.ts → storage/session-event-bridge.d.ts} +14 -15
- package/dist/storage/session-event-bridge.d.ts.map +1 -0
- package/dist/storage/session-helpers.d.ts +9 -0
- package/dist/storage/session-helpers.d.ts.map +1 -0
- package/dist/storage/session-id.d.ts +18 -0
- package/dist/storage/session-id.d.ts.map +1 -0
- package/dist/storage/session-reader.d.ts +21 -0
- package/dist/storage/session-reader.d.ts.map +1 -0
- package/dist/storage/session-recovery.d.ts +93 -0
- package/dist/storage/session-recovery.d.ts.map +1 -0
- package/dist/storage/session-resume-validation.d.ts +6 -0
- package/dist/storage/session-resume-validation.d.ts.map +1 -0
- package/dist/storage/session-rewinder.d.ts +21 -0
- package/dist/storage/session-rewinder.d.ts.map +1 -0
- package/dist/storage/session-store.d.ts +219 -0
- package/dist/storage/session-store.d.ts.map +1 -0
- package/dist/storage/session-summary.d.ts +12 -0
- package/dist/storage/session-summary.d.ts.map +1 -0
- package/dist/storage/session-tool-call-ends.d.ts +5 -0
- package/dist/storage/session-tool-call-ends.d.ts.map +1 -0
- package/dist/storage/storage-concurrency.d.ts +2 -0
- package/dist/storage/storage-concurrency.d.ts.map +1 -0
- package/dist/storage/task-store.d.ts +33 -0
- package/dist/storage/task-store.d.ts.map +1 -0
- package/dist/storage/todos-checkpoint.d.ts +39 -0
- package/dist/storage/todos-checkpoint.d.ts.map +1 -0
- package/dist/storage/tool-audit-log.d.ts +141 -0
- package/dist/storage/tool-audit-log.d.ts.map +1 -0
- package/dist/tasking/index.d.ts +3 -124
- package/dist/tasking/index.d.ts.map +1 -0
- package/dist/tasking/index.js +57 -4
- package/dist/tasking/index.js.map +7 -1
- package/dist/tasking/task-store.d.ts +22 -0
- package/dist/tasking/task-store.d.ts.map +1 -0
- package/dist/tasking/task-tracker.d.ts +102 -0
- package/dist/tasking/task-tracker.d.ts.map +1 -0
- package/dist/tools/index.d.ts +2 -59
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +93 -14
- package/dist/tools/index.js.map +7 -1
- package/dist/tools/mcp-control.d.ts +53 -0
- package/dist/tools/mcp-control.d.ts.map +1 -0
- package/dist/tools/mcp-use.d.ts +24 -0
- package/dist/tools/mcp-use.d.ts.map +1 -0
- package/dist/types/agent-bridge.d.ts +42 -0
- package/dist/types/agent-bridge.d.ts.map +1 -0
- package/dist/types/attachment.d.ts +54 -0
- package/dist/types/attachment.d.ts.map +1 -0
- package/dist/types/autonomy.d.ts +5 -0
- package/dist/types/autonomy.d.ts.map +1 -0
- package/dist/types/blocks.d.ts +76 -0
- package/dist/types/blocks.d.ts.map +1 -0
- package/dist/{compactor-DQLL4HTo.d.ts → types/compactor.d.ts} +5 -7
- package/dist/types/compactor.d.ts.map +1 -0
- package/dist/{config-MRqn1V-u.d.ts → types/config.d.ts} +344 -355
- package/dist/types/config.d.ts.map +1 -0
- package/dist/types/context-evidence.d.ts +68 -0
- package/dist/types/context-evidence.d.ts.map +1 -0
- package/dist/types/context-window.d.ts +35 -0
- package/dist/types/context-window.d.ts.map +1 -0
- package/dist/{default-config-B79_gJYv.d.ts → types/default-config.d.ts} +10 -11
- package/dist/types/default-config.d.ts.map +1 -0
- package/dist/types/design-kit.d.ts +91 -0
- package/dist/types/design-kit.d.ts.map +1 -0
- package/dist/{retry-policy-CQ7KwXJa.d.ts → types/error-handler.d.ts} +5 -12
- package/dist/types/error-handler.d.ts.map +1 -0
- package/dist/types/errors.d.ts +277 -0
- package/dist/types/errors.d.ts.map +1 -0
- package/dist/types/hooks.d.ts +167 -0
- package/dist/types/hooks.d.ts.map +1 -0
- package/dist/types/index.d.ts +40 -244
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +101 -12
- package/dist/types/index.js.map +7 -1
- package/dist/{input-reader-E-ffP2ee.d.ts → types/input-reader.d.ts} +3 -4
- package/dist/types/input-reader.d.ts.map +1 -0
- package/dist/{logger-B63L5bTg.d.ts → types/logger.d.ts} +3 -4
- package/dist/types/logger.d.ts.map +1 -0
- package/dist/types/memory.d.ts +89 -0
- package/dist/types/memory.d.ts.map +1 -0
- package/dist/types/messages.d.ts +24 -0
- package/dist/types/messages.d.ts.map +1 -0
- package/dist/types/mode-prompts.d.ts +2 -0
- package/dist/types/mode-prompts.d.ts.map +1 -0
- package/dist/{mode-CZlO9iU1.d.ts → types/mode.d.ts} +6 -7
- package/dist/types/mode.d.ts.map +1 -0
- package/dist/types/models-registry.d.ts +105 -0
- package/dist/types/models-registry.d.ts.map +1 -0
- package/dist/types/multi-agent.d.ts +443 -0
- package/dist/types/multi-agent.d.ts.map +1 -0
- package/dist/{observability-D-HZN_mF.d.ts → types/observability.d.ts} +17 -13
- package/dist/types/observability.d.ts.map +1 -0
- package/dist/{path-resolver-CPRj4bFY.d.ts → types/path-resolver.d.ts} +2 -3
- package/dist/types/path-resolver.d.ts.map +1 -0
- package/dist/{permission-ByDKXEcG.d.ts → types/permission.d.ts} +8 -9
- package/dist/types/permission.d.ts.map +1 -0
- package/dist/types/plugin.d.ts +385 -0
- package/dist/types/plugin.d.ts.map +1 -0
- package/dist/types/prompt-registry.d.ts +81 -0
- package/dist/types/prompt-registry.d.ts.map +1 -0
- package/dist/{prompt-DLd35n4Q.d.ts → types/prompt.d.ts} +14 -15
- package/dist/types/prompt.d.ts.map +1 -0
- package/dist/{provider-runner-ChL-kVg6.d.ts → types/provider-runner.d.ts} +9 -10
- package/dist/types/provider-runner.d.ts.map +1 -0
- package/dist/types/provider.d.ts +387 -0
- package/dist/types/provider.d.ts.map +1 -0
- package/dist/types/renderer.d.ts +23 -0
- package/dist/types/renderer.d.ts.map +1 -0
- package/dist/types/retry-policy.d.ts +7 -0
- package/dist/types/retry-policy.d.ts.map +1 -0
- package/dist/types/secret-scrubber.d.ts +5 -0
- package/dist/types/secret-scrubber.d.ts.map +1 -0
- package/dist/{secret-vault-BAKpgFw_.d.ts → types/secret-vault.d.ts} +13 -7
- package/dist/types/secret-vault.d.ts.map +1 -0
- package/dist/{selector-D8O6B_Rm.d.ts → types/selector.d.ts} +4 -6
- package/dist/types/selector.d.ts.map +1 -0
- package/dist/types/session-reader.d.ts +81 -0
- package/dist/types/session-reader.d.ts.map +1 -0
- package/dist/{session-rewinder-C9HnMkhP.d.ts → types/session-rewinder.d.ts} +5 -6
- package/dist/types/session-rewinder.d.ts.map +1 -0
- package/dist/types/session.d.ts +650 -0
- package/dist/types/session.d.ts.map +1 -0
- package/dist/types/side-effect.d.ts +34 -0
- package/dist/types/side-effect.d.ts.map +1 -0
- package/dist/{skill-DHniprNl.d.ts → types/skill.d.ts} +4 -5
- package/dist/types/skill.d.ts.map +1 -0
- package/dist/types/slash-command.d.ts +59 -0
- package/dist/types/slash-command.d.ts.map +1 -0
- package/dist/types/spec.d.ts +77 -0
- package/dist/types/spec.d.ts.map +1 -0
- package/dist/types/system-prompt-contributor.d.ts +20 -0
- package/dist/types/system-prompt-contributor.d.ts.map +1 -0
- package/dist/types/system-prompt.d.ts +51 -0
- package/dist/types/system-prompt.d.ts.map +1 -0
- package/dist/{task-graph-CH3acNQ7.d.ts → types/task-graph.d.ts} +21 -22
- package/dist/types/task-graph.d.ts.map +1 -0
- package/dist/types/token-counter.d.ts +42 -0
- package/dist/types/token-counter.d.ts.map +1 -0
- package/dist/types/tool-executor.d.ts +133 -0
- package/dist/types/tool-executor.d.ts.map +1 -0
- package/dist/types/tool-markers.d.ts +23 -0
- package/dist/types/tool-markers.d.ts.map +1 -0
- package/dist/types/tool.d.ts +252 -0
- package/dist/types/tool.d.ts.map +1 -0
- package/dist/types/utility-types.d.ts +31 -0
- package/dist/types/utility-types.d.ts.map +1 -0
- package/dist/utils/assert-never.d.ts +14 -0
- package/dist/utils/assert-never.d.ts.map +1 -0
- package/dist/utils/atomic-write.d.ts +12 -0
- package/dist/utils/atomic-write.d.ts.map +1 -0
- package/dist/utils/child-env.d.ts +67 -0
- package/dist/utils/child-env.d.ts.map +1 -0
- package/dist/utils/color.d.ts +20 -0
- package/dist/utils/color.d.ts.map +1 -0
- package/dist/utils/config-json.d.ts +14 -0
- package/dist/utils/config-json.d.ts.map +1 -0
- package/dist/utils/context-evidence.d.ts +47 -0
- package/dist/utils/context-evidence.d.ts.map +1 -0
- package/dist/utils/deep-merge.d.ts +64 -0
- package/dist/utils/deep-merge.d.ts.map +1 -0
- package/dist/utils/diff.d.ts +11 -0
- package/dist/utils/diff.d.ts.map +1 -0
- package/dist/utils/error.d.ts +2 -3
- package/dist/utils/error.d.ts.map +1 -0
- package/dist/utils/error.js +3 -3
- package/dist/utils/error.js.map +7 -1
- package/dist/utils/expect-defined.d.ts +2 -3
- package/dist/utils/expect-defined.d.ts.map +1 -0
- package/dist/utils/expect-defined.js +3 -3
- package/dist/utils/expect-defined.js.map +7 -1
- package/dist/utils/glob-expand.d.ts +10 -0
- package/dist/utils/glob-expand.d.ts.map +1 -0
- package/dist/utils/glob-match.d.ts +4 -0
- package/dist/utils/glob-match.d.ts.map +1 -0
- package/dist/utils/incoming-images.d.ts +39 -0
- package/dist/utils/incoming-images.d.ts.map +1 -0
- package/dist/utils/index.d.ts +38 -920
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +323 -36
- package/dist/utils/index.js.map +7 -1
- package/dist/utils/instruction-file.d.ts +3 -0
- package/dist/utils/instruction-file.d.ts.map +1 -0
- package/dist/utils/ip-guard.d.ts +34 -0
- package/dist/utils/ip-guard.d.ts.map +1 -0
- package/dist/utils/json-repair.d.ts +23 -0
- package/dist/utils/json-repair.d.ts.map +1 -0
- package/dist/utils/json-schema-validate.d.ts +42 -0
- package/dist/utils/json-schema-validate.d.ts.map +1 -0
- package/dist/utils/lru-cache.d.ts +29 -0
- package/dist/utils/lru-cache.d.ts.map +1 -0
- package/dist/utils/merge-custom-models.d.ts +12 -0
- package/dist/utils/merge-custom-models.d.ts.map +1 -0
- package/dist/utils/merge-models-payload.d.ts +20 -0
- package/dist/utils/merge-models-payload.d.ts.map +1 -0
- package/dist/utils/message-invariants.d.ts +22 -0
- package/dist/utils/message-invariants.d.ts.map +1 -0
- package/dist/utils/newline-normalize.d.ts +5 -0
- package/dist/utils/newline-normalize.d.ts.map +1 -0
- package/dist/utils/regex-guard.d.ts +21 -0
- package/dist/utils/regex-guard.d.ts.map +1 -0
- package/dist/utils/safe-json.d.ts +31 -0
- package/dist/utils/safe-json.d.ts.map +1 -0
- package/dist/utils/session-scoped-path.d.ts +13 -0
- package/dist/utils/session-scoped-path.d.ts.map +1 -0
- package/dist/utils/sleep.d.ts +5 -0
- package/dist/utils/sleep.d.ts.map +1 -0
- package/dist/utils/slug.d.ts +13 -0
- package/dist/utils/slug.d.ts.map +1 -0
- package/dist/utils/string.d.ts +9 -0
- package/dist/utils/string.d.ts.map +1 -0
- package/dist/utils/task-format.d.ts +22 -0
- package/dist/utils/task-format.d.ts.map +1 -0
- package/dist/utils/term.d.ts +133 -0
- package/dist/utils/term.d.ts.map +1 -0
- package/dist/utils/todos-format.d.ts +30 -0
- package/dist/utils/todos-format.d.ts.map +1 -0
- package/dist/utils/token-estimate.d.ts +112 -0
- package/dist/utils/token-estimate.d.ts.map +1 -0
- package/dist/utils/tool-description-mode.d.ts +28 -0
- package/dist/utils/tool-description-mode.d.ts.map +1 -0
- package/dist/utils/tool-output-serializer.d.ts +40 -0
- package/dist/utils/tool-output-serializer.d.ts.map +1 -0
- package/dist/utils/tool-result-render-mode.d.ts +55 -0
- package/dist/utils/tool-result-render-mode.d.ts.map +1 -0
- package/dist/utils/tool-subject.d.ts +5 -0
- package/dist/utils/tool-subject.d.ts.map +1 -0
- package/dist/utils/tool-wire-compact.d.ts +28 -0
- package/dist/utils/tool-wire-compact.d.ts.map +1 -0
- package/dist/utils/ulid.d.ts +11 -0
- package/dist/utils/ulid.d.ts.map +1 -0
- package/dist/{wstack-paths-C3K40Qst.d.ts → utils/wstack-paths.d.ts} +7 -8
- package/dist/utils/wstack-paths.d.ts.map +1 -0
- package/dist/worktree/index.d.ts +2 -0
- package/dist/worktree/index.d.ts.map +1 -0
- package/dist/{worktree-manager-DzwxKE35.d.ts → worktree/worktree-manager.d.ts} +32 -17
- package/dist/worktree/worktree-manager.d.ts.map +1 -0
- package/instructions/agents/browser.md +25 -16
- package/instructions/autonomy/active-mission.md +2 -4
- package/instructions/coordination/subagent-baseline.md +16 -2
- package/instructions/leader-after-task.md +3 -1
- package/instructions/sections/tool/common-patterns.md +7 -1
- package/instructions/sections/tool/delegation-full.md +1 -1
- package/instructions/system.md +47 -0
- package/package.json +4 -5
- package/skills/docker-deploy/SKILL.md +1 -1
- package/skills/node-modern/SKILL.md +2 -2
- package/skills/plugin-author/SKILL.md +9 -16
- package/skills/wrongstack-mailbox/SKILL.md +51 -12
- package/dist/dispatcher-types.d-BBeXBQgS.d.ts +0 -66
- package/dist/global-mailbox-sZwyI6CS.d.ts +0 -959
- package/dist/index--Gm41aBJ.d.ts +0 -671
- package/dist/mcp-servers-DEV4s6Ks.d.ts +0 -259
- package/dist/multi-agent-coordinator-4RCRZKjN.d.ts +0 -1770
- package/dist/null-fleet-bus-CFoNVQEK.d.ts +0 -2127
- package/dist/pipeline-DGDyIohT.d.ts +0 -331
- package/dist/provider-model-resolve-o2hHLs79.d.ts +0 -263
- package/dist/secret-scrubber-3MHDDAtm.d.ts +0 -6
- package/dist/secret-vault-DxohkUBc.d.ts +0 -272
- package/dist/session-reader-7Esxrkpw.d.ts +0 -155
- package/dist/task-format-GX0B1mMC.d.ts +0 -23
- package/dist/todos-checkpoint-FY7PjmMx.d.ts +0 -850
- package/dist/tool-BNlnIJvo.d.ts +0 -2190
- package/dist/tool-executor-CckSCM5E.d.ts +0 -906
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* BrainRuntime — the live, rebuildable owner of `config.brain`.
|
|
3
|
+
*
|
|
4
|
+
* The Brain chain used to be assembled once at boot; every knob except the
|
|
5
|
+
* risk ceiling and escalation mode was frozen until restart. This module
|
|
6
|
+
* makes the whole `BrainConfig` surface live-editable AND persistable from
|
|
7
|
+
* any host surface (/brain subcommands, TUI Brain panel, WebUI BrainSection):
|
|
8
|
+
*
|
|
9
|
+
* - `arbiter` is a STABLE delegating handle (`decide` reads a mutable
|
|
10
|
+
* `current`), so hosts wrap it once in their EscalationRouting/Observable
|
|
11
|
+
* layers and no consumer ever needs a rebind after a settings change.
|
|
12
|
+
* - `apply(patch)` normalizes + validates the patch, commits it, rebuilds
|
|
13
|
+
* the tier chain when a structural knob changed (pool, council, timeout,
|
|
14
|
+
* ledger guard), and persists through an injected callback — core never
|
|
15
|
+
* touches config files itself.
|
|
16
|
+
* - `getSnapshot()` is the JSON-safe truth both UIs render: configured
|
|
17
|
+
* values plus derived facts (resolved pool/council labels, EFFECTIVE
|
|
18
|
+
* council enablement, session-model fallback).
|
|
19
|
+
*
|
|
20
|
+
* Persistence contract: `config.brain` is on the in-project deny list, so
|
|
21
|
+
* the injected `persist` MUST write the GLOBAL config. A persist failure
|
|
22
|
+
* never rolls back the live change; it is reported via the returned promise.
|
|
23
|
+
*
|
|
24
|
+
* @module brain-runtime
|
|
25
|
+
*/
|
|
26
|
+
import { type BrainArbiter, type BrainDecisionRequest, type BrainEscalationMode } from '../coordination/brain.js';
|
|
27
|
+
import type { BrainConfig, BrainCouncilVoterConfig, BrainModelEntry } from '../types/config.js';
|
|
28
|
+
import type { Provider } from '../types/provider.js';
|
|
29
|
+
import { type BrainAutoRisk } from './autonomy-brain.js';
|
|
30
|
+
export type BrainCouncilMinRisk = 'medium' | 'high' | 'critical';
|
|
31
|
+
export type BrainPoolStrategy = 'fallback' | 'round-robin';
|
|
32
|
+
/** JSON-safe view of the live Brain configuration + derived facts. */
|
|
33
|
+
export interface BrainConfigSnapshot {
|
|
34
|
+
mode: BrainEscalationMode;
|
|
35
|
+
maxAutoRisk: BrainAutoRisk;
|
|
36
|
+
/** Configured pool entries (normalized). Empty = session model. */
|
|
37
|
+
models: BrainModelEntry[];
|
|
38
|
+
strategy: BrainPoolStrategy;
|
|
39
|
+
decisionTimeoutMs: number | undefined;
|
|
40
|
+
humanTimeoutMs: number | undefined;
|
|
41
|
+
council: {
|
|
42
|
+
/** EFFECTIVE enablement (default rule `voters >= 2` applied). */
|
|
43
|
+
enabled: boolean;
|
|
44
|
+
/** Raw configured value (undefined = default rule decides). */
|
|
45
|
+
configured: boolean | undefined;
|
|
46
|
+
minRisk: BrainCouncilMinRisk;
|
|
47
|
+
/** Explicitly configured voters; seats derived from the pool are visible via `councilLabels`. */
|
|
48
|
+
voters: BrainCouncilVoterConfig[];
|
|
49
|
+
quorum: number | undefined;
|
|
50
|
+
approval: number | undefined;
|
|
51
|
+
judge: BrainModelEntry | undefined;
|
|
52
|
+
};
|
|
53
|
+
ledger: {
|
|
54
|
+
enabled: boolean;
|
|
55
|
+
autoDenyAfterFailures: number | undefined;
|
|
56
|
+
path: string | undefined;
|
|
57
|
+
};
|
|
58
|
+
/** Resolved pool labels from the LAST assembly (may be fewer than `models` — unresolvable refs are skipped). */
|
|
59
|
+
poolLabels: string[];
|
|
60
|
+
/** Resolved council seat labels; empty = council effectively disabled. */
|
|
61
|
+
councilLabels: string[];
|
|
62
|
+
usingSessionModel: boolean;
|
|
63
|
+
}
|
|
64
|
+
/** Council sub-patch. Arrays REPLACE; `null` clears back to the default. */
|
|
65
|
+
export interface BrainCouncilPatch {
|
|
66
|
+
enabled?: boolean | null | undefined;
|
|
67
|
+
minRisk?: BrainCouncilMinRisk | null | undefined;
|
|
68
|
+
voters?: Array<string | BrainCouncilVoterConfig> | null | undefined;
|
|
69
|
+
quorum?: number | null | undefined;
|
|
70
|
+
approval?: number | null | undefined;
|
|
71
|
+
judge?: string | BrainModelEntry | null | undefined;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Partial update for the live Brain config. Omitted fields are untouched,
|
|
75
|
+
* `null` clears a field back to its default, arrays replace wholesale.
|
|
76
|
+
*/
|
|
77
|
+
export interface BrainConfigPatch {
|
|
78
|
+
mode?: BrainEscalationMode | undefined;
|
|
79
|
+
maxAutoRisk?: BrainAutoRisk | undefined;
|
|
80
|
+
models?: Array<string | BrainModelEntry> | null | undefined;
|
|
81
|
+
strategy?: BrainPoolStrategy | null | undefined;
|
|
82
|
+
decisionTimeoutMs?: number | null | undefined;
|
|
83
|
+
humanTimeoutMs?: number | null | undefined;
|
|
84
|
+
council?: BrainCouncilPatch | null | undefined;
|
|
85
|
+
ledger?: {
|
|
86
|
+
enabled?: boolean | undefined;
|
|
87
|
+
autoDenyAfterFailures?: number | null | undefined;
|
|
88
|
+
} | null | undefined;
|
|
89
|
+
}
|
|
90
|
+
/** Host-owned ledger controller — the runtime never touches ledger files. */
|
|
91
|
+
export interface BrainRuntimeLedgerHost {
|
|
92
|
+
getPath: () => string | undefined;
|
|
93
|
+
isEnabled: () => boolean;
|
|
94
|
+
/** Host starts/stops its BrainDecisionLedger instance. */
|
|
95
|
+
setEnabled: (enabled: boolean) => void;
|
|
96
|
+
failureStreakFor?: ((request: Pick<BrainDecisionRequest, 'source' | 'question' | 'id'>) => number) | undefined;
|
|
97
|
+
getDecisionDigest?: ((request: BrainDecisionRequest) => string | undefined) | undefined;
|
|
98
|
+
}
|
|
99
|
+
export interface BrainRuntimeOptions {
|
|
100
|
+
/** Boot-time `config.brain`. Invalid entries are dropped leniently here (apply() is strict). */
|
|
101
|
+
initialConfig: BrainConfig | undefined;
|
|
102
|
+
/** The session's provider id (`config.provider`). */
|
|
103
|
+
defaultProviderId: string;
|
|
104
|
+
/** Live session provider — read per decision so `/setmodel` switches apply. */
|
|
105
|
+
sessionProvider: () => Provider;
|
|
106
|
+
/** Live session model id — read per decision. */
|
|
107
|
+
sessionModel: () => string;
|
|
108
|
+
/** Resolve a NON-default provider id. May throw / return null → entry skipped. */
|
|
109
|
+
resolveProvider: (providerId: string, model: string) => Provider | null;
|
|
110
|
+
ledger?: BrainRuntimeLedgerHost | undefined;
|
|
111
|
+
/**
|
|
112
|
+
* Injected writer for the canonical `BrainConfig`. MUST target the global
|
|
113
|
+
* config (`config.brain` is denied in project scope). Absent = live-only.
|
|
114
|
+
*/
|
|
115
|
+
persist?: ((config: BrainConfig) => Promise<void>) | undefined;
|
|
116
|
+
/** Fired after every successful apply, with the fresh snapshot. */
|
|
117
|
+
onApplied?: ((snapshot: BrainConfigSnapshot) => void) | undefined;
|
|
118
|
+
}
|
|
119
|
+
export interface BrainApplyResult {
|
|
120
|
+
snapshot: BrainConfigSnapshot;
|
|
121
|
+
/** Resolves `{ok: true}` immediately when persistence was skipped or absent. */
|
|
122
|
+
persisted: Promise<{
|
|
123
|
+
ok: boolean;
|
|
124
|
+
error?: string | undefined;
|
|
125
|
+
}>;
|
|
126
|
+
}
|
|
127
|
+
export interface BrainRuntime {
|
|
128
|
+
/** STABLE arbiter handle — the inner tier chain swaps on `apply`. */
|
|
129
|
+
arbiter: BrainArbiter;
|
|
130
|
+
getMode(): BrainEscalationMode;
|
|
131
|
+
getMaxAutoRisk(): BrainAutoRisk;
|
|
132
|
+
getHumanTimeoutMs(): number | undefined;
|
|
133
|
+
getSnapshot(): BrainConfigSnapshot;
|
|
134
|
+
/** Canonical shape written to `config.brain` (compact string refs where lossless). */
|
|
135
|
+
getConfig(): BrainConfig;
|
|
136
|
+
/** Live-apply synchronously; persistence (default on) is async best-effort. */
|
|
137
|
+
apply(patch: BrainConfigPatch, opts?: {
|
|
138
|
+
persist?: boolean | undefined;
|
|
139
|
+
}): BrainApplyResult;
|
|
140
|
+
}
|
|
141
|
+
export interface BrainDefaultsContext {
|
|
142
|
+
/** The session's fallback chain (`config.fallbackModels`) — seeds the default pool. */
|
|
143
|
+
fallbackModels?: readonly string[] | undefined;
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Product defaults for hosts that want a minimum-human Brain out of the box
|
|
147
|
+
* (CLI/TUI wiring and the standalone WebUI server both apply this before
|
|
148
|
+
* `createBrainRuntime`). Only FILLS GAPS — every explicitly configured field
|
|
149
|
+
* wins, so existing `config.brain` blocks are untouched by updates.
|
|
150
|
+
*
|
|
151
|
+
* - `models` → the user's own `fallbackModels` chain (never hardcoded
|
|
152
|
+
* model ids; every install has different providers). With ≥2 entries the
|
|
153
|
+
* council auto-derives from the pool, so multi-model users get a council
|
|
154
|
+
* by default.
|
|
155
|
+
* - `mode` → 'headless': decisions never block on a human; the terminal
|
|
156
|
+
* policy (safe default / deny) is the escalation of last resort.
|
|
157
|
+
* - `maxAutoRisk` → adaptive: 'all' when a council can convene (critical
|
|
158
|
+
* questions get a multi-model panel), otherwise 'high' (critical
|
|
159
|
+
* questions resolve via the conservative terminal policy instead of a
|
|
160
|
+
* single unchecked model).
|
|
161
|
+
* - `humanTimeoutMs` → 120s: if the user explicitly switches back to
|
|
162
|
+
* 'interactive', an unanswered prompt still auto-resolves instead of
|
|
163
|
+
* hanging an unattended run forever. Set `humanTimeoutMs: 0` to restore
|
|
164
|
+
* the legacy wait-indefinitely behavior.
|
|
165
|
+
*
|
|
166
|
+
* NOTE deliberately NOT persisted anywhere — resolved at boot, so existing
|
|
167
|
+
* users pick these up on update without any config migration/write.
|
|
168
|
+
*/
|
|
169
|
+
export declare function resolveBrainConfigDefaults(brain: BrainConfig | undefined, ctx?: BrainDefaultsContext): BrainConfig;
|
|
170
|
+
export declare function createBrainRuntime(opts: BrainRuntimeOptions): BrainRuntime;
|
|
171
|
+
//# sourceMappingURL=brain-runtime.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"brain-runtime.d.ts","sourceRoot":"","sources":["../../src/execution/brain-runtime.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EAEzB,MAAM,0BAA0B,CAAC;AAGlC,OAAO,KAAK,EAAE,WAAW,EAAE,uBAAuB,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAChG,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,KAAK,aAAa,EAA4B,MAAM,qBAAqB,CAAC;AAGnF,MAAM,MAAM,mBAAmB,GAAG,QAAQ,GAAG,MAAM,GAAG,UAAU,CAAC;AACjE,MAAM,MAAM,iBAAi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E;QAAE,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;KAAE,GAAG,gBAAgB,CAAC;CAC5F;AAkED,MAAM,WAAW,oBAAoB;IACnC,uFAAuF;IACvF,cAAc,CAAC,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,CAAC;CAChD;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,0BAA0B,CACxC,KAAK,EAAE,WAAW,GAAG,SAAS,EAC9B,GAAG,GAAE,oBAAyB,GAC7B,WAAW,CAWb;AA6BD,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,mBAAmB,GAAG,YAAY,CAiP1E"}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import type { Message } from '../types/messages.js';
|
|
2
|
+
import { estimateMessageTokens } from '../utils/token-estimate.js';
|
|
3
|
+
/**
|
|
4
|
+
* Token estimate for a message array (text + tool I/O). Re-exported from the
|
|
5
|
+
* canonical `token-estimate` helper so compactors and the context-pressure
|
|
6
|
+
* monitor share one number.
|
|
7
|
+
*/
|
|
8
|
+
export declare const estimateMessages: typeof estimateMessageTokens;
|
|
9
|
+
/**
|
|
10
|
+
* Shared, pure compaction primitives.
|
|
11
|
+
*
|
|
12
|
+
* Before this module the three compactors (`HybridCompactor`,
|
|
13
|
+
* `IntelligentCompactor`, `SelectiveCompactor`) each carried their own copies
|
|
14
|
+
* of message-token estimation, tool-result elision, text detection and digest
|
|
15
|
+
* rendering — with subtle divergences (notably Selective lacked the
|
|
16
|
+
* tool_use/tool_result pair preservation, so it could elide the result of a
|
|
17
|
+
* tool call it was supposed to keep). These helpers are the single source of
|
|
18
|
+
* truth. They operate on plain `Message[]` and never touch `Context`/state, so
|
|
19
|
+
* each compactor keeps its own `ctx.state.replaceMessages(...)` plumbing.
|
|
20
|
+
*/
|
|
21
|
+
/** Does this message carry any non-empty text? */
|
|
22
|
+
export declare function hasTextContent(m: Message): boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Index where the preserved (recent) window starts. Walks back counting
|
|
25
|
+
* user/assistant messages until `preserveK` are covered, then walks forward to
|
|
26
|
+
* keep any tool_use/tool_result protocol pair intact — so a tool_result whose
|
|
27
|
+
* tool_use is preserved is never elided.
|
|
28
|
+
*
|
|
29
|
+
* Instrumentation: emits `compaction.find_preserve_start.ended` with the
|
|
30
|
+
* repair-loop block count so we can track whether protocol-pair repair is
|
|
31
|
+
* scanning too much content.
|
|
32
|
+
*/
|
|
33
|
+
export declare function findPreserveStart(messages: readonly Message[], preserveK: number): number;
|
|
34
|
+
export interface EliseResult {
|
|
35
|
+
/** New message array, or the same reference when nothing changed. */
|
|
36
|
+
messages: Message[];
|
|
37
|
+
/** Estimated tokens reclaimed. */
|
|
38
|
+
saved: number;
|
|
39
|
+
changed: boolean;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Elide oversized tool I/O that falls before the preserve window. Pure:
|
|
43
|
+
* returns a fresh array (or the same reference when unchanged). Replaces the
|
|
44
|
+
* duplicate copies that lived in all three compactors.
|
|
45
|
+
*/
|
|
46
|
+
export declare function eliseOldToolResults(messages: readonly Message[], opts: {
|
|
47
|
+
preserveK: number;
|
|
48
|
+
eliseThreshold: number;
|
|
49
|
+
}): EliseResult;
|
|
50
|
+
/**
|
|
51
|
+
* Lossless textual digest of a message range. Every text block is kept verbatim
|
|
52
|
+
* (across all roles, so prior `system` digests fold forward and nothing
|
|
53
|
+
* accumulates as loss). `tool_use` / `tool_result` blocks are counted and
|
|
54
|
+
* replaced with a marker rather than serialized — their payload is already
|
|
55
|
+
* persisted in the session log. Empty/tool-only messages are skipped.
|
|
56
|
+
*/
|
|
57
|
+
export declare function buildLosslessDigest(messages: readonly Message[]): string;
|
|
58
|
+
/** Importance score for a message — drives retention vs. summarization. */
|
|
59
|
+
export type ContentScore = 0 | 1 | 2 | 3 | 4 | 5;
|
|
60
|
+
/**
|
|
61
|
+
* Extract the plain text from a message (ignoring tool blocks).
|
|
62
|
+
* Returns empty string if no text content exists.
|
|
63
|
+
*/
|
|
64
|
+
export declare function extractText(m: Message): string;
|
|
65
|
+
/** Check if a message contains a tool_use block. */
|
|
66
|
+
export declare function hasToolUse(m: Message): boolean;
|
|
67
|
+
/** Check if a message contains a tool_result block over the given char threshold. */
|
|
68
|
+
export declare function hasLargeToolResult(m: Message, threshold?: number): boolean;
|
|
69
|
+
/**
|
|
70
|
+
* Score a message by content importance.
|
|
71
|
+
*
|
|
72
|
+
* CRITICAL (5): user corrections, explicit "no/wrong/stop", error messages,
|
|
73
|
+
* architecture decisions, security findings.
|
|
74
|
+
* MEDIUM (3): normal exchanges, successful tool calls, file reads, edits.
|
|
75
|
+
* LOW (1): large tool results (>3K chars), grep/file-list outputs, boilerplate.
|
|
76
|
+
* NOISE (0): repeated identical failures (same tool, same error, 5th+ occurrence
|
|
77
|
+
* within the range), pure tool I/O with no text.
|
|
78
|
+
*/
|
|
79
|
+
export declare function scoreMessage(m: Message, context?: {
|
|
80
|
+
failureCounts?: Map<string, number>;
|
|
81
|
+
}): ContentScore;
|
|
82
|
+
/**
|
|
83
|
+
* Build a content-aware digest of messages.
|
|
84
|
+
*
|
|
85
|
+
* Unlike `buildLosslessDigest` which preserves all text equally, this uses
|
|
86
|
+
* `scoreMessage` to apply tiered treatment:
|
|
87
|
+
* - Score 5 (critical): verbatim text
|
|
88
|
+
* - Score 3 (medium): first sentence only
|
|
89
|
+
* - Score 1 (low): one-line summary
|
|
90
|
+
* - Score 0 (noise): collapsed to count marker
|
|
91
|
+
*/
|
|
92
|
+
export declare function buildSmartDigest(messages: readonly Message[]): string;
|
|
93
|
+
/**
|
|
94
|
+
* Nearest safe cut boundary in [from, to]: the start of the exchange of the
|
|
95
|
+
* closest user-with-text message. Returns -1 when no such boundary exists.
|
|
96
|
+
*/
|
|
97
|
+
export declare function findSafeBoundary(messages: readonly Message[], from: number, to: number): number;
|
|
98
|
+
/**
|
|
99
|
+
* Walk backwards from a user message to find where its logical exchange began
|
|
100
|
+
* (just after the last assistant message that made no tool calls).
|
|
101
|
+
*/
|
|
102
|
+
export declare function findExchangeStart(messages: readonly Message[], userIndex: number): number;
|
|
103
|
+
//# sourceMappingURL=compaction-core.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compaction-core.d.ts","sourceRoot":"","sources":["../../src/execution/compaction-core.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EACL,qBAAqB,EAGtB,MAAM,4BAA4B,CAAC;AAkHpC;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,8BAAwB,CAAC;AAEtD;;;;;;;;;;;GAWG;AAEH,kDAAkD;AAClD,wBAAgB,cAAc,CAAC,CAAC,EAAE,OAAO,GAAG,OAAO,CAGlD;AAED;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,SAAS,OAAO,EAAE,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CA8CzF;AAiCD,MAAM,WAAW,WAAW;IAC1B,qEAAqE;IACrE,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,kCAAkC;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,OAAO,CAAC;CAClB;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,SAAS,OAAO,EAAE,EAC5B,IAAI,EAAE;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,cAAc,EAAE,MAAM,CAAA;CAAE,GAClD,WAAW,CAsIb;AAkED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,SAAS,OAAO,EAAE,GAAG,MAAM,CAoBxE;AAID,2EAA2E;AAC3E,MAAM,MAAM,YAAY,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAMjD;;;GAGG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM,CAM9C;AAED,oDAAoD;AACpD,wBAAgB,UAAU,CAAC,CAAC,EAAE,OAAO,GAAG,OAAO,CAG9C;AAED,qFAAqF;AACrF,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,OAAO,EAAE,SAAS,SAAO,GAAG,OAAO,CAUxE;AAED;;;;;;;;;GASG;AACH,wBAAgB,YAAY,CAC1B,CAAC,EAAE,OAAO,EACV,OAAO,CAAC,EAAE;IAAE,aAAa,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAAE,GAChD,YAAY,CA6Dd;AAED;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,SAAS,OAAO,EAAE,GAAG,MAAM,CAuDrE;AAiCD;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,SAAS,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM,CAS/F;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,SAAS,OAAO,EAAE,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAczF"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { Context } from '../core/context.js';
|
|
2
|
+
import type { CompactReport, Compactor } from '../types/compactor.js';
|
|
3
|
+
export interface CompactorOptions {
|
|
4
|
+
preserveK?: number | undefined;
|
|
5
|
+
eliseThreshold?: number | undefined;
|
|
6
|
+
/**
|
|
7
|
+
* Enable content-aware digest mode. When true, `collapseAncientTurns` uses
|
|
8
|
+
* `buildSmartDigest` which scores messages by importance: critical content
|
|
9
|
+
* (errors, corrections, decisions) is kept verbatim; normal exchanges get
|
|
10
|
+
* first-sentence summaries; large tool outputs and repeated failures are
|
|
11
|
+
* aggressively compressed. Defaults to false (lossless digest).
|
|
12
|
+
*/
|
|
13
|
+
smart?: boolean | undefined;
|
|
14
|
+
/**
|
|
15
|
+
* @deprecated Ignored. Token estimation is centralized in
|
|
16
|
+
* `compaction-core`/`token-estimate` so all compactors and the context-pressure
|
|
17
|
+
* monitor agree on one number. Kept only for backward-compatible call sites.
|
|
18
|
+
*/
|
|
19
|
+
estimator?: (((text: string) => number)) | undefined;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Default tools config values shared across CLI and WebUI.
|
|
23
|
+
* Import this instead of hardcoding to avoid cross-surface inconsistencies.
|
|
24
|
+
* These mirror the values in BEHAVIOR_DEFAULTS (config-loader.ts).
|
|
25
|
+
*
|
|
26
|
+
* @deprecated Import from '../types/default-config.js' instead.
|
|
27
|
+
* This re-export exists for backward compatibility.
|
|
28
|
+
*/
|
|
29
|
+
export { DEFAULT_TOOLS_CONFIG, DEFAULT_CONTEXT_CONFIG, DEFAULT_AUTONOMY_CONFIG } from '../types/default-config.js';
|
|
30
|
+
export declare class HybridCompactor implements Compactor {
|
|
31
|
+
private readonly preserveK;
|
|
32
|
+
private readonly eliseThreshold;
|
|
33
|
+
private readonly smart;
|
|
34
|
+
constructor(opts?: CompactorOptions);
|
|
35
|
+
compact(ctx: Context, opts?: {
|
|
36
|
+
aggressive?: boolean | undefined;
|
|
37
|
+
}): Promise<CompactReport>;
|
|
38
|
+
/**
|
|
39
|
+
* Estimate the full API request token count: messages + systemPrompt + toolDefs.
|
|
40
|
+
* This is the accurate figure for context-window pressure monitoring.
|
|
41
|
+
*/
|
|
42
|
+
private estimateFullRequest;
|
|
43
|
+
/**
|
|
44
|
+
* Lossless rule-based collapse of ancient turns into a single digest message.
|
|
45
|
+
*
|
|
46
|
+
* Preserves ALL textual content of the collapsed range — user instructions,
|
|
47
|
+
* assistant decisions/conclusions, and any prior digests (chained forward so
|
|
48
|
+
* the digest stays lossless across repeated compactions). Only `tool_use` /
|
|
49
|
+
* `tool_result` protocol blocks are dropped and replaced with a count marker;
|
|
50
|
+
* their full payload already lives in the session log. No sub-LLM call.
|
|
51
|
+
*
|
|
52
|
+
* Returns the token savings and the digest text (for audit logging).
|
|
53
|
+
*/
|
|
54
|
+
private collapseAncientTurns;
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=compactor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compactor.d.ts","sourceRoot":"","sources":["../../src/execution/compactor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AActE,MAAM,WAAW,gBAAgB;IAC/B,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,cAAc,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACpC;;;;;;OAMG;IACH,KAAK,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC5B;;;;OAIG;IACH,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC,CAAC,GAAG,SAAS,CAAC;CACtD;AAED;;;;;;;GAOG;AACH,OAAO,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AAEnH,qBAAa,eAAgB,YAAW,SAAS;IAC/C,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;IACnC,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAS;IACxC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAU;IAEhC,YAAY,IAAI,GAAE,gBAAqB,EAItC;IAEK,OAAO,CAAC,GAAG,EAAE,OAAO,EAAE,IAAI,GAAE;QAAE,UAAU,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;KAAO,GAAG,OAAO,CAAC,aAAa,CAAC,CAsDnG;IAED;;;OAGG;IACH,OAAO,CAAC,mBAAmB;IAI3B;;;;;;;;;;OAUG;IACH,OAAO,CAAC,oBAAoB;CAiD7B"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CouncilBrainArbiter — a multi-LLM decision panel for high-stakes questions.
|
|
3
|
+
*
|
|
4
|
+
* Instead of trusting one model's single completion, the council convenes N
|
|
5
|
+
* independent voters (ideally different models/providers), each with a
|
|
6
|
+
* distinct decision persona:
|
|
7
|
+
*
|
|
8
|
+
* - executor — biased toward forward progress; hates stalling.
|
|
9
|
+
* - skeptic — hunts for the reason the proposed action is wrong; may veto.
|
|
10
|
+
* - auditor — cost/waste/budget lens; hates throwing tokens at dead ends.
|
|
11
|
+
*
|
|
12
|
+
* Votes are cast INDEPENDENTLY (no voter sees another's rationale), then
|
|
13
|
+
* tallied with weights. Resolution ladder:
|
|
14
|
+
*
|
|
15
|
+
* 1. QUORUM — fewer than `quorumFraction` of seats returned a valid vote
|
|
16
|
+
* → the council abstains (`ask_human`), letting the escalation tier
|
|
17
|
+
* (human prompt or headless terminal policy) resolve it.
|
|
18
|
+
* 2. VETO — a veto seat explicitly refusing denies the request outright.
|
|
19
|
+
* 3. MAJORITY — the option with the highest total weight wins when it
|
|
20
|
+
* exceeds `approvalFraction` of all cast weight.
|
|
21
|
+
* 4. JUDGE — ties / weak pluralities go to a judge model that sees every
|
|
22
|
+
* vote's rationale and issues the final structured decision. No judge
|
|
23
|
+
* (or judge failure) → abstain (`ask_human`).
|
|
24
|
+
*
|
|
25
|
+
* Optionless (free-text) requests skip the tally: every voter writes an
|
|
26
|
+
* independent stance and the judge synthesizes the final answer; without a
|
|
27
|
+
* judge, the first valid stance wins.
|
|
28
|
+
*
|
|
29
|
+
* The council NEVER blocks on a human itself — its worst case is an
|
|
30
|
+
* `ask_human` abstention that the outer escalation tier resolves.
|
|
31
|
+
*
|
|
32
|
+
* @module council-brain
|
|
33
|
+
*/
|
|
34
|
+
import type { BrainArbiter, BrainDecision, BrainDecisionRequest } from '../coordination/brain.js';
|
|
35
|
+
import { type BrainLlmTarget } from './autonomy-brain.js';
|
|
36
|
+
/** One voting seat on the council. */
|
|
37
|
+
export interface CouncilVoter extends BrainLlmTarget {
|
|
38
|
+
/**
|
|
39
|
+
* Decision lens. Built-ins: 'executor', 'skeptic', 'auditor'. Any other
|
|
40
|
+
* string is injected verbatim as the persona description.
|
|
41
|
+
*/
|
|
42
|
+
persona?: string | undefined;
|
|
43
|
+
/** Vote weight in the tally. Default 1. */
|
|
44
|
+
weight?: number | undefined;
|
|
45
|
+
/** When true, this seat's explicit refusal denies the request outright. */
|
|
46
|
+
veto?: boolean | undefined;
|
|
47
|
+
}
|
|
48
|
+
export interface CouncilBrainOptions {
|
|
49
|
+
voters: CouncilVoter[];
|
|
50
|
+
/** Tie-breaker / synthesizer. Default: none (ties abstain to escalation). */
|
|
51
|
+
judge?: BrainLlmTarget | undefined;
|
|
52
|
+
/** Fraction of seats that must return a valid vote. Default 0.5. */
|
|
53
|
+
quorumFraction?: number | undefined;
|
|
54
|
+
/** Fraction of cast weight the winning option must EXCEED. Default 0.5. */
|
|
55
|
+
approvalFraction?: number | undefined;
|
|
56
|
+
/** Per-voter (and judge) completion timeout in ms. Default 15000. */
|
|
57
|
+
decisionTimeoutMs?: number | undefined;
|
|
58
|
+
/**
|
|
59
|
+
* Decision-history digest (typically `BrainDecisionLedger.digestFor`) —
|
|
60
|
+
* appended to every voter's user message so the panel sees how similar
|
|
61
|
+
* past decisions turned out.
|
|
62
|
+
*/
|
|
63
|
+
getDecisionDigest?: ((request: BrainDecisionRequest) => string | undefined) | undefined;
|
|
64
|
+
/** Called with a human-readable summary after every council decision. */
|
|
65
|
+
onDecision?: ((summary: string, decision: BrainDecision, request: BrainDecisionRequest) => void) | undefined;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Synthetic ballot entry that lets any voter refuse every real option. Kept
|
|
69
|
+
* deliberately awkward so it can never collide with a caller option id; if
|
|
70
|
+
* it somehow does, the synthetic entry is skipped for that request.
|
|
71
|
+
*/
|
|
72
|
+
export declare const COUNCIL_REFUSE_OPTION_ID = "council_refuse";
|
|
73
|
+
/**
|
|
74
|
+
* Create a council-of-LLMs Brain arbiter. See the module docs for the
|
|
75
|
+
* resolution ladder. Positioned by `createTieredBrainArbiter` above the
|
|
76
|
+
* single-LLM tier for requests at/above the council risk floor.
|
|
77
|
+
*/
|
|
78
|
+
export declare function createCouncilBrainArbiter(opts: CouncilBrainOptions): BrainArbiter;
|
|
79
|
+
//# sourceMappingURL=council-brain.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"council-brain.d.ts","sourceRoot":"","sources":["../../src/execution/council-brain.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,OAAO,KAAK,EACV,YAAY,EACZ,aAAa,EAEb,oBAAoB,EACrB,MAAM,0BAA0B,CAAC;AAElC,OAAO,EACL,KAAK,cAAc,EAMpB,MAAM,qBAAqB,CAAC;AAE7B,sCAAsC;AACtC,MAAM,WAAW,YAAa,SAAQ,cAAc;IAClD;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,2CAA2C;IAC3C,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,2EAA2E;IAC3E,IAAI,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CAC5B;AAED,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,YAAY,EAAE,CAAC;IACvB,6EAA6E;IAC7E,KAAK,CAAC,EAAE,cAAc,GAAG,SAAS,CAAC;IACnC,oEAAoE;IACpE,cAAc,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACpC,2EAA2E;IAC3E,gBAAgB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACtC,qEAAqE;IACrE,iBAAiB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACvC;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,CAAC,CAAC,OAAO,EAAE,oBAAoB,KAAK,MAAM,GAAG,SAAS,CAAC,GAAG,SAAS,CAAC;IACxF,yEAAyE;IACzE,UAAU,CAAC,EACP,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,EAAE,OAAO,EAAE,oBAAoB,KAAK,IAAI,CAAC,GACnF,SAAS,CAAC;CACf;AAED;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,mBAAmB,CAAC;AAiDzD;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,mBAAmB,GAAG,YAAY,CA6OjF"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Design Studio color utilities.
|
|
3
|
+
*
|
|
4
|
+
* Design kit tokens are authored in OKLCH (CSS-native, the modern 2026 default).
|
|
5
|
+
* CSS targets keep them verbatim, but native stacks (React Native, Flutter,
|
|
6
|
+
* SwiftUI, Compose) need concrete sRGB — so `materialize` converts each token
|
|
7
|
+
* with `oklchToHex`. The verifier also normalizes colors to hex before
|
|
8
|
+
* comparing, so an `oklch()` token and the same color written as `#rrggbb`
|
|
9
|
+
* count as a match.
|
|
10
|
+
*
|
|
11
|
+
* Conversion is the standard Björn Ottosson OKLab→linear-sRGB pipeline; values
|
|
12
|
+
* out of the sRGB gamut are clamped (not gamut-mapped) — adequate for the
|
|
13
|
+
* near-in-gamut palettes our kits use.
|
|
14
|
+
*/
|
|
15
|
+
/** Parse an `oklch(L C H[ / a])` string into [L(0..1), C, H(deg), a(0..1)] or null. */
|
|
16
|
+
export declare function parseOklch(value: string): [number, number, number, number] | null;
|
|
17
|
+
/**
|
|
18
|
+
* Convert an OKLCH string to `#rrggbb` (or `#rrggbbaa` when alpha < 1).
|
|
19
|
+
* Returns null if `value` is not parseable OKLCH.
|
|
20
|
+
*/
|
|
21
|
+
export declare function oklchToHex(value: string): string | null;
|
|
22
|
+
/**
|
|
23
|
+
* Normalize any color token to a lowercase `#rrggbb[aa]` hex when possible.
|
|
24
|
+
* Passes through existing hex (lowercased, expanded from #rgb), converts
|
|
25
|
+
* `oklch(...)`, and returns null for values we can't resolve (named colors,
|
|
26
|
+
* gradients, non-color tokens like font names).
|
|
27
|
+
*/
|
|
28
|
+
export declare function colorToHex(value: string): string | null;
|
|
29
|
+
/** True when a token value looks like a color (OKLCH or hex), not a font/size. */
|
|
30
|
+
export declare function isColorToken(value: string): boolean;
|
|
31
|
+
//# sourceMappingURL=design-color.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"design-color.d.ts","sourceRoot":"","sources":["../../src/execution/design-color.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAOH,uFAAuF;AACvF,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAiBjF;AAsCD;;;GAGG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAwBvD;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAgBvD;AAED,kFAAkF;AAClF,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAEnD"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Design Studio detection + injection middleware.
|
|
3
|
+
*
|
|
4
|
+
* The system prompt is built ONCE per session (boot / project-switch), so a
|
|
5
|
+
* system-prompt contributor cannot react to "the model just started building a
|
|
6
|
+
* UI" mid-session. Instead, detection and injection ride the per-turn pipelines:
|
|
7
|
+
*
|
|
8
|
+
* - userInput middleware → detect UI intent in the user's message
|
|
9
|
+
* - toolCall middleware → detect a frontend file being written
|
|
10
|
+
* (both set `ctx.meta.designStudio`)
|
|
11
|
+
* - request middleware → on every turn, read `ctx.meta.designStudio` and
|
|
12
|
+
* append an ephemeral block to `req.system`: the kit menu (until a kit is
|
|
13
|
+
* chosen) or a one-line adherence reminder (once chosen).
|
|
14
|
+
*
|
|
15
|
+
* Keeping the heavy kit body out of this path — the model loads it on demand via
|
|
16
|
+
* the `design` tool — is what keeps per-turn token cost low.
|
|
17
|
+
*/
|
|
18
|
+
import type { AgentPipelines, ToolCallPipelinePayload, UserInputPayload } from '../core/agent-types.js';
|
|
19
|
+
import type { Context } from '../core/context.js';
|
|
20
|
+
import type { Middleware } from '../kernel/pipeline.js';
|
|
21
|
+
import type { DesignKitLoader, DesignStack, DesignStudioState } from '../types/design-kit.js';
|
|
22
|
+
import type { Request } from '../types/provider.js';
|
|
23
|
+
export declare function getDesignState(ctx: {
|
|
24
|
+
meta: Record<string, unknown>;
|
|
25
|
+
}): DesignStudioState | undefined;
|
|
26
|
+
/** Mark Design Studio active and merge in detected signals/stack. */
|
|
27
|
+
export declare function activateDesign(ctx: {
|
|
28
|
+
meta: Record<string, unknown>;
|
|
29
|
+
}, signals: string[], stack?: DesignStack): DesignStudioState;
|
|
30
|
+
/** Record the kit the model/user committed to. */
|
|
31
|
+
export declare function setActiveKit(ctx: {
|
|
32
|
+
meta: Record<string, unknown>;
|
|
33
|
+
}, kitId: string, stack?: DesignStack, overrides?: Record<string, string> | undefined): void;
|
|
34
|
+
/** Merge color/token overrides into the live state (used by `design set`). */
|
|
35
|
+
export declare function setDesignOverrides(ctx: {
|
|
36
|
+
meta: Record<string, unknown>;
|
|
37
|
+
}, overrides: Record<string, string>): void;
|
|
38
|
+
/** Clear the active kit (e.g. `/design off`), leaving detection state intact. */
|
|
39
|
+
export declare function clearActiveKit(ctx: {
|
|
40
|
+
meta: Record<string, unknown>;
|
|
41
|
+
}): void;
|
|
42
|
+
/**
|
|
43
|
+
* Inspect user text for UI/design intent. Returns the strongest stack hint and
|
|
44
|
+
* the matched signals, or `null` when nothing UI-ish was found.
|
|
45
|
+
*/
|
|
46
|
+
export declare function detectFrontendIntent(text: string): {
|
|
47
|
+
stack?: DesignStack;
|
|
48
|
+
signals: string[];
|
|
49
|
+
} | null;
|
|
50
|
+
/** Detect whether a written/edited file path is a frontend file. */
|
|
51
|
+
export declare function detectFrontendFile(filePath: string): {
|
|
52
|
+
stack?: DesignStack;
|
|
53
|
+
} | null;
|
|
54
|
+
/** userInput middleware: detect UI intent from the user's message. */
|
|
55
|
+
export declare function makeDesignDetectUserInputMiddleware(): Middleware<UserInputPayload>;
|
|
56
|
+
/** toolCall middleware: detect frontend file writes/edits. */
|
|
57
|
+
export declare function makeDesignDetectToolCallMiddleware(): Middleware<ToolCallPipelinePayload>;
|
|
58
|
+
/**
|
|
59
|
+
* toolCall middleware: after a frontend file is written/edited AND a kit is
|
|
60
|
+
* pinned, scan the file for off-palette colors and append a non-blocking
|
|
61
|
+
* warning to the tool result. This makes adherence PASSIVE — the model is
|
|
62
|
+
* nudged toward kit tokens the moment it drifts, without anyone running
|
|
63
|
+
* `design verify` by hand. Best-effort: any failure leaves the result untouched.
|
|
64
|
+
*/
|
|
65
|
+
export declare function makeDesignVerifyToolCallMiddleware(): Middleware<ToolCallPipelinePayload>;
|
|
66
|
+
/**
|
|
67
|
+
* request middleware: per-turn, inject the kit menu (until a kit is chosen) or a
|
|
68
|
+
* compact adherence reminder (once chosen). No-op when Design Studio is inactive.
|
|
69
|
+
*
|
|
70
|
+
* Closes over the live `Context` because the `request` pipeline payload is just
|
|
71
|
+
* the `Request` — it carries no ctx. `req.system` shares the array reference
|
|
72
|
+
* with `ctx.systemPrompt`, so we return a NEW array rather than mutating it.
|
|
73
|
+
*/
|
|
74
|
+
export declare function makeDesignStudioRequestMiddleware(deps: {
|
|
75
|
+
ctx: Context;
|
|
76
|
+
loader: DesignKitLoader;
|
|
77
|
+
enabled?: () => boolean;
|
|
78
|
+
}): Middleware<Request>;
|
|
79
|
+
/**
|
|
80
|
+
* Install the Design Studio per-turn middleware onto an agent's pipelines.
|
|
81
|
+
* Shared by every host (CLI/TUI + both WebUI servers) so auto-detection behaves
|
|
82
|
+
* identically everywhere. All three are PREPENDED:
|
|
83
|
+
* - detection runs first so a short-circuiting middleware can't suppress it;
|
|
84
|
+
* - the request injector must sit ahead of `ModelRuntimeSettings`, which does
|
|
85
|
+
* not call `next` and would otherwise end the chain before us.
|
|
86
|
+
*
|
|
87
|
+
* The `design` tool and `/design` command are wired separately (builtin pack +
|
|
88
|
+
* slash registry); this only installs the activation behavior.
|
|
89
|
+
*/
|
|
90
|
+
export declare function installDesignStudioMiddleware(deps: {
|
|
91
|
+
pipelines: AgentPipelines;
|
|
92
|
+
ctx: Context;
|
|
93
|
+
/** When false, nothing is installed (tool + /design stay manual). */
|
|
94
|
+
enabled?: boolean | undefined;
|
|
95
|
+
}): void;
|
|
96
|
+
//# sourceMappingURL=design-detect.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"design-detect.d.ts","sourceRoot":"","sources":["../../src/execution/design-detect.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EACV,cAAc,EACd,uBAAuB,EACvB,gBAAgB,EACjB,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAExD,OAAO,KAAK,EAAE,eAAe,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAE9F,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAOpD,wBAAgB,cAAc,CAAC,GAAG,EAAE;IAClC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC/B,GAAG,iBAAiB,GAAG,SAAS,CAGhC;AAWD,qEAAqE;AACrE,wBAAgB,cAAc,CAC5B,GAAG,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAAE,EACtC,OAAO,EAAE,MAAM,EAAE,EACjB,KAAK,CAAC,EAAE,WAAW,GAClB,iBAAiB,CAMnB;AA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AC;IACxB,OAAO,CAAC,EAAE,MAAM,OAAO,CAAC;CACzB,GAAG,UAAU,CAAC,OAAO,CAAC,CAwDtB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,6BAA6B,CAAC,IAAI,EAAE;IAClD,SAAS,EAAE,cAAc,CAAC;IAC1B,GAAG,EAAE,OAAO,CAAC;IACb,qEAAqE;IACrE,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CAC/B,GAAG,IAAI,CAsBP"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { type DesignKitEntry, type DesignKitLoader, type DesignKitManifest, type DesignKitTokens, type DesignStack } from '../types/design-kit.js';
|
|
2
|
+
export interface DesignKitLoaderOptions {
|
|
3
|
+
/** <project>/.wrongstack/design-kits */
|
|
4
|
+
inProjectDir: string;
|
|
5
|
+
/** ~/.wrongstack/design-kits */
|
|
6
|
+
globalDir: string;
|
|
7
|
+
/** Bundled kits shipped with @wrongstack/core (packages/core/design-kits). */
|
|
8
|
+
bundledDir?: string | undefined;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Discovery order (highest priority first; later layers are shadowed by name):
|
|
12
|
+
* 1. Project-committed: <project>/.wrongstack/design-kits/
|
|
13
|
+
* 2. User-global: ~/.wrongstack/design-kits/
|
|
14
|
+
* 3. Bundled with build: packages/core/design-kits/
|
|
15
|
+
*
|
|
16
|
+
* The `_foundations` directory is a reserved kit id holding the mandatory
|
|
17
|
+
* cross-cutting baseline; it is excluded from the selectable menu.
|
|
18
|
+
*/
|
|
19
|
+
export declare class DefaultDesignKitLoader implements DesignKitLoader {
|
|
20
|
+
private readonly dirs;
|
|
21
|
+
private cache?;
|
|
22
|
+
private readonly bodyCache;
|
|
23
|
+
private readonly tokenCache;
|
|
24
|
+
constructor(opts: DesignKitLoaderOptions);
|
|
25
|
+
list(): Promise<DesignKitManifest[]>;
|
|
26
|
+
/** Selectable kits only (excludes the reserved `_foundations` entry). */
|
|
27
|
+
private selectable;
|
|
28
|
+
listEntries(): Promise<DesignKitEntry[]>;
|
|
29
|
+
find(id: string): Promise<DesignKitManifest | undefined>;
|
|
30
|
+
menuText(): Promise<string>;
|
|
31
|
+
readBody(id: string, stack?: DesignStack): Promise<string>;
|
|
32
|
+
readTokens(id: string): Promise<DesignKitTokens | undefined>;
|
|
33
|
+
foundationsText(stack?: DesignStack): Promise<string>;
|
|
34
|
+
invalidateCache(): void;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Resolve the bundled `design-kits/` directory shipped alongside this module.
|
|
38
|
+
* The directory is a sibling of `src/` (dev) and `dist/` (built), so we probe a
|
|
39
|
+
* few candidate depths relative to the compiled module location and return the
|
|
40
|
+
* first that exists. Returns `undefined` if none is found (treated as "no
|
|
41
|
+
* bundled kits this run").
|
|
42
|
+
*/
|
|
43
|
+
export declare function resolveBundledDesignKitsDir(): string | undefined;
|
|
44
|
+
/**
|
|
45
|
+
* Memoized per-project loader. Used by the `design` tool and the Design Studio
|
|
46
|
+
* middleware/slash-command so they share one cached instance without threading
|
|
47
|
+
* the loader through every boot path. The loader is a pure disk reader (no
|
|
48
|
+
* injected services), so a module-level memo is safe.
|
|
49
|
+
*/
|
|
50
|
+
export declare function getDesignKitLoader(projectRoot: string): DefaultDesignKitLoader;
|
|
51
|
+
/** Test helper — clears the per-project loader memo. */
|
|
52
|
+
export declare function _resetDesignKitLoaderMemo(): void;
|
|
53
|
+
//# sourceMappingURL=design-kit-loader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"design-kit-loader.d.ts","sourceRoot":"","sources":["../../src/execution/design-kit-loader.ts"],"names":[],"mappings":"AAIA,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACpB,KAAK,WAAW,EAEjB,MAAM,wBAAwB,CAAC;AAwHhC,MAAM,WAAW,sBAAsB;IACrC,wCAAwC;IACxC,YAAY,EAAE,MAAM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