@orion-agents/orion-code 0.2.2 → 0.3.1

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.
Files changed (217) hide show
  1. package/CHANGELOG.md +82 -0
  2. package/README.md +89 -14
  3. package/README.zh-CN.md +77 -14
  4. package/bin/orion +15 -4
  5. package/dist/cli.js +51 -172
  6. package/dist/cli.js.map +1 -1
  7. package/dist/commands/model-command-handlers.d.ts +2 -2
  8. package/dist/commands/model-command-handlers.d.ts.map +1 -1
  9. package/dist/commands/model-command-handlers.js +113 -32
  10. package/dist/commands/model-command-handlers.js.map +1 -1
  11. package/dist/commands/session-command-handlers.d.ts.map +1 -1
  12. package/dist/commands/session-command-handlers.js +106 -15
  13. package/dist/commands/session-command-handlers.js.map +1 -1
  14. package/dist/commands/types.d.ts +13 -3
  15. package/dist/commands/types.d.ts.map +1 -1
  16. package/dist/commands/types.js +1 -1
  17. package/dist/commands/types.js.map +1 -1
  18. package/dist/core/tool-artifacts.d.ts +2 -0
  19. package/dist/core/tool-artifacts.d.ts.map +1 -1
  20. package/dist/core/tool-artifacts.js +27 -1
  21. package/dist/core/tool-artifacts.js.map +1 -1
  22. package/dist/index.d.ts +1 -1
  23. package/dist/index.js +1 -1
  24. package/dist/runtime/agent-loop.d.ts.map +1 -1
  25. package/dist/runtime/agent-loop.js +3 -3
  26. package/dist/runtime/agent-loop.js.map +1 -1
  27. package/dist/runtime/agent-runtime-controller.d.ts +32 -1
  28. package/dist/runtime/agent-runtime-controller.d.ts.map +1 -1
  29. package/dist/runtime/agent-runtime-controller.js +241 -27
  30. package/dist/runtime/agent-runtime-controller.js.map +1 -1
  31. package/dist/runtime/agent-runtime-protocol.d.ts +4 -0
  32. package/dist/runtime/agent-runtime-protocol.d.ts.map +1 -1
  33. package/dist/runtime/agent-runtime-protocol.js.map +1 -1
  34. package/dist/runtime/agent-runtime-runner.d.ts +2 -1
  35. package/dist/runtime/agent-runtime-runner.d.ts.map +1 -1
  36. package/dist/runtime/durable-tool-receipt-reader.d.ts +32 -0
  37. package/dist/runtime/durable-tool-receipt-reader.d.ts.map +1 -0
  38. package/dist/runtime/durable-tool-receipt-reader.js +130 -0
  39. package/dist/runtime/durable-tool-receipt-reader.js.map +1 -0
  40. package/dist/runtime/legacy-thread-materializer.d.ts +31 -0
  41. package/dist/runtime/legacy-thread-materializer.d.ts.map +1 -1
  42. package/dist/runtime/legacy-thread-materializer.js +71 -17
  43. package/dist/runtime/legacy-thread-materializer.js.map +1 -1
  44. package/dist/runtime/orion-runtime-v1.d.ts +2 -0
  45. package/dist/runtime/orion-runtime-v1.d.ts.map +1 -1
  46. package/dist/runtime/orion-runtime-v1.js +7 -1
  47. package/dist/runtime/orion-runtime-v1.js.map +1 -1
  48. package/dist/runtime/orion-session-runner.d.ts +7 -2
  49. package/dist/runtime/orion-session-runner.d.ts.map +1 -1
  50. package/dist/runtime/orion-session-runner.js +16 -6
  51. package/dist/runtime/orion-session-runner.js.map +1 -1
  52. package/dist/runtime/product-bootstrap.d.ts +22 -0
  53. package/dist/runtime/product-bootstrap.d.ts.map +1 -0
  54. package/dist/runtime/product-bootstrap.js +374 -0
  55. package/dist/runtime/product-bootstrap.js.map +1 -0
  56. package/dist/runtime/product-orion-runtime.d.ts +2 -1
  57. package/dist/runtime/product-orion-runtime.d.ts.map +1 -1
  58. package/dist/runtime/product-orion-runtime.js +83 -13
  59. package/dist/runtime/product-orion-runtime.js.map +1 -1
  60. package/dist/runtime/protocol/runtime-protocol-v1.d.ts +1 -1
  61. package/dist/runtime/protocol/runtime-protocol-v1.js +1 -1
  62. package/dist/runtime/protocol/runtime-protocol-v1.js.map +1 -1
  63. package/dist/runtime/release-receipts.d.ts +66 -3
  64. package/dist/runtime/release-receipts.d.ts.map +1 -1
  65. package/dist/runtime/release-receipts.js +340 -7
  66. package/dist/runtime/release-receipts.js.map +1 -1
  67. package/dist/runtime/step-snapshot.d.ts.map +1 -1
  68. package/dist/runtime/step-snapshot.js +22 -2
  69. package/dist/runtime/step-snapshot.js.map +1 -1
  70. package/dist/runtime/subagents/runtime-integration.d.ts +1 -1
  71. package/dist/runtime/subagents/runtime-integration.d.ts.map +1 -1
  72. package/dist/runtime/subagents/runtime-integration.js +5 -2
  73. package/dist/runtime/subagents/runtime-integration.js.map +1 -1
  74. package/dist/runtime/thread-event-store.d.ts +80 -0
  75. package/dist/runtime/thread-event-store.d.ts.map +1 -1
  76. package/dist/runtime/thread-event-store.js +456 -22
  77. package/dist/runtime/thread-event-store.js.map +1 -1
  78. package/dist/runtime/thread-projection.d.ts +10 -0
  79. package/dist/runtime/thread-projection.d.ts.map +1 -1
  80. package/dist/runtime/thread-projection.js +40 -0
  81. package/dist/runtime/thread-projection.js.map +1 -1
  82. package/dist/runtime/thread-runtime.d.ts +3 -1
  83. package/dist/runtime/thread-runtime.d.ts.map +1 -1
  84. package/dist/runtime/thread-runtime.js +6 -0
  85. package/dist/runtime/thread-runtime.js.map +1 -1
  86. package/dist/runtime/thread-session-index.d.ts +84 -0
  87. package/dist/runtime/thread-session-index.d.ts.map +1 -0
  88. package/dist/runtime/thread-session-index.js +503 -0
  89. package/dist/runtime/thread-session-index.js.map +1 -0
  90. package/dist/runtime/thread-session-view.d.ts +70 -9
  91. package/dist/runtime/thread-session-view.d.ts.map +1 -1
  92. package/dist/runtime/thread-session-view.js +200 -82
  93. package/dist/runtime/thread-session-view.js.map +1 -1
  94. package/dist/runtime/thread-ui-adapter.d.ts +2 -0
  95. package/dist/runtime/thread-ui-adapter.d.ts.map +1 -1
  96. package/dist/runtime/thread-ui-adapter.js +86 -4
  97. package/dist/runtime/thread-ui-adapter.js.map +1 -1
  98. package/dist/runtime/tool-detail-repository.d.ts.map +1 -1
  99. package/dist/runtime/tool-detail-repository.js +23 -19
  100. package/dist/runtime/tool-detail-repository.js.map +1 -1
  101. package/dist/runtime/tool-receipt-validator.d.ts +21 -0
  102. package/dist/runtime/tool-receipt-validator.d.ts.map +1 -0
  103. package/dist/runtime/tool-receipt-validator.js +157 -0
  104. package/dist/runtime/tool-receipt-validator.js.map +1 -0
  105. package/dist/runtime/ui-events.d.ts +35 -0
  106. package/dist/runtime/ui-events.d.ts.map +1 -1
  107. package/dist/runtime/ui-events.js +1 -0
  108. package/dist/runtime/ui-events.js.map +1 -1
  109. package/dist/runtime/ui-view-model.d.ts +2 -0
  110. package/dist/runtime/ui-view-model.d.ts.map +1 -1
  111. package/dist/runtime/ui-view-model.js +7 -3
  112. package/dist/runtime/ui-view-model.js.map +1 -1
  113. package/dist/services/global-config.d.ts +25 -0
  114. package/dist/services/global-config.d.ts.map +1 -1
  115. package/dist/services/global-config.js +373 -5
  116. package/dist/services/global-config.js.map +1 -1
  117. package/dist/services/redaction.d.ts +4 -0
  118. package/dist/services/redaction.d.ts.map +1 -1
  119. package/dist/services/redaction.js +63 -0
  120. package/dist/services/redaction.js.map +1 -1
  121. package/dist/services/session-index.d.ts +16 -0
  122. package/dist/services/session-index.d.ts.map +1 -1
  123. package/dist/services/session-index.js +45 -36
  124. package/dist/services/session-index.js.map +1 -1
  125. package/dist/services/session-storage.d.ts +59 -0
  126. package/dist/services/session-storage.d.ts.map +1 -1
  127. package/dist/services/session-storage.js +306 -107
  128. package/dist/services/session-storage.js.map +1 -1
  129. package/dist/services/settings-coordinator.d.ts +174 -0
  130. package/dist/services/settings-coordinator.d.ts.map +1 -0
  131. package/dist/services/settings-coordinator.js +605 -0
  132. package/dist/services/settings-coordinator.js.map +1 -0
  133. package/dist/services/settings-document-repository.d.ts +138 -0
  134. package/dist/services/settings-document-repository.d.ts.map +1 -0
  135. package/dist/services/settings-document-repository.js +551 -0
  136. package/dist/services/settings-document-repository.js.map +1 -0
  137. package/dist/services/workspace-registry.d.ts +42 -0
  138. package/dist/services/workspace-registry.d.ts.map +1 -0
  139. package/dist/services/workspace-registry.js +222 -0
  140. package/dist/services/workspace-registry.js.map +1 -0
  141. package/dist/terminal-ui/launch.d.ts.map +1 -1
  142. package/dist/terminal-ui/launch.js +5 -0
  143. package/dist/terminal-ui/launch.js.map +1 -1
  144. package/dist/tui-ui/state.d.ts.map +1 -1
  145. package/dist/tui-ui/state.js +5 -0
  146. package/dist/tui-ui/state.js.map +1 -1
  147. package/dist/web/errors.d.ts +6 -0
  148. package/dist/web/errors.d.ts.map +1 -0
  149. package/dist/web/errors.js +13 -0
  150. package/dist/web/errors.js.map +1 -0
  151. package/dist/web/event-hub.d.ts +43 -0
  152. package/dist/web/event-hub.d.ts.map +1 -0
  153. package/dist/web/event-hub.js +323 -0
  154. package/dist/web/event-hub.js.map +1 -0
  155. package/dist/web/file-read-service.d.ts +55 -0
  156. package/dist/web/file-read-service.d.ts.map +1 -0
  157. package/dist/web/file-read-service.js +399 -0
  158. package/dist/web/file-read-service.js.map +1 -0
  159. package/dist/web/git-read-model-service.d.ts +77 -0
  160. package/dist/web/git-read-model-service.d.ts.map +1 -0
  161. package/dist/web/git-read-model-service.js +631 -0
  162. package/dist/web/git-read-model-service.js.map +1 -0
  163. package/dist/web/index.d.ts +6 -0
  164. package/dist/web/index.d.ts.map +1 -0
  165. package/dist/web/index.js +28 -0
  166. package/dist/web/index.js.map +1 -0
  167. package/dist/web/launch.d.ts +9 -0
  168. package/dist/web/launch.d.ts.map +1 -0
  169. package/dist/web/launch.js +64 -0
  170. package/dist/web/launch.js.map +1 -0
  171. package/dist/web/protocol.d.ts +408 -0
  172. package/dist/web/protocol.d.ts.map +1 -0
  173. package/dist/web/protocol.js +369 -0
  174. package/dist/web/protocol.js.map +1 -0
  175. package/dist/web/review-service.d.ts +38 -0
  176. package/dist/web/review-service.d.ts.map +1 -0
  177. package/dist/web/review-service.js +74 -0
  178. package/dist/web/review-service.js.map +1 -0
  179. package/dist/web/server.d.ts +20 -0
  180. package/dist/web/server.d.ts.map +1 -0
  181. package/dist/web/server.js +744 -0
  182. package/dist/web/server.js.map +1 -0
  183. package/dist/web/terminal-manager.d.ts +155 -0
  184. package/dist/web/terminal-manager.d.ts.map +1 -0
  185. package/dist/web/terminal-manager.js +728 -0
  186. package/dist/web/terminal-manager.js.map +1 -0
  187. package/dist/web/terminal-server.d.ts +8 -0
  188. package/dist/web/terminal-server.d.ts.map +1 -0
  189. package/dist/web/terminal-server.js +275 -0
  190. package/dist/web/terminal-server.js.map +1 -0
  191. package/dist/web/workbench-controller.d.ts +99 -0
  192. package/dist/web/workbench-controller.d.ts.map +1 -0
  193. package/dist/web/workbench-controller.js +1267 -0
  194. package/dist/web/workbench-controller.js.map +1 -0
  195. package/dist/web-client/assets/DiffViewer-DpKoD07C.js +5 -0
  196. package/dist/web-client/assets/FilesPanel-BkoLmgjR.js +2 -0
  197. package/dist/web-client/assets/GitPanel-D20StcdG.js +1 -0
  198. package/dist/web-client/assets/ReviewPanel-3MVWbMQV.js +1 -0
  199. package/dist/web-client/assets/TerminalPanel-BLQ592Fb.js +21 -0
  200. package/dist/web-client/assets/TerminalPanel-DLuoa74B.css +1 -0
  201. package/dist/web-client/assets/index-BkIDl_xk.js +16 -0
  202. package/dist/web-client/assets/index-DXMpnWE8.css +1 -0
  203. package/dist/web-client/index.html +16 -0
  204. package/docs/architecture/v0.3.0-web-api.yaml +1340 -0
  205. package/docs/architecture/v0.3.1-web-api.yaml +2290 -0
  206. package/docs/migration/v0.2.2-to-v0.3.0-settings.md +114 -0
  207. package/docs/migration/v0.2.2-to-v0.3.0.md +55 -0
  208. package/docs/migration/v0.3.0-to-v0.3.1.md +88 -0
  209. package/docs/orion.example.json +9 -2
  210. package/docs/plan/v0.3.0-node-runtime-compatibility-plan.md +57 -0
  211. package/docs/plan/v0.3.0-settings-integration-plan.md +740 -0
  212. package/docs/plan/v0.3.0-web-workbench-plan.md +376 -0
  213. package/docs/plan/v0.3.1-web-workbench-professional-shell-plan.md +848 -0
  214. package/docs/readme.md +22 -1
  215. package/docs/test/v0.3.1-web-workbench-e2e-plan.md +140 -0
  216. package/npm-shrinkwrap.json +1229 -45
  217. package/package.json +47 -11
