@kodax-ai/kodax 0.7.96-alpha.5 → 0.7.96-alpha.7

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 (64) hide show
  1. package/CHANGELOG.md +120 -6
  2. package/README.md +62 -29
  3. package/README_CN.md +44 -19
  4. package/config-templates/config.example.jsonc +3 -2
  5. package/config-templates/integrations/a2a.example.jsonc +1 -1
  6. package/dist/chunks/{agent-GP3D2GIO.js → agent-SV3OH5VR.js} +1 -1
  7. package/dist/chunks/argument-completer-TTUEXPZ4.js +2 -0
  8. package/dist/chunks/{chunk-XLGV3VYH.js → chunk-2O2HZCBH.js} +4 -4
  9. package/dist/chunks/{chunk-HU4D77XX.js → chunk-4IH2OTLC.js} +124 -124
  10. package/dist/chunks/{chunk-SQ2WYU4S.js → chunk-52FEJJMH.js} +6 -5
  11. package/dist/chunks/chunk-5XD3D47Z.js +429 -0
  12. package/dist/chunks/{chunk-RTRW6PV5.js → chunk-BRZO5ZGS.js} +1 -1
  13. package/dist/chunks/{chunk-HX4OOCAU.js → chunk-IDEPSEPH.js} +2 -2
  14. package/dist/chunks/{chunk-YDY5LRJO.js → chunk-N5VUIPXE.js} +3 -3
  15. package/dist/chunks/{chunk-FNMPDPVC.js → chunk-RNJPYIXJ.js} +151 -151
  16. package/dist/chunks/{chunk-QJDMUT2B.js → chunk-UQJOGEDC.js} +1 -1
  17. package/dist/chunks/{chunk-UR4J2NED.js → chunk-UTUAC7YQ.js} +1 -1
  18. package/dist/chunks/{chunk-WMQJXU64.js → chunk-W4QOFCVD.js} +1 -1
  19. package/dist/chunks/{chunk-5FOWMS7M.js → chunk-YYPZCZ6O.js} +1 -1
  20. package/dist/chunks/{chunk-4ZAZ4SH5.js → chunk-Z64NI33Q.js} +4 -4
  21. package/dist/chunks/{chunk-BHWBUZBD.js → chunk-ZXNXMFXJ.js} +225 -225
  22. package/dist/chunks/{construction-bootstrap-SG5L6OCS.js → construction-bootstrap-3ITEEWHD.js} +1 -1
  23. package/dist/chunks/{dist-PYEKR2S3.js → dist-QSSK3PCI.js} +1 -1
  24. package/dist/chunks/{host-GRKFTUKW.js → host-4QGM5DQ7.js} +1 -1
  25. package/dist/chunks/{run-manager-X45YHVKB.js → run-manager-CVR6JPLK.js} +1 -1
  26. package/dist/chunks/{utils-I2YFOHMD.js → utils-GYD2CE2X.js} +1 -1
  27. package/dist/index.d.ts +8 -8
  28. package/dist/index.js +3 -3
  29. package/dist/kodax_bootstrap.js +1 -1
  30. package/dist/kodax_cli.js +1319 -1313
  31. package/dist/kodax_resume.js +34 -34
  32. package/dist/native/win32-x64/kodax-windows-sandbox.exe +0 -0
  33. package/dist/native/win32-x64/kodax-windows-text-transaction.node +0 -0
  34. package/dist/native/win32-x64/manifest.json +3 -3
  35. package/dist/runtime-worker.js +1033 -1032
  36. package/dist/sandbox-network-broker.js +26 -26
  37. package/dist/sdk-a2a.d.ts +5 -5
  38. package/dist/sdk-a2a.js +1 -1
  39. package/dist/sdk-coding.d.ts +7 -7
  40. package/dist/sdk-coding.js +1 -1
  41. package/dist/sdk-repl.d.ts +11 -11
  42. package/dist/sdk-repl.js +1 -1
  43. package/dist/sdk-runtime.d.ts +7 -7
  44. package/dist/sdk-runtime.js +1 -1
  45. package/dist/sdk-sandbox.d.ts +7 -5
  46. package/dist/sdk-sandbox.js +1 -1
  47. package/dist/sdk-session.d.ts +3 -3
  48. package/dist/sdk-session.js +1 -1
  49. package/dist/types-chunks/{bash-prefix-extractor.d-BTtOwURv.d.ts → bash-prefix-extractor.d-C_D7FK95.d.ts} +9 -3
  50. package/dist/types-chunks/{exec-policy.d-BmCh781R.d.ts → exec-policy.d-D5a3OUjN.d.ts} +2 -2
  51. package/dist/types-chunks/{public-api.d-CDi5pl3J.d.ts → public-api.d-WT1wNQz9.d.ts} +2 -2
  52. package/dist/types-chunks/{sdk-session-81v92FoH.d.ts → sdk-session-D5fn3-IW.d.ts} +1 -1
  53. package/dist/types-chunks/{shell-command-sets.d-BhDcCxHV.d.ts → shell-command-sets.d-PnzbcF4X.d.ts} +1 -1
  54. package/dist/types-chunks/{trusted-repl-entry-emywa-G-.d.ts → trusted-repl-entry-BLTJoxdD.d.ts} +4 -4
  55. package/dist/types-chunks/{types.d-DWdhYXli.d.ts → types.d-Duj2w9bT.d.ts} +1 -1
  56. package/dist/types-chunks/{utils.d-i32RW7bL.d.ts → utils.d-thZMKPNO.d.ts} +3 -3
  57. package/package.json +1 -1
  58. package/public_docs/README.md +6 -5
  59. package/public_docs/configuration/permissions.md +11 -7
  60. package/public_docs/configuration/sandbox.md +69 -30
  61. package/public_docs/getting-started/installation.md +10 -6
  62. package/public_docs/sdk/embedder-guide.md +86 -56
  63. package/dist/chunks/argument-completer-EV3ZTYFX.js +0 -2
  64. package/dist/chunks/chunk-YBWUVOMB.js +0 -429
