@orion-agents/orion-code 0.3.66 → 0.4.3
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 +81 -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 +34 -0
- package/dist/acp/session-updates.js +162 -0
- package/dist/acp/sessions.d.ts +32 -0
- package/dist/acp/sessions.js +315 -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 +5 -1
- package/dist/commands/diagnostic-command-handlers.js +20 -6
- 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 +0 -18
- 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/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/framework/loop-budget-contract.d.ts +7 -2
- package/dist/framework/loop-budget-contract.js +4 -1
- package/dist/framework/loop-progress.d.ts +22 -0
- package/dist/framework/loop-progress.js +79 -0
- package/dist/framework/prompt.d.ts +0 -2
- package/dist/framework/prompt.js +9 -27
- package/dist/framework/query.d.ts +27 -20
- package/dist/framework/query.js +453 -153
- 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 +31 -12
- package/dist/harness/context-harness.js +491 -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/intent.js +21 -0
- package/dist/harness/ledger.d.ts +6 -11
- package/dist/harness/ledger.js +39 -9
- package/dist/harness/progress-controller.d.ts +12 -7
- package/dist/harness/progress-controller.js +66 -21
- package/dist/harness/state.js +9 -1
- package/dist/harness/task-checklist.d.ts +16 -0
- package/dist/harness/task-checklist.js +95 -0
- package/dist/harness/types.d.ts +73 -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 +38 -0
- package/dist/print-ui/event-stream.js +187 -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 +11 -2
- package/dist/runtime/agent-loop.js +165 -25
- package/dist/runtime/agent-runtime-controller.d.ts +13 -3
- package/dist/runtime/agent-runtime-controller.js +347 -183
- 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 +11 -1
- package/dist/runtime/goal-lifecycle-v2.js +85 -15
- package/dist/runtime/goal-runtime-coordinator.d.ts +10 -1
- package/dist/runtime/goal-runtime-coordinator.js +81 -24
- package/dist/runtime/loop-budget.js +7 -5
- 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 +135 -39
- 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 +128 -52
- 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 +351 -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 +1 -0
- package/dist/runtime/subagents/policy.js +0 -1
- package/dist/runtime/subagents/production.js +1 -1
- 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 +342 -0
- package/dist/runtime/task-context-service.d.ts +16 -10
- package/dist/runtime/task-context-service.js +35 -4
- package/dist/runtime/thread-admission.d.ts +1 -1
- package/dist/runtime/thread-admission.js +12 -6
- 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 +7 -0
- package/dist/runtime/thread-runtime.js +43 -0
- 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 +88 -11
- package/dist/runtime/tool-gateway.d.ts +7 -0
- package/dist/runtime/tool-gateway.js +20 -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 +12 -0
- package/dist/runtime/ui-view-model.d.ts +6 -5
- package/dist/runtime/ui-view-model.js +33 -19
- package/dist/runtime/workspace-runtime-kernel.js +0 -1
- 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 +30 -45
- 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 -56
- package/dist/services/global-config.js +213 -183
- package/dist/services/llm.d.ts +40 -4
- package/dist/services/llm.js +164 -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 +7 -0
- package/dist/services/provider-diagnostics.js +9 -10
- 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 +2 -0
- package/dist/tools/core/write-file.js +5 -0
- 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 +76 -31
- 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 +22 -27
- 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 +562 -0
- package/docs/orion.example.yaml +42 -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
package/README.zh-CN.md
CHANGED
|
@@ -1,312 +1,121 @@
|
|
|
1
1
|
# Orion Code
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
面向终端、本地优先的目标驱动 Coding Agent(CLI/TUI)。
|
|
4
4
|
|
|
5
|
-
> v0.3
|
|
6
|
-
>
|
|
7
|
-
>
|
|
8
|
-
> 的工作空间没有任何删除或归档入口。上一版 0.3.65 已发布 npm(registry
|
|
9
|
-
> `latest`)、打 tag `v0.3.65`;`WEB32-P0-08` 根因仍开放
|
|
10
|
-
> (`docs/plan/evidence/v0.3.53/investigation-and-audit.md`)。
|
|
5
|
+
> v0.4.3 是 ACP v1 接入候选版本。
|
|
6
|
+
> Web Workbench 与桌面产品链已退役,全局配置统一为 `orion.yaml`。
|
|
7
|
+
> 源码版本号、本地可运行、候选包验收与 npm 发布分别记录,不互相替代。
|
|
11
8
|
|
|
12
|
-
[English](README.md) ·
|
|
13
|
-
[
|
|
14
|
-
[v0.3.7 方案](docs/plan/v0.3.7-left-rail-improvement-plan.md) ·
|
|
15
|
-
[v0.3.6 方案](docs/plan/v0.3.6-plan.md) ·
|
|
16
|
-
[v0.3.4 稳定化方案](docs/plan/v0.3.4-stabilization-plan.md) ·
|
|
17
|
-
[v0.3.4 合同](docs/architecture/v0.3.4-stabilization-contract.md) ·
|
|
18
|
-
[v0.3.4 E2E 方案](docs/test/v0.3.4-stabilization-e2e-plan.md) ·
|
|
19
|
-
[v0.3.4 迁移](docs/migration/v0.3.3-to-v0.3.4.md) ·
|
|
20
|
-
[v0.3.3 方案](docs/plan/v0.3.3-plan.md) ·
|
|
21
|
-
[v0.3.3 Web API](docs/architecture/v0.3.3-web-api.yaml) ·
|
|
22
|
-
[模式/权限合同](docs/architecture/agent-mode-permission-contract.md) ·
|
|
23
|
-
[v0.3.3 E2E 方案](docs/test/v0.3.3-web-workbench-e2e-plan.md) ·
|
|
24
|
-
[v0.3.3 迁移](docs/migration/v0.3.2-to-v0.3.3.md) ·
|
|
25
|
-
[v0.3.0 Web 方案](docs/plan/v0.3.0-web-workbench-plan.md) ·
|
|
26
|
-
[Settings 方案](docs/plan/v0.3.0-settings-integration-plan.md) ·
|
|
27
|
-
[Node 兼容方案](docs/plan/v0.3.0-node-runtime-compatibility-plan.md) ·
|
|
28
|
-
[Web API](docs/architecture/v0.3.0-web-api.yaml) ·
|
|
29
|
-
[迁移指南](docs/migration/v0.2.2-to-v0.3.0.md) ·
|
|
30
|
-
[Settings 迁移](docs/migration/v0.2.2-to-v0.3.0-settings.md) ·
|
|
31
|
-
[真实状态图册](docs/assets/screenshots/v0.3.0-web/README.md)
|
|
9
|
+
[English](README.md) · [CLI 使用与验收](docs/cli-guide.md) ·
|
|
10
|
+
[YAML 配置示例](docs/orion.example.yaml) · [变更记录](CHANGELOG.md)
|
|
32
11
|
|
|
33
|
-
##
|
|
12
|
+
## 能做什么
|
|
34
13
|
|
|
35
|
-
-
|
|
36
|
-
|
|
37
|
-
-
|
|
38
|
-
|
|
39
|
-
-
|
|
40
|
-
|
|
41
|
-
- **诚实的 durable/read 投影。** Tool receipt 与 journal fact 必须成对校验;symlink 在保留 lexical
|
|
42
|
-
类型的同时投影有效目标类型;Review 将仓库真实总数与有界可见页分开显示。
|
|
43
|
-
- **Fail-closed 发布证据。** live canary 失败、重复 Runtime 证据,或混入“安全安装阶段”的生命周期
|
|
44
|
-
script 都会阻止发布。
|
|
14
|
+
- 通过共享 Agent Runtime 与 ToolGateway 理解、修改和验证本地仓库。
|
|
15
|
+
- 默认 TUI 承载输入、流式活动、审批、审查和任务接管。
|
|
16
|
+
- 通过 `orion acp` 让 [ACP v1 客户端](docs/cli-guide.md#acp-接入) 驱动编码任务。
|
|
17
|
+
- 保存本版创建的 Session、Plan 与 Goal,重启后恢复,不自动重放已完成副作用。
|
|
18
|
+
- 按需使用模型、Skills 与 MCP,通过 `orion doctor` 检查配置。
|
|
19
|
+
- 区分停止执行与真实完成,保留计划、工具结果和验证证据。
|
|
45
20
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
- **一条执行主干、有界 Web Session actors。** Web Session 与终端产品共用 product bootstrap、
|
|
49
|
-
AgentRuntimeController、Session/Thread、ToolGateway、审批、Goal、Plan、Skills 和 MCP。Web 最多允许
|
|
50
|
-
3 个 Session turn 并行、4 个 actor 常驻;TUI/terminal 继续保持单活动 Session 合同。
|
|
51
|
-
- **Orion 方块工坊。** 内置像素工坊风格可与 system/light/dark 组合,不加载远程资产、动态主题代码或
|
|
52
|
-
第二份 Settings 真相;classic 继续作为显式内置风格提供。
|
|
53
|
-
- **可恢复的 Web 工作台。** React 界面覆盖工作区/会话、对话与工具活动、BUILD/PLAN/AUTO、follow-up、
|
|
54
|
-
interrupt、审批、Goal/Plan、模型/effort、Skills/MCP 和诊断。快照与 cursor replay 负责刷新和 SSE
|
|
55
|
-
重连恢复。
|
|
56
|
-
- **专业项目工作台。** 左侧展示已注册项目并懒加载 Session,中间仍是唯一 Agent 会话。右侧可变宽面板
|
|
57
|
-
提供 Agent、审阅、终端、文件和 Git;左栏可在 240–480px 鼠标调宽或折叠为 48px rail,窄屏使用互斥
|
|
58
|
-
drawer 且不覆盖桌面偏好。
|
|
59
|
-
- **Composer Control Center。** 模式、Session 权限、模型、Effort 与 Context 都在输入框旁的可访问菜单中;
|
|
60
|
-
Runtime 明确投影 current/last-good/pending/error,active turn 模型切换会安全延迟,切小上下文前先 Compact。
|
|
61
|
-
- **可审核 Plan 与有界 Context。** PLAN 写入 durable review 后等待 exact-digest 批准;结构化文件/目录/
|
|
62
|
-
Review/Session/Skill 引用、带 revision 的队列编辑与 Session 草稿恢复让输入意图可见且可恢复。
|
|
63
|
-
- **本地安全边界。** Host 只绑定 `127.0.0.1`;写请求必须携带精确 Origin、进程 nonce、JSON body 和
|
|
64
|
-
幂等键。响应设置严格 CSP,浏览器 payload 经过脱敏,大型工具结果按字节分页读取。
|
|
65
|
-
- **Host 管理的 Settings。** 外观、默认模型、工作区 Effort 与全局工具确认策略统一进入严格、带
|
|
66
|
-
revision 的 `orion.json` Coordinator。原子批量保存、文件锁内 CAS、外部编辑 invalidation、
|
|
67
|
-
last-good 恢复与明确的来源/作用域/生效时机,让浏览器、slash 命令、TUI 与 Runtime 使用同一持久真相。
|
|
68
|
-
- **有边界地参考 DSH。** 方案基于固定 DeepSeek Harness revision 做了源码审计。DSH Web 实际使用
|
|
69
|
-
POST 加两条下行 WebSocket;Orion 有意选择 JSON HTTP 加一条可 replay 的 SSE,同时保留 Orion 的
|
|
70
|
-
Model/Skills/MCP 边界。
|
|
71
|
-
|
|
72
|
-
## v0.2.0 带来了什么
|
|
73
|
-
|
|
74
|
-
Orion 现在只有一条产品执行主干:
|
|
75
|
-
|
|
76
|
-
```text
|
|
77
|
-
Thread → Turn → Step → Item
|
|
78
|
-
│
|
|
79
|
-
├─ 冻结的 prompt/model/capability 快照
|
|
80
|
-
└─ Capability → Policy → Approval → Sandbox → Execute → durable receipt
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
- **默认更轻。** 普通 coding 首步只暴露 7 个精确 core tools,不再把全部 built-in schema
|
|
84
|
-
重复发送给模型。Git、LSP、Web、Skill、MCP、batch 和 subagent 按任务选择。
|
|
85
|
-
- **执行路径唯一。** root turn 与 child agent 共用同一种 Agent Loop 和 ToolGateway;模型看到的 schema
|
|
86
|
-
与实际 dispatch 由同一个 Step Snapshot 绑定。
|
|
87
|
-
- **扩展真正按需。** Skill catalog 只含有界描述,选中后才读取定义和资源;MCP server 在精确选择前
|
|
88
|
-
不连接、不起进程、不打开 socket,空闲后释放 lease。
|
|
89
|
-
- **完成状态可证明。** history、TaskContext evidence、Goal、StopDecision、Capability 与 Plan receipts
|
|
90
|
-
在同一个 TurnCommit 中提交。持续有进展的 Goal 可以运行 20+ turns,只在 completion audit 通过后
|
|
91
|
-
自动退出。
|
|
92
|
-
- **崩溃后可恢复。** append-only runtime facts 是权威源;UI projection、Compact、旧 Session 迁移和
|
|
93
|
-
resume 都进行 digest 校验,半提交或冲突状态 fail closed。
|
|
94
|
-
- **交互一致。** TUI、terminal、print、Plan、Goal、Compact 与 subagent 使用同一版本化协议。
|
|
95
|
-
|
|
96
|
-
架构借鉴 DeepSeek Harness 的 scope/resource lifecycle 和 Codex 的不可变执行契约,同时保留 Orion
|
|
97
|
-
自己的 Goal/Evidence 完成模型。Orion **不是**插件市场或任意 JavaScript 插件宿主;Model、Skills、
|
|
98
|
-
MCP 仍是用户可见的扩展边界。
|
|
21
|
+
本产品不是通用 IDE 或插件市场;支持某个模型,不代表任意编码任务已通过质量评测。
|
|
99
22
|
|
|
100
23
|
## 安装
|
|
101
24
|
|
|
102
|
-
支持 Node.js 22.12
|
|
103
|
-
|
|
25
|
+
支持 **Node.js 22.x(至少 22.12)、24.x 或 26.x**。
|
|
26
|
+
精确候选包的验收 floor 为 22.12.0 / 24.0.0 / 26.0.0。
|
|
104
27
|
|
|
105
|
-
|
|
28
|
+
本地候选使用实际被测的同一包安装,请替换为实际路径:
|
|
106
29
|
|
|
107
30
|
```bash
|
|
108
|
-
npm install -g
|
|
31
|
+
npm install -g /absolute/path/orion-agents-orion-code-0.4.3.tgz
|
|
109
32
|
orion --version
|
|
110
33
|
orion doctor
|
|
111
34
|
```
|
|
112
35
|
|
|
113
|
-
|
|
36
|
+
仅在另行确认 npm 已发布后,固定 registry 版本安装:
|
|
114
37
|
|
|
115
38
|
```bash
|
|
116
|
-
|
|
117
|
-
cd orion-code
|
|
118
|
-
npm install
|
|
119
|
-
npm run build
|
|
120
|
-
npm run start
|
|
39
|
+
npm install -g @orion-agents/orion-code@0.4.3
|
|
121
40
|
```
|
|
122
41
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
Orion 读取 `~/.orion-code/orion.json`。可从
|
|
126
|
-
[`docs/orion.example.json`](docs/orion.example.json) 开始。Provider key 可使用本地值或
|
|
127
|
-
`$HUOSHAN_API_KEY` 这样的环境变量引用;不要提交密钥。
|
|
128
|
-
|
|
129
|
-
最小 OpenAI-compatible 示例:
|
|
130
|
-
|
|
131
|
-
```json
|
|
132
|
-
{
|
|
133
|
-
"schemaVersion": 1,
|
|
134
|
-
"providers": [
|
|
135
|
-
{
|
|
136
|
-
"id": "my-provider",
|
|
137
|
-
"displayName": "My Provider",
|
|
138
|
-
"baseUrl": "https://example.invalid/v1",
|
|
139
|
-
"apiKey": "$MY_PROVIDER_API_KEY",
|
|
140
|
-
"protocol": "openai-completions"
|
|
141
|
-
}
|
|
142
|
-
],
|
|
143
|
-
"models": [
|
|
144
|
-
{
|
|
145
|
-
"id": "my-model",
|
|
146
|
-
"displayName": "My Model",
|
|
147
|
-
"provider": "my-provider",
|
|
148
|
-
"model": "model-name",
|
|
149
|
-
"contextWindow": 200000,
|
|
150
|
-
"maxOutputTokens": 8192
|
|
151
|
-
}
|
|
152
|
-
],
|
|
153
|
-
"defaultModel": "my-model",
|
|
154
|
-
"toolConfirmation": "allow"
|
|
155
|
-
}
|
|
156
|
-
```
|
|
157
|
-
|
|
158
|
-
配置后运行 `orion doctor`。诊断不需要输出密钥本身。
|
|
159
|
-
|
|
160
|
-
## 使用 Orion
|
|
42
|
+
从候选分支源码运行:
|
|
161
43
|
|
|
162
44
|
```bash
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
orion web --no-open --port 0 # 使用操作系统分配的 loopback 端口
|
|
167
|
-
orion web --cwd /path/to/repo # 指定另一个已存在工作区
|
|
168
|
-
orion -p "解释这个仓库" # 实验性的非交互模式
|
|
169
|
-
orion -p --output-format json "运行 focused tests"
|
|
170
|
-
orion diff
|
|
171
|
-
orion commit
|
|
45
|
+
npm ci
|
|
46
|
+
npm run build
|
|
47
|
+
npm run start
|
|
172
48
|
```
|
|
173
49
|
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
### 本地 Web Workbench
|
|
177
|
-
|
|
178
|
-
`orion web` 在同一个 loopback origin 提供打包后的客户端与 `/api/v1/*`,不提供 LAN bind。
|
|
179
|
-
Provider 凭据仍通过 Orion 配置/环境变量管理;浏览器负责选择工作区和会话、执行或 steer 任务、回答
|
|
180
|
-
审批并查看运行态。关闭或刷新 tab 不会替用户批准/拒绝,pending approval 仍由 Runtime 持有;停止
|
|
181
|
-
Host 时会 abort 并 fail-closed。
|
|
182
|
-
|
|
183
|
-
浏览器展示已提交 Plan receipt,并进入 durable `awaiting_review`。批准会创建独立 BUILD request;继续规划
|
|
184
|
-
携带反馈创建独立 PLAN request;取消不产生执行副作用。三种操作均绑定 exact digest,刷新或 Host restart
|
|
185
|
-
后可恢复,stale review fail-closed。
|
|
186
|
-
|
|
187
|
-
Host 以有界 Session actor 池承载并发(默认 3 个运行 / 4 个常驻),而不是单一全局 Runtime;项目导航
|
|
188
|
-
不会把一个 Session 的写入应用到另一个 Session。跨项目 Session 选择是一次带 revision guard 的原子
|
|
189
|
-
Context 切换。桌面左栏可在 240–480px 调整或折叠为 48px rail,右栏为 320–720px;均采用 IDE 式鼠标
|
|
190
|
-
拖动且不提供键盘精细调宽。窄屏自动使用 drawer,且不覆盖桌面宽度偏好。文件区提供带 CAS 冲突检测的
|
|
191
|
-
文本编辑(上限 512 KiB);Git 区提供暂存、hunk/行反馈、本地提交与历史读取;审阅区可发起共享的有界
|
|
192
|
-
审查运行并查看 digest 可验证的 findings。push、reset、discard、amend、force push 等远端与破坏性
|
|
193
|
-
Git 操作仍未开放,作为独立能力另行设计;创建终端需要显式 user gesture,短期 ticket 与输出均不进入
|
|
194
|
-
Workbench SSE。
|
|
195
|
-
|
|
196
|
-
#### 后台运行与管理(v0.3.10)
|
|
197
|
-
|
|
198
|
-
Web Workbench 只绑定 **127.0.0.1**;默认端口为 **4242**(M42,猎户座大星云),避免与常用开发端口冲突。
|
|
50
|
+
## 配置模型
|
|
199
51
|
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
52
|
+
从 [YAML 示例](docs/orion.example.yaml) 创建 `~/.orion-code/orion.yaml`。
|
|
53
|
+
`ORION_CODE_CONFIG_DIR` 可选择独立配置与数据根,新 profile 不导入旧版数据。
|
|
54
|
+
测试时不要删除现有默认 profile,更不能把工作仓库作为清理目标。
|
|
55
|
+
|
|
56
|
+
```yaml
|
|
57
|
+
schemaVersion: 1
|
|
58
|
+
providers:
|
|
59
|
+
- id: example
|
|
60
|
+
baseUrl: https://api.example.com/v1
|
|
61
|
+
apiKey: $ORION_CODE_API_KEY
|
|
62
|
+
protocol: openai-completions
|
|
63
|
+
models:
|
|
64
|
+
- id: example-model
|
|
65
|
+
provider: example
|
|
66
|
+
model: example-model
|
|
67
|
+
defaultModel: example-model
|
|
207
68
|
```
|
|
208
69
|
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
#### Host 管理的 Settings
|
|
214
|
-
|
|
215
|
-
Settings dialog 从当前 Host 读取设置,不把浏览器存储当成第二配置真源。主题和减少动效会跨刷新、端口
|
|
216
|
-
和 Host 重启保留;默认模型只影响新建 Session,当前 Session 仍通过 `/model` 或会话控制显式切换;
|
|
217
|
-
Effort 是当前 workspace 的 project default,Session override 优先;工具确认是全局策略,只能在 Runtime
|
|
218
|
-
idle 时保存,并从下一个 logical request 生效。`allow` 不会绕过 hard policy、sandbox 或工作区边界。
|
|
219
|
-
|
|
220
|
-
每次保存都是一次原子 CAS batch。并发标签页或外部 `orion.json` 编辑会显示冲突但保留草稿;非法 JSON
|
|
221
|
-
只会让页面进入 invalid 状态,Runtime 继续使用 last-good,Web 绝不覆盖坏文件。Provider 凭据不会进入
|
|
222
|
-
Web API,页面只显示 readiness,打开本地配置文件的动作也不接受 path。优先级、旧 appearance 一次迁移
|
|
223
|
-
和回滚方法见 [Settings 迁移说明](docs/migration/v0.2.2-to-v0.3.0-settings.md)。
|
|
224
|
-
|
|
225
|
-
### BUILD、PLAN、AUTO
|
|
70
|
+
替换实际可用的 endpoint 和模型名。密钥支持 `$ENV_VAR` 引用,不要提交真实凭据。
|
|
71
|
+
无效 YAML、重复键、未知或退役字段必须报错,不能静默变成默认配置。
|
|
72
|
+
设置保存保留原子写、锁与 revision 校验,但不保留 YAML 注释。
|
|
73
|
+
可写状态文件本身不能是符号链接;配置目录的符号链接仍可使用。
|
|
226
74
|
|
|
227
|
-
使用
|
|
228
|
-
Allow 或 Deny。Mode 决定工作流,Authority、approval、路径边界和 sandbox policy 是独立状态轴;Allow
|
|
229
|
-
与 AUTO 不会覆盖 hard policy 或显式 Deny。
|
|
75
|
+
## 使用
|
|
230
76
|
|
|
231
|
-
|
|
232
|
-
- **PLAN**:使用同一套可用工具完成探索;将 decision-complete plan 写入 durable PlanReceipt;等待
|
|
233
|
-
批准、继续规划或取消。
|
|
234
|
-
- **AUTO**:在已配置 Authority 内取消交互确认;hard policy 与 sandbox 边界仍然 fail closed。
|
|
77
|
+
先进入希望 Orion 工作的仓库目录:
|
|
235
78
|
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
### Durable Goal
|
|
245
|
-
|
|
246
|
-
```text
|
|
247
|
-
/goal 修复开放问题,运行准出门禁,仅在证据完整后停止
|
|
248
|
-
/goal status
|
|
249
|
-
/goal pause
|
|
250
|
-
/goal resume
|
|
251
|
-
/goal clear
|
|
79
|
+
```bash
|
|
80
|
+
orion # 默认交互 TUI
|
|
81
|
+
orion --ui terminal # 技术诊断 terminal 界面
|
|
82
|
+
orion diff # 只读工作区 diff 摘要
|
|
83
|
+
orion commit # 只生成提交计划,不执行 git commit
|
|
84
|
+
orion -p "解释这个仓库" # 非交互任务
|
|
85
|
+
orion -p --output-format json "检查失败测试"
|
|
252
86
|
```
|
|
253
87
|
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
v0.2.0 breaking cut 已删除 `/target`、`/goal exit`、`edit`、`replace`、`confirm`、`budget` 和
|
|
258
|
-
`clear --yes`,不会把旧命令静默解释为新目标。
|
|
259
|
-
|
|
260
|
-
### 常用命令
|
|
261
|
-
|
|
262
|
-
- `/help`、`/status`、`/doctor`、`/harness explain`
|
|
263
|
-
- `/tools`、`/skills`、`/skill <name>`、`/mcp`
|
|
264
|
-
- `/context`、`/memory`、`/usage`、`/trace`、`/last-tool`
|
|
265
|
-
- `/model`、`/effort`、`/permissions`、`/config`
|
|
266
|
-
- `/compact`、`/resume`、`/session`
|
|
267
|
-
- `/diff`、`/commit-plan`、`/review`、`/research`、`/security`、`/test-gen`
|
|
268
|
-
|
|
269
|
-
安装版本中的 `/help` 是命令清单的权威来源。
|
|
88
|
+
`orion -p` 是早期实验性的非交互入口。需要实时确认或 steering 的任务使用 TUI;
|
|
89
|
+
非交互审批不能无限等待不可达的弹窗。本版不提供 Web 服务器或浏览器工作台。
|
|
270
90
|
|
|
271
|
-
|
|
91
|
+
安装版本中的 `/help` 是命令清单权威来源。常用入口:`/model`、`/context`、
|
|
92
|
+
`/compact`、`/resume`、`/diff`、`/review`、`/skills`、`/mcp`。
|
|
93
|
+
`/plan <任务>` 进入持久计划流程;用户明确要求持续目标时使用 `/goal <目标>`。
|
|
94
|
+
内置工具默认可用。工具自身校验、工作区路径边界以及已配置的沙箱仍在执行时生效。
|
|
272
95
|
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
- 每个已开始的 tool Item 恰好一个 durable terminal outcome。嵌套 batch child 保留 parent/child
|
|
276
|
-
invocation lineage,并重新进入 ToolGateway。
|
|
277
|
-
- 慢 renderer 可以合并 ephemeral delta,但 durable events 不会静默丢失且可以 replay。
|
|
278
|
-
- Compact 只有在 source history、TaskContext、projection 与 pointer CAS 都通过后才提交。
|
|
279
|
-
- v0.1.9 Session 采用 side-by-side materialization;event replay 与 projection digest 验证后才切 active
|
|
280
|
-
index。
|
|
281
|
-
- public exports 只提供产品 runtime/protocol 与 Model/Skill/MCP 配置边界,不暴露内部 service locator
|
|
282
|
-
或插件 SDK。
|
|
96
|
+
Esc 中断当前工作;Ctrl+C 走退出确认。真实中文输入法、快捷键和缩放在实际终端验证。
|
|
97
|
+
`/resume` 恢复本版创建的会话,这不构成旧版本数据兼容承诺。
|
|
283
98
|
|
|
284
|
-
##
|
|
99
|
+
## 开发与准出
|
|
285
100
|
|
|
286
101
|
```bash
|
|
287
102
|
npm run lint
|
|
103
|
+
npm run format:check
|
|
288
104
|
npm run build
|
|
289
|
-
npm test -- --runInBand
|
|
290
105
|
npm run test:coverage -- --runInBand
|
|
291
106
|
npm run test:harness-confluence
|
|
292
|
-
npm run
|
|
293
|
-
npm run bench:harness
|
|
294
|
-
npm run bench:harness:compare -- <baseline.json> <candidate.json>
|
|
295
|
-
npm run prepublishOnly
|
|
296
|
-
npm run test:web-e2e -- --grep @settings
|
|
107
|
+
npm run release:check -- --expected-version 0.4.3
|
|
297
108
|
```
|
|
298
109
|
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
[`v0.3.3 E2E 资格计划`](docs/test/v0.3.3-web-workbench-e2e-plan.md)。v0.3.4 的安全与稳定化增量见
|
|
304
|
-
[`v0.3.4 测试计划`](docs/test/v0.3.4-stabilization-e2e-plan.md);它不会把 source gate 当成发布凭据。
|
|
110
|
+
准出需绑定同一 tarball 的 SHA-256 与源码身份,在三个 Node floor 验证安装后的 CLI、TUI、
|
|
111
|
+
terminal、print、Goal、子任务、SQLite、Skill、MCP、compact/resume。
|
|
112
|
+
源码测试不能冒充精确包验收;错包、缺证据、失败门禁和脏发布源码均应保持 NO-GO。
|
|
113
|
+
人工终端/IME 验收单独记录,详见 [CLI 使用与验收](docs/cli-guide.md)。
|
|
305
114
|
|
|
306
115
|
## 安全
|
|
307
116
|
|
|
308
|
-
不要提交 `.env
|
|
309
|
-
|
|
117
|
+
不要提交 `.env`、Orion profile、本地数据库或凭据。授权前核对动作和目标路径。
|
|
118
|
+
Shell 沙箱能力取决于所选后端和系统平台。
|
|
310
119
|
|
|
311
120
|
## License
|
|
312
121
|
|
package/bin/orion
CHANGED
|
@@ -25,7 +25,10 @@ if (!supportedNodeRuntime) {
|
|
|
25
25
|
|
|
26
26
|
function loadEnvFile(filePath) {
|
|
27
27
|
if (fs.existsSync(filePath)) {
|
|
28
|
-
require('dotenv').config({
|
|
28
|
+
require('dotenv').config({
|
|
29
|
+
path: filePath,
|
|
30
|
+
quiet: true,
|
|
31
|
+
});
|
|
29
32
|
return true;
|
|
30
33
|
}
|
|
31
34
|
return false;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { AgentContext, StopReason } from '@agentclientprotocol/sdk';
|
|
2
|
+
import type { FirstPartyApprovalRequestV1 } from '../runtime/first-party-tool-services';
|
|
3
|
+
import type { RuntimeToolFinishedEvent, RuntimeToolStartedEvent, TranscriptAppendEntry, UiEventSink } from '../runtime/ui-events';
|
|
4
|
+
/** ACP's append-only text and tool updates over the shared Thread UI projection. */
|
|
5
|
+
export declare class AcpSessionUpdates implements UiEventSink {
|
|
6
|
+
private readonly sessionId;
|
|
7
|
+
private readonly client;
|
|
8
|
+
private readonly onWriteFailure;
|
|
9
|
+
private readonly messages;
|
|
10
|
+
private readonly tools;
|
|
11
|
+
private pending;
|
|
12
|
+
private messageSequence;
|
|
13
|
+
private replaying;
|
|
14
|
+
budgetStop?: StopReason;
|
|
15
|
+
constructor(sessionId: string, client: AgentContext, onWriteFailure: () => void);
|
|
16
|
+
setReplaying(replaying: boolean): void;
|
|
17
|
+
flush(): Promise<void>;
|
|
18
|
+
append(entry: TranscriptAppendEntry): string;
|
|
19
|
+
update(id: string, patch: Partial<TranscriptAppendEntry>): void;
|
|
20
|
+
finalize(id: string, patch?: Partial<TranscriptAppendEntry>): void;
|
|
21
|
+
remove(id: string): void;
|
|
22
|
+
replaceTranscript(): void;
|
|
23
|
+
clearTranscript(): void;
|
|
24
|
+
setStatus(): void;
|
|
25
|
+
showSessionPicker(): void;
|
|
26
|
+
showEditPreview(): void;
|
|
27
|
+
setProcessing(): void;
|
|
28
|
+
toolStarted(event: RuntimeToolStartedEvent): void;
|
|
29
|
+
toolFinished(event: RuntimeToolFinishedEvent): void;
|
|
30
|
+
confirm(request: FirstPartyApprovalRequestV1): Promise<boolean>;
|
|
31
|
+
private beginTool;
|
|
32
|
+
private send;
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=session-updates.d.ts.map
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AcpSessionUpdates = void 0;
|
|
4
|
+
const redaction_1 = require("../services/redaction");
|
|
5
|
+
const ALLOW_ONCE = 'allow-once';
|
|
6
|
+
function toolKind(name) {
|
|
7
|
+
switch (name) {
|
|
8
|
+
case 'exec_command':
|
|
9
|
+
return 'execute';
|
|
10
|
+
case 'read_file':
|
|
11
|
+
case 'list_files':
|
|
12
|
+
return 'read';
|
|
13
|
+
case 'write_file':
|
|
14
|
+
case 'edit_file':
|
|
15
|
+
return 'edit';
|
|
16
|
+
case 'glob':
|
|
17
|
+
case 'grep':
|
|
18
|
+
case 'web_search':
|
|
19
|
+
return 'search';
|
|
20
|
+
case 'web_fetch':
|
|
21
|
+
return 'fetch';
|
|
22
|
+
default:
|
|
23
|
+
return 'other';
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
function toolTitle(name, command) {
|
|
27
|
+
return (0, redaction_1.redactTraceText)(command ? name + ': ' + command : name).slice(0, 1024);
|
|
28
|
+
}
|
|
29
|
+
/** ACP's append-only text and tool updates over the shared Thread UI projection. */
|
|
30
|
+
class AcpSessionUpdates {
|
|
31
|
+
constructor(sessionId, client, onWriteFailure) {
|
|
32
|
+
this.sessionId = sessionId;
|
|
33
|
+
this.client = client;
|
|
34
|
+
this.onWriteFailure = onWriteFailure;
|
|
35
|
+
this.messages = new Map();
|
|
36
|
+
this.tools = new Set();
|
|
37
|
+
this.pending = Promise.resolve();
|
|
38
|
+
this.messageSequence = 0;
|
|
39
|
+
this.replaying = false;
|
|
40
|
+
}
|
|
41
|
+
setReplaying(replaying) {
|
|
42
|
+
this.replaying = replaying;
|
|
43
|
+
}
|
|
44
|
+
async flush() {
|
|
45
|
+
await this.pending;
|
|
46
|
+
}
|
|
47
|
+
append(entry) {
|
|
48
|
+
const id = 'message-' + ++this.messageSequence;
|
|
49
|
+
if (!this.replaying && entry.budgetStop) {
|
|
50
|
+
this.budgetStop =
|
|
51
|
+
entry.budgetStop.kind === 'llm_request_limit' ? 'max_turn_requests' : 'refusal';
|
|
52
|
+
}
|
|
53
|
+
if ((entry.role === 'assistant' && entry.title !== 'reasoning') ||
|
|
54
|
+
(entry.role === 'user' && this.replaying)) {
|
|
55
|
+
this.messages.set(id, { role: entry.role, sent: '' });
|
|
56
|
+
this.update(id, entry);
|
|
57
|
+
}
|
|
58
|
+
return id;
|
|
59
|
+
}
|
|
60
|
+
update(id, patch) {
|
|
61
|
+
const message = this.messages.get(id);
|
|
62
|
+
const text = patch.content;
|
|
63
|
+
// The v1 chunks used here can append but cannot rewrite already sent text.
|
|
64
|
+
if (!message || !text || patch.errorLayer || !text.startsWith(message.sent))
|
|
65
|
+
return;
|
|
66
|
+
const delta = text.slice(message.sent.length);
|
|
67
|
+
if (!delta)
|
|
68
|
+
return;
|
|
69
|
+
message.sent = text;
|
|
70
|
+
this.send({
|
|
71
|
+
sessionUpdate: message.role === 'user' ? 'user_message_chunk' : 'agent_message_chunk',
|
|
72
|
+
messageId: id,
|
|
73
|
+
content: { type: 'text', text: delta },
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
finalize(id, patch) {
|
|
77
|
+
if (patch)
|
|
78
|
+
this.update(id, patch);
|
|
79
|
+
this.remove(id);
|
|
80
|
+
}
|
|
81
|
+
remove(id) {
|
|
82
|
+
this.messages.delete(id);
|
|
83
|
+
}
|
|
84
|
+
replaceTranscript() {
|
|
85
|
+
this.clearTranscript();
|
|
86
|
+
}
|
|
87
|
+
clearTranscript() {
|
|
88
|
+
this.messages.clear();
|
|
89
|
+
}
|
|
90
|
+
setStatus() { }
|
|
91
|
+
showSessionPicker() { }
|
|
92
|
+
showEditPreview() { }
|
|
93
|
+
setProcessing() { }
|
|
94
|
+
toolStarted(event) {
|
|
95
|
+
this.beginTool(event.callId, event.name, event.command);
|
|
96
|
+
}
|
|
97
|
+
toolFinished(event) {
|
|
98
|
+
this.tools.delete(event.callId);
|
|
99
|
+
const text = (0, redaction_1.redactTraceText)(event.error || event.summary || '').slice(0, 2048);
|
|
100
|
+
this.send({
|
|
101
|
+
sessionUpdate: 'tool_call_update',
|
|
102
|
+
toolCallId: event.callId,
|
|
103
|
+
status: event.success ? 'completed' : 'failed',
|
|
104
|
+
...(text ? { content: [{ type: 'content', content: { type: 'text', text } }] } : {}),
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
async confirm(request) {
|
|
108
|
+
const { invocationId, abortSignal } = request;
|
|
109
|
+
if (!invocationId || abortSignal?.aborted)
|
|
110
|
+
return false;
|
|
111
|
+
const command = typeof request.args.command === 'string' ? request.args.command : undefined;
|
|
112
|
+
this.beginTool(invocationId, request.name, command);
|
|
113
|
+
try {
|
|
114
|
+
await this.flush();
|
|
115
|
+
if (abortSignal?.aborted)
|
|
116
|
+
return false;
|
|
117
|
+
const { outcome } = await this.client.request('session/request_permission', {
|
|
118
|
+
sessionId: this.sessionId,
|
|
119
|
+
toolCall: {
|
|
120
|
+
toolCallId: invocationId,
|
|
121
|
+
title: toolTitle(request.name, command),
|
|
122
|
+
kind: toolKind(request.name),
|
|
123
|
+
status: 'pending',
|
|
124
|
+
},
|
|
125
|
+
options: [
|
|
126
|
+
{ optionId: ALLOW_ONCE, name: 'Allow once', kind: 'allow_once' },
|
|
127
|
+
{ optionId: 'reject-once', name: 'Reject', kind: 'reject_once' },
|
|
128
|
+
],
|
|
129
|
+
}, { cancellationSignal: abortSignal, stopWaitingOnCancel: true });
|
|
130
|
+
const approved = !abortSignal?.aborted && outcome.outcome === 'selected' && outcome.optionId === ALLOW_ONCE;
|
|
131
|
+
if (approved) {
|
|
132
|
+
this.send({
|
|
133
|
+
sessionUpdate: 'tool_call_update',
|
|
134
|
+
toolCallId: invocationId,
|
|
135
|
+
status: 'in_progress',
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
return approved;
|
|
139
|
+
}
|
|
140
|
+
catch {
|
|
141
|
+
return false;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
beginTool(callId, name, command) {
|
|
145
|
+
if (this.tools.has(callId))
|
|
146
|
+
return;
|
|
147
|
+
this.tools.add(callId);
|
|
148
|
+
this.send({
|
|
149
|
+
sessionUpdate: 'tool_call',
|
|
150
|
+
toolCallId: callId,
|
|
151
|
+
title: toolTitle(name, command),
|
|
152
|
+
kind: toolKind(name),
|
|
153
|
+
status: 'pending',
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
send(update) {
|
|
157
|
+
this.pending = this.pending.then(() => this.client.notify('session/update', { sessionId: this.sessionId, update }));
|
|
158
|
+
void this.pending.catch(this.onWriteFailure);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
exports.AcpSessionUpdates = AcpSessionUpdates;
|
|
162
|
+
//# sourceMappingURL=session-updates.js.map
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { type AgentContext, type ContentBlock, type NewSessionRequest, type PromptResponse } from '@agentclientprotocol/sdk';
|
|
2
|
+
import type { RuntimeEventEnvelopeV1 } from '../runtime/protocol/runtime-protocol-v1';
|
|
3
|
+
import type { OrionCodeUiRuntime } from '../runtime/ui-events';
|
|
4
|
+
declare class AcpSession {
|
|
5
|
+
readonly id: string;
|
|
6
|
+
private readonly runtime;
|
|
7
|
+
private readonly releaseLease;
|
|
8
|
+
private readonly updates;
|
|
9
|
+
private readonly runner;
|
|
10
|
+
private active?;
|
|
11
|
+
constructor(id: string, runtime: OrionCodeUiRuntime, createRunner: NonNullable<OrionCodeUiRuntime['createAgentRunner']>, client: AgentContext, releaseLease: () => void);
|
|
12
|
+
restore(): Promise<void>;
|
|
13
|
+
observe(events: readonly RuntimeEventEnvelopeV1[]): void;
|
|
14
|
+
prompt(blocks: readonly ContentBlock[], requestSignal: AbortSignal): Promise<PromptResponse>;
|
|
15
|
+
cancel(): void;
|
|
16
|
+
shutdown(): Promise<void>;
|
|
17
|
+
}
|
|
18
|
+
/** Owns the product runtimes opened by a single ACP connection. */
|
|
19
|
+
export declare class AcpSessions {
|
|
20
|
+
private readonly sessions;
|
|
21
|
+
private readonly opening;
|
|
22
|
+
private readonly loading;
|
|
23
|
+
private closing;
|
|
24
|
+
open(params: NewSessionRequest, client: AgentContext, signal: AbortSignal, sessionId?: string): Promise<AcpSession>;
|
|
25
|
+
get(id: string): AcpSession;
|
|
26
|
+
cancel(id: string): void;
|
|
27
|
+
shutdown(): Promise<void>;
|
|
28
|
+
private create;
|
|
29
|
+
private acquireLease;
|
|
30
|
+
}
|
|
31
|
+
export {};
|
|
32
|
+
//# sourceMappingURL=sessions.d.ts.map
|