@kodax-ai/kodax 0.7.72-hotfix.0 → 0.7.73

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 (101) hide show
  1. package/CHANGELOG.md +687 -492
  2. package/README.md +91 -38
  3. package/README_CN.md +60 -20
  4. package/dist/chunks/agent-T6PGT6AU.js +2 -0
  5. package/dist/chunks/argument-completer-QGMWA2C3.js +2 -0
  6. package/dist/chunks/{chunk-64NQBOSN.js → chunk-64M5HOCA.js} +1 -1
  7. package/dist/chunks/chunk-6JTWXGVU.js +622 -0
  8. package/dist/chunks/{chunk-SLHL766K.js → chunk-6RI2RBTF.js} +1 -1
  9. package/dist/chunks/chunk-AGDDM5AW.js +329 -0
  10. package/dist/chunks/chunk-BUPJGG3C.js +5 -0
  11. package/dist/chunks/chunk-EAD4SF3Z.js +413 -0
  12. package/dist/chunks/chunk-F7AIEHSS.js +46 -0
  13. package/dist/chunks/chunk-GAFFYJU3.js +37 -0
  14. package/dist/chunks/chunk-HVCNAZ52.js +365 -0
  15. package/dist/chunks/chunk-M7FXNPWV.js +22 -0
  16. package/dist/chunks/{chunk-44QXPEEE.js → chunk-MBAPT2R5.js} +1 -1
  17. package/dist/chunks/chunk-MLEAQTCD.js +151 -0
  18. package/dist/chunks/chunk-OG6DRNKV.js +755 -0
  19. package/dist/chunks/{chunk-SX2WFHIS.js → chunk-PFH53O4M.js} +1 -1
  20. package/dist/chunks/chunk-V4F6IYNK.js +73 -0
  21. package/dist/chunks/chunk-WQ6PWGK5.js +320 -0
  22. package/dist/chunks/chunk-XXQLPTAN.js +78 -0
  23. package/dist/chunks/compaction-config-IHJBP4GO.js +2 -0
  24. package/dist/chunks/{construction-bootstrap-LI2FP7KZ.js → construction-bootstrap-EGRUHKLP.js} +1 -1
  25. package/dist/chunks/dist-5N3I2RTW.js +2 -0
  26. package/dist/chunks/{dist-GOUP4YVE.js → dist-EVEJAII2.js} +1 -1
  27. package/dist/chunks/host-MECITNE3.js +2 -0
  28. package/dist/chunks/run-manager-AY7RQOWM.js +2 -0
  29. package/dist/chunks/{utils-O4PT6SHQ.js → utils-2GAE4XIM.js} +1 -1
  30. package/dist/index.d.ts +18 -18
  31. package/dist/index.js +5 -5
  32. package/dist/kodax_bootstrap.js +28 -0
  33. package/dist/kodax_cli.js +1476 -1463
  34. package/dist/kodax_resume.js +44 -0
  35. package/dist/provider-capabilities.json +234 -53
  36. package/dist/runtime-worker.js +1347 -1344
  37. package/dist/sdk-a2a.d.ts +12 -11
  38. package/dist/sdk-a2a.js +1 -1
  39. package/dist/sdk-agent.d.ts +385 -209
  40. package/dist/sdk-agent.js +1 -1
  41. package/dist/sdk-coding.d.ts +162 -144
  42. package/dist/sdk-coding.js +1 -1
  43. package/dist/sdk-experimental-memory.d.ts +1 -1
  44. package/dist/sdk-experimental-memory.js +1 -1
  45. package/dist/sdk-llm.d.ts +8 -49
  46. package/dist/sdk-llm.js +1 -1
  47. package/dist/sdk-mcp.js +1 -1
  48. package/dist/sdk-media.d.ts +4 -1
  49. package/dist/sdk-media.js +1 -1
  50. package/dist/sdk-repl.d.ts +197 -27
  51. package/dist/sdk-repl.js +2 -2
  52. package/dist/sdk-runtime.d.ts +230 -36
  53. package/dist/sdk-runtime.js +1 -1
  54. package/dist/sdk-session.d.ts +8 -7
  55. package/dist/sdk-session.js +1 -1
  56. package/dist/sdk-skills.d.ts +5 -5
  57. package/dist/sdk-skills.js +1 -1
  58. package/dist/semantic-worker.js +14 -14
  59. package/dist/types-chunks/{base.d-Cz_rwpOi.d.ts → base.d-ChvpaKjZ.d.ts} +1 -1
  60. package/dist/types-chunks/{bash-prefix-extractor.d-YoiZl5yt.d.ts → bash-prefix-extractor.d-bApf5nGw.d.ts} +109 -250
  61. package/dist/types-chunks/{capability-learning.d-_lR0J4iR.d.ts → capability-learning.d-DPrYxRjF.d.ts} +1 -1
  62. package/dist/types-chunks/{capsule.d-CK5Pfz1k.d.ts → capsule.d-CGWltwno.d.ts} +25 -96
  63. package/dist/types-chunks/center-types.d-BBT122uJ.d.ts +91 -0
  64. package/dist/types-chunks/{commands.d-D6g2jq8V.d.ts → commands.d-CEHGwRok.d.ts} +64 -6
  65. package/dist/types-chunks/{guardrail.d-DilYC1dh.d.ts → guardrail.d-CC4vAQl7.d.ts} +2 -1
  66. package/dist/types-chunks/{guardrail.d-DdeDWnVu.d.ts → guardrail.d-CXIPlWP3.d.ts} +91 -18
  67. package/dist/types-chunks/public-api.d-FBmX0kxo.d.ts +1343 -0
  68. package/dist/types-chunks/{run-manager.d-DxU3SSGR.d.ts → run-manager.d-DUNnJcpE.d.ts} +1 -1
  69. package/dist/types-chunks/sdk-session-XqacVOs8.d.ts +82 -0
  70. package/dist/types-chunks/{resolver.d-ssgNSlrh.d.ts → side-query.d-DWTMsndP.d.ts} +68 -5
  71. package/dist/types-chunks/{types.d-CRCaLt_s.d.ts → types.d-BnPhGmar.d.ts} +287 -165
  72. package/dist/types-chunks/{types.d-Cqaw71Ax.d.ts → types.d-CSmF0t0n.d.ts} +6 -5
  73. package/dist/types-chunks/{types.d-vJExiRje.d.ts → types.d-DCQVBqVn.d.ts} +10 -5
  74. package/dist/types-chunks/{types.d-CzsLFqmf.d.ts → types.d-DKr6TCXL.d.ts} +23 -17
  75. package/dist/types-chunks/{types.d-CEZZSY9s.d.ts → types.d-DgciGHoG.d.ts} +3 -3
  76. package/dist/types-chunks/{utils.d-Cb6vdvFM.d.ts → utils.d-BPYX7-KN.d.ts} +99 -18
  77. package/docs/SDK_EMBEDDER_GUIDE.md +287 -35
  78. package/package.json +5 -5
  79. package/scripts/kodax-bin.cjs +4 -2
  80. package/scripts/production-env.cjs +9 -0
  81. package/dist/chunks/agent-A3N27WVN.js +0 -2
  82. package/dist/chunks/argument-completer-BWTLOPZG.js +0 -2
  83. package/dist/chunks/chunk-23X6REO4.js +0 -46
  84. package/dist/chunks/chunk-52JSZ77P.js +0 -37
  85. package/dist/chunks/chunk-5R2SJ2EU.js +0 -306
  86. package/dist/chunks/chunk-64ATCY3Q.js +0 -22
  87. package/dist/chunks/chunk-BRQWYBEY.js +0 -70
  88. package/dist/chunks/chunk-OUMXYT55.js +0 -624
  89. package/dist/chunks/chunk-QDZUOLSM.js +0 -7
  90. package/dist/chunks/chunk-QTXG7B2J.js +0 -366
  91. package/dist/chunks/chunk-RKYTSURE.js +0 -422
  92. package/dist/chunks/chunk-VDJZWXSW.js +0 -329
  93. package/dist/chunks/chunk-X5PDRSXM.js +0 -151
  94. package/dist/chunks/chunk-Y5XKAN7C.js +0 -755
  95. package/dist/chunks/chunk-ZJIMT5I3.js +0 -78
  96. package/dist/chunks/compaction-config-OCZPAJQO.js +0 -2
  97. package/dist/chunks/dist-Y2HGGI7W.js +0 -2
  98. package/dist/chunks/host-ADFTZO6T.js +0 -2
  99. package/dist/chunks/run-manager-QU6EBSHJ.js +0 -2
  100. package/dist/types-chunks/public-api.d-BvCp5VkW.d.ts +0 -601
  101. package/dist/types-chunks/sdk-session-wGpa7X_U.d.ts +0 -796
package/README.md CHANGED
@@ -17,7 +17,7 @@
17
17
  <a href="LICENSE"><img alt="license" src="https://img.shields.io/badge/license-KAI--FCL_1.0-orange?style=flat-square"></a>
18
18
  <a href="https://github.com/icetomoyo/KodaX/stargazers"><img alt="GitHub stars" src="https://img.shields.io/github/stars/icetomoyo/KodaX?style=flat-square&logo=github&color=f1c40f"></a>
19
19
  <a href="https://github.com/icetomoyo/KodaX/actions"><img alt="CI" src="https://img.shields.io/github/actions/workflow/status/icetomoyo/KodaX/release.yml?style=flat-square&label=release"></a>