package/CHANGELOG.md CHANGED
@@ -22,6 +22,88 @@ which is **not** a pass.
22
22
 
23
23
  ## [Unreleased]
24
24
 
25
+ ## [0.3.1] — CANDIDATE
26
+
27
+ > **Status: candidate.** This branch carries the v0.3 Web quality and long-session recovery fixes.
28
+ > It is not a Git tag, GitHub Release or npm publication until those receipts exist.
29
+
30
+ ### Added
31
+
32
+ - Add a registered multi-project navigator with lazy inactive-project Session pages and one atomic,
33
+ revision-guarded active Workspace/Session transition.
34
+ - Add a professional right work dock for Agent, Review, Terminal, Files and Git, with an IDE-style
35
+ mouse-resized 320–720px desktop panel and responsive drawers that preserve desktop width.
36
+ - Add bounded, revisioned read models for workspace-contained files, Git status/log/diff and review
37
+ metadata, plus an explicit real-PTY terminal with short-lived WebSocket attach tickets.
38
+ - Add the v0.3.1 OpenAPI, migration guide and exact-artifact WEB31-P0-01..12 qualification contract.
39
+
40
+ ### Changed
41
+
42
+ - Extend full browser qualification to 34 scenarios and the Node 22.12/24/26 critical matrix to 24
43
+ scenarios, all bound to one source-clean tgz, installed-target identity and real Chrome runner.
44
+ - Raise the packed-package ceiling from 2.00 to 2.25 MiB for the bundled xterm client while keeping
45
+ the 10 MiB unpacked and 1,500-entry limits unchanged.
46
+ - Keep terminal output off the Workbench SSE and durable Session history; Host restart reports the
47
+ terminal as lost instead of fabricating recovery.
48
+
49
+ ### Fixed
50
+
51
+ - Keep the conversation composer in a bounded bottom dock while transcript history and pending
52
+ approval or follow-up content scroll independently.
53
+ - Bind Web commands and recovery snapshots to the active Session, make replay reset a terminal
54
+ barrier, and preserve Session-scoped drafts across navigation.
55
+ - Serve large tool output only from a browser-safe derivative so arbitrary byte offsets cannot
56
+ bypass redaction.
57
+ - Persist verified Thread heads and immutable transcript pages, use revision-bound collection
58
+ cursors, and load additional browser history explicitly instead of draining every page at boot.
59
+
60
+ ### Security
61
+
62
+ - Require UUID idempotency keys and current Workspace/Context guards for v0.3.1 resource operations;
63
+ stale guards return `context_revision_conflict` with zero side effects.
64
+ - Bind every WEB31 screenshot and high-risk structured fact into the Web E2E receipt, including
65
+ context targeting, PTY orphan count, SSE/WS isolation, axe and secret gates.
66
+
67
+ ## [0.3.0] — CANDIDATE
68
+
69
+ > **Status: candidate.** This source version is not a Git tag, GitHub Release or npm publication
70
+ > until those external receipts are created and read back separately.
71
+
72
+ ### Added
73
+
74
+ - Add `orion web`, a loopback-only React workbench for workspace/session navigation, streaming
75
+ conversation and tools, follow-up/interrupt, approvals, Goal/Plan, model/effort settings,
76
+ Skills/MCP metadata, large-output inspection and diagnostics.
77
+ - Add a versioned same-origin Web API with bounded cursor pagination, process-lifetime idempotency
78
+ keys, settings compare-and-swap, session recovery snapshots and a replayable SSE event stream.
79
+ - Add a Host-owned Settings subsystem with strict typed reads, keyed exact-byte revisions,
80
+ raw-preserving atomic batch updates, lock-inside CAS, external-edit convergence, last-good
81
+ recovery and browser conflict handling.
82
+ - Add the source-audited v0.3.0 product plan, OpenAPI contract and v0.2.2 migration/rollback guide.
83
+
84
+ ### Changed
85
+
86
+ - Set the release-qualification contract to maintained Node 22.12+, 24 and 26; publication now
87
+ requires exact-tarball native SQLite, CLI, TUI, Web and fail-closed evidence on every line.
88
+ - Extract the CLI composition into one shared product bootstrap so Web, TUI, terminal and print
89
+ retain the same AgentRuntimeController, OrionSessionRunner, OrionRuntime and durable stores.
90
+ - Resolve new root/child runtimes from the selected model profile and support exact
91
+ BUILD/PLAN/AUTO selection at the next logical-request boundary.
92
+ - Align durable approval scopes with the product permission store as `once`, `project`, `global`.
93
+ - Route Web, TUI and slash-command changes for default model, project/global effort and tool
94
+ confirmation through one Settings coordinator; keep the current-session model distinct from the
95
+ default for newly created sessions.
96
+
97
+ ### Security
98
+
99
+ - Bind Web only to `127.0.0.1`; require exact Origin, per-process nonce and JSON for mutations; cap
100
+ bodies and pages; reject Host/path-boundary violations; and send restrictive browser headers.
101
+ - Keep pending approvals runtime-owned across browser disconnects, redact browser-safe projections,
102
+ expose no provider credentials, and disconnect slow SSE clients so they recover by cursor rather
103
+ than growing an unbounded response buffer.
104
+ - Expose credential readiness only, keep the configuration-file action pathless, preserve invalid
105
+ external bytes, and require Runtime-idle mutation for settings that alter execution policy.
106
+
25
107
  ## [0.2.2] — 2026-08-27