package/CHANGELOG.md CHANGED
@@ -4,6 +4,119 @@ All notable changes to this project will be documented in this file.
4
4
 
5
5
  > Full history for versions prior to v0.7.0: [CHANGELOG_ARCHIVE.md](docs/CHANGELOG_ARCHIVE.md)
6
6
 
7
+ ## [Unreleased]
8
+
9
+ ## [0.7.96-alpha.7] - 2026-09-03
10
+
11
+ ### Fixed
12
+
13
+ - Clarified the sandbox diagnostic boundary across the CLI, setup guide,
14
+ `kodax_manual`, and public documentation: run `kodax sandbox doctor` directly
15
+ in a host terminal or use `/sandbox` inside the REPL, rather than invoking the
16
+ host control-plane doctor through the sandbox-first Bash tool. This prevents a
17
+ healthy Windows sandbox from being misreported when its restricted account is
18
+ correctly denied access to host-owned ASRT state; shell routing and sandbox
19
+ permissions are unchanged.
20
+ - Added cold-start self-healing for stale Windows sandbox setup generations.
21
+ A bare interactive CLI startup, including `kodax -r`, now checks the
22
+ installed generation before creating the REPL Runtime and reuses the existing
23
+ setup-only UAC boundary when migration is required. Concurrent startups
24
+ converge on one setup operation; followers recheck the completed generation
25
+ instead of installing again. Current state stays silent, and print-mode,
26
+ daemon, SDK, and ordinary tool execution never elevate automatically or wait
27
+ on the setup lock. A current marker now takes the same coarse fast path as
28
+ Codex; when recovery is actually required, the unchanged setup operation runs
29
+ in a child process while `kodax -r` and new-session startup display a live
30
+ elapsed-time indicator instead of freezing the last picker frame.
31
+ - Require the setup/onboarding boundary to complete one no-side-effect native
32
+ target-start/exit probe before reporting Windows sandbox recovery as ready.
33
+ The released setup-generation-9 marker migrates in place to generation 10,
34
+ retaining a healthy account SID and filesystem capability nonce. This closes
35
+ the state where verify-only metadata looked ready while real Bash still fell
36
+ back to host execution, without adding a command-path lock, queue, or retry.
37
+
38
+ ## [0.7.96-alpha.6] - 2026-09-02
39
+
40
+ ### Fixed
41
+
42
+ - Aligned the universal npm release audit with Windows native shell protocol
43
+ 10. The release workflow now validates the same manifest contract emitted by
44
+ `build:native`, so a valid protocol-10 Windows artifact is not rejected as an
45
+ incompatible protocol-9 package during GitHub pre-release assembly.
46
+ - Current native protocol 10 keeps isolated Skill Script execution POSIX-only
47
+ on Windows because per-command denyRead remains unsupported.
48
+ - Moved broad Windows profile-root ACL convergence fully into versioned setup.
49
+ Protocol/setup generation 10 marks those roots as setup-owned; ordinary
50
+ admission only verifies their stable capability ACEs and returns a typed
51
+ setup-required error when one is missing. Command-specific small roots retain
52
+ additive convergence. This removes recursive `AppData` DACL propagation from
53
+ target start without adding a lock, queue, per-root timeout, or command retry.
54
+ - Expanded the existing ASRT Windows proxy range to 64 ports and removed KodaX's
55
+ process-local broker-capacity/idle-eviction gate. Up to 32 exact network
56
+ authorities now rely on OS bind arbitration across Runtime processes; broker
57
+ pooling, reference ownership, and bounded idle cleanup remain unchanged.
58
+ - Made explicit CLI and public SDK sandbox doctor execute one no-side-effect
59
+ identity probe with host fallback disabled. `ready: true` now proves a real
60
+ target start and successful exit, while internal startup/admission readiness
61
+ remains verify-only. The explicit probe can republish a missing exact-hash
62
+ native cache object from its pinned packaged bytes, but never runs setup or
63
+ repairs ACL policy. Native request diagnostics retain protocol, setup/broker
64
+ generation, artifact hashes, failure phase, and final sandbox failure evidence.
65
+ - Kept unlowerable nested shell commands opaque, matching Codex's host-policy
66
+ boundary. Recognized `cmd` and PowerShell forms are still recursively checked,
67
+ explicit outer/interpreter rules still apply, and concrete critical effects
68
+ remain fail-closed. Command complexity never changes sandbox selection: these
69
+ calls remain sandbox-first, and parser uncertainty is considered by Edits or
70
+ Auto[LLM] only after a genuine sandbox pre-start failure reaches the host
71
+ boundary instead of becoming a synthetic non-overridable forbid.
72
+ - Pinned every loaded embedded Windows native manifest to its exact immutable
73
+ protected-cache generation. A long-lived npm-linked CLI or SDK process now
74
+ reuses the already verified executable for its embedded hash before consulting
75
+ a mutable rebuilt `dist/native` source, so overlapping builds cannot mix a
76
+ TypeScript host with another native evidence generation. A genuinely new hash
77
+ is still published atomically, without a command lock, queue, or retry loop.
78
+ - Stopped per-command Windows cleanup from deleting the shared private-Temp
79
+ parent. The native command's lifecycle/Job-drain result is now authoritative
80
+ before its unique Temp leaf is removed; a bounded leaf cleanup failure emits
81
+ a diagnostic instead of turning an already proven exit into a Tool Error.
82
+ This fixes the intermittent `rmdir ...\\kodax-sandbox\\<root>: EPERM` seen
83
+ under concurrent packaged Electron smoke without adding a lock, queue, or
84
+ command replay.
85
+ - Removed the two remaining Codex-alignment gaps that could make Bash unusable.
86
+ Windows roots use stable read/write/deny capability ACEs, while each command
87
+ token activates only its authorized capabilities. Setup owns broad profile
88
+ grants; admission accepts already-effective setup grants read-only and never
89
+ downgrades or clears a capability installed for another command. Windows
90
+ shell `%TEMP%`/`%TMP%`/`%TMPDIR%` now point to one empty private directory per
91
+ command under the system temporary directory, so ordinary admission never
92
+ recursively rewrites the shared system Temp/AppData tree. No lock, queue, or
93
+ command retry was added.
94
+ - Restored SDK/daemon host-boundary fallback by forwarding
95
+ `authorizeShellHostExecution` through the Coding tool-execution context. A
96
+ cleanup-proven pre-start sandbox failure can therefore reach the existing
97
+ Auto[LLM]/Exec Policy decision instead of stopping at the misleading
98
+ "requires a new permission decision" message.
99
+ - Advanced the Windows SDK/daemon sandbox contract to `sandboxRuntime:11`.
100
+ An idle same-version daemon from an earlier npm-link build is now replaced
101
+ through the existing authenticated upgrade path instead of silently reusing
102
+ its older admission behavior; busy daemons remain fail-closed and untouched.
103
+ - Retire a shared Windows network-broker generation when a started native host
104
+ proves runner/controller-path loss. Existing holders remain untouched, while
105
+ the next command creates a fresh generation instead of reusing a controller
106
+ that is already exiting and waiting for target-start attestation to time out.
107
+ - Preserved terminal input across bare `kodax -r` session selection in the
108
+ compiled Bun/Windows release. A successful picker hands raw-mode ownership to
109
+ the next owned renderer; cancellation, preparation failure, classic REPL, and
110
+ final terminal cleanup retain their existing behavior.
111
+ - Closed two portable Bash lifecycle gaps without adding a command lock or
112
+ retry loop. Broker-control close/error/overflow now still runs the prepared
113
+ request cleanup before reporting failure, and background execution is not
114
+ reported as started until the wrapper has an OS PID; asynchronous spawn
115
+ rejection therefore cannot return `PID: undefined` or leak prepared state.
116
+ Process settlement and output capture are attached immediately after spawn,
117
+ so a fast target that exits during start attestation cannot lose its output,
118
+ completion footer, or request cleanup.
119
+
7
120
  ## [0.7.96-alpha.5] - 2026-09-01