20
- <img alt="providers" src="https://img.shields.io/badge/LLMs-15_aliases_+_custom-2ecc71?style=flat-square">
20
+ <img alt="providers" src="https://img.shields.io/badge/LLMs-16_aliases_+_custom-2ecc71?style=flat-square">
21
21
  </p>
22
22
 
23
23
  <p align="center">
@@ -44,12 +44,18 @@ npm i -g @kodax-ai/kodax
44
44
  # Pick any one you have an API key for:
45
45
  export ZHIPU_API_KEY=... # or ANTHROPIC_API_KEY / OPENAI_API_KEY / KIMI_API_KEY /
46
46
  # MINIMAX_API_KEY / MIMO_API_KEY / ARK_API_KEY / QWEN_API_KEY /
47
+ # QWEN_TOKEN_API_KEY /
47
48
  # DEEPSEEK_API_KEY / GEMINI_API_KEY
48
49
 
49
50
  kodax
50
51
  ```
51
52
 
52
- That's it. You're in the REPL — ask anything in natural language.
53
+ That's it. You're in the REPL — ask anything in natural language. If this is a
54
+ new machine with no provider selection or supported API-key environment
55
+ variable, the bare `kodax` launch opens a metadata-only setup flow first. It
56
+ never asks for the key itself; after choosing a provider/model, set the named
57
+ environment variable, restart the terminal, and run `kodax` again. Use
58
+ `kodax setup` to rerun that flow explicitly.
53
59
 
54
60
  > **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.
55
61
 
@@ -94,7 +100,7 @@ That's it. You're in the REPL — ask anything in natural language.
94
100
  <h3>🤖 Multi-agent by default</h3>
95
101
  <sub>V2 Worker single-loop + Sidecar Verifier + async children</sub>
96
102
  <br><br>
97
- <code>dispatch_child_task</code>, <code>send_message</code>, <code>task_stop</code>, multi-instance auto-coordination with content-hash safety net.
103
+ <code>spawn_agent</code>, <code>send_message</code>, <code>followup_task</code>, <code>interrupt_agent</code>, multi-instance auto-coordination with content-hash safety net.
98
104
  </td>
99
105
  <td align="center" valign="top">
100
106
  <h3>🧩 Skills + self-construction</h3>
@@ -141,6 +147,14 @@ npm link
141
147
 
142
148
  KodaX reads API keys from environment variables. For built-in providers, the fastest path is:
143
149
 
150
+ ```bash
151
+ # Interactive metadata-only provider/model setup (does not collect a key)
152
+ kodax setup
153
+ ```
154
+
155
+ The command tells you the exact environment-variable name to set and exits so
156
+ you can restart the terminal. You can also configure it directly:
157
+
144
158
  ```bash
145
159
  # macOS / Linux
146
160
  export ZHIPU_API_KEY=your_api_key
@@ -149,6 +163,14 @@ export ZHIPU_API_KEY=your_api_key
149
163
  $env:ZHIPU_API_KEY="your_api_key"
150
164
  ```
151
165
 
166
+ For Qwen Token Plan, select `qwen-token-plan` and use its separate credential;
167
+ `QWEN_API_KEY` does not authenticate this route:
168
+
169
+ ```bash
170
+ export QWEN_TOKEN_API_KEY=your_api_key
171
+ kodax --provider qwen-token-plan
172
+ ```
173
+
152
174
  For CLI defaults, create `~/.kodax/config.json`:
153
175
 
154
176
  ```json
@@ -386,6 +408,17 @@ context diagnostics, and daemon protocol schemas, see
386
408
  The Space/IDE shared-daemon contract is documented in
