@orion-agents/orion-code 0.1.9 → 0.2.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/CHANGELOG.md +50 -0
- package/README.md +142 -323
- package/README.zh-CN.md +117 -578
- package/dist/cli.js +65 -84
- package/dist/cli.js.map +1 -1
- package/dist/commands/context-commands.d.ts.map +1 -1
- package/dist/commands/context-commands.js +14 -7
- package/dist/commands/context-commands.js.map +1 -1
- package/dist/commands/context-tool-command-handlers.d.ts +4 -5
- package/dist/commands/context-tool-command-handlers.d.ts.map +1 -1
- package/dist/commands/context-tool-command-handlers.js +132 -208
- package/dist/commands/context-tool-command-handlers.js.map +1 -1
- package/dist/commands/core-command-handlers.d.ts +3 -6
- package/dist/commands/core-command-handlers.d.ts.map +1 -1
- package/dist/commands/core-command-handlers.js +66 -664
- package/dist/commands/core-command-handlers.js.map +1 -1
- package/dist/commands/diagnostic-command-handlers.d.ts +1 -2
- package/dist/commands/diagnostic-command-handlers.d.ts.map +1 -1
- package/dist/commands/diagnostic-command-handlers.js +3 -17
- package/dist/commands/diagnostic-command-handlers.js.map +1 -1
- package/dist/commands/diagnostic-commands.d.ts.map +1 -1
- package/dist/commands/diagnostic-commands.js +0 -45
- package/dist/commands/diagnostic-commands.js.map +1 -1
- package/dist/commands/index.d.ts +1 -1
- package/dist/commands/index.d.ts.map +1 -1
- package/dist/commands/index.js +2 -7
- package/dist/commands/index.js.map +1 -1
- package/dist/commands/model-command-handlers.d.ts +1 -1
- package/dist/commands/model-command-handlers.js +2 -2
- package/dist/commands/model-command-handlers.js.map +1 -1
- package/dist/commands/model-commands.d.ts.map +1 -1
- package/dist/commands/model-commands.js +0 -11
- package/dist/commands/model-commands.js.map +1 -1
- package/dist/commands/registry.d.ts.map +1 -1
- package/dist/commands/registry.js +1 -139
- package/dist/commands/registry.js.map +1 -1
- package/dist/commands/session-command-handlers.d.ts.map +1 -1
- package/dist/commands/session-command-handlers.js +29 -205
- package/dist/commands/session-command-handlers.js.map +1 -1
- package/dist/commands/session-commands.d.ts.map +1 -1
- package/dist/commands/session-commands.js +0 -48
- package/dist/commands/session-commands.js.map +1 -1
- package/dist/commands/target-command.d.ts +9 -15
- package/dist/commands/target-command.d.ts.map +1 -1
- package/dist/commands/target-command.js +16 -130
- package/dist/commands/target-command.js.map +1 -1
- package/dist/commands/tool-commands.d.ts.map +1 -1
- package/dist/commands/tool-commands.js +0 -10
- package/dist/commands/tool-commands.js.map +1 -1
- package/dist/commands/types.d.ts +8 -14
- package/dist/commands/types.d.ts.map +1 -1
- package/dist/commands/types.js +1 -1
- package/dist/commands/types.js.map +1 -1
- package/dist/commands/workflow-command-handlers.d.ts.map +1 -1
- package/dist/commands/workflow-command-handlers.js +1 -3
- package/dist/commands/workflow-command-handlers.js.map +1 -1
- package/dist/commands/workflow-commands.d.ts.map +1 -1
- package/dist/commands/workflow-commands.js +2 -24
- package/dist/commands/workflow-commands.js.map +1 -1
- package/dist/framework/agent-mode.d.ts +2 -3
- package/dist/framework/agent-mode.d.ts.map +1 -1
- package/dist/framework/agent-mode.js +8 -31
- package/dist/framework/agent-mode.js.map +1 -1
- package/dist/framework/index.d.ts +3 -3
- package/dist/framework/index.d.ts.map +1 -1
- package/dist/framework/index.js +6 -9
- package/dist/framework/index.js.map +1 -1
- package/dist/framework/loop-budget-contract.d.ts +20 -0
- package/dist/framework/loop-budget-contract.d.ts.map +1 -0
- package/dist/framework/loop-budget-contract.js +13 -0
- package/dist/framework/loop-budget-contract.js.map +1 -0
- package/dist/framework/prompt.d.ts.map +1 -1
- package/dist/framework/prompt.js +5 -4
- package/dist/framework/prompt.js.map +1 -1
- package/dist/framework/query.d.ts +45 -22
- package/dist/framework/query.d.ts.map +1 -1
- package/dist/framework/query.js +64 -52
- package/dist/framework/query.js.map +1 -1
- package/dist/framework/store.d.ts +4 -2
- package/dist/framework/store.d.ts.map +1 -1
- package/dist/framework/store.js +1 -0
- package/dist/framework/store.js.map +1 -1
- package/dist/framework/tool-call-orchestrator.d.ts +80 -0
- package/dist/framework/tool-call-orchestrator.d.ts.map +1 -0
- package/dist/framework/tool-call-orchestrator.js +192 -0
- package/dist/framework/tool-call-orchestrator.js.map +1 -0
- package/dist/framework/tool-state.d.ts +12 -11
- package/dist/framework/tool-state.d.ts.map +1 -1
- package/dist/framework/tool-state.js +36 -28
- package/dist/framework/tool-state.js.map +1 -1
- package/dist/framework/tool.d.ts +0 -9
- package/dist/framework/tool.d.ts.map +1 -1
- package/dist/framework/tool.js.map +1 -1
- package/dist/index.d.ts +70 -26
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +64 -65
- package/dist/index.js.map +1 -1
- package/dist/print-ui/launch.d.ts.map +1 -1
- package/dist/print-ui/launch.js +9 -2
- package/dist/print-ui/launch.js.map +1 -1
- package/dist/product/paths.d.ts +7 -0
- package/dist/product/paths.d.ts.map +1 -1
- package/dist/product/paths.js +19 -0
- package/dist/product/paths.js.map +1 -1
- package/dist/runtime/agent-loop.d.ts +78 -0
- package/dist/runtime/agent-loop.d.ts.map +1 -0
- package/dist/runtime/agent-loop.js +418 -0
- package/dist/runtime/agent-loop.js.map +1 -0
- package/dist/runtime/agent-runtime-controller.d.ts +10 -57
- package/dist/runtime/agent-runtime-controller.d.ts.map +1 -1
- package/dist/runtime/agent-runtime-controller.js +265 -1215
- package/dist/runtime/agent-runtime-controller.js.map +1 -1
- package/dist/runtime/agent-runtime-protocol.d.ts +4 -5
- package/dist/runtime/agent-runtime-protocol.d.ts.map +1 -1
- package/dist/runtime/agent-runtime-protocol.js.map +1 -1
- package/dist/runtime/agent-runtime-runner.d.ts +34 -0
- package/dist/runtime/agent-runtime-runner.d.ts.map +1 -0
- package/dist/runtime/agent-runtime-runner.js +3 -0
- package/dist/runtime/agent-runtime-runner.js.map +1 -0
- package/dist/runtime/batch-read-service.d.ts +29 -0
- package/dist/runtime/batch-read-service.d.ts.map +1 -0
- package/dist/runtime/batch-read-service.js +212 -0
- package/dist/runtime/batch-read-service.js.map +1 -0
- package/dist/runtime/builtin-tool-provider.d.ts +30 -0
- package/dist/runtime/builtin-tool-provider.d.ts.map +1 -0
- package/dist/runtime/builtin-tool-provider.js +233 -0
- package/dist/runtime/builtin-tool-provider.js.map +1 -0
- package/dist/runtime/capabilities/compiler.d.ts +11 -0
- package/dist/runtime/capabilities/compiler.d.ts.map +1 -0
- package/dist/runtime/capabilities/compiler.js +719 -0
- package/dist/runtime/capabilities/compiler.js.map +1 -0
- package/dist/runtime/capabilities/index.d.ts +3 -0
- package/dist/runtime/capabilities/index.d.ts.map +1 -0
- package/dist/runtime/capabilities/index.js +9 -0
- package/dist/runtime/capabilities/index.js.map +1 -0
- package/dist/runtime/capabilities/types.d.ts +175 -0
- package/dist/runtime/capabilities/types.d.ts.map +1 -0
- package/dist/runtime/capabilities/types.js +3 -0
- package/dist/runtime/capabilities/types.js.map +1 -0
- package/dist/runtime/capability-receipt-journal.d.ts +29 -0
- package/dist/runtime/capability-receipt-journal.d.ts.map +1 -0
- package/dist/runtime/capability-receipt-journal.js +264 -0
- package/dist/runtime/capability-receipt-journal.js.map +1 -0
- package/dist/runtime/capability-step-factory.d.ts +73 -0
- package/dist/runtime/capability-step-factory.d.ts.map +1 -0
- package/dist/runtime/capability-step-factory.js +302 -0
- package/dist/runtime/capability-step-factory.js.map +1 -0
- package/dist/runtime/compact-transaction.d.ts +225 -0
- package/dist/runtime/compact-transaction.d.ts.map +1 -0
- package/dist/runtime/compact-transaction.js +622 -0
- package/dist/runtime/compact-transaction.js.map +1 -0
- package/dist/runtime/composer/buffer.d.ts +3 -4
- package/dist/runtime/composer/buffer.d.ts.map +1 -1
- package/dist/runtime/composer/buffer.js +3 -4
- package/dist/runtime/composer/buffer.js.map +1 -1
- package/dist/runtime/composer/grapheme.d.ts +2 -4
- package/dist/runtime/composer/grapheme.d.ts.map +1 -1
- package/dist/runtime/composer/grapheme.js +2 -4
- package/dist/runtime/composer/grapheme.js.map +1 -1
- package/dist/runtime/composer/layout.d.ts +1 -3
- package/dist/runtime/composer/layout.d.ts.map +1 -1
- package/dist/runtime/composer/layout.js +1 -3
- package/dist/runtime/composer/layout.js.map +1 -1
- package/dist/runtime/core-tools/descriptors.d.ts +17 -0
- package/dist/runtime/core-tools/descriptors.d.ts.map +1 -0
- package/dist/runtime/core-tools/descriptors.js +185 -0
- package/dist/runtime/core-tools/descriptors.js.map +1 -0
- package/dist/runtime/first-party-core-provider.d.ts +55 -0
- package/dist/runtime/first-party-core-provider.d.ts.map +1 -0
- package/dist/runtime/first-party-core-provider.js +197 -0
- package/dist/runtime/first-party-core-provider.js.map +1 -0
- package/dist/runtime/first-party-long-tail-provider.d.ts +57 -0
- package/dist/runtime/first-party-long-tail-provider.d.ts.map +1 -0
- package/dist/runtime/first-party-long-tail-provider.js +238 -0
- package/dist/runtime/first-party-long-tail-provider.js.map +1 -0
- package/dist/runtime/first-party-tool-services.d.ts +43 -0
- package/dist/runtime/first-party-tool-services.d.ts.map +1 -0
- package/dist/runtime/first-party-tool-services.js +200 -0
- package/dist/runtime/first-party-tool-services.js.map +1 -0
- package/dist/runtime/first-party-tool-universe.d.ts +14 -0
- package/dist/runtime/first-party-tool-universe.d.ts.map +1 -0
- package/dist/runtime/first-party-tool-universe.js +20 -0
- package/dist/runtime/first-party-tool-universe.js.map +1 -0
- package/dist/runtime/goal-lifecycle-v2.d.ts +63 -0
- package/dist/runtime/goal-lifecycle-v2.d.ts.map +1 -0
- package/dist/runtime/goal-lifecycle-v2.js +253 -0
- package/dist/runtime/goal-lifecycle-v2.js.map +1 -0
- package/dist/runtime/goal-runtime-coordinator.d.ts +105 -0
- package/dist/runtime/goal-runtime-coordinator.d.ts.map +1 -0
- package/dist/runtime/goal-runtime-coordinator.js +506 -0
- package/dist/runtime/goal-runtime-coordinator.js.map +1 -0
- package/dist/runtime/harness-confluence.d.ts +165 -0
- package/dist/runtime/harness-confluence.d.ts.map +1 -0
- package/dist/runtime/harness-confluence.js +807 -0
- package/dist/runtime/harness-confluence.js.map +1 -0
- package/dist/runtime/harness-eval.d.ts +96 -0
- package/dist/runtime/harness-eval.d.ts.map +1 -0
- package/dist/runtime/harness-eval.js +181 -0
- package/dist/runtime/harness-eval.js.map +1 -0
- package/dist/runtime/harness-metrics.d.ts +202 -0
- package/dist/runtime/harness-metrics.d.ts.map +1 -0
- package/dist/runtime/harness-metrics.js +415 -0
- package/dist/runtime/harness-metrics.js.map +1 -0
- package/dist/runtime/legacy-session-importer.d.ts +99 -0
- package/dist/runtime/legacy-session-importer.d.ts.map +1 -0
- package/dist/runtime/legacy-session-importer.js +455 -0
- package/dist/runtime/legacy-session-importer.js.map +1 -0
- package/dist/runtime/legacy-thread-materializer.d.ts +72 -0
- package/dist/runtime/legacy-thread-materializer.d.ts.map +1 -0
- package/dist/runtime/legacy-thread-materializer.js +553 -0
- package/dist/runtime/legacy-thread-materializer.js.map +1 -0
- package/dist/runtime/long-tail-tools/descriptors.d.ts +23 -0
- package/dist/runtime/long-tail-tools/descriptors.d.ts.map +1 -0
- package/dist/runtime/long-tail-tools/descriptors.js +423 -0
- package/dist/runtime/long-tail-tools/descriptors.js.map +1 -0
- package/dist/runtime/loop-budget.d.ts +1 -1
- package/dist/runtime/loop-budget.d.ts.map +1 -1
- package/dist/runtime/loop-budget.js +2 -2
- package/dist/runtime/loop-budget.js.map +1 -1
- package/dist/runtime/mcp/first-party-mcp-adapter.d.ts +75 -0
- package/dist/runtime/mcp/first-party-mcp-adapter.d.ts.map +1 -0
- package/dist/runtime/mcp/first-party-mcp-adapter.js +484 -0
- package/dist/runtime/mcp/first-party-mcp-adapter.js.map +1 -0
- package/dist/runtime/mcp/first-party-mcp-config.d.ts +13 -0
- package/dist/runtime/mcp/first-party-mcp-config.d.ts.map +1 -0
- package/dist/runtime/mcp/first-party-mcp-config.js +139 -0
- package/dist/runtime/mcp/first-party-mcp-config.js.map +1 -0
- package/dist/runtime/mcp/index.d.ts +5 -0
- package/dist/runtime/mcp/index.d.ts.map +1 -0
- package/dist/{skills → runtime/mcp}/index.js +3 -9
- package/dist/runtime/mcp/index.js.map +1 -0
- package/dist/runtime/mcp/lazy-mcp-runtime.d.ts +95 -0
- package/dist/runtime/mcp/lazy-mcp-runtime.d.ts.map +1 -0
- package/dist/runtime/mcp/lazy-mcp-runtime.js +854 -0
- package/dist/runtime/mcp/lazy-mcp-runtime.js.map +1 -0
- package/dist/runtime/mcp/types.d.ts +128 -0
- package/dist/runtime/mcp/types.d.ts.map +1 -0
- package/dist/runtime/mcp/types.js +5 -0
- package/dist/runtime/mcp/types.js.map +1 -0
- package/dist/runtime/orion-runtime-v1.d.ts +321 -0
- package/dist/runtime/orion-runtime-v1.d.ts.map +1 -0
- package/dist/runtime/orion-runtime-v1.js +958 -0
- package/dist/runtime/orion-runtime-v1.js.map +1 -0
- package/dist/runtime/orion-session-runner.d.ts +37 -0
- package/dist/runtime/orion-session-runner.d.ts.map +1 -0
- package/dist/runtime/orion-session-runner.js +146 -0
- package/dist/runtime/orion-session-runner.js.map +1 -0
- package/dist/runtime/product-orion-runtime.d.ts +35 -0
- package/dist/runtime/product-orion-runtime.d.ts.map +1 -0
- package/dist/runtime/product-orion-runtime.js +1019 -0
- package/dist/runtime/product-orion-runtime.js.map +1 -0
- package/dist/runtime/prompts/index.d.ts +3 -0
- package/dist/runtime/prompts/index.d.ts.map +1 -0
- package/dist/{ink-ui/types.js → runtime/prompts/index.js} +3 -2
- package/dist/runtime/prompts/index.js.map +1 -0
- package/dist/runtime/prompts/prompt-registry.d.ts +22 -0
- package/dist/runtime/prompts/prompt-registry.d.ts.map +1 -0
- package/dist/runtime/prompts/prompt-registry.js +356 -0
- package/dist/runtime/prompts/prompt-registry.js.map +1 -0
- package/dist/runtime/prompts/types.d.ts +111 -0
- package/dist/runtime/prompts/types.d.ts.map +1 -0
- package/dist/runtime/prompts/types.js +5 -0
- package/dist/runtime/prompts/types.js.map +1 -0
- package/dist/runtime/protocol/canonical.d.ts +3 -0
- package/dist/runtime/protocol/canonical.d.ts.map +1 -0
- package/dist/runtime/protocol/canonical.js +21 -0
- package/dist/runtime/protocol/canonical.js.map +1 -0
- package/dist/runtime/protocol/index.d.ts +4 -0
- package/dist/runtime/protocol/index.d.ts.map +1 -0
- package/dist/runtime/protocol/index.js +16 -0
- package/dist/runtime/protocol/index.js.map +1 -0
- package/dist/runtime/protocol/runtime-protocol-v1.d.ts +671 -0
- package/dist/runtime/protocol/runtime-protocol-v1.d.ts.map +1 -0
- package/dist/runtime/protocol/runtime-protocol-v1.js +557 -0
- package/dist/runtime/protocol/runtime-protocol-v1.js.map +1 -0
- package/dist/runtime/release-receipts.d.ts +109 -0
- package/dist/runtime/release-receipts.d.ts.map +1 -0
- package/dist/runtime/release-receipts.js +304 -0
- package/dist/runtime/release-receipts.js.map +1 -0
- package/dist/runtime/resource-scope.d.ts +123 -0
- package/dist/runtime/resource-scope.d.ts.map +1 -0
- package/dist/runtime/resource-scope.js +363 -0
- package/dist/runtime/resource-scope.js.map +1 -0
- package/dist/runtime/runtime-event-buffer.d.ts +78 -0
- package/dist/runtime/runtime-event-buffer.d.ts.map +1 -0
- package/dist/runtime/runtime-event-buffer.js +237 -0
- package/dist/runtime/runtime-event-buffer.js.map +1 -0
- package/dist/runtime/runtime-services.d.ts +87 -0
- package/dist/runtime/runtime-services.d.ts.map +1 -0
- package/dist/runtime/runtime-services.js +180 -0
- package/dist/runtime/runtime-services.js.map +1 -0
- package/dist/runtime/skills/bounded-lru-cache.d.ts +34 -0
- package/dist/runtime/skills/bounded-lru-cache.d.ts.map +1 -0
- package/dist/runtime/skills/bounded-lru-cache.js +100 -0
- package/dist/runtime/skills/bounded-lru-cache.js.map +1 -0
- package/dist/runtime/skills/filesystem-skill-provider.d.ts +96 -0
- package/dist/runtime/skills/filesystem-skill-provider.d.ts.map +1 -0
- package/dist/runtime/skills/filesystem-skill-provider.js +829 -0
- package/dist/runtime/skills/filesystem-skill-provider.js.map +1 -0
- package/dist/runtime/skills/index.d.ts +5 -0
- package/dist/runtime/skills/index.d.ts.map +1 -0
- package/dist/{ink-ui/controllers/chat-controller.js → runtime/skills/index.js} +5 -2
- package/dist/runtime/skills/index.js.map +1 -0
- package/dist/runtime/skills/lazy-skill-runtime.d.ts +77 -0
- package/dist/runtime/skills/lazy-skill-runtime.d.ts.map +1 -0
- package/dist/runtime/skills/lazy-skill-runtime.js +673 -0
- package/dist/runtime/skills/lazy-skill-runtime.js.map +1 -0
- package/dist/runtime/skills/types.d.ts +137 -0
- package/dist/runtime/skills/types.d.ts.map +1 -0
- package/dist/runtime/skills/types.js +13 -0
- package/dist/runtime/skills/types.js.map +1 -0
- package/dist/runtime/step-snapshot.d.ts +183 -0
- package/dist/runtime/step-snapshot.d.ts.map +1 -0
- package/dist/runtime/step-snapshot.js +286 -0
- package/dist/runtime/step-snapshot.js.map +1 -0
- package/dist/runtime/subagent-thread-runtime.d.ts +239 -0
- package/dist/runtime/subagent-thread-runtime.d.ts.map +1 -0
- package/dist/runtime/subagent-thread-runtime.js +876 -0
- package/dist/runtime/subagent-thread-runtime.js.map +1 -0
- package/dist/runtime/subagents/index.d.ts +4 -1
- package/dist/runtime/subagents/index.d.ts.map +1 -1
- package/dist/runtime/subagents/index.js +10 -2
- package/dist/runtime/subagents/index.js.map +1 -1
- package/dist/runtime/subagents/parent-step-fork.d.ts +36 -0
- package/dist/runtime/subagents/parent-step-fork.d.ts.map +1 -0
- package/dist/runtime/subagents/parent-step-fork.js +83 -0
- package/dist/runtime/subagents/parent-step-fork.js.map +1 -0
- package/dist/runtime/subagents/production.d.ts +65 -46
- package/dist/runtime/subagents/production.d.ts.map +1 -1
- package/dist/runtime/subagents/production.js +494 -170
- package/dist/runtime/subagents/production.js.map +1 -1
- package/dist/runtime/subagents/receipt-journal.d.ts +20 -0
- package/dist/runtime/subagents/receipt-journal.d.ts.map +1 -0
- package/dist/runtime/subagents/receipt-journal.js +74 -0
- package/dist/runtime/subagents/receipt-journal.js.map +1 -0
- package/dist/runtime/subagents/runtime-contract.d.ts +29 -0
- package/dist/runtime/subagents/runtime-contract.d.ts.map +1 -0
- package/dist/runtime/subagents/runtime-contract.js +3 -0
- package/dist/runtime/subagents/runtime-contract.js.map +1 -0
- package/dist/runtime/subagents/runtime-integration.d.ts +41 -56
- package/dist/runtime/subagents/runtime-integration.d.ts.map +1 -1
- package/dist/runtime/subagents/runtime-integration.js +34 -198
- package/dist/runtime/subagents/runtime-integration.js.map +1 -1
- package/dist/runtime/subagents/supervisor.d.ts +19 -7
- package/dist/runtime/subagents/supervisor.d.ts.map +1 -1
- package/dist/runtime/subagents/supervisor.js +83 -40
- package/dist/runtime/subagents/supervisor.js.map +1 -1
- package/dist/runtime/subagents/types.d.ts +1 -1
- package/dist/runtime/subagents/types.js +1 -1
- package/dist/runtime/task-context-service.d.ts +91 -0
- package/dist/runtime/task-context-service.d.ts.map +1 -0
- package/dist/runtime/task-context-service.js +122 -0
- package/dist/runtime/task-context-service.js.map +1 -0
- package/dist/runtime/thread-admission.d.ts +130 -0
- package/dist/runtime/thread-admission.d.ts.map +1 -0
- package/dist/runtime/thread-admission.js +276 -0
- package/dist/runtime/thread-admission.js.map +1 -0
- package/dist/runtime/thread-compact-persistence.d.ts +50 -0
- package/dist/runtime/thread-compact-persistence.d.ts.map +1 -0
- package/dist/runtime/thread-compact-persistence.js +176 -0
- package/dist/runtime/thread-compact-persistence.js.map +1 -0
- package/dist/runtime/thread-event-store.d.ts +98 -0
- package/dist/runtime/thread-event-store.d.ts.map +1 -0
- package/dist/runtime/thread-event-store.js +737 -0
- package/dist/runtime/thread-event-store.js.map +1 -0
- package/dist/runtime/thread-projection.d.ts +91 -0
- package/dist/runtime/thread-projection.d.ts.map +1 -0
- package/dist/runtime/thread-projection.js +407 -0
- package/dist/runtime/thread-projection.js.map +1 -0
- package/dist/runtime/thread-runtime.d.ts +165 -0
- package/dist/runtime/thread-runtime.d.ts.map +1 -0
- package/dist/runtime/thread-runtime.js +704 -0
- package/dist/runtime/thread-runtime.js.map +1 -0
- package/dist/runtime/thread-tool-journal.d.ts +11 -0
- package/dist/runtime/thread-tool-journal.d.ts.map +1 -0
- package/dist/runtime/thread-tool-journal.js +131 -0
- package/dist/runtime/thread-tool-journal.js.map +1 -0
- package/dist/runtime/thread-ui-adapter.d.ts +85 -0
- package/dist/runtime/thread-ui-adapter.d.ts.map +1 -0
- package/dist/runtime/thread-ui-adapter.js +514 -0
- package/dist/runtime/thread-ui-adapter.js.map +1 -0
- package/dist/runtime/tool-gateway.d.ts +159 -0
- package/dist/runtime/tool-gateway.d.ts.map +1 -0
- package/dist/runtime/tool-gateway.js +311 -0
- package/dist/runtime/tool-gateway.js.map +1 -0
- package/dist/runtime/turn-commit.d.ts +103 -0
- package/dist/runtime/turn-commit.d.ts.map +1 -0
- package/dist/runtime/turn-commit.js +321 -0
- package/dist/runtime/turn-commit.js.map +1 -0
- package/dist/runtime/ui-events.d.ts +13 -5
- package/dist/runtime/ui-events.d.ts.map +1 -1
- package/dist/runtime/ui-events.js +0 -1
- package/dist/runtime/ui-events.js.map +1 -1
- package/dist/runtime/ui-view-model.d.ts +1 -1
- package/dist/runtime/ui-view-model.d.ts.map +1 -1
- package/dist/runtime/ui-view-model.js +3 -5
- package/dist/runtime/ui-view-model.js.map +1 -1
- package/dist/services/config-dir.d.ts +1 -1
- package/dist/services/config-dir.d.ts.map +1 -1
- package/dist/services/config-dir.js +2 -1
- package/dist/services/config-dir.js.map +1 -1
- package/dist/services/config.d.ts +2 -16
- package/dist/services/config.d.ts.map +1 -1
- package/dist/services/config.js +2 -29
- package/dist/services/config.js.map +1 -1
- package/dist/services/doctor.d.ts +0 -2
- package/dist/services/doctor.d.ts.map +1 -1
- package/dist/services/doctor.js +39 -64
- package/dist/services/doctor.js.map +1 -1
- package/dist/services/global-config.d.ts +2 -2
- package/dist/services/global-config.d.ts.map +1 -1
- package/dist/skills/builtin/code-review/SKILL.md +51 -0
- package/dist/skills/builtin/security-check/SKILL.md +54 -0
- package/dist/skills/builtin/test-gen/SKILL.md +49 -0
- package/dist/terminal-ui/launch.d.ts +3 -1
- package/dist/terminal-ui/launch.d.ts.map +1 -1
- package/dist/terminal-ui/launch.js +19 -3
- package/dist/terminal-ui/launch.js.map +1 -1
- package/dist/tools/core/common.d.ts +34 -0
- package/dist/tools/core/common.d.ts.map +1 -0
- package/dist/tools/core/common.js +164 -0
- package/dist/tools/core/common.js.map +1 -0
- package/dist/tools/core/edit-file.d.ts +10 -0
- package/dist/tools/core/edit-file.d.ts.map +1 -0
- package/dist/tools/core/edit-file.js +301 -0
- package/dist/tools/core/edit-file.js.map +1 -0
- package/dist/tools/core/exec-command.d.ts +2 -0
- package/dist/tools/core/exec-command.d.ts.map +1 -0
- package/dist/tools/core/exec-command.js +347 -0
- package/dist/tools/core/exec-command.js.map +1 -0
- package/dist/tools/core/glob.d.ts +2 -0
- package/dist/tools/core/glob.d.ts.map +1 -0
- package/dist/tools/core/glob.js +133 -0
- package/dist/tools/core/glob.js.map +1 -0
- package/dist/tools/core/grep.d.ts +12 -0
- package/dist/tools/core/grep.d.ts.map +1 -0
- package/dist/tools/core/grep.js +223 -0
- package/dist/tools/core/grep.js.map +1 -0
- package/dist/tools/core/index.d.ts +15 -0
- package/dist/tools/core/index.d.ts.map +1 -0
- package/dist/tools/core/index.js +31 -0
- package/dist/tools/core/index.js.map +1 -0
- package/dist/tools/core/list-files.d.ts +2 -0
- package/dist/tools/core/list-files.d.ts.map +1 -0
- package/dist/tools/core/list-files.js +87 -0
- package/dist/tools/core/list-files.js.map +1 -0
- package/dist/tools/core/read-file.d.ts +2 -0
- package/dist/tools/core/read-file.d.ts.map +1 -0
- package/dist/tools/core/read-file.js +129 -0
- package/dist/tools/core/read-file.js.map +1 -0
- package/dist/tools/core/write-file.d.ts +2 -0
- package/dist/tools/core/write-file.d.ts.map +1 -0
- package/dist/tools/core/write-file.js +65 -0
- package/dist/tools/core/write-file.js.map +1 -0
- package/dist/tools/todo.d.ts +3 -4
- package/dist/tools/todo.d.ts.map +1 -1
- package/dist/tools/todo.js +80 -79
- package/dist/tools/todo.js.map +1 -1
- package/dist/tui-ui/chrome-view-model.js +1 -1
- package/dist/tui-ui/chrome-view-model.js.map +1 -1
- package/dist/tui-ui/layout.js +1 -1
- package/dist/tui-ui/layout.js.map +1 -1
- package/docs/migration/v0.1.9-to-v0.2.0.md +98 -0
- package/docs/orion.example.json +79 -0
- package/docs/plan/v0.2.0-dsh-harness-redesign-plan.md +1234 -0
- package/docs/plan/v0.2.0-release-checklist.md +91 -0
- package/docs/readme.md +8 -8
- package/npm-shrinkwrap.json +45 -450
- package/package.json +17 -13
- package/dist/agents/coder.d.ts +0 -12
- package/dist/agents/coder.d.ts.map +0 -1
- package/dist/agents/coder.js +0 -48
- package/dist/agents/coder.js.map +0 -1
- package/dist/agents/coordinator.d.ts +0 -86
- package/dist/agents/coordinator.d.ts.map +0 -1
- package/dist/agents/coordinator.js +0 -291
- package/dist/agents/coordinator.js.map +0 -1
- package/dist/agents/fork.d.ts +0 -73
- package/dist/agents/fork.d.ts.map +0 -1
- package/dist/agents/fork.js +0 -163
- package/dist/agents/fork.js.map +0 -1
- package/dist/agents/leader.d.ts +0 -12
- package/dist/agents/leader.d.ts.map +0 -1
- package/dist/agents/leader.js +0 -49
- package/dist/agents/leader.js.map +0 -1
- package/dist/agents/router.d.ts +0 -59
- package/dist/agents/router.d.ts.map +0 -1
- package/dist/agents/router.js +0 -193
- package/dist/agents/router.js.map +0 -1
- package/dist/agents/worker-pool.d.ts +0 -72
- package/dist/agents/worker-pool.d.ts.map +0 -1
- package/dist/agents/worker-pool.js +0 -229
- package/dist/agents/worker-pool.js.map +0 -1
- package/dist/commands/legacy-commands.d.ts +0 -4
- package/dist/commands/legacy-commands.d.ts.map +0 -1
- package/dist/commands/legacy-commands.js +0 -44
- package/dist/commands/legacy-commands.js.map +0 -1
- package/dist/core/agent.d.ts +0 -84
- package/dist/core/agent.d.ts.map +0 -1
- package/dist/core/agent.js +0 -58
- package/dist/core/agent.js.map +0 -1
- package/dist/core/brain.d.ts +0 -50
- package/dist/core/brain.d.ts.map +0 -1
- package/dist/core/brain.js +0 -95
- package/dist/core/brain.js.map +0 -1
- package/dist/framework/tool-scheduler.d.ts +0 -191
- package/dist/framework/tool-scheduler.d.ts.map +0 -1
- package/dist/framework/tool-scheduler.js +0 -573
- package/dist/framework/tool-scheduler.js.map +0 -1
- package/dist/harness/harness.d.ts +0 -58
- package/dist/harness/harness.d.ts.map +0 -1
- package/dist/harness/harness.js +0 -195
- package/dist/harness/harness.js.map +0 -1
- package/dist/harness/safety.d.ts +0 -101
- package/dist/harness/safety.d.ts.map +0 -1
- package/dist/harness/safety.js +0 -322
- package/dist/harness/safety.js.map +0 -1
- package/dist/init.d.ts +0 -108
- package/dist/init.d.ts.map +0 -1
- package/dist/init.js +0 -393
- package/dist/init.js.map +0 -1
- package/dist/ink-ui/App.d.ts +0 -9
- package/dist/ink-ui/App.d.ts.map +0 -1
- package/dist/ink-ui/App.js +0 -12
- package/dist/ink-ui/App.js.map +0 -1
- package/dist/ink-ui/components/Markdown.d.ts +0 -10
- package/dist/ink-ui/components/Markdown.d.ts.map +0 -1
- package/dist/ink-ui/components/Markdown.js +0 -210
- package/dist/ink-ui/components/Markdown.js.map +0 -1
- package/dist/ink-ui/components/NativeCursor.d.ts +0 -12
- package/dist/ink-ui/components/NativeCursor.d.ts.map +0 -1
- package/dist/ink-ui/components/NativeCursor.js +0 -35
- package/dist/ink-ui/components/NativeCursor.js.map +0 -1
- package/dist/ink-ui/components/PixelHorseBanner.d.ts +0 -8
- package/dist/ink-ui/components/PixelHorseBanner.d.ts.map +0 -1
- package/dist/ink-ui/components/PixelHorseBanner.js +0 -97
- package/dist/ink-ui/components/PixelHorseBanner.js.map +0 -1
- package/dist/ink-ui/components/PromptInput.d.ts +0 -13
- package/dist/ink-ui/components/PromptInput.d.ts.map +0 -1
- package/dist/ink-ui/components/PromptInput.js +0 -30
- package/dist/ink-ui/components/PromptInput.js.map +0 -1
- package/dist/ink-ui/components/RunningHorseIndicator.d.ts +0 -13
- package/dist/ink-ui/components/RunningHorseIndicator.d.ts.map +0 -1
- package/dist/ink-ui/components/RunningHorseIndicator.js +0 -53
- package/dist/ink-ui/components/RunningHorseIndicator.js.map +0 -1
- package/dist/ink-ui/components/SelectList.d.ts +0 -16
- package/dist/ink-ui/components/SelectList.d.ts.map +0 -1
- package/dist/ink-ui/components/SelectList.js +0 -60
- package/dist/ink-ui/components/SelectList.js.map +0 -1
- package/dist/ink-ui/components/StatusLine.d.ts +0 -11
- package/dist/ink-ui/components/StatusLine.d.ts.map +0 -1
- package/dist/ink-ui/components/StatusLine.js +0 -70
- package/dist/ink-ui/components/StatusLine.js.map +0 -1
- package/dist/ink-ui/components/ToolActivity.d.ts +0 -19
- package/dist/ink-ui/components/ToolActivity.d.ts.map +0 -1
- package/dist/ink-ui/components/ToolActivity.js +0 -134
- package/dist/ink-ui/components/ToolActivity.js.map +0 -1
- package/dist/ink-ui/components/Transcript.d.ts +0 -14
- package/dist/ink-ui/components/Transcript.d.ts.map +0 -1
- package/dist/ink-ui/components/Transcript.js +0 -66
- package/dist/ink-ui/components/Transcript.js.map +0 -1
- package/dist/ink-ui/controllers/chat-controller.d.ts +0 -2
- package/dist/ink-ui/controllers/chat-controller.d.ts.map +0 -1
- package/dist/ink-ui/controllers/chat-controller.js.map +0 -1
- package/dist/ink-ui/hooks/use-raw-input-bridge.d.ts +0 -6
- package/dist/ink-ui/hooks/use-raw-input-bridge.d.ts.map +0 -1
- package/dist/ink-ui/hooks/use-raw-input-bridge.js +0 -27
- package/dist/ink-ui/hooks/use-raw-input-bridge.js.map +0 -1
- package/dist/ink-ui/hooks/use-terminal-size.d.ts +0 -7
- package/dist/ink-ui/hooks/use-terminal-size.d.ts.map +0 -1
- package/dist/ink-ui/hooks/use-terminal-size.js +0 -34
- package/dist/ink-ui/hooks/use-terminal-size.js.map +0 -1
- package/dist/ink-ui/launch.d.ts +0 -9
- package/dist/ink-ui/launch.d.ts.map +0 -1
- package/dist/ink-ui/launch.js +0 -101
- package/dist/ink-ui/launch.js.map +0 -1
- package/dist/ink-ui/runtime/grapheme.d.ts +0 -10
- package/dist/ink-ui/runtime/grapheme.d.ts.map +0 -1
- package/dist/ink-ui/runtime/grapheme.js +0 -17
- package/dist/ink-ui/runtime/grapheme.js.map +0 -1
- package/dist/ink-ui/runtime/input-buffer.d.ts +0 -10
- package/dist/ink-ui/runtime/input-buffer.d.ts.map +0 -1
- package/dist/ink-ui/runtime/input-buffer.js +0 -18
- package/dist/ink-ui/runtime/input-buffer.js.map +0 -1
- package/dist/ink-ui/runtime/layout-budget.d.ts +0 -13
- package/dist/ink-ui/runtime/layout-budget.d.ts.map +0 -1
- package/dist/ink-ui/runtime/layout-budget.js +0 -25
- package/dist/ink-ui/runtime/layout-budget.js.map +0 -1
- package/dist/ink-ui/runtime/native-cursor.d.ts +0 -62
- package/dist/ink-ui/runtime/native-cursor.d.ts.map +0 -1
- package/dist/ink-ui/runtime/native-cursor.js +0 -398
- package/dist/ink-ui/runtime/native-cursor.js.map +0 -1
- package/dist/ink-ui/runtime/prompt-layout.d.ts +0 -10
- package/dist/ink-ui/runtime/prompt-layout.d.ts.map +0 -1
- package/dist/ink-ui/runtime/prompt-layout.js +0 -21
- package/dist/ink-ui/runtime/prompt-layout.js.map +0 -1
- package/dist/ink-ui/runtime/raw-input.d.ts +0 -4
- package/dist/ink-ui/runtime/raw-input.d.ts.map +0 -1
- package/dist/ink-ui/runtime/raw-input.js +0 -15
- package/dist/ink-ui/runtime/raw-input.js.map +0 -1
- package/dist/ink-ui/runtime/transcript-state.d.ts +0 -37
- package/dist/ink-ui/runtime/transcript-state.d.ts.map +0 -1
- package/dist/ink-ui/runtime/transcript-state.js +0 -91
- package/dist/ink-ui/runtime/transcript-state.js.map +0 -1
- package/dist/ink-ui/screens/ReplScreen.d.ts +0 -27
- package/dist/ink-ui/screens/ReplScreen.d.ts.map +0 -1
- package/dist/ink-ui/screens/ReplScreen.js +0 -781
- package/dist/ink-ui/screens/ReplScreen.js.map +0 -1
- package/dist/ink-ui/types.d.ts +0 -2
- package/dist/ink-ui/types.d.ts.map +0 -1
- package/dist/ink-ui/types.js.map +0 -1
- package/dist/runtime/chat-checkpoint.d.ts +0 -17
- package/dist/runtime/chat-checkpoint.d.ts.map +0 -1
- package/dist/runtime/chat-checkpoint.js +0 -105
- package/dist/runtime/chat-checkpoint.js.map +0 -1
- package/dist/runtime/chat-command-scope.d.ts +0 -5
- package/dist/runtime/chat-command-scope.d.ts.map +0 -1
- package/dist/runtime/chat-command-scope.js +0 -22
- package/dist/runtime/chat-command-scope.js.map +0 -1
- package/dist/runtime/chat-compact.d.ts +0 -26
- package/dist/runtime/chat-compact.d.ts.map +0 -1
- package/dist/runtime/chat-compact.js +0 -132
- package/dist/runtime/chat-compact.js.map +0 -1
- package/dist/runtime/chat-controller.d.ts +0 -62
- package/dist/runtime/chat-controller.d.ts.map +0 -1
- package/dist/runtime/chat-controller.js +0 -1620
- package/dist/runtime/chat-controller.js.map +0 -1
- package/dist/runtime/chat-effort.d.ts +0 -5
- package/dist/runtime/chat-effort.d.ts.map +0 -1
- package/dist/runtime/chat-effort.js +0 -47
- package/dist/runtime/chat-effort.js.map +0 -1
- package/dist/runtime/chat-presentation.d.ts +0 -63
- package/dist/runtime/chat-presentation.d.ts.map +0 -1
- package/dist/runtime/chat-presentation.js +0 -561
- package/dist/runtime/chat-presentation.js.map +0 -1
- package/dist/runtime/chat-trace.d.ts +0 -52
- package/dist/runtime/chat-trace.d.ts.map +0 -1
- package/dist/runtime/chat-trace.js +0 -234
- package/dist/runtime/chat-trace.js.map +0 -1
- package/dist/runtime/chat-workspace.d.ts +0 -22
- package/dist/runtime/chat-workspace.d.ts.map +0 -1
- package/dist/runtime/chat-workspace.js +0 -154
- package/dist/runtime/chat-workspace.js.map +0 -1
- package/dist/runtime/goals/accounting.d.ts +0 -45
- package/dist/runtime/goals/accounting.d.ts.map +0 -1
- package/dist/runtime/goals/accounting.js +0 -114
- package/dist/runtime/goals/accounting.js.map +0 -1
- package/dist/runtime/goals/coordinator.d.ts +0 -92
- package/dist/runtime/goals/coordinator.d.ts.map +0 -1
- package/dist/runtime/goals/coordinator.js +0 -1471
- package/dist/runtime/goals/coordinator.js.map +0 -1
- package/dist/runtime/goals/lifecycle.d.ts +0 -13
- package/dist/runtime/goals/lifecycle.d.ts.map +0 -1
- package/dist/runtime/goals/lifecycle.js +0 -46
- package/dist/runtime/goals/lifecycle.js.map +0 -1
- package/dist/runtime/goals/prompt.d.ts +0 -16
- package/dist/runtime/goals/prompt.d.ts.map +0 -1
- package/dist/runtime/goals/prompt.js +0 -88
- package/dist/runtime/goals/prompt.js.map +0 -1
- package/dist/runtime/goals/stop-policy.d.ts +0 -9
- package/dist/runtime/goals/stop-policy.d.ts.map +0 -1
- package/dist/runtime/goals/stop-policy.js +0 -83
- package/dist/runtime/goals/stop-policy.js.map +0 -1
- package/dist/runtime/goals/tools.d.ts +0 -61
- package/dist/runtime/goals/tools.d.ts.map +0 -1
- package/dist/runtime/goals/tools.js +0 -568
- package/dist/runtime/goals/tools.js.map +0 -1
- package/dist/sdk/index.d.ts +0 -10
- package/dist/sdk/index.d.ts.map +0 -1
- package/dist/sdk/index.js +0 -23
- package/dist/sdk/index.js.map +0 -1
- package/dist/sdk/init.d.ts +0 -24
- package/dist/sdk/init.d.ts.map +0 -1
- package/dist/sdk/init.js +0 -48
- package/dist/sdk/init.js.map +0 -1
- package/dist/sdk/query.d.ts +0 -19
- package/dist/sdk/query.d.ts.map +0 -1
- package/dist/sdk/query.js +0 -42
- package/dist/sdk/query.js.map +0 -1
- package/dist/sdk/sessions.d.ts +0 -19
- package/dist/sdk/sessions.d.ts.map +0 -1
- package/dist/sdk/sessions.js +0 -57
- package/dist/sdk/sessions.js.map +0 -1
- package/dist/sdk/types.d.ts +0 -47
- package/dist/sdk/types.d.ts.map +0 -1
- package/dist/sdk/types.js +0 -8
- package/dist/sdk/types.js.map +0 -1
- package/dist/services/agent-runner.d.ts +0 -71
- package/dist/services/agent-runner.d.ts.map +0 -1
- package/dist/services/agent-runner.js +0 -185
- package/dist/services/agent-runner.js.map +0 -1
- package/dist/services/task-manager.d.ts +0 -161
- package/dist/services/task-manager.d.ts.map +0 -1
- package/dist/services/task-manager.js +0 -315
- package/dist/services/task-manager.js.map +0 -1
- package/dist/skills/discovery.d.ts +0 -22
- package/dist/skills/discovery.d.ts.map +0 -1
- package/dist/skills/discovery.js +0 -75
- package/dist/skills/discovery.js.map +0 -1
- package/dist/skills/index.d.ts +0 -11
- package/dist/skills/index.d.ts.map +0 -1
- package/dist/skills/index.js.map +0 -1
- package/dist/skills/loader.d.ts +0 -53
- package/dist/skills/loader.d.ts.map +0 -1
- package/dist/skills/loader.js +0 -421
- package/dist/skills/loader.js.map +0 -1
- package/dist/skills/registry.d.ts +0 -41
- package/dist/skills/registry.d.ts.map +0 -1
- package/dist/skills/registry.js +0 -157
- package/dist/skills/registry.js.map +0 -1
- package/dist/skills/runtime.d.ts +0 -46
- package/dist/skills/runtime.d.ts.map +0 -1
- package/dist/skills/runtime.js +0 -363
- package/dist/skills/runtime.js.map +0 -1
- package/dist/skills/types.d.ts +0 -112
- package/dist/skills/types.d.ts.map +0 -1
- package/dist/skills/types.js +0 -24
- package/dist/skills/types.js.map +0 -1
- package/dist/tools/index.d.ts +0 -52
- package/dist/tools/index.d.ts.map +0 -1
- package/dist/tools/index.js +0 -2268
- package/dist/tools/index.js.map +0 -1
- package/dist/tools/mcp.d.ts +0 -99
- package/dist/tools/mcp.d.ts.map +0 -1
- package/dist/tools/mcp.js +0 -695
- package/dist/tools/mcp.js.map +0 -1
- package/dist/tools/plan.d.ts +0 -17
- package/dist/tools/plan.d.ts.map +0 -1
- package/dist/tools/plan.js +0 -84
- package/dist/tools/plan.js.map +0 -1
- package/docs/migration/v0.1.8-to-v0.1.9.md +0 -60
- package/docs/plan/v0.1.9-release-checklist.md +0 -64
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
/**
|
|
2
|
+
/** Core slash-command presentation backed only by explicit runtime state. */
|
|
3
3
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
4
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
5
|
};
|
|
@@ -7,37 +7,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
7
7
|
exports.showHelp = showHelp;
|
|
8
8
|
exports.showStatus = showStatus;
|
|
9
9
|
exports.handleExit = handleExit;
|
|
10
|
-
exports.handleTask = handleTask;
|
|
11
|
-
exports.handleRun = handleRun;
|
|
12
|
-
exports.handleChat = handleChat;
|
|
13
10
|
exports.sortCommands = sortCommands;
|
|
14
11
|
exports.getCommandCategoryLabel = getCommandCategoryLabel;
|
|
15
12
|
const chalk_1 = __importDefault(require("chalk"));
|
|
16
|
-
const
|
|
17
|
-
const task_manager_1 = require("../services/task-manager");
|
|
18
|
-
const agent_runner_1 = require("../services/agent-runner");
|
|
19
|
-
const config_1 = require("../services/config");
|
|
20
|
-
const errors_1 = require("../utils/errors");
|
|
21
|
-
const tool_allowlist_1 = require("../services/tool-allowlist");
|
|
22
|
-
const box_1 = require("../ui/box");
|
|
23
|
-
const stream_markdown_1 = require("../ui/stream-markdown");
|
|
24
|
-
const progress_1 = require("../ui/progress");
|
|
13
|
+
const auto_compact_1 = require("../services/compact/auto-compact");
|
|
25
14
|
const format_1 = require("../services/format");
|
|
26
|
-
const
|
|
27
|
-
const tools_1 = require("../tools");
|
|
15
|
+
const model_context_1 = require("../services/model-context");
|
|
28
16
|
const session_storage_1 = require("../services/session-storage");
|
|
29
|
-
const auto_compact_1 = require("../services/compact/auto-compact");
|
|
30
|
-
const harness_1 = require("../harness");
|
|
31
|
-
const skills_1 = require("../skills");
|
|
32
|
-
const file_context_1 = require("../services/file-context");
|
|
33
17
|
const project_instructions_1 = require("../services/project-instructions");
|
|
34
18
|
const prompt_context_1 = require("../services/prompt-context");
|
|
35
|
-
const
|
|
36
|
-
const agent_status_1 = require("../runtime/agent-status");
|
|
37
|
-
const loop_budget_1 = require("../runtime/loop-budget");
|
|
38
|
-
// ============================================================================
|
|
39
|
-
// 颜色常量
|
|
40
|
-
// ============================================================================
|
|
19
|
+
const ui_view_model_1 = require("../runtime/ui-view-model");
|
|
41
20
|
const BRAND = chalk_1.default.hex('#FF6B35');
|
|
42
21
|
const ACCENT = chalk_1.default.hex('#00D4AA');
|
|
43
22
|
const DIM = chalk_1.default.dim;
|
|
@@ -55,12 +34,16 @@ const CATEGORY_ORDER = [
|
|
|
55
34
|
'diagnostics',
|
|
56
35
|
'legacy',
|
|
57
36
|
];
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
37
|
+
const CATEGORY_LABELS = {
|
|
38
|
+
workflow: 'Workflow',
|
|
39
|
+
session: 'Session',
|
|
40
|
+
context: 'Context',
|
|
41
|
+
tools: 'Tools',
|
|
42
|
+
model: 'Model',
|
|
43
|
+
system: 'System',
|
|
44
|
+
diagnostics: 'Diagnostics',
|
|
45
|
+
legacy: 'Legacy',
|
|
46
|
+
};
|
|
64
47
|
function formatTokenCount(tokens) {
|
|
65
48
|
if (tokens >= 1000000)
|
|
66
49
|
return `${(tokens / 1000000).toFixed(1)}M`;
|
|
@@ -72,9 +55,7 @@ function formatThreshold(value) {
|
|
|
72
55
|
return `${Math.round(value * 100)}%`;
|
|
73
56
|
}
|
|
74
57
|
function formatDurationMs(ms) {
|
|
75
|
-
|
|
76
|
-
return `${(ms / 1000).toFixed(1)}s`;
|
|
77
|
-
return `${Math.round(ms)}ms`;
|
|
58
|
+
return ms >= 1000 ? `${(ms / 1000).toFixed(1)}s` : `${Math.round(ms)}ms`;
|
|
78
59
|
}
|
|
79
60
|
function formatRendererStatus(ctx) {
|
|
80
61
|
const snapshot = (0, ui_view_model_1.createStatusSnapshot)({
|
|
@@ -85,21 +66,16 @@ function formatRendererStatus(ctx) {
|
|
|
85
66
|
? WARN('deprecated')
|
|
86
67
|
: snapshot.renderer.status === 'product'
|
|
87
68
|
? SUCCESS('product')
|
|
88
|
-
: snapshot.renderer.status
|
|
89
|
-
? DIM('technical')
|
|
90
|
-
: snapshot.renderer.status === 'non-interactive'
|
|
91
|
-
? DIM('non-interactive')
|
|
92
|
-
: DIM('custom');
|
|
69
|
+
: DIM(snapshot.renderer.status);
|
|
93
70
|
return `${BRAND(snapshot.renderer.name)} ${status} ${DIM(snapshot.renderer.capabilityLabels.join(', '))}`;
|
|
94
71
|
}
|
|
95
72
|
function formatLoopBudgetSource(stats) {
|
|
96
73
|
const source = stats.loopBudgetSource ?? 'unknown';
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
return source;
|
|
74
|
+
return source === 'config' && stats.loopBudgetBaseProfile
|
|
75
|
+
? `config over ${stats.loopBudgetBaseProfile}`
|
|
76
|
+
: source;
|
|
101
77
|
}
|
|
102
|
-
function formatLoopStatsLines(stats
|
|
78
|
+
function formatLoopStatsLines(stats) {
|
|
103
79
|
const lines = [
|
|
104
80
|
`Finish ${stats.finishReason}`,
|
|
105
81
|
`Requests ${stats.llmRequests} LLM / ${stats.turnsStarted} turns`,
|
|
@@ -109,49 +85,12 @@ function formatLoopStatsLines(stats, detail = false) {
|
|
|
109
85
|
if (stats.summarizedBytes > 0) {
|
|
110
86
|
lines.push(`Saved ${(0, format_1.formatBytes)(stats.summarizedBytes)} from model context`);
|
|
111
87
|
}
|
|
112
|
-
if (stats.compactTrigger)
|
|
88
|
+
if (stats.compactTrigger)
|
|
113
89
|
lines.push(`Compact ${stats.compactTrigger}`);
|
|
114
|
-
|
|
115
|
-
if (stats.localFastPathUsed) {
|
|
116
|
-
lines.push('Fast path yes');
|
|
117
|
-
}
|
|
118
|
-
if (stats.budgetExceededReason) {
|
|
90
|
+
if (stats.budgetExceededReason)
|
|
119
91
|
lines.push(`Budget ${stats.budgetExceededReason}`);
|
|
120
|
-
}
|
|
121
|
-
if (stats.continuationActions && stats.continuationActions.length > 0) {
|
|
122
|
-
lines.push(`Next ${stats.continuationActions.join(', ')}`);
|
|
123
|
-
}
|
|
124
|
-
if (stats.lastToolName) {
|
|
125
|
-
lines.push(`Stopped at ${stats.lastToolName}${stats.lastToolSummary ? ` — ${stats.lastToolSummary}` : ''}`);
|
|
126
|
-
}
|
|
127
92
|
if ((stats.providerRetryCount ?? 0) > 0) {
|
|
128
|
-
|
|
129
|
-
`${stats.providerRetryCount} retries`,
|
|
130
|
-
`delay ${formatDurationMs(stats.providerRetryDelayMs ?? 0)}`,
|
|
131
|
-
stats.providerLastRetryErrorType
|
|
132
|
-
? `last ${stats.providerLastRetryErrorType}${stats.providerLastRetryStatus ? `/${stats.providerLastRetryStatus}` : ''}`
|
|
133
|
-
: undefined,
|
|
134
|
-
].filter(Boolean);
|
|
135
|
-
lines.push(`Provider ${retryParts.join(', ')}`);
|
|
136
|
-
}
|
|
137
|
-
if ((stats.providerFallbackCount ?? 0) > 0 || stats.providerUsingFallback) {
|
|
138
|
-
const fallbackPath = stats.providerFallbackFromModel && stats.providerFallbackToModel
|
|
139
|
-
? `${stats.providerFallbackFromModel} -> ${stats.providerFallbackToModel}`
|
|
140
|
-
: stats.providerFinalModel
|
|
141
|
-
? `final ${stats.providerFinalModel}`
|
|
142
|
-
: 'active';
|
|
143
|
-
lines.push(`Fallback ${fallbackPath}`);
|
|
144
|
-
}
|
|
145
|
-
if (typeof stats.verificationClaimAllowed === 'boolean') {
|
|
146
|
-
const verificationParts = [
|
|
147
|
-
stats.verificationProfile ?? 'unknown',
|
|
148
|
-
`required=${stats.verificationRequired ? 'yes' : 'no'}`,
|
|
149
|
-
`passed=${stats.verificationPassedCommands?.length ?? 0}`,
|
|
150
|
-
`failed=${stats.verificationFailedCommands?.length ?? 0}`,
|
|
151
|
-
`missing=${stats.verificationMissingCommands?.length ?? 0}`,
|
|
152
|
-
`claim=${stats.verificationClaimAllowed ? 'yes' : 'no'}`,
|
|
153
|
-
];
|
|
154
|
-
lines.push(`Verify ${verificationParts.join(' ')}`);
|
|
93
|
+
lines.push(`Provider ${stats.providerRetryCount} retries, delay ${formatDurationMs(stats.providerRetryDelayMs ?? 0)}`);
|
|
155
94
|
}
|
|
156
95
|
if (typeof stats.loopBudgetMaxLlmRequests === 'number' ||
|
|
157
96
|
typeof stats.loopBudgetMaxToolCalls === 'number' ||
|
|
@@ -166,46 +105,11 @@ function formatLoopStatsLines(stats, detail = false) {
|
|
|
166
105
|
typeof stats.loopBudgetMaxModelVisibleBytes === 'number'
|
|
167
106
|
? `${(0, format_1.formatBytes)(stats.modelVisibleToolBytes)}/${(0, format_1.formatBytes)(stats.loopBudgetMaxModelVisibleBytes)} visible`
|
|
168
107
|
: undefined,
|
|
169
|
-
typeof stats.loopBudgetMaxReadOnlyFragmentation === 'number'
|
|
170
|
-
? `fragment ${stats.singleReadOnlyStreak}/${stats.loopBudgetMaxReadOnlyFragmentation}`
|
|
171
|
-
: undefined,
|
|
172
108
|
].filter(Boolean);
|
|
173
109
|
lines.push(`Budget cap ${caps.join(', ')} (${formatLoopBudgetSource(stats)})`);
|
|
174
110
|
}
|
|
175
|
-
if (stats.singleReadOnlyStreak > 0 || stats.batchReadSuggestionCount > 0) {
|
|
176
|
-
lines.push(`Read-only streak ${stats.singleReadOnlyStreak}, batch_read hints ${stats.batchReadSuggestionCount}`);
|
|
177
|
-
}
|
|
178
|
-
if (detail) {
|
|
179
|
-
lines.push(`Unsafe ${stats.unsafeToolCalls}`);
|
|
180
|
-
if (stats.providerRetryErrorTypes && stats.providerRetryErrorTypes.length > 0) {
|
|
181
|
-
lines.push(`Retry type ${stats.providerRetryErrorTypes.join(', ')}`);
|
|
182
|
-
}
|
|
183
|
-
if (stats.verificationFailedCommands && stats.verificationFailedCommands.length > 0) {
|
|
184
|
-
lines.push(`Failed ${stats.verificationFailedCommands.join(' && ')}`);
|
|
185
|
-
}
|
|
186
|
-
if (stats.verificationMissingCommands && stats.verificationMissingCommands.length > 0) {
|
|
187
|
-
lines.push(`Missing ${stats.verificationMissingCommands.join(' && ')}`);
|
|
188
|
-
}
|
|
189
|
-
if (stats.verificationSkippedReason) {
|
|
190
|
-
lines.push(`Verify why ${stats.verificationSkippedReason}`);
|
|
191
|
-
}
|
|
192
|
-
if (stats.continuationHint) {
|
|
193
|
-
lines.push(`Next why ${stats.continuationHint}`);
|
|
194
|
-
}
|
|
195
|
-
lines.push(`Budget hit ${stats.finishReason === 'budget_exceeded' ? 'yes' : 'no'}`);
|
|
196
|
-
}
|
|
197
111
|
return lines;
|
|
198
112
|
}
|
|
199
|
-
const CATEGORY_LABELS = {
|
|
200
|
-
workflow: 'Workflow',
|
|
201
|
-
session: 'Session',
|
|
202
|
-
context: 'Context',
|
|
203
|
-
tools: 'Tools',
|
|
204
|
-
model: 'Model',
|
|
205
|
-
system: 'System',
|
|
206
|
-
diagnostics: 'Diagnostics',
|
|
207
|
-
legacy: 'Legacy',
|
|
208
|
-
};
|
|
209
113
|
function commandCategory(command) {
|
|
210
114
|
return command.category ?? 'system';
|
|
211
115
|
}
|
|
@@ -223,583 +127,81 @@ function sortCommands(commands) {
|
|
|
223
127
|
return a.name.localeCompare(b.name);
|
|
224
128
|
});
|
|
225
129
|
}
|
|
226
|
-
function isAbortError(error, abortSignal) {
|
|
227
|
-
if (abortSignal?.aborted)
|
|
228
|
-
return true;
|
|
229
|
-
if (error instanceof Error) {
|
|
230
|
-
return error.name === 'AbortError' || error.message.toLowerCase().includes('aborted');
|
|
231
|
-
}
|
|
232
|
-
return false;
|
|
233
|
-
}
|
|
234
|
-
// ============================================================================
|
|
235
|
-
// 工具参数摘要
|
|
236
|
-
// ============================================================================
|
|
237
|
-
// ============================================================================
|
|
238
|
-
// 命令实现
|
|
239
|
-
// ============================================================================
|
|
240
|
-
let taskManager = null;
|
|
241
130
|
function showHelp(ctx, visible, includeAdvanced = false) {
|
|
242
131
|
const lines = ['', HEADER('Commands:'), ''];
|
|
243
|
-
const write = (line = '') => {
|
|
244
|
-
lines.push(line);
|
|
245
|
-
};
|
|
246
132
|
for (const category of CATEGORY_ORDER) {
|
|
247
|
-
const items = visible.filter(
|
|
248
|
-
(includeAdvanced || (
|
|
133
|
+
const items = visible.filter(command => commandCategory(command) === category &&
|
|
134
|
+
(includeAdvanced || (command.audience ?? 'primary') === 'primary'));
|
|
249
135
|
if (items.length === 0)
|
|
250
136
|
continue;
|
|
251
|
-
|
|
252
|
-
for (const
|
|
253
|
-
const aliases =
|
|
254
|
-
const params =
|
|
255
|
-
const
|
|
256
|
-
|
|
257
|
-
:
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
const risk = cmd.risk === 'destructive' ? ' destructive' : '';
|
|
261
|
-
const availability = cmd.availability?.(ctx);
|
|
137
|
+
lines.push(DIM(getCommandCategoryLabel(category)));
|
|
138
|
+
for (const command of items) {
|
|
139
|
+
const aliases = command.aliases ? ` (${command.aliases.join(', ')})` : '';
|
|
140
|
+
const params = command.argumentHint || command.params?.map(param => `<${param.name}>`).join(' ') || '';
|
|
141
|
+
const availability = command.availability?.(ctx);
|
|
142
|
+
const lifecycle = command.lifecycle?.status === 'deprecated'
|
|
143
|
+
? ` deprecated since ${command.lifecycle.since ?? 'unknown'}${command.lifecycle.replacement ? `; use ${command.lifecycle.replacement}` : ''}`
|
|
144
|
+
: '';
|
|
145
|
+
const risk = command.risk === 'destructive' ? ' destructive' : '';
|
|
262
146
|
const unavailable = availability && !availability.available
|
|
263
147
|
? ` unavailable: ${availability.reason ?? 'requirements not met'}`
|
|
264
148
|
: '';
|
|
265
|
-
|
|
266
|
-
|
|
149
|
+
lines.push(` ${ACCENT(`/${command.name}`)}${aliases} ${DIM(params)}`);
|
|
150
|
+
lines.push(` ${DIM(`${command.description}${lifecycle}${risk}${unavailable}`)}`);
|
|
267
151
|
}
|
|
268
|
-
|
|
152
|
+
lines.push('');
|
|
269
153
|
}
|
|
270
|
-
|
|
271
|
-
write();
|
|
154
|
+
lines.push(DIM('Type any text without / prefix to start a runtime turn.'), '');
|
|
272
155
|
return { success: true, output: lines.join('\n') };
|
|
273
156
|
}
|
|
274
157
|
function showStatus(ctx) {
|
|
275
158
|
const lines = ['', HEADER('System Status'), DIM('─'.repeat(40))];
|
|
276
|
-
const
|
|
277
|
-
lines.push(line);
|
|
278
|
-
};
|
|
279
|
-
const brainStatus = ctx.runtime.brain.getStatus();
|
|
280
|
-
const memStatus = ctx.runtime.memory.getStatus();
|
|
281
|
-
const storeStats = ctx.runtime.store.getStats();
|
|
282
|
-
write(` Mode ${BRAND(ctx.config.mode)}`);
|
|
283
|
-
write(` Log level ${DIM(ctx.config.logLevel)}`);
|
|
284
|
-
const modelId = ctx.llm?.getModel() ?? snapshotCurrentModel(ctx);
|
|
159
|
+
const modelId = ctx.llm?.getModel() ?? ctx.store.getSnapshot().currentModel ?? ctx.config.model;
|
|
285
160
|
const modelContext = (0, model_context_1.resolveModelContext)(modelId);
|
|
286
|
-
const
|
|
287
|
-
write(` Model ${BRAND(modelId)}`);
|
|
288
|
-
const effort = ctx.store.getSnapshot().resolvedEffort;
|
|
289
|
-
write(` Effort ${DIM(effort ? `${effort.requested}/${effort.effective ?? 'provider-default'}` : 'auto/provider-default')}`);
|
|
290
|
-
write(` Context ${DIM(`${formatTokenCount(modelContext.contextWindow)} tokens (${modelContext.source}${modelContext.source === 'fuzzy' ? `:${modelContext.matchedId}` : ''})`)}`);
|
|
291
|
-
write(` Compact ${compactStats.enabled ? SUCCESS('auto') : WARN('off')} ${DIM(`predict ${formatThreshold(compactStats.predictiveCompactThreshold)}, hard ${formatThreshold(compactStats.threshold)}, used ${compactStats.ctxPercent}%`)}`);
|
|
292
|
-
write(` Renderer ${formatRendererStatus(ctx)}`);
|
|
293
|
-
write();
|
|
294
|
-
write(` Agents ${SUCCESS(brainStatus.agents.length)} registered`);
|
|
295
|
-
write(` Tasks ${brainStatus.pendingTasks} pending (${brainStatus.strategy} strategy)`);
|
|
296
|
-
write();
|
|
297
|
-
write(' Memory (inline):');
|
|
298
|
-
write(` Working ${memStatus.working} entries`);
|
|
299
|
-
write(` Short-term ${memStatus['short-term']} entries`);
|
|
300
|
-
write(` Long-term ${memStatus['long-term']} entries`);
|
|
301
|
-
write();
|
|
302
|
-
write(' Memory (store):');
|
|
303
|
-
write(` Working ${storeStats.working} entries`);
|
|
304
|
-
write(` Short-term ${storeStats['short-term']} entries`);
|
|
305
|
-
write(` Long-term ${storeStats['long-term']} entries`);
|
|
306
|
-
(0, prompt_context_1.refreshProjectInstructions)(ctx.store, ctx.cwd);
|
|
307
|
-
const snapshot = ctx.store.getSnapshot();
|
|
308
|
-
const instructionFiles = (0, project_instructions_1.loadProjectInstructionFiles)(ctx.cwd);
|
|
309
|
-
write();
|
|
310
|
-
write(' Context:');
|
|
311
|
-
write(` Project rules ${instructionFiles.length > 0 ? SUCCESS(`${instructionFiles.length} files`) : DIM('none')}`);
|
|
312
|
-
for (const file of instructionFiles.slice(0, 8)) {
|
|
313
|
-
write(` ${DIM(file.path)}${file.truncated ? ` ${WARN('(truncated)')}` : ''}`);
|
|
314
|
-
}
|
|
315
|
-
if (instructionFiles.length > 8) {
|
|
316
|
-
write(` ${DIM(`... ${instructionFiles.length - 8} more`)}`);
|
|
317
|
-
}
|
|
318
|
-
write(` Prompt rules ${snapshot.projectInstructionsContent ? SUCCESS(`${snapshot.projectInstructionsContent.length} chars`) : DIM('none')}`);
|
|
319
|
-
write(` Project memory ${snapshot.memoryContent ? SUCCESS(`${snapshot.memoryContent.length} chars`) : DIM('none')}`);
|
|
320
|
-
write(` Skills index ${snapshot.skillsContent ? SUCCESS(`${snapshot.skillsContent.length} chars`) : DIM('none')}`);
|
|
321
|
-
if (snapshot.lastLoopStats) {
|
|
322
|
-
const stats = snapshot.lastLoopStats;
|
|
323
|
-
write();
|
|
324
|
-
write(' Last loop:');
|
|
325
|
-
for (const line of formatLoopStatsLines(stats)) {
|
|
326
|
-
write(` ${line}`);
|
|
327
|
-
}
|
|
328
|
-
}
|
|
329
|
-
const harnessState = snapshot.harnessState;
|
|
330
|
-
if (harnessState?.contract || harnessState?.capsule) {
|
|
331
|
-
write();
|
|
332
|
-
write(' Harness:');
|
|
333
|
-
if (harnessState.contract) {
|
|
334
|
-
write(` Objective ${ACCENT(harnessState.contract.objective)}`);
|
|
335
|
-
}
|
|
336
|
-
write(` Ledger ${DIM(`${harnessState.ledger.length} entries`)}`);
|
|
337
|
-
if (harnessState.capsule) {
|
|
338
|
-
write(` Next ${DIM(harnessState.capsule.nextAction)}`);
|
|
339
|
-
const passed = harnessState.capsule.verification.passed.length;
|
|
340
|
-
const failed = harnessState.capsule.verification.failed.length;
|
|
341
|
-
write(` Verify ${SUCCESS(`${passed} passed`)} / ${failed > 0 ? ERROR(`${failed} failed`) : DIM('0 failed')}`);
|
|
342
|
-
}
|
|
343
|
-
}
|
|
344
|
-
write();
|
|
345
|
-
return { success: true, output: lines.join('\n') };
|
|
346
|
-
}
|
|
347
|
-
function snapshotCurrentModel(ctx) {
|
|
348
|
-
return ctx.store.getSnapshot().currentModel || ctx.config.model;
|
|
349
|
-
}
|
|
350
|
-
function getCommandAutoCompact(ctx, modelId) {
|
|
161
|
+
const compact = ctx.compactCoordinator?.getAutomatic() ?? (0, auto_compact_1.getAutoCompact)({ modelId });
|
|
351
162
|
if (ctx.compactCoordinator) {
|
|
352
163
|
ctx.compactCoordinator.configure({
|
|
353
164
|
modelId,
|
|
354
165
|
llm: ctx.llm,
|
|
355
166
|
outputReserveTokens: ctx.llm?.getMaxTokens?.(),
|
|
356
167
|
});
|
|
357
|
-
return ctx.compactCoordinator.getAutomatic();
|
|
358
|
-
}
|
|
359
|
-
return (0, auto_compact_1.getAutoCompact)({ modelId });
|
|
360
|
-
}
|
|
361
|
-
function handleTask(ctx, args) {
|
|
362
|
-
const [sub] = args.trim().split(/\s+/);
|
|
363
|
-
if (sub === 'list' || sub === 'ls') {
|
|
364
|
-
if (!taskManager) {
|
|
365
|
-
taskManager = new task_manager_1.TaskManager();
|
|
366
|
-
}
|
|
367
|
-
console.log();
|
|
368
|
-
console.log(HEADER('Task List'));
|
|
369
|
-
console.log(DIM('─'.repeat(40)));
|
|
370
|
-
const stats = taskManager.getStats();
|
|
371
|
-
console.log(` Total ${stats.total}`);
|
|
372
|
-
console.log(` Pending ${stats.pending}`);
|
|
373
|
-
console.log(` Running ${stats.running}`);
|
|
374
|
-
console.log(` Completed ${SUCCESS(stats.completed)}`);
|
|
375
|
-
console.log(` Failed ${ERROR(stats.failed)}`);
|
|
376
|
-
console.log(` Cancelled ${DIM(stats.cancelled)}`);
|
|
377
|
-
const tasks = taskManager.list();
|
|
378
|
-
if (tasks.length > 0) {
|
|
379
|
-
console.log();
|
|
380
|
-
for (const t of tasks) {
|
|
381
|
-
const statusIcon = t.status === 'completed'
|
|
382
|
-
? SUCCESS('✓')
|
|
383
|
-
: t.status === 'failed'
|
|
384
|
-
? ERROR('✗')
|
|
385
|
-
: t.status === 'running'
|
|
386
|
-
? WARN('◌')
|
|
387
|
-
: t.status === 'cancelled'
|
|
388
|
-
? DIM('⊘')
|
|
389
|
-
: DIM('○');
|
|
390
|
-
console.log(` ${statusIcon} ${ACCENT(t.name)} ${DIM(`(${t.id.slice(0, 8)})`)}`);
|
|
391
|
-
console.log(` ${DIM(`[${t.priority}]`)} ${t.description.slice(0, 60)}`);
|
|
392
|
-
}
|
|
393
|
-
}
|
|
394
|
-
console.log();
|
|
395
|
-
return { success: true };
|
|
396
168
|
}
|
|
397
|
-
|
|
398
|
-
const taskName = args.trim() || 'demo-task';
|
|
399
|
-
const task = {
|
|
400
|
-
id: `cli-${Date.now()}`,
|
|
401
|
-
name: taskName,
|
|
402
|
-
description: `Task submitted from CLI: ${taskName}`,
|
|
403
|
-
priority: 'P1',
|
|
404
|
-
assignedTo: 'leader',
|
|
405
|
-
status: 'pending',
|
|
406
|
-
};
|
|
407
|
-
console.log();
|
|
408
|
-
ctx.runtime.brain.submitTask(task);
|
|
409
|
-
console.log(SUCCESS(`✔ Task "${taskName}" submitted`));
|
|
410
|
-
console.log();
|
|
411
|
-
return { success: true };
|
|
412
|
-
}
|
|
413
|
-
async function handleRun(ctx, args) {
|
|
414
|
-
if (!args.trim()) {
|
|
415
|
-
console.log(ERROR('Usage: /run <task description>'));
|
|
416
|
-
console.log(DIM(' Creates a task and executes it through the Agent + LLM pipeline.'));
|
|
417
|
-
console.log();
|
|
418
|
-
return { success: false };
|
|
419
|
-
}
|
|
420
|
-
if (!ctx.llm || !(0, config_1.isConfigured)(ctx.config)) {
|
|
421
|
-
console.log(WARN('⚠ LLM not configured. Set ORION_CODE_API_KEY in .env to enable run mode.'));
|
|
422
|
-
console.log();
|
|
423
|
-
return { success: false };
|
|
424
|
-
}
|
|
425
|
-
if (!taskManager) {
|
|
426
|
-
taskManager = new task_manager_1.TaskManager();
|
|
427
|
-
}
|
|
428
|
-
const taskOptions = {
|
|
429
|
-
name: args.slice(0, 80),
|
|
430
|
-
description: args,
|
|
431
|
-
priority: 'P1',
|
|
432
|
-
assignedTo: 'leader',
|
|
433
|
-
tags: ['cli', 'interactive'],
|
|
434
|
-
};
|
|
435
|
-
let record;
|
|
436
|
-
try {
|
|
437
|
-
record = taskManager.create(taskOptions);
|
|
438
|
-
}
|
|
439
|
-
catch (error) {
|
|
440
|
-
if (error instanceof task_manager_1.TaskCapacityError) {
|
|
441
|
-
console.log(ERROR(`✗ ${error.message}`));
|
|
442
|
-
console.log();
|
|
443
|
-
return { success: false };
|
|
444
|
-
}
|
|
445
|
-
throw error;
|
|
446
|
-
}
|
|
447
|
-
console.log();
|
|
448
|
-
console.log(SUCCESS(`✔ Task created: ${ACCENT(record.name)}`));
|
|
449
|
-
console.log(DIM(` ID: ${record.id} | Tags: ${record.tags.join(', ')}`));
|
|
450
|
-
taskManager.start(record.id);
|
|
451
|
-
console.log(WARN('◌ Running task through Agent + LLM...'));
|
|
452
|
-
try {
|
|
453
|
-
const agent = ctx.runtime.agents[0];
|
|
454
|
-
if (!agent) {
|
|
455
|
-
throw new Error('No agents registered');
|
|
456
|
-
}
|
|
457
|
-
const runner = new agent_runner_1.AgentRunner(agent, ctx.llm);
|
|
458
|
-
const task = taskManager.toTask(record);
|
|
459
|
-
const result = await runner.run(task);
|
|
460
|
-
if (result.success) {
|
|
461
|
-
taskManager.complete(record.id, result);
|
|
462
|
-
console.log(SUCCESS(`✓ Task completed in ${result.duration}ms`));
|
|
463
|
-
if (result.tokenUsage) {
|
|
464
|
-
console.log(DIM(` Tokens: ${result.tokenUsage.promptTokens} in / ${result.tokenUsage.completionTokens} out`));
|
|
465
|
-
}
|
|
466
|
-
if (result.data?.summary) {
|
|
467
|
-
console.log();
|
|
468
|
-
console.log(ACCENT(' Summary:'));
|
|
469
|
-
console.log(` ${result.data.summary}`);
|
|
470
|
-
}
|
|
471
|
-
}
|
|
472
|
-
else {
|
|
473
|
-
taskManager.fail(record.id, result.error, result);
|
|
474
|
-
console.log(ERROR(`✗ Task failed: ${result.error}`));
|
|
475
|
-
}
|
|
476
|
-
}
|
|
477
|
-
catch (error) {
|
|
478
|
-
const message = (0, errors_1.errorMessage)(error);
|
|
479
|
-
taskManager.fail(record.id, message);
|
|
480
|
-
console.log(ERROR(`✗ Task error: ${message}`));
|
|
481
|
-
}
|
|
482
|
-
console.log();
|
|
483
|
-
return { success: true };
|
|
484
|
-
}
|
|
485
|
-
async function handleChat(ctx, input) {
|
|
486
|
-
const ui = commandUICapabilities(ctx);
|
|
487
|
-
const writeOutput = ctx.writeOutput ?? ((text) => process.stdout.write(text));
|
|
488
|
-
const writeLine = ctx.writeLine ?? ((text = '') => console.log(text));
|
|
489
|
-
if (!input) {
|
|
490
|
-
console.log(ERROR('Usage: /chat <message>'));
|
|
491
|
-
console.log();
|
|
492
|
-
return { success: false };
|
|
493
|
-
}
|
|
494
|
-
if (!ctx.llm || !(0, config_1.isConfigured)(ctx.config)) {
|
|
495
|
-
console.log(WARN('⚠ LLM not configured. Set ORION_CODE_API_KEY in .env to enable chat.'));
|
|
496
|
-
console.log();
|
|
497
|
-
return { success: false };
|
|
498
|
-
}
|
|
499
|
-
const activeSession = ctx.getSession?.() ??
|
|
500
|
-
ctx.ensureSession?.() ??
|
|
501
|
-
(ctx.sessionId ? (0, session_storage_1.loadSessionMeta)(ctx.sessionId) : null);
|
|
502
|
-
const sessionId = activeSession?.id ?? ctx.sessionId;
|
|
503
|
-
const runtimeTools = (0, tools_1.getRuntimeTools)();
|
|
504
|
-
const skillResolution = (0, skills_1.resolveSkillsForTurn)({
|
|
505
|
-
cwd: ctx.cwd,
|
|
506
|
-
input,
|
|
507
|
-
tools: runtimeTools,
|
|
508
|
-
projectPath: activeSession?.projectPath,
|
|
509
|
-
sessionId,
|
|
510
|
-
});
|
|
511
|
-
const appliedSkillNames = skillResolution.skills.map(skill => skill.name);
|
|
512
|
-
// Record user message to session
|
|
513
|
-
if (sessionId) {
|
|
514
|
-
(0, session_storage_1.appendSessionMessage)(sessionId, {
|
|
515
|
-
role: 'user',
|
|
516
|
-
content: input,
|
|
517
|
-
timestamp: Date.now(),
|
|
518
|
-
appliedSkills: appliedSkillNames.length > 0 ? appliedSkillNames : undefined,
|
|
519
|
-
});
|
|
520
|
-
}
|
|
521
|
-
ctx.store.addMessage({ role: 'user', content: input });
|
|
522
|
-
(0, prompt_context_1.refreshProjectInstructions)(ctx.store, ctx.cwd);
|
|
169
|
+
const compactStats = compact.getStats();
|
|
523
170
|
const snapshot = ctx.store.getSnapshot();
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
memoryContent: snapshot.memoryContent,
|
|
542
|
-
skillsContent: snapshot.skillsContent,
|
|
543
|
-
projectInstructionsContent: snapshot.projectInstructionsContent,
|
|
544
|
-
activeSkillsContent: skillResolution.promptInjection,
|
|
545
|
-
referencedFilesContent: (0, file_context_1.buildReferencedFilesPrompt)(input, ctx.cwd),
|
|
546
|
-
planMode: snapshot.planMode || snapshot.agentMode === 'plan',
|
|
547
|
-
};
|
|
548
|
-
const systemPrompt = (0, framework_1.getSystemPrompt)(promptCtx);
|
|
549
|
-
const spinner = (0, box_1.createSpinner)();
|
|
550
|
-
const useSpinner = !ui.inlineProgress;
|
|
551
|
-
if (useSpinner) {
|
|
552
|
-
spinner.start('Thinking');
|
|
553
|
-
}
|
|
554
|
-
let finalContent = '';
|
|
555
|
-
let finalModel = '';
|
|
556
|
-
let finalUsage;
|
|
557
|
-
let responseStarted = false;
|
|
558
|
-
const sessionMessagesToRecord = [];
|
|
559
|
-
// Issue #22: 批量工具调用进度显示
|
|
560
|
-
let toolCallCount = 0;
|
|
561
|
-
let lastProgressUpdate = 0;
|
|
562
|
-
// 流式 Markdown 渲染器
|
|
563
|
-
let streamRenderer = null;
|
|
564
|
-
// Issue #32 #3.2: toolExecutor 支持 abortSignal
|
|
565
|
-
const toolExecutor = async (name, args, abortSignal) => {
|
|
566
|
-
if (!skillResolution.tools.some(tool => tool.name === name)) {
|
|
567
|
-
return JSON.stringify({
|
|
568
|
-
success: false,
|
|
569
|
-
error: skillResolution.toolScopeActive
|
|
570
|
-
? `Tool ${name} is not available for the active skill scope. Available tools: ${skillResolution.tools.map(tool => tool.name).join(', ') || 'none'}`
|
|
571
|
-
: `Tool ${name} is not available.`,
|
|
572
|
-
});
|
|
573
|
-
}
|
|
574
|
-
const result = await (0, tools_1.executeTool)(name, args, abortSignal, {
|
|
575
|
-
cwd: ctx.cwd,
|
|
576
|
-
config: {
|
|
577
|
-
name: ctx.config.name,
|
|
578
|
-
mode: ctx.config.mode,
|
|
579
|
-
},
|
|
580
|
-
sessionId,
|
|
581
|
-
turnId: ctx.turnId,
|
|
582
|
-
// Tools that fan out to other tools (batch_read) have to re-run the
|
|
583
|
-
// permission gate per sub-step; they need the mode and the allowlist.
|
|
584
|
-
permissionMode: ctx.store.getEffectivePermissionMode(),
|
|
585
|
-
toolAllowlist: (0, tool_allowlist_1.resolveProjectToolAllowlist)(ctx.cwd).evaluator,
|
|
586
|
-
});
|
|
587
|
-
// 不在这里打印,让 tool_result 事件处理
|
|
588
|
-
return result;
|
|
589
|
-
};
|
|
590
|
-
const streamCallbacks = {
|
|
591
|
-
onChunk: (chunk) => {
|
|
592
|
-
if (ctx.abortSignal?.aborted) {
|
|
593
|
-
return;
|
|
594
|
-
}
|
|
595
|
-
if (!responseStarted) {
|
|
596
|
-
responseStarted = true;
|
|
597
|
-
spinner.stop();
|
|
598
|
-
// 打印换行,让流式输出在新行开始
|
|
599
|
-
writeLine();
|
|
600
|
-
// 初始化流式渲染器
|
|
601
|
-
streamRenderer = (0, stream_markdown_1.createStreamRenderer)();
|
|
602
|
-
}
|
|
603
|
-
// 使用流式渲染器处理 chunk
|
|
604
|
-
if (streamRenderer) {
|
|
605
|
-
const rendered = streamRenderer.feed(chunk);
|
|
606
|
-
if (rendered) {
|
|
607
|
-
writeOutput(rendered);
|
|
608
|
-
}
|
|
609
|
-
}
|
|
610
|
-
else {
|
|
611
|
-
writeOutput(chunk);
|
|
612
|
-
}
|
|
613
|
-
},
|
|
614
|
-
};
|
|
615
|
-
try {
|
|
616
|
-
const messages = [
|
|
617
|
-
{ role: 'system', content: systemPrompt },
|
|
618
|
-
...snapshot.conversationHistory,
|
|
619
|
-
];
|
|
620
|
-
for await (const event of (0, framework_1.query)({
|
|
621
|
-
messages,
|
|
622
|
-
tools: skillResolution.tools,
|
|
623
|
-
toolExecutor,
|
|
624
|
-
llm: ctx.llm,
|
|
625
|
-
streamCallbacks,
|
|
626
|
-
costTracker: snapshot.costTracker,
|
|
627
|
-
permissionMode: ctx.store.getEffectivePermissionMode(),
|
|
628
|
-
toolConfirmation: ctx.config.toolConfirmation,
|
|
629
|
-
toolAllowlist: (0, tool_allowlist_1.resolveProjectToolAllowlist)(ctx.cwd).evaluator,
|
|
630
|
-
toolContext: {
|
|
631
|
-
cwd: ctx.cwd,
|
|
632
|
-
config: {
|
|
633
|
-
name: ctx.config.name,
|
|
634
|
-
mode: ctx.config.mode,
|
|
635
|
-
},
|
|
636
|
-
sessionId,
|
|
637
|
-
turnId: ctx.turnId,
|
|
638
|
-
},
|
|
639
|
-
abortSignal: ctx.abortSignal,
|
|
640
|
-
harness,
|
|
641
|
-
input,
|
|
642
|
-
loopBudget: (0, loop_budget_1.resolveRuntimeLoopBudget)(input, ctx.config, harness.toJSON()),
|
|
643
|
-
})) {
|
|
644
|
-
switch (event.type) {
|
|
645
|
-
case 'request_start':
|
|
646
|
-
// 停止 spinner,等待 LLM 响应
|
|
647
|
-
spinner.stop();
|
|
648
|
-
writeLine();
|
|
649
|
-
writeLine(DIM((0, agent_status_1.agentStepStatus)(event.turn)));
|
|
650
|
-
// 重置流式渲染器
|
|
651
|
-
streamRenderer = (0, stream_markdown_1.createStreamRenderer)();
|
|
652
|
-
// Issue #22: 重置工具调用计数器
|
|
653
|
-
toolCallCount = 0;
|
|
654
|
-
lastProgressUpdate = 0;
|
|
655
|
-
break;
|
|
656
|
-
case 'assistant_tool_calls':
|
|
657
|
-
if (event.toolCalls.length > 1) {
|
|
658
|
-
writeLine(DIM((0, agent_status_1.runningToolsStatus)(event.toolCalls.length)));
|
|
659
|
-
}
|
|
660
|
-
sessionMessagesToRecord.push({
|
|
661
|
-
role: 'assistant',
|
|
662
|
-
content: event.content || '',
|
|
663
|
-
timestamp: Date.now(),
|
|
664
|
-
tool_calls: event.toolCalls,
|
|
665
|
-
});
|
|
666
|
-
break;
|
|
667
|
-
case 'tool_call':
|
|
668
|
-
// Issue #22: 批量工具调用进度显示
|
|
669
|
-
toolCallCount++;
|
|
670
|
-
if (toolCallCount >= 3 && Date.now() - lastProgressUpdate > 1000) {
|
|
671
|
-
(0, progress_1.showToolProgress)(toolCallCount, event.name);
|
|
672
|
-
lastProgressUpdate = Date.now();
|
|
673
|
-
}
|
|
674
|
-
break;
|
|
675
|
-
case 'tool_result':
|
|
676
|
-
// Issue #22: 隐藏进度指示
|
|
677
|
-
(0, progress_1.hideProgress)();
|
|
678
|
-
// 显示工具结果后,准备下一轮(不启动 spinner)
|
|
679
|
-
writeLine(event.summary || (0, box_1.toolLine)(event.name, event.args, event.success, event.duration));
|
|
680
|
-
// 显示错误详情
|
|
681
|
-
if (!event.success && event.error) {
|
|
682
|
-
writeLine(ERROR(` Error: ${event.error}`));
|
|
683
|
-
}
|
|
684
|
-
// Debug: 显示接收到的参数
|
|
685
|
-
if (!event.success && Object.keys(event.args).length === 0) {
|
|
686
|
-
writeLine(WARN(` ⚠ Tool received empty arguments - LLM may not be providing parameters correctly`));
|
|
687
|
-
writeLine(DIM(` Try using /model qwen or /model gpt4o for better tool calling support`));
|
|
688
|
-
}
|
|
689
|
-
// Record tool result for session
|
|
690
|
-
sessionMessagesToRecord.push({
|
|
691
|
-
role: 'tool',
|
|
692
|
-
content: event.result,
|
|
693
|
-
modelVisibleContent: event.modelVisibleResult,
|
|
694
|
-
timestamp: Date.now(),
|
|
695
|
-
toolCallId: event.callId,
|
|
696
|
-
});
|
|
697
|
-
break;
|
|
698
|
-
case 'message':
|
|
699
|
-
if (event.content) {
|
|
700
|
-
sessionMessagesToRecord.push({
|
|
701
|
-
role: 'assistant',
|
|
702
|
-
content: event.content,
|
|
703
|
-
timestamp: Date.now(),
|
|
704
|
-
});
|
|
705
|
-
}
|
|
706
|
-
break;
|
|
707
|
-
case 'strategy_exhausted':
|
|
708
|
-
writeLine(WARN(`⚠ ${event.suggestion}`));
|
|
709
|
-
break;
|
|
710
|
-
case 'complete':
|
|
711
|
-
finalContent = event.content;
|
|
712
|
-
finalModel = event.model;
|
|
713
|
-
finalUsage = event.usage;
|
|
714
|
-
if (event.stats) {
|
|
715
|
-
ctx.store.setLastLoopStats(event.stats);
|
|
716
|
-
}
|
|
717
|
-
break;
|
|
718
|
-
}
|
|
719
|
-
}
|
|
720
|
-
// 刷新流式渲染器,输出剩余内容
|
|
721
|
-
if (streamRenderer) {
|
|
722
|
-
const remaining = streamRenderer.flush();
|
|
723
|
-
if (remaining) {
|
|
724
|
-
writeOutput(remaining);
|
|
725
|
-
}
|
|
726
|
-
streamRenderer = null;
|
|
727
|
-
}
|
|
728
|
-
const wasAborted = ctx.abortSignal?.aborted === true;
|
|
729
|
-
if (finalContent && !wasAborted) {
|
|
730
|
-
ctx.store.addMessage({ role: 'assistant', content: finalContent });
|
|
731
|
-
}
|
|
732
|
-
if (sessionId && sessionMessagesToRecord.length > 0 && !wasAborted) {
|
|
733
|
-
(0, session_storage_1.appendSessionMessages)(sessionId, sessionMessagesToRecord);
|
|
734
|
-
}
|
|
735
|
-
if (finalUsage && !wasAborted) {
|
|
736
|
-
ctx.store.setTokenUsage(finalUsage);
|
|
737
|
-
}
|
|
738
|
-
if (!wasAborted) {
|
|
739
|
-
harness.ingestTurn({
|
|
740
|
-
userInput: input,
|
|
741
|
-
assistantContent: finalContent,
|
|
742
|
-
sessionMessages: sessionMessagesToRecord,
|
|
743
|
-
intent,
|
|
744
|
-
});
|
|
745
|
-
const harnessState = harness.toJSON();
|
|
746
|
-
ctx.store.setState({ harnessState });
|
|
747
|
-
if (sessionId) {
|
|
748
|
-
(0, session_storage_1.updateSessionSkills)(sessionId, appliedSkillNames);
|
|
749
|
-
(0, session_storage_1.updateSessionHarnessState)(sessionId, harnessState);
|
|
750
|
-
}
|
|
751
|
-
}
|
|
752
|
-
if (responseStarted) {
|
|
753
|
-
writeLine();
|
|
754
|
-
if (ui.extraAssistantSpacing) {
|
|
755
|
-
writeLine();
|
|
756
|
-
}
|
|
757
|
-
}
|
|
758
|
-
if (!ui.suppressLegacyTokenMeta) {
|
|
759
|
-
const stats = [
|
|
760
|
-
finalUsage ? `tokens: ${finalUsage.promptTokens}+${finalUsage.completionTokens}` : '',
|
|
761
|
-
finalModel ? finalModel : '',
|
|
762
|
-
]
|
|
763
|
-
.filter(Boolean)
|
|
764
|
-
.join(' ');
|
|
765
|
-
if (stats) {
|
|
766
|
-
writeLine(DIM(stats));
|
|
767
|
-
}
|
|
768
|
-
}
|
|
171
|
+
lines.push(` Mode ${BRAND(ctx.config.mode)}`);
|
|
172
|
+
lines.push(` Model ${BRAND(modelId)}`);
|
|
173
|
+
lines.push(` Context ${DIM(`${formatTokenCount(modelContext.contextWindow)} tokens (${modelContext.source})`)}`);
|
|
174
|
+
lines.push(` Compact ${compactStats.enabled ? SUCCESS('auto') : WARN('off')} ${DIM(`predict ${formatThreshold(compactStats.predictiveCompactThreshold)}, hard ${formatThreshold(compactStats.threshold)}`)}`);
|
|
175
|
+
lines.push(` Renderer ${formatRendererStatus(ctx)}`);
|
|
176
|
+
lines.push(` Runtime ${SUCCESS('Thread / StepSnapshot / ToolGateway')}`);
|
|
177
|
+
lines.push(` Completion ${SUCCESS('TaskContext')}`);
|
|
178
|
+
(0, prompt_context_1.refreshProjectInstructions)(ctx.store, ctx.cwd);
|
|
179
|
+
const instructionFiles = (0, project_instructions_1.loadProjectInstructionFiles)(ctx.cwd);
|
|
180
|
+
lines.push('', ' Context:');
|
|
181
|
+
lines.push(` Project rules ${instructionFiles.length > 0 ? SUCCESS(`${instructionFiles.length} files`) : DIM('none')}`);
|
|
182
|
+
lines.push(` Memory ${snapshot.memoryContent ? SUCCESS(`${snapshot.memoryContent.length} chars`) : DIM('none')}`);
|
|
183
|
+
lines.push(` Skill bodies ${snapshot.skillsContent ? ERROR('legacy resident') : SUCCESS('lazy / none resident')}`);
|
|
184
|
+
if (snapshot.lastLoopStats) {
|
|
185
|
+
lines.push('', ' Last loop:');
|
|
186
|
+
for (const line of formatLoopStatsLines(snapshot.lastLoopStats))
|
|
187
|
+
lines.push(` ${line}`);
|
|
769
188
|
}
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
(0, progress_1.hideProgress)();
|
|
775
|
-
if (!ui.suppressAbortNotice) {
|
|
776
|
-
writeLine(DIM('Interrupted.'));
|
|
777
|
-
}
|
|
778
|
-
}
|
|
779
|
-
else {
|
|
780
|
-
writeLine(ERROR(`✗ ${(0, errors_1.errorMessage)(error)}`));
|
|
781
|
-
const hist = ctx.store.getSnapshot().conversationHistory;
|
|
782
|
-
if (hist.length > 0) {
|
|
783
|
-
ctx.store.setState({ conversationHistory: hist.slice(0, -1) });
|
|
784
|
-
}
|
|
785
|
-
}
|
|
189
|
+
if (snapshot.harnessState?.contract) {
|
|
190
|
+
lines.push('', ' TaskContext:');
|
|
191
|
+
lines.push(` Objective ${ACCENT(snapshot.harnessState.contract.objective)}`);
|
|
192
|
+
lines.push(` Evidence ${DIM(`${snapshot.harnessState.evidenceIndex?.length ?? 0} records`)}`);
|
|
786
193
|
}
|
|
787
|
-
|
|
194
|
+
lines.push('');
|
|
195
|
+
return { success: true, output: lines.join('\n') };
|
|
788
196
|
}
|
|
789
197
|
async function handleExit(ctx) {
|
|
790
|
-
console.log();
|
|
791
|
-
console.log(DIM('Shutting down...'));
|
|
792
|
-
// Update session summary before exit
|
|
793
198
|
if (ctx.sessionId) {
|
|
794
199
|
const messages = (0, session_storage_1.readSessionMessages)(ctx.sessionId);
|
|
795
|
-
if (messages.length > 0)
|
|
200
|
+
if (messages.length > 0)
|
|
796
201
|
(0, session_storage_1.updateSessionSummary)(ctx.sessionId, messages);
|
|
797
|
-
}
|
|
798
202
|
(0, session_storage_1.endSession)(ctx.sessionId);
|
|
799
203
|
}
|
|
800
204
|
ctx.requestShutdown?.('user request');
|
|
801
|
-
|
|
802
|
-
console.log(SUCCESS('Goodbye.'));
|
|
803
|
-
return { success: true };
|
|
205
|
+
return { success: true, output: 'Goodbye.' };
|
|
804
206
|
}
|
|
805
207
|
//# sourceMappingURL=core-command-handlers.js.map
|