26
108
 
27
109
  > **Status: published.** The `v0.2.2` tag and npm `latest` package identify this release tree.
package/README.md CHANGED
@@ -1,13 +1,46 @@
1
1
  # Orion Code
2
2
 
3
- Goal-driven coding agent for the terminal.
4
-
5
- > v0.2.2resilient Thread session recovery, provider-safe interrupted tool
6
- > history, and width-stable Goal usage visibility on the v0.2 Harness.
7
-
8
- [中文说明](README.zh-CN.md) · [Architecture plan](docs/plan/v0.2.0-dsh-harness-redesign-plan.md) ·
9
- [Migration guide](docs/migration/v0.1.9-to-v0.2.0.md) ·
10
- [Release checklist](docs/plan/v0.2.0-release-checklist.md)
3
+ Local-first, goal-driven coding agent for the terminal and browser.
4
+
5
+ > v0.3.1 candidate one Orion runtime with a local Web Workbench, replayable browser state and
6
+ > the existing TUI/terminal surfaces. Candidate source is not an npm publication or Git tag.
7
+
8
+ [中文说明](README.zh-CN.md) ·
9
+ [v0.3.1 professional shell plan](docs/plan/v0.3.1-web-workbench-professional-shell-plan.md) ·
10
+ [v0.3.1 Web API](docs/architecture/v0.3.1-web-api.yaml) ·
11
+ [v0.3.1 E2E plan](docs/test/v0.3.1-web-workbench-e2e-plan.md) ·
12
+ [v0.3.1 migration](docs/migration/v0.3.0-to-v0.3.1.md) ·
13
+ [v0.3.0 Web plan](docs/plan/v0.3.0-web-workbench-plan.md) ·
14
+ [Settings plan](docs/plan/v0.3.0-settings-integration-plan.md) ·
15
+ [Node compatibility](docs/plan/v0.3.0-node-runtime-compatibility-plan.md) ·
16
+ [Web API](docs/architecture/v0.3.0-web-api.yaml) ·
17
+ [Migration guide](docs/migration/v0.2.2-to-v0.3.0.md) ·
18
+ [Settings migration](docs/migration/v0.2.2-to-v0.3.0-settings.md) ·
19
+ [real-state gallery](docs/assets/screenshots/v0.3.0-web/README.md)
20
+
21
+ ## What v0.3.1 includes
22
+
23
+ - **One runtime, two interactive surfaces.** `orion web` uses the same product bootstrap,
24
+ AgentRuntimeController, Session/Thread stores, ToolGateway, approvals, Goals, Plans, Skills and
25
+ MCP boundaries as the terminal product; the browser does not run a second agent loop.
26
+ - **Recoverable Web workbench.** The React workbench includes workspace/session navigation,
27
+ transcript and tool activity, BUILD/PLAN/AUTO, follow-ups, interrupt, approvals, Goal/Plan,
28
+ model/effort settings, Skills/MCP and diagnostics. Snapshots plus cursor replay repair refreshes
29
+ and SSE reconnects.
30
+ - **Professional project shell.** The left navigator shows registered projects with lazy Session
31
+ pages while the center remains the only Agent conversation. A resizable right dock provides
32
+ Agent, Review, Terminal, Files and Git surfaces; files/Git/review are bounded read models and the
33
+ terminal is an explicit, ephemeral real PTY isolated from Session history and SSE.
34
+ - **Local security boundary.** The host binds only `127.0.0.1`; writes require an exact Origin,
35
+ process nonce, JSON body and idempotency key. Responses use a restrictive CSP, browser payloads
36
+ are redacted, and large tool results are byte-paged instead of placed on the event stream.
37
+ - **Host-owned Settings.** Appearance, the default model, workspace effort and the global tool
38
+ confirmation policy use one strict, revisioned `orion.json` coordinator. Atomic batches, file-lock
39
+ CAS, external-edit invalidation, last-good recovery and explicit source/scope/apply metadata keep
40
+ the browser, slash commands, TUI and Runtime on the same persisted truth.
41
+ - **Deliberate DSH adaptation.** The design was source-audited against a fixed DeepSeek Harness
42
+ revision. DSH's browser uses POST plus two downlink WebSockets; Orion intentionally uses JSON
43
+ HTTP plus one replayable SSE downlink while retaining Orion's Model/Skills/MCP boundaries.
11
44
 
