@orion-agents/orion-code 0.3.66 → 0.4.4
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 +87 -0
- package/README.md +78 -361
- package/README.zh-CN.md +71 -262
- package/bin/orion +4 -1
- package/dist/acp/session-updates.d.ts +35 -0
- package/dist/acp/session-updates.js +183 -0
- package/dist/acp/sessions.d.ts +32 -0
- package/dist/acp/sessions.js +328 -0
- package/dist/acp/stdio.d.ts +3 -0
- package/dist/acp/stdio.js +59 -0
- package/dist/cli.js +136 -185
- package/dist/commands/context-tool-command-handlers.d.ts +1 -1
- package/dist/commands/context-tool-command-handlers.js +24 -3
- package/dist/commands/core-command-handlers.js +10 -18
- package/dist/commands/diagnostic-command-handlers.js +58 -48
- package/dist/commands/diagnostic-commands.js +0 -12
- package/dist/commands/init-command.d.ts +3 -0
- package/dist/commands/init-command.js +131 -0
- package/dist/commands/model-command-handlers.d.ts +1 -2
- package/dist/commands/model-command-handlers.js +15 -100
- package/dist/commands/model-commands.js +0 -11
- package/dist/commands/registry.js +1 -19
- package/dist/commands/rsi-command.d.ts +2 -0
- package/dist/commands/rsi-command.js +180 -0
- package/dist/commands/session-command-handlers.js +28 -19
- package/dist/commands/system-commands.js +0 -1
- package/dist/commands/target-command.js +49 -6
- package/dist/commands/tool-commands.js +1 -1
- package/dist/commands/types.d.ts +4 -10
- package/dist/commands/types.js +1 -21
- package/dist/commands/workflow-command-handlers.js +13 -4
- package/dist/commands/workflow-commands.js +2 -2
- package/dist/framework/loop-budget-contract.d.ts +2 -8
- package/dist/framework/loop-budget-contract.js +0 -3
- package/dist/framework/loop-progress.d.ts +18 -0
- package/dist/framework/loop-progress.js +63 -0
- package/dist/framework/prompt.d.ts +0 -2
- package/dist/framework/prompt.js +9 -27
- package/dist/framework/query.d.ts +26 -31
- package/dist/framework/query.js +451 -292
- package/dist/framework/store.d.ts +6 -10
- package/dist/framework/store.js +2 -21
- package/dist/framework/tool-call-orchestrator.d.ts +7 -0
- package/dist/framework/tool-call-orchestrator.js +8 -3
- package/dist/framework/tool-state.d.ts +2 -0
- package/dist/framework/tool.d.ts +0 -23
- package/dist/framework/verification-command.d.ts +15 -0
- package/dist/framework/verification-command.js +32 -0
- package/dist/harness/assembler.d.ts +1 -0
- package/dist/harness/assembler.js +24 -0
- package/dist/harness/capsule.d.ts +1 -1
- package/dist/harness/capsule.js +33 -14
- package/dist/harness/context-harness.d.ts +37 -12
- package/dist/harness/context-harness.js +545 -35
- package/dist/harness/contract.js +1 -1
- package/dist/harness/drift-guard.d.ts +4 -0
- package/dist/harness/drift-guard.js +68 -16
- package/dist/harness/index.d.ts +1 -1
- package/dist/harness/intent.js +21 -0
- package/dist/harness/ledger.d.ts +7 -11
- package/dist/harness/ledger.js +50 -9
- package/dist/harness/progress-controller.d.ts +12 -7
- package/dist/harness/progress-controller.js +96 -29
- package/dist/harness/state.js +10 -1
- package/dist/harness/stop-controller.d.ts +0 -5
- package/dist/harness/stop-controller.js +11 -31
- package/dist/harness/task-checklist.d.ts +16 -0
- package/dist/harness/task-checklist.js +92 -0
- package/dist/harness/types.d.ts +78 -1
- package/dist/harness/verification.d.ts +19 -1
- package/dist/harness/verification.js +116 -29
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -3
- package/dist/print-ui/event-stream.d.ts +43 -0
- package/dist/print-ui/event-stream.js +204 -0
- package/dist/print-ui/launch.d.ts +12 -1
- package/dist/print-ui/launch.js +173 -11
- package/dist/product/environment.d.ts +1 -1
- package/dist/product/environment.js +1 -1
- package/dist/product/identity.d.ts +1 -1
- package/dist/product/identity.js +1 -1
- package/dist/product/paths.d.ts +3 -2
- package/dist/product/paths.js +6 -2
- package/dist/runtime/agent-loop.d.ts +12 -2
- package/dist/runtime/agent-loop.js +172 -29
- package/dist/runtime/agent-runtime-controller.d.ts +14 -4
- package/dist/runtime/agent-runtime-controller.js +366 -192
- package/dist/runtime/agent-runtime-protocol.d.ts +10 -18
- package/dist/runtime/agent-runtime-runner.d.ts +10 -0
- package/dist/runtime/builtin-tool-provider.js +5 -1
- package/dist/runtime/capability-receipt-journal.js +1 -0
- package/dist/runtime/durable-tool-receipt-reader.js +2 -1
- package/dist/runtime/first-party-tool-services.d.ts +1 -0
- package/dist/runtime/first-party-tool-services.js +2 -12
- package/dist/runtime/first-party-tool-universe.d.ts +1 -0
- package/dist/runtime/first-party-tool-universe.js +1 -1
- package/dist/runtime/followup-queue-store.d.ts +16 -0
- package/dist/runtime/followup-queue-store.js +75 -0
- package/dist/runtime/goal-lifecycle-v2.d.ts +16 -4
- package/dist/runtime/goal-lifecycle-v2.js +217 -39
- package/dist/runtime/goal-runtime-coordinator.d.ts +14 -2
- package/dist/runtime/goal-runtime-coordinator.js +147 -36
- package/dist/runtime/goals/presentation.js +3 -1
- package/dist/runtime/goals/types.d.ts +1 -3
- package/dist/runtime/goals/types.js +0 -3
- package/dist/runtime/loop-budget.d.ts +0 -7
- package/dist/runtime/loop-budget.js +8 -52
- package/dist/runtime/mcp/first-party-mcp-adapter.d.ts +2 -0
- package/dist/runtime/mcp/first-party-mcp-adapter.js +23 -19
- package/dist/runtime/model-coordinator.js +2 -5
- package/dist/runtime/orion-runtime-v1.d.ts +18 -2
- package/dist/runtime/orion-runtime-v1.js +183 -46
- package/dist/runtime/orion-session-runner.d.ts +7 -0
- package/dist/runtime/orion-session-runner.js +82 -0
- package/dist/runtime/plan-review.d.ts +1 -0
- package/dist/runtime/plan-review.js +8 -4
- package/dist/runtime/product-bootstrap.d.ts +6 -0
- package/dist/runtime/product-bootstrap.js +41 -51
- package/dist/runtime/product-orion-runtime.js +129 -58
- package/dist/runtime/release-receipts.d.ts +24 -133
- package/dist/runtime/release-receipts.js +129 -693
- package/dist/runtime/rich-text/layout.js +108 -65
- package/dist/runtime/rsi/contracts.d.ts +50 -0
- package/dist/runtime/rsi/contracts.js +17 -0
- package/dist/runtime/rsi/diagnosis.d.ts +46 -0
- package/dist/runtime/rsi/diagnosis.js +98 -0
- package/dist/runtime/rsi/evaluation-suite.d.ts +25 -0
- package/dist/runtime/rsi/evaluation-suite.js +141 -0
- package/dist/runtime/rsi/evaluation-worker.d.ts +19 -0
- package/dist/runtime/rsi/evaluation-worker.js +64 -0
- package/dist/runtime/rsi/evaluation.d.ts +49 -0
- package/dist/runtime/rsi/evaluation.js +345 -0
- package/dist/runtime/rsi/lifecycle.d.ts +54 -0
- package/dist/runtime/rsi/lifecycle.js +279 -0
- package/dist/runtime/rsi/proposal.d.ts +39 -0
- package/dist/runtime/rsi/proposal.js +312 -0
- package/dist/runtime/rsi/receipt.d.ts +28 -0
- package/dist/runtime/rsi/receipt.js +138 -0
- package/dist/runtime/rsi/skill-state.d.ts +7 -0
- package/dist/runtime/rsi/skill-state.js +50 -0
- package/dist/runtime/rsi/trajectory.d.ts +19 -0
- package/dist/runtime/rsi/trajectory.js +314 -0
- package/dist/runtime/rsi/triage.d.ts +274 -0
- package/dist/runtime/rsi/triage.js +58 -0
- package/dist/runtime/session-composer-control.d.ts +5 -24
- package/dist/runtime/session-composer-control.js +27 -189
- package/dist/runtime/step-snapshot.d.ts +4 -1
- package/dist/runtime/step-snapshot.js +11 -1
- package/dist/runtime/subagent-thread-runtime.js +27 -5
- package/dist/runtime/subagents/policy.js +0 -1
- package/dist/runtime/subagents/production.js +1 -5
- package/dist/runtime/subagents/runtime-integration.js +2 -4
- package/dist/runtime/subagents/types.d.ts +0 -5
- package/dist/runtime/subagents/types.js +0 -2
- package/dist/runtime/task-context-recovery.d.ts +55 -0
- package/dist/runtime/task-context-recovery.js +349 -0
- package/dist/runtime/task-context-service.d.ts +20 -10
- package/dist/runtime/task-context-service.js +69 -9
- package/dist/runtime/thread-admission.d.ts +3 -1
- package/dist/runtime/thread-admission.js +21 -7
- package/dist/runtime/thread-event-store.d.ts +2 -2
- package/dist/runtime/thread-event-store.js +7 -2
- package/dist/runtime/thread-projection.js +4 -2
- package/dist/runtime/thread-runtime.d.ts +10 -0
- package/dist/runtime/thread-runtime.js +85 -3
- package/dist/runtime/thread-session-index.d.ts +8 -0
- package/dist/runtime/thread-session-index.js +50 -1
- package/dist/runtime/thread-session-view.d.ts +2 -1
- package/dist/runtime/thread-session-view.js +4 -0
- package/dist/runtime/thread-tool-journal.d.ts +1 -0
- package/dist/runtime/thread-tool-journal.js +6 -2
- package/dist/runtime/thread-ui-adapter.d.ts +1 -0
- package/dist/runtime/thread-ui-adapter.js +89 -22
- package/dist/runtime/tool-gateway.d.ts +9 -0
- package/dist/runtime/tool-gateway.js +24 -0
- package/dist/runtime/tool-receipt-validator.js +4 -0
- package/dist/runtime/tool-transcript-entry.d.ts +16 -0
- package/dist/runtime/tool-transcript-entry.js +73 -0
- package/dist/runtime/turn-commit.d.ts +4 -1
- package/dist/runtime/turn-commit.js +19 -15
- package/dist/runtime/ui-events.d.ts +15 -1
- package/dist/runtime/ui-view-model.d.ts +6 -5
- package/dist/runtime/ui-view-model.js +78 -61
- package/dist/runtime/workspace-runtime-kernel.js +0 -1
- package/dist/runtime/workspace-verification.d.ts +7 -0
- package/dist/runtime/workspace-verification.js +83 -0
- package/dist/services/atomic-write.d.ts +2 -0
- package/dist/services/atomic-write.js +12 -1
- package/dist/services/code-review/format.d.ts +4 -1
- package/dist/services/code-review/format.js +5 -1
- package/dist/services/code-review/runner.d.ts +2 -2
- package/dist/services/code-review/runner.js +86 -64
- package/dist/services/code-review/snapshot.d.ts +9 -9
- package/dist/services/code-review/snapshot.js +182 -166
- package/dist/services/compact/auto-compact.d.ts +21 -6
- package/dist/services/compact/auto-compact.js +148 -22
- package/dist/services/compact/background-candidate.d.ts +33 -0
- package/dist/services/compact/background-candidate.js +184 -0
- package/dist/services/compact/compact.d.ts +4 -1
- package/dist/services/compact/compact.js +30 -3
- package/dist/services/compact/coordinator.d.ts +10 -4
- package/dist/services/compact/coordinator.js +17 -7
- package/dist/services/compact/summary-generator.d.ts +4 -2
- package/dist/services/compact/summary-generator.js +17 -3
- package/dist/services/config.d.ts +5 -5
- package/dist/services/config.js +29 -48
- package/dist/services/doctor.js +85 -13
- package/dist/services/effort.d.ts +5 -5
- package/dist/services/effort.js +5 -11
- package/dist/services/file-lock.d.ts +9 -3
- package/dist/services/file-lock.js +92 -26
- package/dist/services/global-config.d.ts +26 -64
- package/dist/services/global-config.js +233 -193
- package/dist/services/llm.d.ts +42 -4
- package/dist/services/llm.js +177 -45
- package/dist/services/model-client-pool.d.ts +15 -9
- package/dist/services/model-client-pool.js +62 -33
- package/dist/services/model-context.d.ts +2 -1
- package/dist/services/model-context.js +15 -9
- package/dist/services/model-registry.d.ts +4 -15
- package/dist/services/model-registry.js +32 -101
- package/dist/services/provider-diagnostics.d.ts +8 -0
- package/dist/services/provider-diagnostics.js +17 -12
- package/dist/services/provider-resilience/coordinator.d.ts +1 -1
- package/dist/services/provider-resilience/coordinator.js +10 -6
- package/dist/services/provider-resilience/request-gate.d.ts +3 -0
- package/dist/services/provider-resilience/request-gate.js +29 -18
- package/dist/services/provider-resilience/types.d.ts +2 -0
- package/dist/services/session-storage.d.ts +7 -10
- package/dist/services/session-storage.js +57 -30
- package/dist/services/settings-coordinator.d.ts +0 -6
- package/dist/services/settings-coordinator.js +19 -56
- package/dist/services/settings-document-repository.d.ts +3 -10
- package/dist/services/settings-document-repository.js +7 -85
- package/dist/services/usage-state.d.ts +3 -3
- package/dist/services/usage-state.js +11 -42
- package/dist/terminal-ui/answer-format.d.ts +14 -0
- package/dist/terminal-ui/answer-format.js +119 -0
- package/dist/terminal-ui/launch.d.ts +7 -6
- package/dist/terminal-ui/launch.js +160 -70
- package/dist/terminal-ui/output-queue.d.ts +2 -1
- package/dist/terminal-ui/output-queue.js +1 -1
- package/dist/terminal-ui/raw-editor.d.ts +2 -1
- package/dist/terminal-ui/raw-editor.js +56 -15
- package/dist/tools/core/edit-file.js +6 -2
- package/dist/tools/core/write-file.js +9 -2
- package/dist/tools/lsp.d.ts +16 -1
- package/dist/tools/lsp.js +60 -19
- package/dist/tools/sandbox.d.ts +1 -1
- package/dist/tools/sandbox.js +3 -16
- package/dist/tools/todo.d.ts +4 -2
- package/dist/tools/todo.js +91 -30
- package/dist/tui-core/input-parser.d.ts +1 -0
- package/dist/tui-core/input-parser.js +6 -0
- package/dist/tui-core/style.d.ts +1 -8
- package/dist/tui-core/style.js +3 -110
- package/dist/tui-ui/chrome-view-model.d.ts +1 -1
- package/dist/tui-ui/chrome-view-model.js +36 -32
- package/dist/tui-ui/launch.js +14 -14
- package/dist/tui-ui/layout.d.ts +5 -7
- package/dist/tui-ui/layout.js +129 -124
- package/dist/tui-ui/runner.d.ts +11 -12
- package/dist/tui-ui/runner.js +88 -67
- package/dist/tui-ui/state.d.ts +0 -11
- package/dist/tui-ui/state.js +22 -33
- package/dist/tui-ui/terminal-image.js +22 -4
- package/dist/tui-ui/transcript-inspector-layout.js +6 -3
- package/dist/tui-ui/transcript-inspector.d.ts +1 -0
- package/dist/tui-ui/transcript-inspector.js +7 -1
- package/dist/tui-ui/transcript-layout.js +42 -6
- package/dist/utils/terminal-text.d.ts +11 -0
- package/dist/utils/terminal-text.js +114 -0
- package/docs/cli-guide.md +575 -0
- package/docs/orion.example.yaml +43 -0
- package/docs/readme.md +12 -57
- package/npm-shrinkwrap.json +484 -1855
- package/package.json +13 -63
- package/dist/migration/command.d.ts +0 -9
- package/dist/migration/command.js +0 -100
- package/dist/migration/index.d.ts +0 -7
- package/dist/migration/index.js +0 -14
- package/dist/migration/migrate.d.ts +0 -19
- package/dist/migration/migrate.js +0 -406
- package/dist/migration/types.d.ts +0 -55
- package/dist/migration/types.js +0 -6
- package/dist/services/tool-allowlist.d.ts +0 -110
- package/dist/services/tool-allowlist.js +0 -299
- package/dist/services/yaml-config.d.ts +0 -57
- package/dist/services/yaml-config.js +0 -178
- package/dist/web/cli-options.d.ts +0 -17
- package/dist/web/cli-options.js +0 -51
- package/dist/web/code-review-run-service.d.ts +0 -68
- package/dist/web/code-review-run-service.js +0 -228
- package/dist/web/context-text.d.ts +0 -17
- package/dist/web/context-text.js +0 -40
- package/dist/web/errors.d.ts +0 -6
- package/dist/web/errors.js +0 -13
- package/dist/web/event-hub.d.ts +0 -45
- package/dist/web/event-hub.js +0 -370
- package/dist/web/file-read-service.d.ts +0 -101
- package/dist/web/file-read-service.js +0 -593
- package/dist/web/file-write-service.d.ts +0 -16
- package/dist/web/file-write-service.js +0 -103
- package/dist/web/git-compare-service.d.ts +0 -45
- package/dist/web/git-compare-service.js +0 -160
- package/dist/web/git-diff-document.d.ts +0 -102
- package/dist/web/git-diff-document.js +0 -258
- package/dist/web/git-file-source.d.ts +0 -25
- package/dist/web/git-file-source.js +0 -21
- package/dist/web/git-history-service.d.ts +0 -151
- package/dist/web/git-history-service.js +0 -619
- package/dist/web/git-index-transaction.d.ts +0 -45
- package/dist/web/git-index-transaction.js +0 -174
- package/dist/web/git-patch-builder.d.ts +0 -30
- package/dist/web/git-patch-builder.js +0 -138
- package/dist/web/git-read-model-service.d.ts +0 -452
- package/dist/web/git-read-model-service.js +0 -1833
- package/dist/web/git-version-service.d.ts +0 -79
- package/dist/web/git-version-service.js +0 -279
- package/dist/web/host-daemon.d.ts +0 -70
- package/dist/web/host-daemon.js +0 -237
- package/dist/web/index.d.ts +0 -6
- package/dist/web/index.js +0 -28
- package/dist/web/launch.d.ts +0 -12
- package/dist/web/launch.js +0 -89
- package/dist/web/native-directory-picker.d.ts +0 -63
- package/dist/web/native-directory-picker.js +0 -169
- package/dist/web/protocol.d.ts +0 -705
- package/dist/web/protocol.js +0 -639
- package/dist/web/review-service.d.ts +0 -22
- package/dist/web/review-service.js +0 -68
- package/dist/web/server.d.ts +0 -20
- package/dist/web/server.js +0 -1453
- package/dist/web/session-runtime-registry.d.ts +0 -138
- package/dist/web/session-runtime-registry.js +0 -471
- package/dist/web/terminal-manager.d.ts +0 -156
- package/dist/web/terminal-manager.js +0 -779
- package/dist/web/terminal-server.d.ts +0 -8
- package/dist/web/terminal-server.js +0 -304
- package/dist/web/workbench-controller.d.ts +0 -395
- package/dist/web/workbench-controller.js +0 -3077
- package/dist/web/workspace-discovery.d.ts +0 -92
- package/dist/web/workspace-discovery.js +0 -324
- package/dist/web/workspace-mutation-arbiter.d.ts +0 -54
- package/dist/web/workspace-mutation-arbiter.js +0 -267
- package/dist/web/workspace-open-telemetry.d.ts +0 -55
- package/dist/web/workspace-open-telemetry.js +0 -73
- package/dist/web-client/assets/FilesPanel-CPDovK_K.js +0 -1
- package/dist/web-client/assets/GitPanel-DtU_TD61.js +0 -4
- package/dist/web-client/assets/ReviewPanel-vMO7BEA3.js +0 -6
- package/dist/web-client/assets/TerminalPanel-C9vDTAlS.js +0 -23
- package/dist/web-client/assets/TerminalPanel-DLuoa74B.css +0 -1
- package/dist/web-client/assets/index-CABdwh4l.css +0 -1
- package/dist/web-client/assets/index-KvshfEbl.js +0 -20
- package/dist/web-client/assets/useAutoNotice-IE1g2wcb.js +0 -1
- package/dist/web-client/favicon.svg +0 -9
- package/dist/web-client/index.html +0 -17
- package/docs/architecture/agent-mode-permission-contract.md +0 -87
- package/docs/architecture/v0.3.0-web-api.yaml +0 -1340
- package/docs/architecture/v0.3.1-web-api.yaml +0 -2338
- package/docs/architecture/v0.3.2-web-api.yaml +0 -3029
- package/docs/architecture/v0.3.3-web-api.yaml +0 -3205
- package/docs/architecture/v0.3.4-stabilization-contract.md +0 -32
- package/docs/migration/v0.1.9-to-v0.2.0.md +0 -98
- package/docs/migration/v0.2.2-to-v0.3.0-settings.md +0 -114
- package/docs/migration/v0.2.2-to-v0.3.0.md +0 -55
- package/docs/migration/v0.3.0-to-v0.3.1.md +0 -88
- package/docs/migration/v0.3.1-to-v0.3.2.md +0 -94
- package/docs/migration/v0.3.2-to-v0.3.3.md +0 -62
- package/docs/migration/v0.3.3-to-v0.3.4.md +0 -36
- package/docs/orion.example.json +0 -86
- package/docs/plan/v0.2.0-dsh-harness-redesign-plan.md +0 -1234
- package/docs/plan/v0.2.0-release-checklist.md +0 -91
- package/docs/plan/v0.3.0-node-runtime-compatibility-plan.md +0 -57
- package/docs/plan/v0.3.0-settings-integration-plan.md +0 -740
- package/docs/plan/v0.3.0-web-workbench-plan.md +0 -376
- package/docs/plan/v0.3.1-web-workbench-professional-shell-plan.md +0 -848
- package/docs/plan/v0.3.2-web-workbench-layout-and-composer-plan.md +0 -869
- package/docs/plan/v0.3.3-plan.md +0 -1113
- package/docs/plan/v0.3.4-stabilization-plan.md +0 -89
- package/docs/test/v0.3.1-web-workbench-e2e-plan.md +0 -140
- package/docs/test/v0.3.2-web-workbench-e2e-plan.md +0 -100
- package/docs/test/v0.3.3-web-workbench-e2e-plan.md +0 -79
- package/docs/test/v0.3.4-stabilization-e2e-plan.md +0 -54
|
@@ -24,6 +24,8 @@ export interface SummaryOptions {
|
|
|
24
24
|
* secondary to protocol, safety, criteria, evidence, and pending-work rules.
|
|
25
25
|
*/
|
|
26
26
|
instructions?: string;
|
|
27
|
+
/** Optional foreground/speculative provider budget. Larger inputs use typed local projection. */
|
|
28
|
+
singleProviderRequest?: boolean;
|
|
27
29
|
}
|
|
28
30
|
export declare function normalizeCompactFocus(value: string | undefined): string | undefined;
|
|
29
31
|
export declare function normalizeCompactInstructions(value: string | undefined): string | undefined;
|
|
@@ -41,7 +43,7 @@ export interface GeneratedSummary {
|
|
|
41
43
|
semanticSummary: CompactSummary;
|
|
42
44
|
diagnostics: SummaryDiagnostic[];
|
|
43
45
|
}
|
|
44
|
-
export type SummaryDiagnosticCode = 'llm_request_failed' | 'llm_empty_response' | 'llm_chunked_input' | 'heuristic_fallback' | 'deterministic_projection';
|
|
46
|
+
export type SummaryDiagnosticCode = 'llm_request_failed' | 'llm_empty_response' | 'llm_chunked_input' | 'llm_summary_budget' | 'background_summary_reused' | 'heuristic_fallback' | 'deterministic_projection';
|
|
45
47
|
export interface SummaryDiagnostic {
|
|
46
48
|
code: SummaryDiagnosticCode;
|
|
47
49
|
message: string;
|
|
@@ -49,7 +51,7 @@ export interface SummaryDiagnostic {
|
|
|
49
51
|
chunkIndex?: number;
|
|
50
52
|
chunkCount?: number;
|
|
51
53
|
}
|
|
52
|
-
export declare function generateSummaryWithSource(messages: Message[], llm: LLMService, options?: SummaryOptions): Promise<GeneratedSummary>;
|
|
54
|
+
export declare function generateSummaryWithSource(messages: Message[], llm: Pick<LLMService, 'chat'>, options?: SummaryOptions, abortSignal?: AbortSignal): Promise<GeneratedSummary>;
|
|
53
55
|
/**
|
|
54
56
|
* Generate a summary using the LLM for high-quality context compaction.
|
|
55
57
|
* Falls back to heuristic summary if LLM call fails or times out.
|
|
@@ -258,7 +258,8 @@ function mergeChunkOutputs(outputs, maxLength) {
|
|
|
258
258
|
const perChunk = Math.max(1, Math.floor((maxLength - separatorBudget) / outputs.length));
|
|
259
259
|
return truncateSummary(outputs.map(output => truncateSummary(output.trim(), perChunk)).join('\n'), maxLength);
|
|
260
260
|
}
|
|
261
|
-
async function generateSummaryWithSource(messages, llm, options) {
|
|
261
|
+
async function generateSummaryWithSource(messages, llm, options, abortSignal) {
|
|
262
|
+
abortSignal?.throwIfAborted();
|
|
262
263
|
const opts = { ...DEFAULT_OPTIONS, ...options };
|
|
263
264
|
if (messages.length === 0) {
|
|
264
265
|
return {
|
|
@@ -296,7 +297,16 @@ async function generateSummaryWithSource(messages, llm, options) {
|
|
|
296
297
|
});
|
|
297
298
|
}
|
|
298
299
|
const outputs = [];
|
|
299
|
-
|
|
300
|
+
const providerChunks = opts.singleProviderRequest && chunks.length > 1 ? [] : chunks;
|
|
301
|
+
if (providerChunks.length !== chunks.length) {
|
|
302
|
+
diagnostics.push({
|
|
303
|
+
code: 'llm_summary_budget',
|
|
304
|
+
message: 'Used local projection because the summary would require multiple provider calls.',
|
|
305
|
+
fallbackUsed: true,
|
|
306
|
+
chunkCount: chunks.length,
|
|
307
|
+
});
|
|
308
|
+
}
|
|
309
|
+
for (const [chunkIndex, chunk] of providerChunks.entries()) {
|
|
300
310
|
const priorSummarySection = chunkIndex === 0 && prepared.priorSummary
|
|
301
311
|
? `Prior durable summary (merge it with only the new conversation below):\n${prepared.priorSummary}\n\n`
|
|
302
312
|
: '';
|
|
@@ -319,7 +329,10 @@ ${chunk}
|
|
|
319
329
|
|
|
320
330
|
Summary:`;
|
|
321
331
|
try {
|
|
322
|
-
|
|
332
|
+
abortSignal?.throwIfAborted();
|
|
333
|
+
const response = await llm.chat([{ role: 'user', content: prompt }], undefined, {
|
|
334
|
+
abortSignal,
|
|
335
|
+
});
|
|
323
336
|
if (!response.content?.trim()) {
|
|
324
337
|
diagnostics.push({
|
|
325
338
|
code: 'llm_empty_response',
|
|
@@ -333,6 +346,7 @@ Summary:`;
|
|
|
333
346
|
outputs.push(response.content.trim());
|
|
334
347
|
}
|
|
335
348
|
catch (error) {
|
|
349
|
+
abortSignal?.throwIfAborted();
|
|
336
350
|
diagnostics.push({
|
|
337
351
|
code: 'llm_request_failed',
|
|
338
352
|
message: (0, redaction_1.redactTraceText)(error instanceof Error ? error.message : String(error)),
|
|
@@ -3,24 +3,24 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Config loading priority:
|
|
5
5
|
* 1. CLI arguments
|
|
6
|
-
* 2. ~/.orion-code/orion.
|
|
6
|
+
* 2. ~/.orion-code/orion.yaml (GlobalConfig)
|
|
7
7
|
* 3. Agent internal defaults
|
|
8
8
|
*
|
|
9
|
-
* orion.
|
|
9
|
+
* orion.yaml is the single configuration source. Provider credentials
|
|
10
10
|
* (ANTHROPIC_API_KEY, OPENAI_API_KEY, DASHSCOPE_API_KEY, etc.) are still read
|
|
11
11
|
* from the process environment by the model/web-search clients at runtime;
|
|
12
12
|
* those are functional reads, not configuration overrides.
|
|
13
13
|
*
|
|
14
|
-
* UI renderer is intentionally not read from orion.
|
|
14
|
+
* UI renderer is intentionally not read from orion.yaml or env. TUI is the
|
|
15
15
|
* public product default; --ui terminal selects the technical diagnostics
|
|
16
16
|
* fallback. The retired Ink renderer is intentionally not a compatibility path.
|
|
17
17
|
*/
|
|
18
|
-
import { type ToolConfirmationPolicy, type UIConfig, type UIRenderer, type
|
|
18
|
+
import { type ToolConfirmationPolicy, type UIConfig, type UIRenderer, type WebSearchMcpConfig, type SkillsConfig, type AgentLoopConfig, type AgentLoopBudgetConfig, type SubagentUserConfig, type SubagentMode, type SubagentRole, type CostConfig } from './global-config';
|
|
19
19
|
import { type ModelRegistry } from './model-registry';
|
|
20
20
|
import { ModelClientPool } from './model-client-pool';
|
|
21
21
|
import type { EffortPreference } from './effort';
|
|
22
22
|
import { type SubagentConfig } from '../runtime/subagents/types';
|
|
23
|
-
export type { ToolConfirmationPolicy, UIConfig, UIRenderer,
|
|
23
|
+
export type { ToolConfirmationPolicy, UIConfig, UIRenderer, WebSearchMcpConfig, SkillsConfig, AgentLoopConfig, AgentLoopBudgetConfig, SubagentUserConfig, SubagentMode, SubagentRole, CostConfig, };
|
|
24
24
|
export declare const PRODUCT_UI_RENDERER: UIRenderer;
|
|
25
25
|
export declare const TECHNICAL_UI_RENDERERS: readonly ["terminal"];
|
|
26
26
|
export declare const DEFAULT_UI_RENDERER: UIRenderer;
|
package/dist/services/config.js
CHANGED
|
@@ -4,15 +4,15 @@
|
|
|
4
4
|
*
|
|
5
5
|
* Config loading priority:
|
|
6
6
|
* 1. CLI arguments
|
|
7
|
-
* 2. ~/.orion-code/orion.
|
|
7
|
+
* 2. ~/.orion-code/orion.yaml (GlobalConfig)
|
|
8
8
|
* 3. Agent internal defaults
|
|
9
9
|
*
|
|
10
|
-
* orion.
|
|
10
|
+
* orion.yaml is the single configuration source. Provider credentials
|
|
11
11
|
* (ANTHROPIC_API_KEY, OPENAI_API_KEY, DASHSCOPE_API_KEY, etc.) are still read
|
|
12
12
|
* from the process environment by the model/web-search clients at runtime;
|
|
13
13
|
* those are functional reads, not configuration overrides.
|
|
14
14
|
*
|
|
15
|
-
* UI renderer is intentionally not read from orion.
|
|
15
|
+
* UI renderer is intentionally not read from orion.yaml or env. TUI is the
|
|
16
16
|
* public product default; --ui terminal selects the technical diagnostics
|
|
17
17
|
* fallback. The retired Ink renderer is intentionally not a compatibility path.
|
|
18
18
|
*/
|
|
@@ -43,7 +43,6 @@ exports.SUPPORTED_UI_RENDERERS = [
|
|
|
43
43
|
// ============================================================================
|
|
44
44
|
// Agent internal defaults
|
|
45
45
|
// ============================================================================
|
|
46
|
-
let _legacyConfigWarned = false;
|
|
47
46
|
const INTERNAL_DEFAULTS = {
|
|
48
47
|
name: 'orion-code',
|
|
49
48
|
mode: 'development',
|
|
@@ -51,20 +50,10 @@ const INTERNAL_DEFAULTS = {
|
|
|
51
50
|
toolConfirmation: 'allow',
|
|
52
51
|
ui: {
|
|
53
52
|
renderer: exports.DEFAULT_UI_RENDERER,
|
|
54
|
-
confirmations: 'config',
|
|
55
53
|
theme: 'orion-pixel',
|
|
56
54
|
motion: 'reduced',
|
|
57
55
|
mascot: true,
|
|
58
|
-
statusLine: [
|
|
59
|
-
'mode',
|
|
60
|
-
'goal',
|
|
61
|
-
'model',
|
|
62
|
-
'effort',
|
|
63
|
-
'context',
|
|
64
|
-
'permission',
|
|
65
|
-
'queue',
|
|
66
|
-
'activity',
|
|
67
|
-
],
|
|
56
|
+
statusLine: ['mode', 'goal', 'model', 'effort', 'context', 'queue', 'activity'],
|
|
68
57
|
keymap: {},
|
|
69
58
|
},
|
|
70
59
|
};
|
|
@@ -88,9 +77,6 @@ function isProductUIRenderer(value) {
|
|
|
88
77
|
function isTechnicalUIRenderer(value) {
|
|
89
78
|
return typeof value === 'string' && exports.TECHNICAL_UI_RENDERERS.includes(value);
|
|
90
79
|
}
|
|
91
|
-
function normalizeUIConfirmationMode(value) {
|
|
92
|
-
return value === 'config' || value === 'interactive' ? value : undefined;
|
|
93
|
-
}
|
|
94
80
|
function toNonEmptyString(value) {
|
|
95
81
|
if (typeof value !== 'string')
|
|
96
82
|
return undefined;
|
|
@@ -117,7 +103,7 @@ function loadWebSearchConfig(globalConfig, overrides) {
|
|
|
117
103
|
...globalConfig.webSearch,
|
|
118
104
|
...overrides.webSearch,
|
|
119
105
|
};
|
|
120
|
-
// orion.
|
|
106
|
+
// orion.yaml is the sole structured configuration source. The provider API
|
|
121
107
|
// key remains a functional read from the environment (DASHSCOPE_API_KEY) so
|
|
122
108
|
// the built-in DashScope web search keeps working without an explicit key.
|
|
123
109
|
const apiKey = merged.apiKey ?? process.env.DASHSCOPE_API_KEY;
|
|
@@ -128,9 +114,6 @@ function loadWebSearchConfig(globalConfig, overrides) {
|
|
|
128
114
|
function loadUIConfig(globalConfig, overrides) {
|
|
129
115
|
return {
|
|
130
116
|
renderer: resolveUIRenderer(overrides.ui?.renderer) ?? INTERNAL_DEFAULTS.ui.renderer,
|
|
131
|
-
confirmations: normalizeUIConfirmationMode(overrides.ui?.confirmations) ??
|
|
132
|
-
normalizeUIConfirmationMode(globalConfig.ui?.confirmations) ??
|
|
133
|
-
INTERNAL_DEFAULTS.ui.confirmations,
|
|
134
117
|
theme: overrides.ui?.theme ?? globalConfig.ui?.theme ?? INTERNAL_DEFAULTS.ui.theme,
|
|
135
118
|
motion: overrides.ui?.motion ?? globalConfig.ui?.motion ?? INTERNAL_DEFAULTS.ui.motion,
|
|
136
119
|
mascot: overrides.ui?.mascot ?? globalConfig.ui?.mascot ?? INTERNAL_DEFAULTS.ui.mascot,
|
|
@@ -146,11 +129,19 @@ function loadUIConfig(globalConfig, overrides) {
|
|
|
146
129
|
};
|
|
147
130
|
}
|
|
148
131
|
function loadAgentLoopConfig(globalConfig, overrides) {
|
|
149
|
-
const
|
|
150
|
-
|
|
151
|
-
|
|
132
|
+
const maxModelVisibleToolBytes = overrides.agentLoop?.budget?.maxModelVisibleToolBytes ??
|
|
133
|
+
globalConfig.agentLoop?.budget?.maxModelVisibleToolBytes;
|
|
134
|
+
const continuation = overrides.agentLoop?.continuation ?? globalConfig.agentLoop?.continuation;
|
|
135
|
+
const goalBudget = {
|
|
136
|
+
...globalConfig.agentLoop?.goalBudget,
|
|
137
|
+
...overrides.agentLoop?.goalBudget,
|
|
138
|
+
};
|
|
139
|
+
const result = {
|
|
140
|
+
...(maxModelVisibleToolBytes === undefined ? {} : { budget: { maxModelVisibleToolBytes } }),
|
|
141
|
+
...(continuation ? { continuation } : {}),
|
|
142
|
+
...(Object.keys(goalBudget).length > 0 ? { goalBudget } : {}),
|
|
152
143
|
};
|
|
153
|
-
return Object.keys(
|
|
144
|
+
return Object.keys(result).length > 0 ? result : undefined;
|
|
154
145
|
}
|
|
155
146
|
function normalizePricing(value) {
|
|
156
147
|
if (!value || typeof value !== 'object')
|
|
@@ -200,7 +191,6 @@ function loadSubagentConfig(globalConfig, overrides) {
|
|
|
200
191
|
mode: merged.mode ?? types_1.DEFAULT_SUBAGENT_CONFIG.mode,
|
|
201
192
|
maxParallel: merged.maxParallel ?? types_1.DEFAULT_SUBAGENT_CONFIG.maxParallel,
|
|
202
193
|
maxTasksPerTurn: merged.maxTasksPerTurn ?? types_1.DEFAULT_SUBAGENT_CONFIG.maxTasksPerTurn,
|
|
203
|
-
maxTurnsPerTask: merged.maxTurnsPerTask ?? types_1.DEFAULT_SUBAGENT_CONFIG.maxTurnsPerTask,
|
|
204
194
|
maxModelRequestsPerTask: merged.maxModelRequestsPerTask ?? types_1.DEFAULT_SUBAGENT_CONFIG.maxModelRequestsPerTask,
|
|
205
195
|
maxModelRequestsPerTurn: merged.maxModelRequestsPerTurn ?? types_1.DEFAULT_SUBAGENT_CONFIG.maxModelRequestsPerTurn,
|
|
206
196
|
maxToolCallsPerTask: merged.maxToolCallsPerTask ?? types_1.DEFAULT_SUBAGENT_CONFIG.maxToolCallsPerTask,
|
|
@@ -240,12 +230,6 @@ function loadConfig(overrides = {}) {
|
|
|
240
230
|
}
|
|
241
231
|
}
|
|
242
232
|
if (!modelRegistry) {
|
|
243
|
-
if ((0, model_registry_1.isLegacyConfig)(rawConfig)) {
|
|
244
|
-
if (!_legacyConfigWarned) {
|
|
245
|
-
_legacyConfigWarned = true;
|
|
246
|
-
console.warn(`[orion-code] ${(0, model_registry_1.getLegacyMigrationHint)().split('\n')[0]}`);
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
233
|
resolvedModel =
|
|
250
234
|
toNonEmptyString(overrides.model) ?? toNonEmptyString(globalConfig.defaultModel) ?? 'gpt-4o';
|
|
251
235
|
resolvedFallback =
|
|
@@ -254,14 +238,13 @@ function loadConfig(overrides = {}) {
|
|
|
254
238
|
undefined;
|
|
255
239
|
}
|
|
256
240
|
const config = {
|
|
257
|
-
apiKey: toNonEmptyString(overrides.apiKey) ??
|
|
258
|
-
apiBaseUrl: toNonEmptyString(overrides.apiBaseUrl)
|
|
241
|
+
apiKey: toNonEmptyString(overrides.apiKey) ?? '',
|
|
242
|
+
apiBaseUrl: toNonEmptyString(overrides.apiBaseUrl),
|
|
259
243
|
model: resolvedModel,
|
|
260
244
|
fallbackModel: resolvedFallback,
|
|
261
245
|
modelRegistry,
|
|
262
246
|
modelClientPool,
|
|
263
247
|
toolConfirmation: normalizeToolConfirmationPolicy(overrides.toolConfirmation) ??
|
|
264
|
-
normalizeToolConfirmationPolicy(globalConfig.toolConfirmation) ??
|
|
265
248
|
INTERNAL_DEFAULTS.toolConfirmation,
|
|
266
249
|
defaultEffort: globalConfig.defaultEffort,
|
|
267
250
|
webSearch: loadWebSearchConfig(globalConfig, overrides),
|
|
@@ -277,20 +260,18 @@ function loadConfig(overrides = {}) {
|
|
|
277
260
|
return config;
|
|
278
261
|
}
|
|
279
262
|
function isConfigured(config) {
|
|
280
|
-
|
|
281
|
-
const provider = config.modelRegistry.providers.get(config.modelRegistry.defaultProfile.provider);
|
|
282
|
-
if (provider) {
|
|
283
|
-
return provider.apiKey.length > 0;
|
|
284
|
-
}
|
|
285
|
-
}
|
|
286
|
-
return Boolean(config.apiKey);
|
|
263
|
+
return getConfigErrors(config).length === 0;
|
|
287
264
|
}
|
|
288
265
|
function getConfigErrors(config) {
|
|
289
|
-
const
|
|
290
|
-
|
|
291
|
-
|
|
266
|
+
const registry = config.modelRegistry;
|
|
267
|
+
const provider = registry?.defaultProfile
|
|
268
|
+
? registry.providers.get(registry.defaultProfile.provider)
|
|
269
|
+
: undefined;
|
|
270
|
+
if (registry && !provider) {
|
|
271
|
+
return ['No default model provider is configured in ~/.orion-code/orion.yaml.'];
|
|
292
272
|
}
|
|
293
|
-
|
|
273
|
+
const { error } = (0, model_client_pool_1.resolveProviderCredential)(provider?.apiKey ?? config.apiKey);
|
|
274
|
+
return error ? [error] : [];
|
|
294
275
|
}
|
|
295
276
|
function getConfigSummary(config) {
|
|
296
277
|
return {
|
|
@@ -302,7 +283,7 @@ function getConfigSummary(config) {
|
|
|
302
283
|
mode: config.mode,
|
|
303
284
|
logLevel: config.logLevel,
|
|
304
285
|
toolConfirmation: config.toolConfirmation,
|
|
305
|
-
ui:
|
|
286
|
+
ui: config.ui?.renderer ?? INTERNAL_DEFAULTS.ui.renderer,
|
|
306
287
|
webSearch: config.webSearch?.endpoint || config.webSearch?.apiKey || config.webSearch?.toolName
|
|
307
288
|
? 'configured'
|
|
308
289
|
: '(default)',
|
package/dist/services/doctor.js
CHANGED
|
@@ -7,6 +7,7 @@ const fs_1 = require("fs");
|
|
|
7
7
|
const path_1 = require("path");
|
|
8
8
|
const config_dir_1 = require("./config-dir");
|
|
9
9
|
const config_1 = require("./config");
|
|
10
|
+
const model_client_pool_1 = require("./model-client-pool");
|
|
10
11
|
const mcp_1 = require("../runtime/mcp");
|
|
11
12
|
const project_instructions_1 = require("./project-instructions");
|
|
12
13
|
const prompt_context_1 = require("./prompt-context");
|
|
@@ -91,6 +92,19 @@ function summarizeAutoCompact(ctx) {
|
|
|
91
92
|
`preCompactArmed=${stats.preCompactArmed}`,
|
|
92
93
|
`compactCount=${stats.compactCount}`,
|
|
93
94
|
`lastCompactMode=${stats.lastCompactMode ?? 'none'}`,
|
|
95
|
+
...(stats.backgroundCompact
|
|
96
|
+
? [
|
|
97
|
+
`backgroundCompact=${stats.backgroundCompact.state}${stats.backgroundCompact.reason ? ` (${stats.backgroundCompact.reason})` : ''}`,
|
|
98
|
+
`backgroundElapsedMs=${stats.backgroundCompact.elapsedMs}`,
|
|
99
|
+
`backgroundSummaryAttempts=${stats.backgroundCompact.summaryAttempts ?? 0}`,
|
|
100
|
+
...(stats.backgroundCompact.promptTokens === undefined
|
|
101
|
+
? []
|
|
102
|
+
: [
|
|
103
|
+
`backgroundPromptTokens=${stats.backgroundCompact.promptTokens}`,
|
|
104
|
+
`backgroundCompletionTokens=${stats.backgroundCompact.completionTokens}`,
|
|
105
|
+
]),
|
|
106
|
+
]
|
|
107
|
+
: []),
|
|
94
108
|
].join('\n'),
|
|
95
109
|
};
|
|
96
110
|
}
|
|
@@ -423,18 +437,78 @@ function summarizeWarningDedup() {
|
|
|
423
437
|
};
|
|
424
438
|
}
|
|
425
439
|
function summarizeProviderConfig(ctx) {
|
|
440
|
+
// v0.4: resolve the active model's provider from the registry, not the
|
|
441
|
+
// retired top-level apiKey/apiBaseUrl fields, so custom providers show their
|
|
442
|
+
// real endpoint instead of "unknown / default endpoint".
|
|
443
|
+
const registry = ctx.config.modelRegistry;
|
|
444
|
+
const selector = ctx.store.getSnapshot().currentModel;
|
|
445
|
+
const activeModel = ctx.llm?.getModel() ?? selector;
|
|
446
|
+
const profile = registry?.profiles.get(selector) ??
|
|
447
|
+
registry?.enabledProfiles.find(item => item.id === activeModel || item.model === activeModel);
|
|
448
|
+
const provider = profile ? registry?.providers.get(profile.provider) : undefined;
|
|
449
|
+
const credential = (0, model_client_pool_1.resolveProviderCredential)(provider?.apiKey ?? ctx.config.apiKey);
|
|
426
450
|
const diagnostic = (0, provider_diagnostics_1.diagnoseProviderConfig)({
|
|
427
|
-
apiKey:
|
|
428
|
-
baseUrl: ctx.config.apiBaseUrl,
|
|
451
|
+
apiKey: credential.apiKey,
|
|
452
|
+
baseUrl: ctx.config.apiBaseUrl || provider?.baseUrl,
|
|
429
453
|
fallbackModel: ctx.config.fallbackModel,
|
|
430
|
-
model:
|
|
454
|
+
model: activeModel,
|
|
455
|
+
provider: profile?.provider ?? provider?.id,
|
|
456
|
+
...(profile
|
|
457
|
+
? {
|
|
458
|
+
effectiveLimits: {
|
|
459
|
+
contextWindow: profile.resolvedContextWindow,
|
|
460
|
+
maxOutputTokens: profile.resolvedMaxOutputTokens,
|
|
461
|
+
source: `${profile.contextSource}/${profile.outputSource}`,
|
|
462
|
+
},
|
|
463
|
+
}
|
|
464
|
+
: {}),
|
|
431
465
|
});
|
|
432
466
|
return {
|
|
433
467
|
id: 'provider-config',
|
|
434
468
|
status: diagnostic.status,
|
|
435
469
|
label: 'Provider Config',
|
|
436
470
|
summary: diagnostic.summary,
|
|
437
|
-
detail: diagnostic.detail.join('\n'),
|
|
471
|
+
detail: [...diagnostic.detail, ...(credential.error ? [credential.error] : [])].join('\n'),
|
|
472
|
+
};
|
|
473
|
+
}
|
|
474
|
+
/**
|
|
475
|
+
* v0.4.0 — detect injected proxy env that hijacks provider requests.
|
|
476
|
+
* WorkBuddy/Conductor sessions inject HTTP(S)_PROXY; Node's fetch/undici honors
|
|
477
|
+
* them by default, so a healthy provider appears to fail before TLS. Report a
|
|
478
|
+
* warn with the remediation command, never echoing credentials in proxy URLs.
|
|
479
|
+
*/
|
|
480
|
+
function summarizeProxyEnvironment() {
|
|
481
|
+
const names = [
|
|
482
|
+
'HTTP_PROXY',
|
|
483
|
+
'HTTPS_PROXY',
|
|
484
|
+
'ALL_PROXY',
|
|
485
|
+
'http_proxy',
|
|
486
|
+
'https_proxy',
|
|
487
|
+
'all_proxy',
|
|
488
|
+
];
|
|
489
|
+
const present = names.filter(name => {
|
|
490
|
+
const value = process.env[name]?.trim() ?? '';
|
|
491
|
+
return value.length > 0 && !/^(direct|none|off)$/i.test(value);
|
|
492
|
+
});
|
|
493
|
+
if (present.length === 0) {
|
|
494
|
+
return {
|
|
495
|
+
id: 'proxy-environment',
|
|
496
|
+
status: 'ok',
|
|
497
|
+
label: 'Proxy Environment',
|
|
498
|
+
summary: 'No proxy environment variables set',
|
|
499
|
+
};
|
|
500
|
+
}
|
|
501
|
+
return {
|
|
502
|
+
id: 'proxy-environment',
|
|
503
|
+
status: 'warn',
|
|
504
|
+
label: 'Proxy Environment',
|
|
505
|
+
summary: `${present.length} proxy variable(s) set — provider requests may be hijacked`,
|
|
506
|
+
detail: [
|
|
507
|
+
`set: ${present.join(', ')} (values redacted)`,
|
|
508
|
+
'If provider requests fail before TLS (ECONNRESET / socket hang up), retry with:',
|
|
509
|
+
' env -u HTTP_PROXY -u HTTPS_PROXY -u ALL_PROXY -u http_proxy -u https_proxy -u all_proxy orion',
|
|
510
|
+
'Or set NO_PROXY to include the provider host.',
|
|
511
|
+
].join('\n'),
|
|
438
512
|
};
|
|
439
513
|
}
|
|
440
514
|
function collectDoctorReport(ctx) {
|
|
@@ -443,32 +517,30 @@ function collectDoctorReport(ctx) {
|
|
|
443
517
|
const tools = snapshot.tools;
|
|
444
518
|
const staticTools = tools.filter(tool => !tool.name.startsWith('mcp__')).length;
|
|
445
519
|
const mcpTools = tools.length - staticTools;
|
|
520
|
+
const configError = (0, config_1.getConfigErrors)(ctx.config)[0];
|
|
446
521
|
const checks = [
|
|
447
522
|
{
|
|
448
523
|
id: 'config',
|
|
449
|
-
status:
|
|
524
|
+
status: configError ? 'fail' : 'ok',
|
|
450
525
|
label: 'Config',
|
|
451
|
-
summary:
|
|
452
|
-
? `API key present, model ${ctx.config.model}`
|
|
453
|
-
: 'Missing API key',
|
|
526
|
+
summary: configError ?? `API key present, model ${ctx.config.model}`,
|
|
454
527
|
detail: `config=${(0, config_dir_1.getGlobalConfigPath)()}\nbaseUrl=${(0, provider_diagnostics_1.redactProviderSecrets)(ctx.config.apiBaseUrl || '(default OpenAI-compatible endpoint)')}`,
|
|
455
528
|
},
|
|
456
529
|
{
|
|
457
530
|
id: 'llm',
|
|
458
|
-
status: ctx.llm &&
|
|
531
|
+
status: ctx.llm && !configError ? 'ok' : 'fail',
|
|
459
532
|
label: 'LLM',
|
|
460
533
|
summary: ctx.llm ? `Initialized ${ctx.llm.getModel()}` : 'LLM service is not initialized',
|
|
461
534
|
},
|
|
462
535
|
summarizeProviderConfig(ctx),
|
|
536
|
+
summarizeProxyEnvironment(),
|
|
463
537
|
summarizeAutoCompact(ctx),
|
|
464
538
|
{
|
|
465
539
|
id: 'permissions',
|
|
466
540
|
status: 'ok',
|
|
467
541
|
label: 'Permissions',
|
|
468
|
-
summary:
|
|
469
|
-
detail:
|
|
470
|
-
? `Interactive tool confirmation is routed through the shared runtime permission protocol.${(0, config_1.isProductUIRenderer)(ctx.config.ui?.renderer) ? ' TUI is the product default.' : ''}`
|
|
471
|
-
: undefined,
|
|
542
|
+
summary: 'All registered tools are enabled by default',
|
|
543
|
+
detail: 'Built-in tool checks and workspace containment apply during execution.',
|
|
472
544
|
},
|
|
473
545
|
{
|
|
474
546
|
id: 'tools',
|
|
@@ -3,12 +3,12 @@ export declare const EFFORT_LEVELS: readonly ["none", "minimal", "low", "medium"
|
|
|
3
3
|
export type EffortLevel = (typeof EFFORT_LEVELS)[number];
|
|
4
4
|
export type EffortPreference = 'auto' | EffortLevel;
|
|
5
5
|
export type EffortScope = 'session' | 'project' | 'global';
|
|
6
|
-
export
|
|
7
|
-
export interface ReasoningCapability {
|
|
8
|
-
kind: 'effort-level' | 'thinking-level' | 'thinking-budget';
|
|
6
|
+
export interface ReasoningEffortPolicy {
|
|
9
7
|
supportedLevels: EffortLevel[];
|
|
10
8
|
defaultLevel?: EffortLevel;
|
|
11
|
-
|
|
9
|
+
}
|
|
10
|
+
/** Resolved registry metadata, never read from the public configuration document. */
|
|
11
|
+
export interface ReasoningCapability extends ReasoningEffortPolicy {
|
|
12
12
|
source: 'config' | 'discovery' | 'builtin';
|
|
13
13
|
}
|
|
14
14
|
export interface ResolvedEffort {
|
|
@@ -34,7 +34,7 @@ export interface ProviderEffortSnapshot {
|
|
|
34
34
|
capability?: ReasoningCapability;
|
|
35
35
|
resolved: ResolvedEffort;
|
|
36
36
|
}
|
|
37
|
-
/**
|
|
37
|
+
/** An inherited preference sends an override only when the model has a configured level. */
|
|
38
38
|
export declare function buildProviderEffortParams(snapshot: ProviderEffortSnapshot): Record<string, unknown>;
|
|
39
39
|
export declare function resolveProfileEffort(profile: ResolvedModelProfile | undefined, preferences: Omit<EffortResolutionInput, 'capability'>): ResolvedEffort;
|
|
40
40
|
//# sourceMappingURL=effort.d.ts.map
|
package/dist/services/effort.js
CHANGED
|
@@ -26,7 +26,7 @@ function resolveEffort(input) {
|
|
|
26
26
|
source,
|
|
27
27
|
supported: false,
|
|
28
28
|
supportedLevels: [],
|
|
29
|
-
warning: '
|
|
29
|
+
warning: 'reasoning effort capability is not configured',
|
|
30
30
|
};
|
|
31
31
|
}
|
|
32
32
|
if (requested === 'auto') {
|
|
@@ -58,21 +58,15 @@ function resolveEffort(input) {
|
|
|
58
58
|
supportedLevels: [...capability.supportedLevels],
|
|
59
59
|
};
|
|
60
60
|
}
|
|
61
|
-
/**
|
|
61
|
+
/** An inherited preference sends an override only when the model has a configured level. */
|
|
62
62
|
function buildProviderEffortParams(snapshot) {
|
|
63
|
-
if (
|
|
64
|
-
snapshot.resolved.
|
|
63
|
+
if (snapshot.protocol !== 'openai-completions' ||
|
|
64
|
+
!snapshot.resolved.supported ||
|
|
65
65
|
!snapshot.resolved.effective ||
|
|
66
66
|
!snapshot.capability) {
|
|
67
67
|
return {};
|
|
68
68
|
}
|
|
69
|
-
|
|
70
|
-
snapshot.capability.adapter === 'openai-chat-reasoning-effort') {
|
|
71
|
-
return { reasoning_effort: snapshot.resolved.effective };
|
|
72
|
-
}
|
|
73
|
-
// Anthropic Messages is not sent through Orion's current OpenAI SDK seam.
|
|
74
|
-
// Keep it unavailable until a native protocol adapter owns the full request.
|
|
75
|
-
return {};
|
|
69
|
+
return { reasoning_effort: snapshot.resolved.effective };
|
|
76
70
|
}
|
|
77
71
|
function resolveProfileEffort(profile, preferences) {
|
|
78
72
|
return resolveEffort({ ...preferences, capability: profile?.reasoningCapability });
|
|
@@ -1,7 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
export declare class FileLockBusyError extends Error {
|
|
2
|
+
constructor(lockPath: string);
|
|
3
|
+
}
|
|
4
|
+
interface FileLockOptions {
|
|
3
5
|
waitMs?: number;
|
|
4
6
|
retryMs?: number;
|
|
5
7
|
staleMs?: number;
|
|
6
|
-
}
|
|
8
|
+
}
|
|
9
|
+
/** Exclusive owner handle for a lifecycle that spans asynchronous work. */
|
|
10
|
+
export declare function acquireFileLockSync(rawTargetPath: string, options?: FileLockOptions): () => void;
|
|
11
|
+
export declare function withFileLockSync<T>(rawTargetPath: string, operation: () => T, options?: FileLockOptions): T;
|
|
12
|
+
export {};
|
|
7
13
|
//# sourceMappingURL=file-lock.d.ts.map
|