8
121
 
9
122
  ### Fixed
@@ -57,7 +170,6 @@ All notable changes to this project will be documented in this file.
57
170
  ticket but before its revision CAS. One authenticated follower resumes that
58
171
  exact durable ticket after detaching while the first client and any other
59
172
  followers only observe the owner change; active or untrusted work remains untouched.
60
-
61
173
  ## [0.7.96-alpha.4] - 2026-08-30
62
174
 
63
175
  ### Changed
@@ -101,11 +213,12 @@ All notable changes to this project will be documented in this file.
101
213
  - Removed the shell-tool fallback that could execute unsandboxed after native
102
214
  sandbox bootstrap and termination both failed. The boundary is now explicit,
103
215
  policy-reviewed, and single-attempt.
104
- - Closed administrator Exec Policy bypasses through nested Windows shells.
216
+ - Closed administrator Exec Policy bypasses through recognized nested Windows shells.
105
217
  `cmd /C` and `/K`, PowerShell command selectors/abbreviations, and strict
106
- UTF-16LE `EncodedCommand` payloads are recursively evaluated; invalid or
107
- policy-opaque nested execution fails closed where an administrator forbid
108
- must remain absolute.
218
+ UTF-16LE `EncodedCommand` payloads are recursively evaluated. Unlowerable
219
+ bodies remain opaque full-argv operations for exact outer policy and the
220
+ normal Edits/Auto[LLM] boundary; only explicit matched forbids and concrete
221
+ critical effects are non-bypassable.
109
222
  - Corrected the Windows shell concurrency regression at its setup/admission
110
223
  boundary. Protocol 9/setup generation 9 removes every machine-global ACL
111
224
  mutex from ordinary admission. Each canonical root receives one
@@ -123,7 +236,8 @@ All notable changes to this project will be documented in this file.
123
236
  converges NUL compatibility plus profile read capabilities. The caller
124
237
  publishes the ready marker only after the parent succeeds. No helper or
125
238
  migration overlaps ordinary admission, system TMP is not prewarmed, and
126
- `sandboxRuntime` advances to `9`,
239
+ native protocol/setup advance to `9`, while the published Runtime capability
240
+ is `sandboxRuntime:10`;
127
241
  so a newly linked CLI replaces an idle daemon that still carries the setup-8
128
242
  ACL behavior and refuses a busy one instead of mixing generations.
129
243
  - Fixed first-launch policy construction when a custom `KODAX_HOME` is below the
package/README.md CHANGED
@@ -60,12 +60,15 @@ After setting the variable, close the current terminal, open a new one, and run
60
60
  KodaX opens the provider/model metadata setup. Use `kodax setup` to rerun the
61
61
  flow, `kodax setup --custom` for a guided custom provider, and
62
62
  `kodax setup --help` (or REPL `/setup --help`) for paths, provider variables,
63
- commands, and shortcuts. Interactive setup also checks the optional ASRT sandbox once:
64
- Windows requests UAC during activation (an existing v2 account rotation may
65
- require a second confirmation); macOS/Linux report any required
66
- Seatbelt/bubblewrap dependencies. Declining or missing a dependency does not
67
- break ordinary permission handling, and normal startup will not keep reminding
68
- you.
63
+ commands, and shortcuts. Interactive setup also checks the optional ASRT sandbox
64
+ once. On Windows, a bare interactive CLI startup checks the installed setup
65
+ generation before the REPL and uses the same UAC setup boundary to repair a
66
+ missing or stale generation; a healthy upgrade preserves the existing sandbox
67
+ SID. Current state stays silent, concurrent startups converge on one setup, and
68
+ ordinary tool calls never run setup or wait on its lock. Print-mode, daemon,
69
+ and SDK startup never trigger UAC automatically. macOS/Linux report any
70
+ required Seatbelt/bubblewrap dependencies. Declining or missing a dependency
71
+ does not break ordinary permission handling.
69
72
 