12
45
  ## What changed in v0.2.0
13
46
 
@@ -44,12 +77,13 @@ user extension boundaries.
44
77
 
45
78
  ## Install
46
79
 
47
- Node.js 20, 22, and 24 are supported.
80
+ Node.js 22.12+, 24, and 26 are supported. Use Node 24 LTS for production or Node 26 Current for
81
+ current development environments. Node 20 is upstream EOL and is no longer a v0.3 runtime.
48
82
 
49
- Install the published `0.2.2` release:
83
+ After the immutable `0.3.1` npm receipt exists:
50
84
 
51
85
  ```bash
52
- npm install -g @orion-agents/orion-code@0.2.2
86
+ npm install -g @orion-agents/orion-code@0.3.1
53
87
  orion --version
54
88
  orion doctor
55
89
  ```
@@ -106,6 +140,9 @@ Run `orion doctor` after configuration. Diagnostics never need to print the secr
106
140
  ```bash
107
141
  orion # default product TUI
108
142
  orion --ui terminal # technical terminal fallback
143
+ orion web # local Web Workbench; opens a browser
144
+ orion web --no-open --port 0 # choose an ephemeral loopback port
145
+ orion web --cwd /path/to/repo # start against another existing workspace
109
146
  orion -p "explain this repo" # experimental non-interactive mode
110
147
  orion -p --output-format json "run the focused tests"
111
148
  orion diff
@@ -115,6 +152,41 @@ orion commit
115
152
  Experimental non-interactive print mode is available through `orion -p`; keep it out of
116
153
  interactive workflows that require confirmations or live steering.
117
154
 
155
+ ### Local Web Workbench
156
+
157
+ `orion web` serves the packaged client and `/api/v1/*` from one loopback origin. It does not expose
158
+ a LAN bind. Configure provider credentials with the normal Orion config/environment flow, then use
159
+ the browser to select a workspace and session, run or steer work, answer approvals, and inspect
160
+ runtime state. Closing or refreshing a tab leaves pending approvals owned by the runtime; stopping
161
+ the host aborts them fail-closed.
162
+
163
+ The browser exposes Plan receipts exactly as committed (`body`, `returnMode`, `digest`). It does not
164
+ insert an extra review gate: after PLAN commits, the existing runtime restores BUILD/AUTO and starts
165
+ implementation in a separate logical turn.
166
+
167
+ The project navigator does not create multiple runtimes. Cross-project Session selection is one
168
+ atomic, revision-guarded Context transition. The right dock is 320–720px on desktop and is adjusted
169
+ with an IDE-style mouse drag; there is no keyboard fine-resize control. Narrow layouts use drawers
170
+ without overwriting the saved desktop width. Files, Git and Review are read-only; terminal creation
171
+ requires an explicit gesture and its short-lived ticket and output never enter the Workbench SSE.
172
+
173
+ #### Host-managed Settings
174
+
175
+ The Settings dialog reads from the active Host rather than treating browser storage as a second
176
+ configuration source. Theme and reduced-motion preferences persist across refreshes, ports and Host
177
+ restarts. The default model applies to newly created sessions; changing the current session remains
178
+ an explicit `/model` or session-control action. Effort is the active workspace's project default,
179
+ with a session override taking precedence. Tool confirmation is global, may be changed only while
180
+ the Runtime is idle and applies at the next logical request; `allow` never bypasses hard policy,
181
+ sandbox or workspace containment.
182
+
183
+ Every save is one atomic compare-and-swap batch. A concurrent tab or external `orion.json` edit is
184
+ shown as a conflict without discarding the draft. Invalid external JSON preserves the last-good
185
+ Runtime configuration and is never overwritten by the Web UI. Provider credentials remain outside
186
+ the Web API: Settings exposes readiness only and its local configuration action accepts no path.
187
+ See the [Settings migration guide](docs/migration/v0.2.2-to-v0.3.0-settings.md) for precedence,
188
+ legacy appearance import and rollback details.
189
+
118
190
  ### BUILD, PLAN, AUTO
119
191
 
120
192
  Press `Shift+Tab` to cycle `BUILD → PLAN → AUTO`. The status bar and input border show the current
@@ -190,12 +262,15 @@ npm run bench:harness:baseline
190
262
  npm run bench:harness
191
263
  npm run bench:harness:compare -- <baseline.json> <candidate.json>
192
264
  npm run prepublishOnly
265
+ npm run test:web-e2e -- --grep @settings
193
266
  ```
194
267
 
195
268
  Release qualification additionally builds one exact tarball and installs that unchanged hash on
196
- Node 20/22/24 for package identity, native SQLite, TUI, terminal, print, Goal, subagent, Skill, MCP,
197
- Compact, and resume journeys. See the
198
- [`v0.2.0 release checklist`](docs/plan/v0.2.0-release-checklist.md).
269
+ Node 22/24/26 for package identity, native SQLite, TUI, terminal, print, Web, Goal, subagent, Skill,
270
+ MCP, Compact, and resume journeys. WEB31-P0-01..12 additionally qualify the multi-project shell,
271
+ read-only engineering panels, real PTY and responsive/accessibility contract. See the
272
+ [`v0.3.1 Web Workbench plan`](docs/plan/v0.3.1-web-workbench-professional-shell-plan.md) and
273
+ [`v0.3.1 E2E qualification plan`](docs/test/v0.3.1-web-workbench-e2e-plan.md).
199
274
 
200
275
  ## Security
201
276
 
package/README.zh-CN.md CHANGED
@@ -1,13 +1,42 @@
1
1
  # Orion Code
2
2
 
3
- 面向终端的目标驱动 Coding Agent。
4
-
5
- > v0.2.2:让 Thread 会话恢复具备单会话故障隔离,安全恢复中断的工具历史,并确保窄终端
6
- > 始终可见 Goal 已用 token
7
-
8
- [English](README.md) · [架构主计划](docs/plan/v0.2.0-dsh-harness-redesign-plan.md) ·
9
- [迁移指南](docs/migration/v0.1.9-to-v0.2.0.md) ·
10
- [准出清单](docs/plan/v0.2.0-release-checklist.md)
3
+ 面向终端与浏览器、本地优先的目标驱动 Coding Agent。
4
+
5
+ > v0.3.1 候选版本:一套 Orion Runtime,同时提供本地 Web Workbench 与既有 TUI/terminal。
6
+ > Candidate 源码不代表已经创建 npm 发布或 Git tag
7
+
8
+ [English](README.md) ·
9
+ [v0.3.1 专业工作台方案](docs/plan/v0.3.1-web-workbench-professional-shell-plan.md) ·
10
+ [v0.3.1 Web API](docs/architecture/v0.3.1-web-api.yaml) ·
11
+ [v0.3.1 E2E 方案](docs/test/v0.3.1-web-workbench-e2e-plan.md) ·
12
+ [v0.3.1 迁移](docs/migration/v0.3.0-to-v0.3.1.md) ·
13
+ [v0.3.0 Web 方案](docs/plan/v0.3.0-web-workbench-plan.md) ·
14
+ [Settings 方案](docs/plan/v0.3.0-settings-integration-plan.md) ·
15
+ [Node 兼容方案](docs/plan/v0.3.0-node-runtime-compatibility-plan.md) ·
16
+ [Web API](docs/architecture/v0.3.0-web-api.yaml) ·
17
+ [迁移指南](docs/migration/v0.2.2-to-v0.3.0.md) ·
18
+ [Settings 迁移](docs/migration/v0.2.2-to-v0.3.0-settings.md) ·
19
+ [真实状态图册](docs/assets/screenshots/v0.3.0-web/README.md)
20
+
21
+ ## v0.3.1 包含什么
22
+
23
+ - **一个 Runtime、两个交互界面。** `orion web` 与终端产品共用 product bootstrap、
24
+ AgentRuntimeController、Session/Thread、ToolGateway、审批、Goal、Plan、Skills 和 MCP;浏览器不另起
25
+ 一套 agent loop。
26
+ - **可恢复的 Web 工作台。** React 界面覆盖工作区/会话、对话与工具活动、BUILD/PLAN/AUTO、follow-up、
27
+ interrupt、审批、Goal/Plan、模型/effort、Skills/MCP 和诊断。快照与 cursor replay 负责刷新和 SSE
28
+ 重连恢复。
29
+ - **专业项目工作台。** 左侧展示已注册项目并懒加载 Session,中间仍是唯一 Agent 会话。右侧可变宽面板
30
+ 提供 Agent、审阅、终端、文件和 Git;文件/Git/审阅是有界只读投影,终端是显式启动、与 Session
31
+ history 和 SSE 隔离的临时真实 PTY。
32
+ - **本地安全边界。** Host 只绑定 `127.0.0.1`;写请求必须携带精确 Origin、进程 nonce、JSON body 和
33
+ 幂等键。响应设置严格 CSP,浏览器 payload 经过脱敏,大型工具结果按字节分页读取。
34
+ - **Host 管理的 Settings。** 外观、默认模型、工作区 Effort 与全局工具确认策略统一进入严格、带
35
+ revision 的 `orion.json` Coordinator。原子批量保存、文件锁内 CAS、外部编辑 invalidation、
36
+ last-good 恢复与明确的来源/作用域/生效时机,让浏览器、slash 命令、TUI 与 Runtime 使用同一持久真相。
37
+ - **有边界地参考 DSH。** 方案基于固定 DeepSeek Harness revision 做了源码审计。DSH Web 实际使用
38
+ POST 加两条下行 WebSocket;Orion 有意选择 JSON HTTP 加一条可 replay 的 SSE,同时保留 Orion 的
39
+ Model/Skills/MCP 边界。
11
40
 
12
41
  ## v0.2.0 带来了什么
13
42
 
@@ -39,12 +68,13 @@ MCP 仍是用户可见的扩展边界。
39
68
 
40
69
  ## 安装
41
70
 
42
- 支持 Node.js 20、2224
71
+ 支持 Node.js 22.12+、24 和 26。生产环境建议使用 Node 24 LTS,当前开发环境也支持 Node 26
72
+ Current。Node 20 已结束上游维护,不再属于 v0.3 Runtime 合同。
43
73
 
44
- 安装已发布的 `0.2.2` 版本:
74
+ npm 已存在不可变的 `0.3.1` 发布凭据后:
45
75
 
46
76
  ```bash
47
- npm install -g @orion-agents/orion-code@0.2.2
77
+ npm install -g @orion-agents/orion-code@0.3.1
48
78
  orion --version
49
79
  orion doctor
50
80
  ```
@@ -101,6 +131,9 @@ Orion 读取 `~/.orion-code/orion.json`。可从
101
131
  ```bash
102
132
  orion # 默认产品 TUI
103
133
  orion --ui terminal # 技术诊断 terminal fallback
134
+ orion web # 启动本地 Web Workbench 并打开浏览器
135
+ orion web --no-open --port 0 # 使用操作系统分配的 loopback 端口
136
+ orion web --cwd /path/to/repo # 指定另一个已存在工作区
104
137
  orion -p "解释这个仓库" # 实验性的非交互模式
105
138
  orion -p --output-format json "运行 focused tests"
106
139
  orion diff
@@ -109,6 +142,33 @@ orion commit
109
142
 
110
143
  `orion -p` 是早期实验性的非交互入口;需要确认弹层或实时 steering 的任务应使用 TUI。
111
144
 
145
+ ### 本地 Web Workbench
146
+
147
+ `orion web` 在同一个 loopback origin 提供打包后的客户端与 `/api/v1/*`,v0.3.1 不提供 LAN bind。
148
+ Provider 凭据仍通过 Orion 配置/环境变量管理;浏览器负责选择工作区和会话、执行或 steer 任务、回答
149
+ 审批并查看运行态。关闭或刷新 tab 不会替用户批准/拒绝,pending approval 仍由 Runtime 持有;停止
150
+ Host 时会 abort 并 fail-closed。
151
+
152
+ 浏览器只展示已提交 Plan receipt 的 `body`、`returnMode`、`digest`,不会额外插入 review gate。
153
+ PLAN 提交后仍由既有 Runtime 恢复 BUILD/AUTO,并在新的 logical turn 中启动实现。
154
+
155
+ 多项目导航不会创建多个 Runtime;跨项目 Session 选择是一次带 revision guard 的原子 Context 切换。
156
+ 桌面右栏可用 IDE 式鼠标拖动在 320–720px 间调整,不提供键盘精细调宽;窄屏自动使用 drawer,且不覆盖
157
+ 桌面宽度偏好。文件、Git 和审阅保持只读;创建终端需要显式 user gesture,短期 ticket 与输出均不进入
158
+ Workbench SSE。
159
+
160
+ #### Host 管理的 Settings
161
+
162
+ Settings dialog 从当前 Host 读取设置,不把浏览器存储当成第二配置真源。主题和减少动效会跨刷新、端口
163
+ 和 Host 重启保留;默认模型只影响新建 Session,当前 Session 仍通过 `/model` 或会话控制显式切换;
164
+ Effort 是当前 workspace 的 project default,Session override 优先;工具确认是全局策略,只能在 Runtime
165
+ idle 时保存,并从下一个 logical request 生效。`allow` 不会绕过 hard policy、sandbox 或工作区边界。
166
+
167
+ 每次保存都是一次原子 CAS batch。并发标签页或外部 `orion.json` 编辑会显示冲突但保留草稿;非法 JSON
168
+ 只会让页面进入 invalid 状态,Runtime 继续使用 last-good,Web 绝不覆盖坏文件。Provider 凭据不会进入
169
+ Web API,页面只显示 readiness,打开本地配置文件的动作也不接受 path。优先级、旧 appearance 一次迁移
170
+ 和回滚方法见 [Settings 迁移说明](docs/migration/v0.2.2-to-v0.3.0-settings.md)。
171
+
112
172
  ### BUILD、PLAN、AUTO
113
173
 
114
174
  按 `Shift+Tab` 循环 `BUILD → PLAN → AUTO`。状态栏和输入框边框会显示当前模式。Mode 决定工作流,
@@ -179,11 +239,14 @@ npm run bench:harness:baseline
179
239
  npm run bench:harness
180
240
  npm run bench:harness:compare -- <baseline.json> <candidate.json>
181
241
  npm run prepublishOnly
242
+ npm run test:web-e2e -- --grep @settings
182
243
  ```
183
244
 
184
- 正式准出还会只构建一次 exact tarball,并在 Node 20/22/24 安装同一个 hash,验证 package identity、
185
- native SQLite、TUI、terminal、print、Goal、subagent、Skill、MCP、Compact 与 resume。详见
186
- [`v0.2.0 准出清单`](docs/plan/v0.2.0-release-checklist.md)。
245
+ 正式准出还会只构建一次 exact tarball,并在 Node 22/24/26 安装同一个 hash,验证 package identity、
246
+ native SQLite、TUI、terminal、print、Web、Goal、subagent、Skill、MCP、Compact 与 resume
247
+ WEB31-P0-01..12 还会验证多项目工作台、只读工程面板、真实 PTY、响应式与无障碍合同。详见
248
+ [`v0.3.1 Web Workbench 方案`](docs/plan/v0.3.1-web-workbench-professional-shell-plan.md)与
249
+ [`v0.3.1 E2E 资格计划`](docs/test/v0.3.1-web-workbench-e2e-plan.md)。
187
250
 
188
251
  ## 安全
189
252
 
package/bin/orion CHANGED
@@ -4,6 +4,16 @@ const path = require('path');
4
4
  const os = require('os');
5
5
  const fs = require('fs');
6
6
 
7
+ const [nodeMajor, nodeMinor] = process.versions.node.split('.').map(Number);
8
+ const supportedNodeRuntime =
9
+ (nodeMajor === 22 && nodeMinor >= 12) || nodeMajor === 24 || nodeMajor === 26;
10
+ if (!supportedNodeRuntime) {
11
+ console.error(
12
+ `Orion Code requires Node.js 22.12+, 24, or 26; current runtime is ${process.versions.node}.`
13
+ );
14
+ process.exit(1);
15
+ }
16
+
7
17
  // ============================================================================
8
18
  // Multi-path .env loading
9
19
  //
@@ -22,22 +32,23 @@ function loadEnvFile(filePath) {
22
32
  }
23
33
 
24
34
  const envFilesLoaded = [];
35
+ const loadConfiguredEnvFiles = process.env.ORION_CODE_DISABLE_ENV_FILES !== '1';
25
36
 
26
37
  // 1. Global config: ~/.orion-code.env
27
38
  const globalEnv = path.join(os.homedir(), '.orion-code.env');
28
- if (loadEnvFile(globalEnv)) {
39
+ if (loadConfiguredEnvFiles && loadEnvFile(globalEnv)) {
29
40
  envFilesLoaded.push(globalEnv);
30
41
  }
31
42
 
32
43
  // 2. Current working directory: ./.env
33
44
  const localEnv = path.join(process.cwd(), '.env');
34
- if (loadEnvFile(localEnv)) {
45
+ if (loadConfiguredEnvFiles && loadEnvFile(localEnv)) {
35
46
  envFilesLoaded.push(localEnv);
36
47
  }
37
48
 
38
49
  // 3. Package directory (development fallback)
39
50
  const packageEnv = path.join(__dirname, '..', '.env');
40
- if (loadEnvFile(packageEnv)) {
51
+ if (loadConfiguredEnvFiles && loadEnvFile(packageEnv)) {
41
52
  envFilesLoaded.push(packageEnv);
42
53
  }
43
54
 
@@ -53,4 +64,4 @@ if (fs.existsSync(distCli)) {
53
64
  } else {
54
65
  require('ts-node').register({ transpileOnly: true });
55
66
  require(srcCli);
56
- }
67
+ }