387
409
  [SDK Embedder Guide section 23](docs/SDK_EMBEDDER_GUIDE.md#23-shared-coder-daemon-for-space-and-ide-hosts-feature_269-v0769).
388
410
 
411
+ **v0.7.72–v0.7.73 Runtime permission contract:** Auto Mode is owned by the Runtime session,
412
+ not by a UI hook. It reuses its LLM/rules guardrail across turns, classifies
413
+ before the shared permission bridge, and persists an automatic fallback to
414
+ rules. The same session settings can select a classifier model and bounded
415
+ timeout; `auto` defaults to LLM classification and fails with a recoverable
416
+ configuration error when no effective classifier model exists, rather than
417
+ silently falling back. Runtime permission prompts now offer opaque, exact
418
+ allow-once/session/persistent grant suggestions; persistent grants are
419
+ daemon-owned and revisioned. Host plan exit is exposed only when the host
420
+ supplies an approval callback. See the [Runtime Auto Mode integration guide](docs/SDK_EMBEDDER_GUIDE.md#24-runtime-owned-auto-mode-and-plan-approval-bridges-v072).
421
+
389
422
  ## Repo Intelligence
390
423
 
391
424
  KodaX ships with built-in repo intelligence (`repo_overview`, `module_context`, `symbol_context`, `process_context`, `impact_estimate`, and related tools) that helps the coding agent understand large codebases without ad-hoc grep/glob exploration.
@@ -404,11 +437,11 @@ KodaX uses a **monorepo architecture** with npm workspaces. Source layout curren
404
437
  ```
405
438
  KodaX/
406
439
  ├── packages/ # 4 workspace packages (FEATURE_194 v0.7.43)
407
- │ ├── llm/ # @kodax-ai/llm - LLM abstraction (15 built-in provider aliases)
440
+ │ ├── llm/ # @kodax-ai/llm - LLM abstraction (16 built-in provider aliases)
408
441
  │ │ └── providers/ # Anthropic, OpenAI, DeepSeek, Kimi, MiMo, MiniMax, Zhipu, Ark, …
409
442
  │ │
410
443
  │ ├── agent/ # @kodax-ai/agent - Generic Agent framework
411
- │ │ ├── orchestration/ # Runner, runFanOut, runWithIdleYield, ChildTaskRegistry
444
+ │ │ ├── actors/ # Runtime-owned Actor tree, scheduler, mailbox, events
412
445
  │ │ ├── session-lineage/ # branchable session tree (inline v0.7.43)
413
446
  │ │ ├── capabilities/
414
447
  │ │ │ ├── mcp/ # MCP integration (inline v0.7.43)
@@ -417,7 +450,7 @@ KodaX/
417
450
  │ │
418
451
  │ ├── coding/ # @kodax-ai/coding - Coding Agent (tools + prompts)
419
452
  │ │ ├── tools/ # 50+ tools: read, write, edit, bash, glob, grep, undo,
420
- │ │ │ # dispatch_child_task, send_message, task_stop,
453
+ │ │ │ # spawn_agent, send_message, followup_task, wait_agent,
421
454
  │ │ │ # ask_user_question, repo-intelligence, …
422
455
  │ │ └── repo-intelligence/ # incl. protocol.ts (inline v0.7.43)
423
456
  │ │
@@ -452,7 +485,7 @@ KodaX/
452
485
  ┌──────────────┐ ┌──────────────────────────┐ ┌──────────────┐
453
486
  │@kodax-ai/ │ │@kodax-ai/agent │ │@kodax-ai/llm │
454
487
  │coding (via │ │Runner + fan-out + │ │LLM Abstract │
455
- │above) │ │idle-yield + session- │ │(15 aliases) │
488
+ │above) │ │idle-yield + session- │ │(16 aliases) │
456
489
  │ │ │lineage + skills + mcp + │ │ │
457
490
  │ │ │tracing (FEATURE_194) │ │ │
458
491
  └──────────────┘ └──────────────────────────┘ └──────────────┘
@@ -464,9 +497,9 @@ Source-side workspace package names (`@kodax-ai/*`). npm consumers install the s
464
497
 
465
498
  | Workspace package | Purpose | Key Dependencies |
466
499
  |---------|---------|------------------|
467
- | `@kodax-ai/llm` | LLM abstraction (15 built-in provider aliases + custom registration) | @anthropic-ai/sdk, openai |
500
+ | `@kodax-ai/llm` | LLM abstraction (16 built-in provider aliases + custom registration) | @anthropic-ai/sdk, openai |
468
501
  | `@kodax-ai/agent` | Generic Agent framework — Runner, fan-out, idle-yield, media/input artifacts, session-lineage, capabilities (mcp + skills), tracing (ADR-036 v0.7.43 consolidation; subpaths: `/media`, `/session-lineage`, `/capabilities/mcp`, `/capabilities/skills`, `/tracing`) | @kodax-ai/llm, js-tiktoken, fflate, jimp, yaml |
469
- | `@kodax-ai/coding` | Coding Agent — 50+ tools (incl. `dispatch_child_task` / `send_message` / `task_stop`) + role prompts + auto-continue + repo-intelligence protocol | @kodax-ai/llm, @kodax-ai/agent |
502
+ | `@kodax-ai/coding` | Coding Agent — 50+ tools (incl. canonical Actor collaboration tools) + role prompts + auto-continue + repo-intelligence protocol | @kodax-ai/llm, @kodax-ai/agent |
470
503
  | `@kodax-ai/repl` | Complete interactive terminal UI (Ink/React, permission modes, commands, streaming) | @kodax-ai/coding, ink, react |
471
504
 
472
505
  ### Source-side vs npm-published surface
@@ -480,7 +513,7 @@ KodaX has two layers that consumers should understand separately:
480
513
 
481
514
  | Source package | npm subpath | Type | What you get | Example consumer |
482
515
  |---|---|---|---|---|
483
- | `packages/llm` | `@kodax-ai/kodax/llm` | Full package | 15-alias LLM abstraction (108 exports) | Standalone LLM clients |
516
+ | `packages/llm` | `@kodax-ai/kodax/llm` | Full package | 16-alias LLM abstraction (108 exports) | Standalone LLM clients |
484
517
  | `packages/agent` | `@kodax-ai/kodax/agent` | Full package | Runner / fan-out / external-agent plane / session-lineage / capabilities / tracing (331 exports) | Custom agent frameworks |
485
518
  | `packages/agent` | `@kodax-ai/kodax/skills` | **Narrow subset** | Skills system only — `SkillRegistry` / `loadFullSkill` / `expandSkillForLLM` / ... (26 exports = pre-v0.7.43 `@kodax-ai/skills` complete API) | Skill loaders, IDE plugins |
486
519
  | `packages/agent` | `@kodax-ai/kodax/mcp` | **Narrow subset** | MCP only — `McpCapabilityProvider` / `createMcpTransport` / `searchMcpCatalog` / ... (23 exports) | MCP server hosts |
@@ -500,11 +533,11 @@ KodaX has two layers that consumers should understand separately:
500
533
 
501
534
  **Host Reads Persisted History (FEATURE_230 + FEATURE_234, v0.7.51; v0.7.63 hardening)**: additive closures for hosts that read persisted state. **Durable tool transcript replay** — a resumed session now replays the tool cards the assistant used instead of degrading to text-only. `messages` / `lineage` stay canonical; `SessionData.uiHistory` becomes a bounded, sanitized, terminal-only replay cache. The SDK transcript contract is explicit: `loadSession()` = active model context, `loadFullTranscript()` = append-order host scrollback with typed entries (`message` / `compaction` / `branch_summary` / `rewind_marker` / `client_notice` / `task_result`) plus clone provenance (`logicalId` / `sourceEntryId`), `uiHistory` = optional replay cache, and tool cards can always be reconstructed from canonical messages. Hosts can persist local slash output with `appendClientNotice()` without entering model context, and workflow/child completions expose structured `taskResults[]` instead of requiring `<task-completed>` parsing. `rewind_marker` is an audit entry for host scrollback only and is excluded from model-context messages. **Workflow run host attribution** — `WorkflowProcessTrackerOptions` / `WorkflowProcessSnapshot` gain a host-owned opaque `hostMetadata?: Record<string, string>` that the SDK stores, persists to `run.json`, and echoes back (including after a restart) without interpreting it, so a host can map a run to the session/surface that launched it with zero side table. Unstamped/legacy runs honestly echo `hostMetadata === undefined`. See [docs/features/v0.7.51.md](docs/features/v0.7.51.md).
502
535
 
503
- **Inline Workflow Authoring (FEATURE_246, v0.7.58)**: in AMA/AMAW the Worker can now author and run a workflow inline via a model-callable `run_workflow` tool it scouts the codebase with its own tools first, then bakes concrete findings into each child prompt, and runs the script through the **unchanged** sandbox + static-validation + postcondition-verification pipeline. This replaces the context-blind `sideQuery` generator as the primary interactive path (the generator survives only as a fallback for the explicit `/workflow create` command and non-interactive / CI hosts that have no investigating Worker). It adds structured child output (`outputSchema`), the no-barrier `wf.pipeline` staged primitive, same-session resume (`resumeFromRunId`), nested `wf.workflow(...)`, and a `/workflow create` redirect to Worker-authored scouting; `run_workflow` is async / idle-yield so the turn is not blocked. The neutral run-lifecycle manager (`createWorkflowRunManager` / `getDefaultWorkflowRunManager`) now lives in `@kodax-ai/kodax/agent` for non-coding SDK hosts. See [docs/features/v0.7.58.md](docs/features/v0.7.58.md) and [docs/ADR.md](docs/ADR.md) ADR-044/046/047/048/049.
536
+ **Inline Workflow Authoring (FEATURE_246, v0.7.58; F270 update in v0.7.72)**: the Worker can author and run a workflow inline via the model-callable `run_workflow` tool when Workflow intent is explicit. It scouts the codebase first, bakes concrete findings into child prompts, and runs the script through the sandbox, static-validation, and postcondition-verification pipeline. F270 retires AMAW and complexity-driven activation; AMA keeps explicit `/workflow`, named/SDK, and natural-language Workflow requests. Workflow child Agents now run on the unified Actor control plane. See [docs/features/v0.7.58.md](docs/features/v0.7.58.md), [docs/features/v0.7.72.md](docs/features/v0.7.72.md), and ADR-044/046/047/048/049/055.
504
537
 
505
- **Workflow Activation Tiers (FEATURE_248 + FEATURE_249, v0.7.59)**: the three agent modes now have a coherent workflow posture. **AMAW** carries a mode-level `ORCHESTRATION DEFAULT` standing directive (mirroring the reference "ultracode" posture): substantive work a multi-file investigation, a design decision, anything costly to get wrong — defaults to orchestrating multiple cross-checking agents, with a PLAN-TIME COMMITMENT flow-fix that front-loads the orchestrate-vs-solo call to turn 0. **AMA** hosts the same `run_workflow` tool but with no standing directive — it activates a workflow when you ask for orchestration in natural language, never on complexity alone. **SA** stays solo. The directive is leak-closed via `amawOrchestrationAvailable`, so AMA and SA prompts stay byte-identical. See [docs/features/v0.7.59.md](docs/features/v0.7.59.md).
538
+ **Historical Workflow Activation Tiers (FEATURE_248 + FEATURE_249, v0.7.59; superseded by F270 in v0.7.72)**: v0.7.59 introduced AMAW and explicit-request AMA behavior. F270 retires AMAW and its complexity-driven directive. SA remains solo; AMA is the single adaptive multi-Agent mode and activates Workflow only from explicit Workflow intent. See [docs/features/v0.7.59.md](docs/features/v0.7.59.md) and [docs/features/v0.7.72.md](docs/features/v0.7.72.md).
506
539
 
507
- **Progressive Disclosure on the Managed Tool Path (FEATURE_250, v0.7.60)**: the deferred-tool progressive-disclosure mechanism — previously SA-path-only — now applies to the AMA/AMAW **managed** path too. Cache-cold managed turns carry one-line search hints instead of full descriptions for the 13 non-mcp deferred tools (repo-intelligence + web/code + goal); each tool's `input_schema` is unchanged, so it stays directly callable and the full description is fetched on demand via `tool_search`. `mcp_*` stay resident and `run_workflow` is untouched. Transparent to users; validated by two 5-alias eval panels (DEFER_SAFE 5/5, 0% read/grep fallback). See [docs/features/v0.7.60.md](docs/features/v0.7.60.md).
540
+ **Progressive Disclosure on the Managed Tool Path (FEATURE_250, v0.7.60; F270 mode update in v0.7.72)**: the deferred-tool progressive-disclosure mechanism applies to the managed AMA path. Cache-cold managed turns carry one-line search hints instead of full descriptions for the 13 non-mcp deferred tools (repo-intelligence + web/code + goal); each tool's `input_schema` is unchanged, so it stays directly callable and the full description is fetched on demand via `tool_search`. `mcp_*` stay resident and `run_workflow` is untouched. F270 retires the former AMAW mode without changing this disclosure behavior. See [docs/features/v0.7.60.md](docs/features/v0.7.60.md).
508
541
 
509
542
  **Context-Efficient Tool Results + Workflow Quality Preflight (FEATURE_251 + FEATURE_252, v0.7.61; corrected 2026-07-14)**: local tools collect complete output and apply only contract-equivalent normalization that is strictly shorter; command-specific lossy Bash filters are off by default, and compound Bash uses no semantic adapter. One owner evaluates the complete parallel-result batch against the final provider request: it solves the largest final input `Pmax` for which `Pmax + output reserve + max(2048, 3% of Pmax) <= context window`, then admits only the remaining physical capacity. Results stay verbatim whenever they fit; only real overflow persists the complete value and emits `KODAX_RESULT_INCOMPLETE`. History follows the same physical-capacity rule: no default lossy microcompaction below capacity, summary-first at actual pressure, and typed failure without silent message deletion when a recoverable request cannot be formed. Static early percentages are explicit opt-ins. FEATURE_252's deterministic pre-start workflow contract lint is unchanged. See [docs/features/v0.7.61.md](docs/features/v0.7.61.md) and [docs/ADR.md ADR-050](docs/ADR.md).
510
543
 
@@ -619,9 +652,9 @@ one-time provisioning).
619
652
  ## Features
620
653
 
621
654
  - **Modular Architecture** - Use as CLI, as a library, or as a Node-free single binary
622
- - **15 Built-in Provider Aliases** - Anthropic, OpenAI, DeepSeek, Kimi, Kimi Code, Qwen, Zhipu, Zhipu Coding, Zai Coding, MiniMax Coding, MiMo Coding, MiMo, Ark Coding, Gemini CLI, Codex CLI - plus user-defined OpenAI/Anthropic-compatible providers
655
+ - **16 Built-in Provider Aliases** - Anthropic, OpenAI, DeepSeek, Kimi, Kimi Code, Qwen, Qwen Token Plan, Zhipu, Zhipu Coding, Zai Coding, MiniMax Coding, MiMo Coding, MiMo, Ark Coding, Gemini CLI, Codex CLI - plus user-defined OpenAI/Anthropic-compatible providers
623
656
  - **Dynamic Workflows + SDK Process Surface** - Generate/reuse capability-routed workflows, observe live progress through `WorkflowProcessSnapshot`, and control workflow lifecycle from SDK hosts without parsing REPL output
624
- - **V2 Worker single-loop + Sidecar Verifier (default)** - Single-agent main loop with an out-of-band Sidecar Verifier as Stop-hook (claudecode-shape; FEATURE_184 v0.7.42, ADR-030). Verifier returns accept/revise/blocked verdict on Worker text-only termination. The pre-v0.7.43 V1 chain is retired, `emit_handoff` is deleted, accept-verdict UI silently passes through, and content-aware gating skips trivial-chat sidecar calls. Async child steering uses `dispatch_child_task` + `send_message` + `task_stop` with idle-yield wait; specialist routing uses `subagent_type`.
657
+ - **V2 Worker single-loop + Sidecar Verifier (default)** - Single-agent main loop with an out-of-band Sidecar Verifier as Stop-hook (claudecode-shape; FEATURE_184 v0.7.42, ADR-030). Verifier returns accept/revise/blocked verdict on Worker text-only termination. The pre-v0.7.43 V1 chain is retired, `emit_handoff` is deleted, accept-verdict UI silently passes through, and content-aware gating skips trivial-chat sidecar calls. Adaptive child steering uses the canonical Actor collaboration tools with idle-yield waiting; specialist routing uses `spawn_agent(agent_id=...)`.
625
658
  - **Reasoning Effort** - Effort-first control (`off/auto/low/medium/high` plus model-supported extras) across providers
626
659
  - **Streaming Output** - Real-time response display
627
660
  - **Session Management** - JSONL format with branchable session lineage tree
@@ -721,7 +754,7 @@ For smaller surface and tree-shake-friendly imports, the SDK is also exposed via
721
754
 
722
755
  ```typescript
723
756
  import { Runner } from '@kodax-ai/kodax/agent'; // agent runtime
724
- import { getProvider } from '@kodax-ai/kodax/llm'; // LLM abstraction (15 aliases)
757
+ import { getProvider } from '@kodax-ai/kodax/llm'; // LLM abstraction (16 aliases)
725
758
  import { runKodaX } from '@kodax-ai/kodax/coding'; // coding tools + prompts
726
759
  import { createImageArtifactFromPath } from '@kodax-ai/kodax/media'; // input artifacts
727
760
  import { SkillRegistry } from '@kodax-ai/kodax/skills'; // zero-dep skill loader
@@ -806,7 +839,12 @@ Bare `-r` opens an interactive picker with incremental search, arrow/PageUp/Page
806
839
  navigation, Tab completion, full selected-session ID display, and Enter-to-resume.
807
840
  An explicit value checks the complete session ID first, then an exact
808
841
  case-insensitive title; duplicate titles open a narrowed picker instead of
809
- silently choosing one. Cleanup is preview-only unless
842
+ silently choosing one. The picker loads before the full CLI, so session listing
843
+ remains responsive. After selection it hands terminal input to the resumed
844
+ REPL; Esc releases the picker's stdin ownership and immediately returns to the
845
+ invoking shell. Session replay preserves each recorded message/event timestamp.
846
+
847
+ Cleanup is preview-only unless
810
848
  `--apply-session-cleanup` is also provided; matching sessions are archived rather
811
849
  than permanently deleted.
812
850
 
@@ -862,14 +900,14 @@ KodaX provides 3 permission modes for fine-grained control:
862
900
  |------|-------------|------------------------|
863
901
  | `plan` | Read-only planning mode | All modification tools blocked |
864
902
  | `accept-edits` | Auto-accept file edits | bash only |
865
- | `auto-in-project` | Full auto within project | None (project-scoped) |
903
+ | `auto` | Runtime-owned LLM/rules classification within the project boundary | Only explicit classifier escalation |
866
904
 
867
905
  ```bash
868
906
  # In REPL, use /mode command
869
907
  /mode plan # Switch to plan mode (read-only)
870
908
  /mode accept-edits # Switch to accept-edits mode
871
- /mode auto-in-project # Switch to auto-in-project mode
872
- /auto # Alias for auto-in-project
909
+ /mode auto # Switch to Runtime-owned Auto Mode
910
+ /auto # Alias for auto
873
911
 
874
912
  # Check current mode
875
913
  /mode
@@ -881,6 +919,15 @@ KodaX provides 3 permission modes for fine-grained control:
881
919
  - Permanent protection zones: `.kodax/`, `~/.kodax/`, paths outside project
882
920
  - Pattern-based permission: Allow specific Bash commands (e.g., `Bash(npm install)`)
883
921
  - Unified diff display for write/edit operations
922
+ - Auto Mode runs guardrail classification before the permission UI; a safe
923
+ allow verdict does not create a pending approval request. The session records
924
+ an automatic LLM-to-rules fallback for later turns.
925
+ - Runtime-backed prompts can offer exact `allow once`, `allow this session`,
926
+ and `always allow` choices. Return the Runtime-issued opaque suggestion;
927
+ never derive or widen a permission rule from the displayed command or path.
928
+ Persistent grants are daemon-owned, revisioned, and can be listed/revoked
929
+ through `runtime.permissions` by an authorized SDK host. Dynamic shell
930
+ commands deliberately receive no persistent-grant suggestion.
884
931
 
885
932
  ### CLI Help Topics
886
933
 
@@ -1044,7 +1091,7 @@ npm install @kodax-ai/kodax
1044
1091
  ```typescript
1045
1092
  import { runKodaX } from '@kodax-ai/kodax'; // root: CLI helpers + runKodaX
1046
1093
  import { Runner, runFanOut } from '@kodax-ai/kodax/agent'; // generic Agent framework
1047
- import { getProvider } from '@kodax-ai/kodax/llm'; // 15-alias LLM abstraction
1094
+ import { getProvider } from '@kodax-ai/kodax/llm'; // 16-alias LLM abstraction
1048
1095
  import { KODAX_TOOLS } from '@kodax-ai/kodax/coding'; // tools + prompts + agent loop
1049
1096
  import { createImageArtifactFromPath } from '@kodax-ai/kodax/media'; // input artifact helpers
1050
1097
  import { runInkInteractiveMode } from '@kodax-ai/kodax/repl'; // Ink TUI entrypoint
@@ -1060,7 +1107,7 @@ import { createMemoryAgent } from '@kodax-ai/kodax/experimental-memory'; // opt-
1060
1107
 
1061
1108
  ### `@kodax-ai/kodax/llm` — LLM Abstraction
1062
1109
 
1063
- 15 built-in provider aliases (Anthropic, OpenAI, DeepSeek, Kimi, Kimi-Code, Qwen, Zhipu, Zhipu-Coding, Zai-Coding, MiniMax-Coding, MiMo, MiMo-Coding, Ark-Coding, Gemini-CLI, Codex-CLI) + custom provider registration.
1110
+ 16 built-in provider aliases (Anthropic, OpenAI, DeepSeek, Kimi, Kimi-Code, Qwen, Qwen-Token-Plan, Zhipu, Zhipu-Coding, Zai-Coding, MiniMax-Coding, MiMo, MiMo-Coding, Ark-Coding, Gemini-CLI, Codex-CLI) + custom provider registration.
1064
1111
 
1065
1112
  ```typescript
1066
1113
  import { getProvider, KodaXBaseProvider } from '@kodax-ai/kodax/llm';
@@ -1088,8 +1135,7 @@ import {
1088
1135
  Runner,
1089
1136
  runFanOut,
1090
1137
  runWithIdleYield,
1091
- registerChildTask,
1092
- type ChildTaskRegistry,
1138
+ createAgentActorController,
1093
1139
  generateSessionId,
1094
1140
  estimateTokens,
1095
1141
  DefaultSummaryCompaction,
@@ -1102,14 +1148,15 @@ const result = await runFanOut({
1102
1148
  run: async (bundle) => doWork(bundle),
1103
1149
  });
1104
1150
 
1105
- // Idle-yield wait pause when out of useful work, resume when a wake event arrives
1106
- await runWithIdleYield({ runOnce, computeSnapshot, registry, messageQueue, agentId });
1151
+ // Runtime-owned Actor identity tree (inject an executor before starting Turns)
1152
+ const actors = await createAgentActorController();
1153
+ const tree = actors.list('/root');
1107
1154
 
1108
1155
  // Pluggable compaction policy (FEATURE_081)
1109
1156
  const policy = new DefaultSummaryCompaction({ thresholdRatio: 0.8, keepRecent: 10 });
1110
1157
  ```
1111
1158
 
1112
- **Key Features**: `Runner` + per-step lifecycle · `runFanOut` (bounded-concurrency + abort + progress events) · `runWithIdleYield` (chat-while-waiting) · `ChildTaskRegistry` / `TaskAbortRegistry` · session-id generation · tiktoken-based token estimation · `CompactionPolicy` interface.
1159
+ **Key Features**: `Runner` + per-step lifecycle · `runFanOut` (bounded-concurrency + abort + progress events) · `runWithIdleYield` (chat-while-waiting) · `AgentActorController` / `AgentTurnScheduler` · session-id generation · tiktoken-based token estimation · `CompactionPolicy` interface.
1113
1160
 
1114
1161
  ### `@kodax-ai/kodax/skills` — Skills System
1115
1162
 
@@ -1138,7 +1185,7 @@ const result = await executeSkill({
1138
1185
 
1139
1186
  ### `@kodax-ai/kodax/coding` — Coding Agent
1140
1187
 
1141
- Complete coding agent: 50+ tools (`read`/`write`/`edit`/`bash`/`grep`/`glob`/`dispatch_child_task`/`send_message`/`task_stop`/...) + Worker role prompt + Sidecar Verifier (out-of-band Stop-hook) + agent loop + auto-continue + session management.
1188
+ Complete coding agent: 50+ tools (`read`/`write`/`edit`/`bash`/`grep`/`glob` plus `spawn_agent`/`send_message`/`followup_task`/`wait_agent`/`interrupt_agent`/`list_agents`/`agent_output`) + Worker role prompt + Sidecar Verifier (out-of-band Stop-hook) + agent loop + auto-continue + session management.
1142
1189
 
1143
1190
  ```typescript
1144
1191
  import { runKodaX, KodaXClient, KODAX_TOOLS } from '@kodax-ai/kodax/coding';
@@ -1160,7 +1207,7 @@ await client.send('Create a new file');
1160
1207
  await client.send('Add a function to it'); // Has context from previous message
1161
1208
  ```
1162
1209
 
1163
- **Key Features**: 50+ built-in tools (see [Tools](#tools)) · V2 Worker single-loop + Sidecar Verifier (FEATURE_184 v0.7.42 / V1 chain fully retired by FEATURE_193 v0.7.43) · async child steering via `send_message` / `task_stop` (FEATURE_120, v0.7.39) · idle-yield wait mechanic (FEATURE_155, v0.7.38) · specialist routing via `subagent_type` (FEATURE_191, v0.7.43) · auto-continue · session lineage.
1210
+ **Key Features**: 50+ built-in tools (see [Tools](#tools)) · V2 Worker single-loop + Sidecar Verifier (FEATURE_184 v0.7.42 / V1 chain fully retired by FEATURE_193 v0.7.43) · Runtime-owned Actor collaboration and safe-boundary steering (FEATURE_270, v0.7.72) · idle-yield waiting · specialist routing via `spawn_agent(agent_id=...)` · auto-continue · session lineage.
1164
1211
 
1165
1212
  ### `@kodax-ai/kodax/repl` — Interactive Terminal UI
1166
1213
 
@@ -1198,7 +1245,7 @@ await runInkInteractiveMode({ provider: 'zhipu-coding', effort: 'auto' });
1198
1245
 
1199
1246
  | Use Case | Subpath | Why |
1200
1247
  |----------|---------|-----|
1201
- | Only need LLM abstraction | `@kodax-ai/kodax/llm` | Minimal deps; 15 built-in aliases |
1248
+ | Only need LLM abstraction | `@kodax-ai/kodax/llm` | Minimal deps; 16 built-in aliases |
1202
1249
  | Building custom agent | `@kodax-ai/kodax/agent` | Runner + fan-out + idle-yield + session-lineage + capabilities |
1203
1250
  | Coding tasks | `@kodax-ai/kodax/coding` | Complete coding agent + tools |
1204
1251
  | Terminal app | `@kodax-ai/kodax/repl` | Full interactive experience |
@@ -1214,10 +1261,11 @@ await runInkInteractiveMode({ provider: 'zhipu-coding', effort: 'auto' });
1214
1261
  | kimi | `KIMI_API_KEY` | Native | kimi-k2.7-code (262,144-token context; `kimi-k2.7-code-highspeed` / `kimi-k2.6` / `kimi-k2.5` via `/model`) |
1215
1262
  | kimi-code | `KIMI_CODE_API_KEY` | Native | kimi-for-coding (`k3-256k` for Moderato / `k3` 1M for Allegretto+ / `kimi-for-coding-highspeed` via `/model`; both K3 choices use upstream `k3`) |
1216
1263
  | qwen | `QWEN_API_KEY` | Native | qwen3.5-plus |
1264
+ | qwen-token-plan | `QWEN_TOKEN_API_KEY` | Native | qwen3.8-max-preview (Anthropic-compat; `qwen3.7-max` / `qwen3.7-plus` / `qwen3.6-flash` / `glm-5.2` / `deepseek-v4-pro` via `/model`; all 1M context; image input on Qwen 3.8 / 3.7 Plus / 3.6 Flash) |
1217
1265
  | zhipu | `ZHIPU_API_KEY` | Native | glm-5 (`glm-5.2` 1M ctx / `glm-5.1` / `glm-5-turbo` via `/model`) |
1218
- | zhipu-coding | `ZHIPU_CODING_API_KEY` | Native | glm-5 (`glm-5.2` 1M ctx / `glm-5.1` / `glm-5-turbo` via `/model`) |
1266
+ | zhipu-coding | `ZHIPU_CODING_API_KEY` | Native | glm-5.2 (1M ctx; legacy `glm-5.1` and `glm-5-turbo` remain selectable via `/model`) |
1219
1267
  | zai-coding | `ZAI_CODING_API_KEY` | Native | glm-5.2 (Zhipu Coding Plan overseas mirror via `api.z.ai`, Anthropic-compat — same model lineup as `zhipu-coding`, served from outside CN) |
1220
- | minimax-coding | `MINIMAX_CODING_API_KEY` | Native | MiniMax-M2.7 (`MiniMax-M3` Frontier Coding, native multimodal + 1M ctx, plus `MiniMax-M2.7-highspeed` via `/model`) |
1268
+ | minimax-coding | `MINIMAX_CODING_API_KEY` | Native | MiniMax-M3 (Frontier Coding, native multimodal + 1M ctx; legacy `MiniMax-M2.7` / `MiniMax-M2.7-highspeed` remain selectable via `/model`) |
1221
1269
  | mimo | `MIMO_API_KEY` | Native | mimo-v2.5-pro (Xiaomi MiMo pay-per-token, Anthropic-compat) |
1222
1270
  | mimo-coding | `MIMO_CODING_API_KEY` | Native | mimo-v2.5-pro (Xiaomi Token Plan, Anthropic-compat) |
1223
1271
  | ark-coding | `ARK_CODING_API_KEY` | Native | glm-5.2 (Volcengine Ark Coding Plan — GLM-5.2 (alias: `glm-latest`) · Kimi K2.7 Code / K2.6 · MiniMax M3 / M2.7 · DeepSeek V4 Pro / V4 Flash · Doubao Seed 2.0 Code / Pro / Lite · Doubao Seed Code) |
@@ -1246,7 +1294,7 @@ kodax --session list
1246
1294
  # Parallel tool execution
1247
1295
  kodax --parallel "Read package.json and tsconfig.json"
1248
1296
 
1249
- # Adaptive multi-agent (AMA) mode — V2 Worker single-loop with `dispatch_child_task` fan-out
1297
+ # Adaptive multi-agent (AMA) mode — V2 Worker single-loop with Actor collaboration
1250
1298
  kodax --agent-mode ama "Analyze code structure, check test coverage, find bugs"
1251
1299
  ```
1252
1300
 
@@ -1304,12 +1352,16 @@ KodaX ships 50+ built-in tools, grouped below. They are registered as a single f
1304
1352
  ### Agent control & UX
1305
1353
  | Tool | Description |
1306
1354
  |------|-------------|
1307
- | `dispatch_child_task` | Spawn a sub-agent for an independent investigation/edit task. Optional `model_hint: 'fast' \| 'balanced' \| 'deep'` (advisory; routing no-op until FEATURE_102 v0.7.45). |
1308
- | `send_message` | Append an instruction to an in-flight child's queue surfaces as `<coordinator-instruction>` at the child's next turn boundary. Coordinator-only. (FEATURE_120, v0.7.39) |
1309
- | `task_stop` | Request graceful exit of a specific child. Current tool finishes atomically, then the child sees a `<coordinator-stop-request>` and emits a final summary. Coordinator-only. (FEATURE_120, v0.7.39) |
1355
+ | `spawn_agent` | Create a named child Actor and start its first Turn under inherited capabilities, session capacity, and root work budget. |
1356
+ | `send_message` | Commit bounded information to an Actor mailbox without starting a new Turn. |
1357
+ | `followup_task` | Join a running Actor at a safe boundary or atomically start a new Turn for an idle Actor. |
1358
+ | `wait_agent` | Wait for one or more Actor state changes without polling a second task registry. |
1359
+ | `interrupt_agent` | Request interruption of an active Turn while preserving Actor identity. |
1360
+ | `list_agents` | Inspect the caller-visible Actor subtree and Turn states. |
1361
+ | `agent_output` | Read bounded durable output for an authorized Actor/Turn. |
1310
1362
  | `ask_user_question` | Single/multi-select or free-text prompt back to the user |
1311
- | `exit_plan_mode` | Present a finalized plan for approval (REPL only) |
1312
- | `run_workflow` | Author and run a workflow script inline. Hosted in AMAW (self-activates on complexity via the ORCHESTRATION DEFAULT directive) and AMA (activates on an explicit natural-language request); not in SA. Scouts the codebase first, then bakes findings into child prompts; structured output via `outputSchema`, same-session `resumeFromRunId`, nested `wf.workflow(...)`. Async / idle-yield. (FEATURE_246 v0.7.58; FEATURE_248/249 v0.7.59) |
1363
+ | `exit_plan_mode` | Present a finalized plan only when the active REPL/host supplied an approval callback |
1364
+ | `run_workflow` | Author and run a deterministic Workflow protocol in AMA only when Workflow intent is explicit; complexity alone never activates it. Child Agents share the Actor control plane. Async / idle-yield. (FEATURE_246; FEATURE_270 v0.7.72) |
1313
1365
  | `emit_managed_protocol` | Internal managed-task protocol side-channel for role payloads (verdict). V2 Worker single-loop + Sidecar Verifier is the default since v0.7.42 (FEATURE_184); V1 chain retired in v0.7.43 (FEATURE_193). |
1314
1366
 
1315
1367
  ---
@@ -1446,6 +1498,7 @@ KodaX uses an **English-first** comment style with selective Chinese brief notes
1446
1498
  ## Documentation
1447
1499
 
1448
1500
  - [README_CN.md](README_CN.md) - Chinese Documentation
1501
+ - [docs/SDK_EMBEDDER_GUIDE.md](docs/SDK_EMBEDDER_GUIDE.md) - SDK hosting, shared Runtime daemon, Auto Mode, and permission-grant contracts
1449
1502
  - [docs/release.md](docs/release.md) - Standalone binary build & release pipeline
1450
1503
  - [docs/PRD.md](docs/PRD.md) - Product Requirements
1451
1504
  - [docs/ADR.md](docs/ADR.md) - Architecture Decisions
package/README_CN.md CHANGED
@@ -17,7 +17,7 @@
17
17
  <a href="LICENSE"><img alt="license" src="https://img.shields.io/badge/license-KAI--FCL_1.0-orange?style=flat-square"></a>
18
18
  <a href="https://github.com/icetomoyo/KodaX/stargazers"><img alt="GitHub stars" src="https://img.shields.io/github/stars/icetomoyo/KodaX?style=flat-square&logo=github&color=f1c40f"></a>
19
19
  <a href="https://github.com/icetomoyo/KodaX/actions"><img alt="CI" src="https://img.shields.io/github/actions/workflow/status/icetomoyo/KodaX/release.yml?style=flat-square&label=release"></a>
20
- <img alt="providers" src="https://img.shields.io/badge/LLMs-15_aliases_+_custom-2ecc71?style=flat-square">
20
+ <img alt="providers" src="https://img.shields.io/badge/LLMs-16_aliases_+_custom-2ecc71?style=flat-square">
21
21
  </p>
22
22
 
23
23
  <p align="center">
@@ -44,12 +44,15 @@ npm i -g @kodax-ai/kodax
44
44
  # 选一个你有 API key 的 provider
45
45
  export ZHIPU_API_KEY=... # 或 KIMI_API_KEY / MINIMAX_API_KEY / MIMO_API_KEY /
46
46
  # ARK_API_KEY / DEEPSEEK_API_KEY / ANTHROPIC_API_KEY /
47
- # OPENAI_API_KEY / QWEN_API_KEY / GEMINI_API_KEY
47
+ # OPENAI_API_KEY / QWEN_API_KEY / QWEN_TOKEN_API_KEY / GEMINI_API_KEY
48
48
 
49
49
  kodax
50
50
  ```
51
51
 
52
- 就这样。进 REPL,自然语言提问。
52
+ 就这样。进 REPL,自然语言提问。如果新机器既没有选择 provider,也没有任何
53
+ 受支持的 API Key 环境变量,直接运行 `kodax` 会先打开只配置元数据的向导;它不会
54
+ 要求输入或保存 Key。选择 provider/model 后,按提示设置对应环境变量、重启终端,
55
+ 再运行 `kodax`。需要主动重新配置时可运行 `kodax setup`。
53
56
 
54
57
  > **不装 Node 的目标机器**:从 [GitHub Releases](https://github.com/icetomoyo/KodaX/releases) 拿 Bun 编译的单文件二进制(Win / macOS / Linux × x64 + arm64)。详见 [docs/release.md](docs/release.md)。
55
58
 
@@ -88,6 +91,17 @@ daemon,不会再次打开 GUI。`ELECTRON_RUN_AS_NODE` 只存在于子进程
88
91
  再使用 attach-only 模式连接。SDK 的 `homeDir` 是拥有 `.kodax` 的 CLI 风格基础目录,
89
92
  不是 `.kodax` 目录本身。
90
93
 
94
+ **v0.7.72–v0.7.73 Runtime 权限契约:**Auto Mode 的权限决策由 Runtime Session 持有,
95
+ 不再由 UI hook 抢先决定。Runtime 会跨 turn 复用 LLM/rules guardrail,先分类、
96
+ 仅在 `escalate` 时创建共享 permission 请求,并把自动降级到 rules 的结果持久化到
97
+ session。Session 也可设置 classifier model 和有界 timeout;`auto` 默认使用 LLM
98
+ 分类,没有有效 classifier model 时会在调用 provider 或创建审批前返回可恢复配置错误,
99
+ 绝不静默退回 rules。Runtime 权限请求可给出由 Runtime 生成的精确作用域建议:一次允许、
100
+ 本 Session 允许,或(仅安全场景)持久允许;客户端只能回传不透明 suggestion id,不能从
101
+ 预览内容自行扩大范围。持久授权由 daemon 持有并通过 revision 管理。没有宿主审批回调时,
102
+ 不会向模型暴露 `exit_plan_mode`。完整 SDK 接入见
103
+ [Runtime Auto Mode 指引](docs/SDK_EMBEDDER_GUIDE.md#24-runtime-owned-auto-mode-and-plan-approval-bridges-v072)。
104
+
91
105
  ## 为什么用 KodaX
92
106
 
93
107
  <table>
@@ -116,7 +130,7 @@ daemon,不会再次打开 GUI。`ELECTRON_RUN_AS_NODE` 只存在于子进程
116
130
  <h3>🤖 默认多 agent</h3>
117
131
  <sub>V2 Worker 单循环 + Sidecar Verifier + 异步子 agent</sub>
118
132
  <br><br>
119
- <code>dispatch_child_task</code>、<code>send_message</code>、<code>task_stop</code>,多实例自动协调(content-hash safety net)。
133
+ <code>spawn_agent</code>、<code>send_message</code>、<code>followup_task</code>、<code>interrupt_agent</code>,多实例自动协调(content-hash safety net)。
120
134
  </td>
121
135
  <td align="center" valign="top">
122
136
  <h3>🧩 Skills + 自构造</h3>
@@ -167,7 +181,14 @@ kodax
167
181
 
168
182
  ### 2. 配置模型提供商
169
183
 
170
- 最简单的方式是先设置 API Key:
184
+ 可以先运行不会收集 Key 的交互配置:
185
+
186
+ ```bash
187
+ kodax setup
188
+ ```
189
+
190
+ 命令会保存 provider/model,告诉你准确的环境变量名,然后退出以便重启终端。
191
+ 也可以直接设置 API Key:
171
192
 
172
193
  ```bash
173
194
  # macOS / Linux
@@ -177,6 +198,14 @@ export ZHIPU_API_KEY=your_api_key
177
198
  $env:ZHIPU_API_KEY="your_api_key"
178
199
  ```
179
200
 
201
+ Qwen Token Plan 需要选择 `qwen-token-plan` 并使用单独的凭据;`QWEN_API_KEY`
202
+ 不能用于该路由:
203
+
204
+ ```bash
205
+ export QWEN_TOKEN_API_KEY=your_api_key
206
+ kodax --provider qwen-token-plan
207
+ ```
208
+
180
209
  然后在 `~/.kodax/config.json` 里写一个最小配置:
181
210
 
182
211
  ```json
@@ -228,7 +257,7 @@ const result = await runKodaX(
228
257
 
229
258
  ```typescript
230
259
  import { Runner } from '@kodax-ai/kodax/agent'; // Agent runtime
231
- import { getProvider } from '@kodax-ai/kodax/llm'; // LLM 抽象(15 个内置 alias)
260
+ import { getProvider } from '@kodax-ai/kodax/llm'; // LLM 抽象(16 个内置 alias)
232
261
  import { runKodaX } from '@kodax-ai/kodax/coding'; // Coding tools + prompts
233
262
  import { createImageArtifactFromPath } from '@kodax-ai/kodax/media'; // 输入 artifact helpers
234
263
  import { SkillRegistry } from '@kodax-ai/kodax/skills'; // 零依赖 skill loader
@@ -465,10 +494,11 @@ dist/binary/linux-x64/
465
494
  | kimi | `KIMI_API_KEY` | Native | kimi-k2.7-code(262,144 token;可 `/model` 切换 `kimi-k2.7-code-highspeed` / `kimi-k2.6` / `kimi-k2.5`) |
466
495
  | kimi-code | `KIMI_CODE_API_KEY` | Native | kimi-for-coding(可 `/model` 切换 `k3-256k`〔Moderato,256K〕/ `k3`〔Allegretto+,1M〕/ `kimi-for-coding-highspeed`;两个 K3 选项均请求上游 `k3`) |
467
496
  | qwen | `QWEN_API_KEY` | Native | qwen3.5-plus |
497
+ | qwen-token-plan | `QWEN_TOKEN_API_KEY` | Native | qwen3.8-max-preview(Anthropic 协议;可 `/model` 切换 `qwen3.7-max` / `qwen3.7-plus` / `qwen3.6-flash` / `glm-5.2` / `deepseek-v4-pro`;均为 1M ctx;Qwen 3.8 / 3.7 Plus / 3.6 Flash 支持图片理解) |
468
498
  | zhipu | `ZHIPU_API_KEY` | Native | glm-5(可 `/model` 切换 `glm-5.2` 1M ctx / `glm-5.1` / `glm-5-turbo`) |
469
- | zhipu-coding | `ZHIPU_CODING_API_KEY` | Native | glm-5(GLM Coding Plan;可 `/model` 切换 `glm-5.2` 1M ctx / `glm-5.1` / `glm-5-turbo`) |
499
+ | zhipu-coding | `ZHIPU_CODING_API_KEY` | Native | glm-5.21M ctx;仍可通过 `/model` 显式选择兼容模型 `glm-5.1` / `glm-5-turbo`) |
470
500
  | zai-coding | `ZAI_CODING_API_KEY` | Native | glm-5.2(GLM Coding Plan 海外站,通过 `api.z.ai` 接入,Anthropic 协议 — 模型清单和 `zhipu-coding` 完全一致) |
471
- | minimax-coding | `MINIMAX_CODING_API_KEY` | Native | MiniMax-M2.7(可 `/model` 切换 `MiniMax-M3` Frontier Coding,原生多模态 + 1M ctx;以及 `MiniMax-M2.7-highspeed`) |
501
+ | minimax-coding | `MINIMAX_CODING_API_KEY` | Native | MiniMax-M3Frontier Coding,原生多模态 + 1M ctx;仍可通过 `/model` 显式选择兼容模型 `MiniMax-M2.7` / `MiniMax-M2.7-highspeed`) |
472
502
  | mimo | `MIMO_API_KEY` | Native | mimo-v2.5-pro(小米 MiMo 按量计费,Anthropic 协议) |
473
503
  | mimo-coding | `MIMO_CODING_API_KEY` | Native | mimo-v2.5-pro(小米 MiMo Token Plan,Anthropic 协议) |
474
504
  | ark-coding | `ARK_CODING_API_KEY` | Native | glm-5.2(火山方舟 Coding Plan — GLM-5.2(别名 `glm-latest`) · Kimi K2.7 Code / K2.6 · MiniMax M3 / M2.7 · DeepSeek V4 Pro / V4 Flash · Doubao Seed 2.0 Code / Pro / Lite · Doubao Seed Code) |
@@ -533,11 +563,15 @@ KodaX 有 50+ 个内置工具,按类别分组如下(实际暴露给 LLM 是
533
563
 
534
564
  | 工具 | 说明 |
535
565
  |------|------|
536
- | `dispatch_child_task` | 派发子 agent 跑独立调研 / 改动任务。可选 `model_hint: 'fast' \| 'balanced' \| 'deep'`(advisory 标记,routing 在 FEATURE_102 v0.7.45 之前是 no-op) |
537
- | `send_message` | 给在跑 child 队列追加一条 `<coordinator-instruction>` 指令,child 下一个 turn 边界看到。仅 coordinator 可用。(FEATURE_120, v0.7.39) |
538
- | `task_stop` | 请求指定 child 优雅退出。当前 tool 原子结束后 child 看到 `<coordinator-stop-request>` 并 emit 最终摘要。仅 coordinator 可用。(FEATURE_120, v0.7.39) |
566
+ | `spawn_agent` | 创建命名子 Actor,并在继承权限、会话并发和根工作预算约束下启动首个 Turn。 |
567
+ | `send_message` | Actor 的持久 mailbox 提交有界信息,不启动新 Turn。 |
568
+ | `followup_task` | 在安全边界加入运行中的 Actor,或为 idle Actor 原子启动新 Turn。 |
569
+ | `wait_agent` | 等待一个或多个 Actor 状态变化,不轮询第二套任务注册表。 |
570
+ | `interrupt_agent` | 请求中断 active Turn,同时保留 Actor 身份。 |
571
+ | `list_agents` | 查看调用方有权访问的 Actor 子树与 Turn 状态。 |
572
+ | `agent_output` | 读取有权限的 Actor/Turn 有界持久输出。 |
539
573
  | `ask_user_question` | 向用户发起单选 / 多选 / 自由文本提问 |
540
- | `exit_plan_mode` | Plan 模式下提交最终方案给用户审批(仅 REPL |
574
+ | `exit_plan_mode` | 仅在当前 REPL/宿主提供审批回调时提交最终方案 |
541
575
  | `emit_managed_protocol` | managed-task 协议侧信道(verdict role payload)。v0.7.42 FEATURE_184 起默认走 V2 Worker 单循环 + Sidecar Verifier;v0.7.43 FEATURE_193 退役 V1 chain。 |
542
576
 
543
577
  ## Repo Intelligence(内置 full/light 引擎)
@@ -557,9 +591,9 @@ KodaX 是基于 npm workspaces 的 TypeScript monorepo,**源码层 4 个 works
557
591
 
558
592
  | Workspace 包 | 作用 | 主要依赖 |
559
593
  |----|------|---------|
560
- | `@kodax-ai/llm` | LLM 抽象层(15 个内置 provider alias + 自定义 provider 注册),可独立使用 | `@anthropic-ai/sdk`, `openai` |
561
- | `@kodax-ai/agent` | 通用 Agent 框架 —— Runner / runFanOut / runWithIdleYield / ChildTaskRegistry + media/input artifacts + 会话管理 + tokenization + 可插拔 compaction + **inline 后**:session-lineage 子树 + capabilities (mcp + skills + builtin) + tracing(subpaths: `/media`、`/session-lineage`、`/capabilities/mcp`、`/capabilities/skills`、`/tracing`) | `@kodax-ai/llm`, `js-tiktoken`, `fflate`, `jimp`, `yaml` |
562
- | `@kodax-ai/coding` | Coding Agent:50+ 工具(含 `dispatch_child_task`/`send_message`/`task_stop`)、role prompts、agent loop、auto-continue + repo-intelligence protocol(v0.7.43 inline) | `@kodax-ai/llm`, `@kodax-ai/agent` |
594
+ | `@kodax-ai/llm` | LLM 抽象层(16 个内置 provider alias + 自定义 provider 注册),可独立使用 | `@anthropic-ai/sdk`, `openai` |
595
+ | `@kodax-ai/agent` | 通用 Agent 框架 —— Runner / runFanOut / runWithIdleYield / AgentActorController / AgentTurnScheduler + media/input artifacts + 会话管理 + tokenization + 可插拔 compaction + **inline 后**:session-lineage 子树 + capabilities (mcp + skills + builtin) + tracing(subpaths: `/media`、`/session-lineage`、`/capabilities/mcp`、`/capabilities/skills`、`/tracing`) | `@kodax-ai/llm`, `js-tiktoken`, `fflate`, `jimp`, `yaml` |
596
+ | `@kodax-ai/coding` | Coding Agent:50+ 工具(含 canonical Actor 协作工具)、role prompts、agent loop、auto-continue + repo-intelligence protocol(v0.7.43 inline) | `@kodax-ai/llm`, `@kodax-ai/agent` |
563
597
  | `@kodax-ai/repl` | 完整交互式终端 UI(Ink / React、权限模式、命令系统、流式渲染) | `@kodax-ai/coding`, `ink`, `react` |
564
598
 
565
599
  根目录 `src/kodax_cli.ts` 是 CLI 入口;`src/sdk-{agent,llm,coding,media,repl,skills,mcp,session,runtime,a2a,experimental-memory}.ts` 是 SDK subpath 入口;构建产物在 `dist/`,单文件二进制在 `dist/binary/<target>/`。
@@ -677,22 +711,28 @@ A2A 配置迁移与历史任务 owner 迁移是两件事。如果升级 realm-aw
677
711
  精确授权的 Skill 脚本必须使用隔离策略,并通过 `kodax sandbox doctor`;
678
712
  Windows 的一次性显式初始化由 `kodax sandbox setup` 完成。
679
713
 
714
+ **v0.7.72 会话恢复与队列闭环:**裸 `kodax -r` 先加载可搜索选择器,不为列出
715
+ session 预加载完整 CLI;选中后才把 stdin 交给恢复后的 REPL,Esc 会释放选择器的
716
+ stdin 并立即回到原 shell。历史回放保留每条持久 event 的原始时间。用户 follow-up
717
+ 使用 session-root Actor queue scope,避免一个 session/child 的待处理输入被另一个
718
+ REPL 显示、唤醒或消费。
719
+
680
720
  **外部 Agent SDK plane(FEATURE_258,v0.7.67)**:`/agent` 导出协议中立的 executor、registration、policy、credential broker、artifact policy、catalog 和 durable task 契约;`/runtime` 通过 `admin.agentRegistrations`、`agents`、`agentTasks` 向 embedded 与 daemon client 提供同一组 DTO API。Executor factory 是宿主函数,只能装入 inline owner,或在创建新的 in-process daemon owner 时装入;不能通过既有 daemon 连接或 Runtime Worker 边界注入。Plane 关闭后是终态:未完成的 wait 和后续所有服务调用都会拒绝;受限 Workflow 脚本会完整校验并传递 `phase` 与外部 `target`。完整所有权、注册、preflight、启动/等待/继续/取消/对账和安全边界见 [SDK Embedder Guide §18](docs/SDK_EMBEDDER_GUIDE.md#18-external-agent-executor-plane-feature_258-v0767)。
681
721
 
682
722
  **成本受控 Workflow SDK(FEATURE_259,v0.7.67)**:SDK 调用方用 run-scoped `modelTiers` 与 `workflow.maxConcurrency` 配置路由和并发,workflow 作者只表达 `fast` / `balanced` / `deep` 语义意图。terminal workflow event 回显 tier/source/fallback/usage/duration,持久化 `run.json.efficiencyReport` 给出 token coverage、role/tier 启动数、packet-read 拓扑、review wave 和 quality gate 结果。完整配置与遥测读取方式见 [SDK Embedder Guide §20](docs/SDK_EMBEDDER_GUIDE.md#20-cost-disciplined-workflow-routing-and-telemetry-feature_259-v0767)。
683
723
 
684
- **Inline workflow authoring(FEATURE_246,v0.7.58)**:AMA/AMAW Worker 现在可通过 model-callable 的 `run_workflow` 工具在会话内直接编写并运行工作流——先用自己的工具 scout 代码库,再把具体发现烤进每个 child prompt,然后走**不变的** sandbox + 静态校验 + postcondition 验证流水线。它取代 context-blind 的 `sideQuery` generator 成为主交互路径(generator 仅作为显式 `/workflow create` 命令与无 investigating Worker 的 non-interactive/CI 主机的 fallback 保留);新增结构化 child 输出(`outputSchema`)、无 barrier `wf.pipeline` 分阶段原语、同会话 resume(`resumeFromRunId`)、嵌套 `wf.workflow(...)`,`/workflow create` 重定向到 Worker 的 scout-then-author;`run_workflow` 为 async / idle-yield,不阻塞当前轮。中立的 run-lifecycle manager(`createWorkflowRunManager`)已移入 `@kodax-ai/kodax/agent` 供非 coding SDK 宿主使用。详见 [docs/features/v0.7.58.md](docs/features/v0.7.58.md)[docs/ADR.md](docs/ADR.md) ADR-044/046/047/048/049。
724
+ **Inline workflow authoring(FEATURE_246,v0.7.58;F270 v0.7.72 更新)**:Worker 在明确表达 Workflow 意图时,可通过 model-callable 的 `run_workflow` 工具在会话内编写并运行工作流。F270 退役 AMAW 与复杂度驱动激活;AMA 保留显式 `/workflow`、named/SDK 和自然语言 Workflow 请求。Workflow Agent 统一运行在 Actor 控制面。详见 [docs/features/v0.7.58.md](docs/features/v0.7.58.md)[docs/features/v0.7.72.md](docs/features/v0.7.72.md) ADR-044/046/047/048/049/055
685
725
 
686
- **工作流激活分层(FEATURE_248 + FEATURE_249,v0.7.59)**:三种 agent 模式现在有一致的工作流姿态。**AMAW** 携带 mode-level `ORCHESTRATION DEFAULT` 常驻指令(对齐参考实现的 "ultracode" 姿态):实质性工作——多文件调查、设计决策、任何做错代价高的任务——默认编排多个交叉验证的 agent,并有 PLAN-TIME COMMITMENT 流程修正把 orchestrate-vs-solo 决策前置到第 0 轮。**AMA** 同样 host `run_workflow` 工具但没有常驻指令——当你用自然语言请求编排时才激活,绝不因复杂度独自触发。**SA** 保持单独作业。该指令通过 `amawOrchestrationAvailable` 关闭泄漏,因此 AMA SA prompt 保持逐字节一致。详见 [docs/features/v0.7.59.md](docs/features/v0.7.59.md)。
726
+ **历史工作流激活分层(FEATURE_248 + FEATURE_249,v0.7.59;F270 v0.7.72 取代)**:v0.7.59 引入 AMAW AMA 的显式请求行为。F270 退役 AMAW 及其复杂度驱动指令;SA 保持单独作业,AMA 成为唯一自适应多 Agent 模式,并且只在明确 Workflow 意图下激活 Workflow。详见 [docs/features/v0.7.59.md](docs/features/v0.7.59.md) 与 [docs/features/v0.7.72.md](docs/features/v0.7.72.md)
687
727
 
688
- **managed 工具路径的渐进披露(FEATURE_250,v0.7.60)**:deferred-tool 渐进披露机制——此前仅 SA path 拥有——现在也应用于 AMA/AMAW**managed** path。缓存冷启的 managed 轮次对 13 个 non-mcp 延迟工具(repo-intelligence + web/code + goal)携带一行 search hint 而非完整描述;每个工具的 `input_schema` 不变,因此仍可直接调用,完整描述按需通过 `tool_search` 拉取。`mcp_*` 保持常驻,`run_workflow` 不动。对用户透明;由两个 5-alias eval panel 验证(DEFER_SAFE 5/5,0% read/grep 回退)。详见 [docs/features/v0.7.60.md](docs/features/v0.7.60.md)。
728
+ **managed 工具路径的渐进披露(FEATURE_250,v0.7.60;F270 模式更新于 v0.7.72)**:deferred-tool 渐进披露机制应用于 AMA 的 managed path。缓存冷启轮次以一行 search hint 替代 13 个 non-mcp 延迟工具的完整描述;F270 退役原 AMAW 模式,但不改变这项披露行为。详见 [docs/features/v0.7.60.md](docs/features/v0.7.60.md)。
689
729
 
690
730
  **上下文高效的工具结果 + Workflow 质量预检(FEATURE_251 + FEATURE_252,v0.7.61;2026-07-14 纠偏)**:本地工具先完整采集,只采用契约等价且严格更短的无损规范化;命令专用 Bash 有损过滤默认关闭,compound Bash 不使用语义 adapter。并行结果由唯一 owner 按最终 provider 请求统一判容:先求满足 `Pmax + 输出预留 + max(2048, Pmax 的 3%) <= 上下文窗口` 的最大最终输入,再只使用剩余物理容量。能放下就逐字交付,只有真实溢出才持久化完整结果并返回 `KODAX_RESULT_INCOMPLETE`。历史压缩使用同一物理容量规则:容量内不做默认有损 microcompaction,真实压力下 summary-first,无法形成可恢复请求时 typed failure,禁止静默删消息;静态提前百分比仅为显式 opt-in。FEATURE_252 的确定性 workflow 启动前合约 lint 保持不变。详见 [docs/features/v0.7.61.md](docs/features/v0.7.61.md) 与 [docs/ADR.md ADR-050](docs/ADR.md)。
691
731
 
692
732
  ```
693
733
  KodaX/ # 4 workspace packages(FEATURE_194 v0.7.43)
694
734
  ├── packages/
695
- │ ├── llm/ # @kodax-ai/llm —— 15 个内置 provider alias
735
+ │ ├── llm/ # @kodax-ai/llm —— 16 个内置 provider alias
696
736
  │ ├── agent/ # @kodax-ai/agent —— Runner / fan-out / idle-yield + 子树:
697
737
  │ │ ├── session-lineage/ # 分支 session tree (v0.7.43 inline)
698
738
  │ │ ├── capabilities/
@@ -800,7 +840,7 @@ KodaX 现在会把 Repo Intelligence 的本地缓存分成内置引擎 profile
800
840
  ## 文档
801
841
 
802
842
  - [README.md](README.md) - 英文版 README
803
- - [docs/SDK_EMBEDDER_GUIDE.md](docs/SDK_EMBEDDER_GUIDE.md) - SDK 宿主集成与 v0.7.70 公共 API 契约
843
+ - [docs/SDK_EMBEDDER_GUIDE.md](docs/SDK_EMBEDDER_GUIDE.md) - SDK 宿主集成、shared Runtime、v0.7.73 Auto Mode 与精确授权契约
804
844
  - [docs/release.md](docs/release.md) - 单文件二进制构建与发布流程
805
845
  - [docs/PRD.md](docs/PRD.md) - 产品需求
806
846
  - [docs/ADR.md](docs/ADR.md) - 架构决策
@@ -0,0 +1,2 @@
1
+ // @kodax-ai/kodax — bundled distribution. See docs/ADR.md ADR-022 + ADR-024.
2
+ import{Ga as i,Ma as j,da as d,ea as e,fa as f,j as c,ua as g,va as h}from"./chunk-AGDDM5AW.js";import"./chunk-64M5HOCA.js";import"./chunk-MBAPT2R5.js";import"./chunk-HVCNAZ52.js";import"./chunk-XXQLPTAN.js";import{sb as a,tb as b}from"./chunk-OG6DRNKV.js";import"./chunk-GAFFYJU3.js";import"./chunk-BUPJGG3C.js";import"./chunk-F7AIEHSS.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,j as runKodaX,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{Ea as a,Fa as b}from"./chunk-6JTWXGVU.js";import"./chunk-MLEAQTCD.js";import"./chunk-PFH53O4M.js";import"./chunk-EAD4SF3Z.js";import"./chunk-6RI2RBTF.js";import"./chunk-M7FXNPWV.js";import"./chunk-AGDDM5AW.js";import"./chunk-64M5HOCA.js";import"./chunk-MBAPT2R5.js";import"./chunk-HVCNAZ52.js";import"./chunk-XXQLPTAN.js";import"./chunk-OG6DRNKV.js";import"./chunk-GAFFYJU3.js";import"./chunk-BUPJGG3C.js";import"./chunk-F7AIEHSS.js";import"./chunk-ONUPGMER.js";export{a as ArgumentCompleter,b as createArgumentCompleter};