70
73
  > **No-Node target machines:** download a Bun-compiled single binary for Windows / macOS / Linux × x64 + arm64 from the [GitHub Releases](https://github.com/icetomoyo/KodaX/releases) page. See [docs/release.md](docs/release.md) for the build pipeline.
71
74
 
@@ -198,7 +201,11 @@ $env:ZHIPU_API_KEY="your_api_key"
198
201
 
199
202
  ### 2.1 Activate the optional sandbox
200
203
 
201
- `kodax setup` and first-run setup check sandbox readiness. You can inspect or
204
+ `kodax setup` and first-run setup check sandbox readiness. A bare interactive
205
+ Windows CLI startup (including `kodax -r`) also self-heals an absent or stale
206
+ setup generation before creating the REPL Runtime. A current generation uses a
207
+ marker-only fast path. If migration is needed, startup keeps a live elapsed-time
208
+ indicator visible while the existing setup operation runs. You can inspect or
202
209
  activate it explicitly:
203
210
 
204
211
  ```bash
@@ -206,8 +213,17 @@ kodax sandbox doctor
206
213
  kodax sandbox setup
207
214
  ```
208
215
 
216
+ Run these host control-plane commands directly in the user's terminal, not
217
+ through KodaX's Bash tool. Inside the REPL, use `/sandbox` for read-only
218
+ readiness diagnostics. On Windows, a doctor launched through Bash is contained
219
+ and cannot inspect the host-owned ASRT state database, so its nested result is
220
+ not the host readiness result.
221
+
209
222
  - Windows uses a restricted sandbox account and network policy. A normal
210
223
  terminal is sufficient; approve the activation UAC confirmation(s).
224
+ Concurrent interactive startups share only the existing setup lock: one
225
+ performs the repair, followers recheck its result, and shell commands remain
226
+ independent. Headless, print-mode, daemon, and SDK startup never open UAC.
211
227
  - macOS uses Seatbelt/`sandbox-exec` and requires ripgrep
212
228
  (`brew install ripgrep`).
213
229
  - Linux uses bubblewrap and requires `bubblewrap`, `socat`, and `ripgrep`
@@ -229,8 +245,10 @@ history. SDK embedders can use the same capability independently through
229
245
  Sandboxed shell commands inherit the host environment, including ordinary
230
246
  development credentials, and retain external network access. A fixed internal
231
247
  deny set removes KodaX/Electron execution-control variables. Writes remain
232
- bounded to the workspace and system temporary directory; broad host reads,
233
- including Agent Home and global Git configuration, are available.
248
+ bounded to the workspace and platform temporary roots. On Windows, each command
249
+ receives a private directory under the system temporary directory; `%TEMP%`,
250
+ `%TMP%`, and `%TMPDIR%` point to that directory.
251
+ Broad host reads, including Agent Home and global Git configuration, are available.
234
252
 
235
253
  For Qwen Token Plan, select `qwen-token-plan` and use its separate credential;
236
254
  `QWEN_API_KEY` does not authenticate this route:
@@ -556,7 +574,8 @@ sandbox completion is silent; only a proven pre-start boundary reaches Edits
556
574
  or Auto[LLM], and reviewer infrastructure failure blocks with a safer-route
557
575
  message after one retry. Workspace containment now permits broad host reads,
558
576
  including Agent Home, credential locations, and global Git configuration,
559
- while retaining workspace/system-TMP-only writes and external network. See the
577
+ while retaining workspace/platform-Temp writes (a private per-command Temp child
578
+ on Windows), plus external network. See the
560
579
  [v0.7.96 design](docs/features/v0.7.96.md#feature_297-codex-aligned-permission-profiles-sandbox-escalation-and-exec-policy),
561
580
  [ADR-069](docs/ADR.md#adr-069-sandbox-success-is-authority-while-host-escalation-is-a-separate-policy-boundary),
562
581
  and the [SDK permission guide](public_docs/sdk/embedder-guide.md#24-runtime-owned-permission-routing-and-plan-bridges-v0796).
@@ -740,7 +759,7 @@ permission UI, and recovers stale prepared Session tails through an
740
759
  authoritative merge. Background persistence failures are surfaced as
741
760
  diagnostics rather than hidden.
742
761
 
743
- **v0.7.96-alpha.5 release:** Windows shell admission now follows the
762
+ **v0.7.96-alpha.7 release:** Windows shell admission now follows the
744
763
  Codex concurrency boundary: versioned setup performs legacy migration once,
745
764
  while ordinary admission accepts effective inherited normal-token access and
746
765
  only converges a missing exact-root restricted capability using `SET_ACCESS`
@@ -754,21 +773,33 @@ No command-lifetime or machine-global filesystem coordinator is shared
754
773
  by Bash, trusted text, worktrees, Sessions, or Runtime processes. Every native
755
774
  command has an independent request, token, control channel, and Job; matching
756
775
  network authorities share a bounded broker pool without serializing command
757
- lifetime. Protocol 9/setup generation 9 holds the protected setup marker until
776
+ lifetime. Protocol 10/setup generation 10 holds the protected setup marker until
758
777
  durable target `Started`, reuses a healthy fixed sandbox account across setup
759
- versions, and upgrades generation-8 installations in place without replaying
760
- legacy ACL cleanup. Generation 8 remains the proof boundary for the one-time
778
+ versions, and upgrades healthy generation-8 or released generation-9
779
+ installations in place without replaying legacy ACL cleanup. Generation 8
780
+ remains the proof boundary for the one-time
761
781
  legacy migration. Setup first publishes a protected non-ready `installing`
762
782
  marker; the elevated parent synchronously installs NUL compatibility and profile
763
783
  read capabilities, and only then does the caller atomically publish the ready
764
- marker. No helper or migration overlaps ordinary admission, and system TMP is
765
- not prewarmed. This release
766
- also creates its five fixed protected Agent Home directories before constructing
767
- a Windows policy when a custom `KODAX_HOME` sits below the system-TMP write
768
- grant; missing deny roots therefore cannot reject first launch, and no lock or
769
- ACL transaction is added. This release advertises `sandboxRuntime:9`, so a
770
- linked CLI cannot silently reuse a daemon that still runs the setup-8 ACL path. See the
771
- [v0.7.96-alpha.5 release checklist](docs/release.md#v0796-alpha5-release-preparation).
784
+ marker. No helper or migration overlaps ordinary admission, and the shared
785
+ system TMP root is not prewarmed or rewritten during command admission. Each
786
+ command instead receives an empty private Temp child. Setup converges broad
787
+ profile capabilities once; ordinary admission only verifies those roots and
788
+ converges command-specific small roots additively. The command token activates
789
+ only its authorized capabilities. This release advertises `sandboxRuntime:11`, so a
790
+ linked CLI cannot silently reuse a daemon that predates this admission and recovery contract.
791
+ Each loaded embedded native manifest also keeps its exact content-addressed
792
+ protected-cache generation across later `npm link` rebuilds; another build
793
+ cannot swap a long-lived process onto a mismatched native evidence schema.
794
+ Unlowerable nested shell bodies remain opaque for exact Exec Policy plus the
795
+ normal Edits/Auto[LLM] host boundary, rather than becoming a parser-generated
796
+ hard forbid. Alpha.7 also self-heals a stale Windows setup
797
+ generation before an interactive REPL starts, keeps current-marker startup on a
798
+ fast path, shows live elapsed time only while real recovery runs, and documents
799
+ that sandbox doctor is a host control-plane operation (`/sandbox` in the REPL or
800
+ `kodax sandbox doctor` directly in a user terminal). npm publication remains a
801
+ manual maintainer action. See the
802
+ [release checklist](docs/release.md#v0796-alpha7-release-preparation).
772
803
 
773
804
  **v0.7.96-alpha.3 release:** Provider credentials are lazy, scoped,
774
805
  revocable capabilities (ADR-068). The v2 credential broker keeps Provider
@@ -1054,8 +1085,9 @@ Runtime session, not by a UI hook. Edits and Auto try the sandbox first;
1054
1085
  sandbox completion is final, while only a proven pre-start host boundary reaches
1055
1086
  Exec Policy and the Edits user decision or Auto[LLM] reviewer. Auto review has
1056
1087
  fixed 90/180-second attempt bounds and never falls back to Rules, Edits, or an
1057
- automatic user prompt. Full Access skips sandbox and review but retains
1058
- administrator policy and critical-effect denial. Runtime permission prompts
1088
+ automatic user prompt. Full Access samples the profile once per Bash call and
1089
+ runs directly on the host without sandbox or approval prompts. Explicit
1090
+ forbidden rules and the Codex dangerous-command policy still block. Runtime permission prompts
1059
1091
  offer opaque, exact
1060
1092
  allow-once/session/persistent grant suggestions; persistent grants are
1061
1093
  daemon-owned and revisioned. Host plan exit is exposed only when the host
@@ -1305,7 +1337,7 @@ Agent, Skill, Extension-tool authority, workspace, tool-policy, or task-store
1305
1337
  changes require an explicit server restart. Managed
1306
1338
  A2A contexts default to `~/kodax_a2a_server_workspace/<runtime-profile>/contexts/`.
1307
1339
  Exact Skill scripts require the opt-in isolated policy and a passing
1308
- `kodax sandbox doctor`. On current native protocol 9 this isolated Skill Script
1340
+ `kodax sandbox doctor`. On current native protocol 10 this isolated Skill Script
1309
1341
  route is POSIX-only. Windows is unavailable because the route requires
1310
1342
  per-command `denyRead`, which the Windows `WRITE_RESTRICTED` backend rejects as
1311
1343
  `unsupported_policy`; `kodax sandbox setup` cannot enable it.
@@ -1566,14 +1598,14 @@ KodaX provides 4 permission profiles:
1566
1598
  | `plan` | Read-only planning mode | All modification tools blocked |
1567
1599
  | `accept-edits` | Sandbox-first edits; user decides an exact host boundary | Host-boundary operations |
1568
1600
  | `auto` | Sandbox-first execution; LLM reviews an exact host boundary | No automatic prompt; denied calls return a safer-route reason |
1569
- | `full-access` | Direct host execution without sandbox or Auto review | Explicit Exec Policy `prompt` only |
1601
+ | `full-access` | Direct host execution without sandbox or approval prompts | Never prompts; explicit forbidden/dangerous policy can block |
1570
1602
 
1571
1603
  ```bash
1572
1604
  # In REPL, use /mode command
1573
1605
  /mode plan # Switch to plan mode (read-only)
1574
1606
  /mode accept-edits # Switch to accept-edits mode
1575
1607
  /mode auto # Switch to Runtime-owned Auto Mode
1576
- /mode full-access # Direct host execution, still subject to Exec Policy
1608
+ /mode full-access # Direct host execution without sandbox or approvals
1577
1609
  /auto # Alias for auto
1578
1610
 
1579
1611
  # Check current mode
@@ -1594,8 +1626,9 @@ KodaX provides 4 permission profiles:
1594
1626
  - Shift-Tab cycles `Plan -> Edits -> Auto[LLM] -> Full Access`; Shift+Enter
1595
1627
  inserts a newline. Legacy `auto-in-project` and Auto[RULES] state normalize
1596
1628
  to Auto[LLM] and are never persisted again.
1597
- - Full Access skips sandbox and reviewer, but administrator forbids and the
1598
- narrow critical-effect fallback remain enforced. Use
1629
+ - Full Access skips sandbox and all approval paths. Explicit forbidden rules
1630
+ and the Codex dangerous-command policy remain enforced; an Exec Policy
1631
+ `prompt` rule is rejected under Never approval semantics. Use
1599
1632
  `kodax execpolicy check -- <command>` to inspect host policy without running it.
1600
1633
  - Runtime-backed prompts can offer exact `allow once`, `allow this session`,
1601
1634
  and `always allow` choices. Return the Runtime-issued opaque suggestion;
package/README_CN.md CHANGED
@@ -58,10 +58,12 @@ kodax
58
58
  provider/model 元数据设置。使用 `kodax setup` 重新运行设置,
59
59
  使用 `kodax setup --custom` 配置自定义 provider;使用 `kodax setup --help` 或
60
60
  REPL `/setup --help` 查看完整路径、环境变量、命令和快捷键。交互式 setup 还会检查
61
- 一次可选 ASRT sandbox:Windows 激活时会请求 UAC(已有安装进行 v2 账户 SID
62
- 轮换时可能需要第二次确认);
61
+ 一次可选 ASRT sandbox。Windows 裸交互 CLI 启动会在进入 REPL 前检查已安装 setup
62
+ generation;缺失或过期时复用同一条 setup 边界并按需请求 UAC,健康升级保留现有
63
+ sandbox SID。当前状态保持静默,并发启动只收敛到一次 setup,普通工具调用不执行
64
+ setup、也不等待 setup 锁;print 模式、daemon 与 SDK 启动绝不会自动弹 UAC。
63
65
  macOS/Linux 会报告 Seatbelt/bubblewrap 所需依赖。拒绝 UAC 或缺少依赖不会破坏普通
64
- 权限管理,日常启动也不会反复提醒。
66
+ 权限管理。
65
67
 
66
68
  > **不装 Node 的目标机器**:从 [GitHub Releases](https://github.com/icetomoyo/KodaX/releases) 拿 Bun 编译的单文件二进制(Win / macOS / Linux × x64 + arm64)。详见 [docs/release.md](docs/release.md)。
67
69
 
@@ -194,7 +196,8 @@ option,以及多余参数都会失败且不改变目录。目标位置是所
194
196
  成功完成时静默返回,只有可证明的启动前边界才进入 Edits 或 Auto[LLM];reviewer
195
197
  基础设施失败重试一次后阻断并提示更安全路线,不降级权限模式。Workspace
196
198
  containment 允许包括 Agent Home、凭据位置和全局 Git 配置在内的广泛宿主读取,仍只
197
- 允许 workspace/系统 TMP 写入,并保留外部网络。详见
199
+ 允许 workspace 与平台临时目录写入;Windows 使用系统 TMP 下的每命令私有目录,
200
+ POSIX 保留平台 canonical Temp 根与继承变量。外部网络继续可用。详见
198
201
  [v0.7.96 FEATURE_297](docs/features/v0.7.96.md#feature_297-codex-aligned-permission-profiles-sandbox-escalation-and-exec-policy)、
199
202
  [ADR-069](docs/ADR.md#adr-069-sandbox-success-is-authority-while-host-escalation-is-a-separate-policy-boundary) 和
200
203
  [SDK 权限指南](public_docs/sdk/embedder-guide.md#24-runtime-owned-permission-routing-and-plan-bridges-v0796)。
@@ -293,7 +296,7 @@ SDK 系统代码契约更新,但没有放宽 shell/sandbox 的 fail-closed 边
293
296
  `handleRuntimePermissionRequest()` 管理 SDK 权限 UI,并在 prepared Session 尾部遇到
294
297
  `data_changed` 时通过权威 delta 合并恢复;后台持久化失败会显示为诊断,不再静默丢失。
295
298
 
296
- **v0.7.96-alpha.5 发布**:Windows shell 准入现在遵循 Codex 的并发边界:
299
+ **v0.7.96-alpha.7 发布**:Windows shell 准入现在遵循 Codex 的并发边界:
297
300
  版本化 setup 只执行一次 legacy 迁移;普通准入在 capability 已存在时只读,只有缺失
298
301
  精确 root restricted capability 时才用 `SET_ACCESS` 与 DACL 回读收敛,且不等待任何
299
302
  跨进程目标互斥锁。稳定 filesystem capability SID 保留在对象上,每条命令的 token
@@ -302,20 +305,30 @@ SDK 系统代码契约更新,但没有放宽 shell/sandbox 的 fail-closed 边
302
305
  无法把 restricting SID 用于读权限;该字段继续保留跨平台 API 兼容。Bash、可信文本、worktree、
303
306
  Session 与 Runtime 进程之间不再共享命令生命周期或机器级 filesystem coordinator。
304
307
  每条 native 命令拥有独立 request、token、控制通道和 Job;相同网络权威使用有界
305
- broker pool,但不串行命令生命周期。protocol 9/setup generation 9 会把受保护 setup
308
+ broker pool,但不串行命令生命周期。protocol 10/setup generation 10 会把受保护 setup
306
309
  marker 持有到目标 `Started` 已持久化;setup 版本升级复用健康的固定沙箱账户与 SID,
307
- 已有 generation 8 安装会原地升级且不会重放 legacy ACL 清理;generation 8 继续仅作为
310
+ 健康的 generation 8 或已发布 generation 9 安装会原地升级且不会重放 legacy ACL 清理;generation 8 继续仅作为
308
311
  一次性 legacy 迁移的证明边界。setup 先发布受保护且不可执行的 `installing` marker;高权限
309
312
  父进程同步完成 NUL 兼容性与 profile 读 capability,调用方随后才原子发布 ready marker。
310
- 不存在与普通命令准入重叠的 helper 或迁移,也不预热系统 TMP。自定义 `KODAX_HOME` 位于系统 TMP
311
- 写入根下时,KodaX 会在构造 Windows 策略前仅创建五个固定的受保护内部目录,避免不存在的
312
- deny root 拒绝首次启动;该动作不增加锁、ACL 事务或命令生命周期协调。本版本广告
313
- `sandboxRuntime:9`,因此 npm link 后的新 CLI 不会静默复用仍运行 setup-8 ACL 路径的旧 daemon。
313
+ 不存在与普通命令准入重叠的 helper 或迁移,也不会在命令准入中预热或改写共享系统 TMP。
314
+ 每条命令会在系统临时目录下获得一个空的私有 Temp 子目录,`TEMP`/`TMP`/`TMPDIR` 均指向它;
315
+ 每个 canonical root 收敛相同的稳定 capability ACE 集合,由命令 token 只激活本次授权能力,
316
+ 且不会降级其他命令已有授权。
317
+ setup 一次性收敛宽泛 profile 根权限,普通命令只验证这些 setup-owned 根,并仅对命令特有的
318
+ 小根做幂等增量授权。该路径不增加锁、ACL 清场或命令生命周期协调。本版本广告
319
+ `sandboxRuntime:11`,因此 npm link 后的新 CLI 不会静默复用缺少本次准入与自愈契约的旧 daemon。
320
+ 已加载的 embedded native manifest 还会持续使用其精确内容哈希对应的受保护缓存代际;后续
321
+ `npm link` 重建不能让长生命周期进程切换到不匹配的 native 证据格式。无法可靠降低的嵌套
322
+ shell 内容保留为 opaque 完整 argv,由精确 Exec Policy 与正常 Edits/Auto[LLM] 宿主边界处理,
323
+ 不会仅因解析不确定就生成不可覆盖的硬拒绝。
314
324
  失败的 broker 代际会立即脱离复用但不会停止仍在运行的 holder,并继续计入固定端口容量直到进程
315
325
  实际关闭;启动/控制阶段各自以 15 秒为界,不会缩短命令执行 deadline。多个 npm-link/`kodax -r`
316
326
  客户端同时遇到空闲旧 daemon 时,会以认证临时身份选出一个替换者,其余客户端脱离后等待或续跑
317
- 同一精确 prepared ticket;忙碌或不可信的 daemon 仍保持不动并返回结构化边界。详见
318
- [v0.7.96-alpha.5 发布清单](docs/release.md#v0796-alpha5-release-preparation)。
327
+ 同一精确 prepared ticket;忙碌或不可信的 daemon 仍保持不动并返回结构化边界。alpha.7 还会在
328
+ 交互式 REPL 启动前自愈陈旧的 Windows setup generation;当前 marker 走快速路径,只有实际恢复
329
+ 才显示持续更新的等待时间。sandbox doctor 明确属于宿主控制面:REPL 内使用 `/sandbox`,或直接
330
+ 在用户终端运行 `kodax sandbox doctor`,不能通过 sandbox-first Bash 工具调用。npm 发布仍由
331
+ 维护者手动执行。详见 [v0.7.96-alpha.7 发布清单](docs/release.md#v0796-alpha7-release-preparation)。
319
332
 
320
333
  **v0.7.96-alpha.3 发布**:Provider 凭据成为惰性、受限、可撤销的能力(ADR-068)。v2
321
334
  credential broker 将 Provider 密钥保留在 OS keychain,按每次 wire call、为单一封闭
@@ -511,8 +524,10 @@ CLI 也会在配置的 deadline 被终止。详见
511
524
 
512
525
  **v0.7.96 权限契约:**权限档位统一为 `Plan -> Edits -> Auto[LLM] -> Full Access`。
513
526
  Edits 与 Auto 先尝试 sandbox;成功即静默完成,只有启动前拒绝或 backend 不可用
514
- 才在 Exec Policy 后进入用户/LLM 宿主边界。Full Access 不经过 sandbox 或 reviewer,
515
- 但仍受管理员 forbidden 与窄 critical-effect fallback 约束。旧 `auto-in-project`
527
+ 才在 Exec Policy 后进入用户/LLM 宿主边界。每次 Bash 调用只在入口读取一次权限档位;
528
+ Full Access 直接在宿主执行,不经过 sandbox、reviewer 或授权弹窗。显式 forbidden 规则
529
+ 与 Codex dangerous-command policy 仍可阻断,Exec Policy `prompt` 在 Never 语义下直接拒绝。
530
+ 旧 `auto-in-project`
516
531
  和 Auto[RULES] 状态只做读取兼容并归一到 Auto[LLM];`/auto-engine` 已移除。
517
532
  Reviewer 首次 90 秒,只有 timeout/provider/无效输出会再试一次 180 秒;普通失败
518
533
  或具体高风险判断都不会自动弹授权框,而是拒绝本次操作并给 Agent 更安全绕行提示。
@@ -636,15 +651,24 @@ $env:ZHIPU_API_KEY="your_api_key"
636
651
 
637
652
  ### 2.1 激活可选 sandbox
638
653
 
639
- `kodax setup` 与首次安装 setup 会检查 sandbox。也可以显式检查或激活:
654
+ `kodax setup` 与首次安装 setup 会检查 sandbox。Windows 裸交互 CLI 启动(包括
655
+ `kodax -r`)也会在创建 REPL Runtime 前自愈缺失或过期的 setup generation。当前
656
+ generation 只读取 marker 并立即通过;确需迁移时,启动界面会持续显示已等待时间,
657
+ 不会再把最后一帧 session picker 冻在屏幕上。也可以显式检查或激活:
640
658
 
641
659
  ```bash
642
660
  kodax sandbox doctor
643
661
  kodax sandbox setup
644
662
  ```
645
663
 
664
+ 这些宿主控制面命令应直接在用户终端中运行,不要通过 KodaX 的 Bash 工具调用。
665
+ 在 REPL 内请使用 `/sandbox` 做只读就绪诊断。Windows 上,通过 Bash 启动的 doctor
666
+ 自身也处于沙箱内,无法读取宿主持有的 ASRT 状态数据库;该嵌套结果不代表宿主就绪状态。
667
+
646
668
  - Windows 使用受限 sandbox 账户和网络策略。普通 Terminal 即可,按提示同意激活
647
- 所需的 UAC 确认;不必先以管理员身份启动 Terminal。
669
+ 所需的 UAC 确认;不必先以管理员身份启动 Terminal。并发交互启动只共享既有 setup 锁:
670
+ 一个进程修复,其他进程复查结果,shell 命令仍彼此独立。无头、print、daemon 和 SDK
671
+ 启动不会自动弹 UAC。
648
672
  - macOS 使用 Seatbelt/`sandbox-exec`,需要 ripgrep:
649
673
  `brew install ripgrep`。
650
674
  - Linux 使用 bubblewrap,需要 `bubblewrap`、`socat` 和 `ripgrep`,请根据发行版用
@@ -660,7 +684,8 @@ KodaX 不会自动运行 `sudo` 或系统包管理器。Edits 与 Auto[LLM] 会
660
684
  见 [SDK sandbox 指南](public_docs/sdk/embedder-guide.md#30-standalone-sandbox-sdk-v0778)。
661
685
 
662
686
  sandbox shell 默认继承宿主环境和普通开发凭据,并允许外部网络;固定的
663
- KodaX/Electron 执行控制变量仍会被移除。写入范围保持在 workspace 与系统 TMP,
687
+ KodaX/Electron 执行控制变量仍会被移除。写入范围保持在 workspace 与平台临时目录;
688
+ Windows 使用系统 TMP 下的每命令私有目录,POSIX 保留平台 canonical Temp 根与继承变量。
664
689
  宿主读取范围则包含 Agent Home、凭据位置和真实的全局 Git 配置。
665
690
 
666
691
  Qwen Token Plan 需要选择 `qwen-token-plan` 并使用单独的凭据;`QWEN_API_KEY`
@@ -1207,7 +1232,7 @@ A2A 配置迁移与历史任务 owner 迁移是两件事。如果升级 realm-aw
1207
1232
 
1208
1233
  托管 A2A 上下文默认位于 `~/kodax_a2a_server_workspace/<runtime-profile>/contexts/`。
1209
1234
  精确授权的 Skill 脚本必须使用隔离策略,并通过 `kodax sandbox doctor`。
1210
- 当前 native protocol 9 下,该隔离 Skill Script 路径仅支持 POSIX;Windows 不可用,
1235
+ 当前 native protocol 10 下,该隔离 Skill Script 路径仅支持 POSIX;Windows 不可用,
1211
1236
  因为它必须使用每命令 `denyRead`,而 Windows `WRITE_RESTRICTED` 后端会以
1212
1237
  `unsupported_policy` 拒绝该策略;`kodax sandbox setup` 不能启用此路径。
1213
1238
 
@@ -38,8 +38,9 @@
38
38
 
39
39
  // Agent harness: "ama" enables adaptive multi-agent use; "sa" forces one
40
40
  // agent. Permission profiles are "plan", "accept-edits", sandbox-first
41
- // "auto", or direct-host "full-access". Full Access still honors
42
- // administrator/critical policy. Exec Policy is separate:
41
+ // "auto", or direct-host "full-access". Full Access has no sandbox or
42
+ // approval prompts; explicit forbidden and Codex dangerous-command policy
43
+ // still block. Exec Policy is separate:
43
44
  // ~/.kodax/exec-policy.jsonc (and explicitly trusted project policy).
44
45
  // "agentMode": "ama",
45
46
  // "permissionMode": "accept-edits",
@@ -16,7 +16,7 @@
16
16
  // Arbitrary shell is never exposed. Skill instructions/assets need no
17
17
  // process authority. An exact checked-in scripts/... entry requires
18
18
  // process="isolated", skillScripts admission, and `kodax sandbox doctor`.
19
- // On native protocol 9, isolated Skill Script is POSIX-only. Windows is
19
+ // On native protocol 10, isolated Skill Script is POSIX-only. Windows is
20
20
  // unavailable because its required per-command denyRead is unsupported.
21
21
  // ASRT receives no KodaX credentials or ambient ~/.srt-settings.json and its
22
22
  // script quota is observed; hostile tenants also require an outer container/VM.
@@ -1,2 +1,2 @@
1
1
  // @kodax-ai/kodax — bundled distribution. See docs/ADR.md ADR-022 + ADR-024.
2
- import{Aa as f,Qa as g,Sa as h,a as c,db as i,eb as j,mb as k,ya as d,za as e}from"./chunk-UR4J2NED.js";import"./chunk-MXJFGVTT.js";import"./chunk-BHWBUZBD.js";import"./chunk-LNPTCPLR.js";import"./chunk-ZD5NDQ53.js";import"./chunk-TD2PU67Z.js";import{Ob as a,Pb as b}from"./chunk-S5USXWS2.js";import"./chunk-7CPZTMYD.js";import"./chunk-ONUPGMER.js";export{e as bucketProviderPayloadSize,g as buildAutoRepoIntelligenceContext,f as checkPromiseSignal,b as cleanupIncompleteToolCalls,h as describeTransientProviderRetry,c as emitResilienceDebug,d as estimateProviderPayloadBytes,k as runKodaX,j as saveRequiredSessionSnapshot,i as saveSessionSnapshot,a as validateAndFixToolHistory};
2
+ import{Aa as f,Qa as g,Sa as h,a as c,db as i,eb as j,mb as k,ya as d,za as e}from"./chunk-UTUAC7YQ.js";import"./chunk-MXJFGVTT.js";import"./chunk-ZXNXMFXJ.js";import"./chunk-LNPTCPLR.js";import"./chunk-ZD5NDQ53.js";import"./chunk-TD2PU67Z.js";import{Ob as a,Pb as b}from"./chunk-S5USXWS2.js";import"./chunk-7CPZTMYD.js";import"./chunk-ONUPGMER.js";export{e as bucketProviderPayloadSize,g as buildAutoRepoIntelligenceContext,f as checkPromiseSignal,b as cleanupIncompleteToolCalls,h as describeTransientProviderRetry,c as emitResilienceDebug,d as estimateProviderPayloadBytes,k as runKodaX,j as saveRequiredSessionSnapshot,i as saveSessionSnapshot,a as validateAndFixToolHistory};
@@ -0,0 +1,2 @@
1
+ // @kodax-ai/kodax — bundled distribution. See docs/ADR.md ADR-022 + ADR-024.
2
+ import{Ma as a,Na as b}from"./chunk-N5VUIPXE.js";import"./chunk-52FEJJMH.js";import"./chunk-O3SCJ4HT.js";import"./chunk-4IH2OTLC.js";import"./chunk-YYPZCZ6O.js";import"./chunk-UTUAC7YQ.js";import"./chunk-MXJFGVTT.js";import"./chunk-IDEPSEPH.js";import"./chunk-ZXNXMFXJ.js";import"./chunk-LNPTCPLR.js";import"./chunk-ZD5NDQ53.js";import"./chunk-TD2PU67Z.js";import"./chunk-S5USXWS2.js";import"./chunk-7CPZTMYD.js";import"./chunk-ONUPGMER.js";export{a as ArgumentCompleter,b as createArgumentCompleter};