@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.
- package/CHANGELOG.md +687 -492
- package/README.md +91 -38
- package/README_CN.md +60 -20
- package/dist/chunks/agent-T6PGT6AU.js +2 -0
- package/dist/chunks/argument-completer-QGMWA2C3.js +2 -0
- package/dist/chunks/{chunk-64NQBOSN.js → chunk-64M5HOCA.js} +1 -1
- package/dist/chunks/chunk-6JTWXGVU.js +622 -0
- package/dist/chunks/{chunk-SLHL766K.js → chunk-6RI2RBTF.js} +1 -1
- package/dist/chunks/chunk-AGDDM5AW.js +329 -0
- package/dist/chunks/chunk-BUPJGG3C.js +5 -0
- package/dist/chunks/chunk-EAD4SF3Z.js +413 -0
- package/dist/chunks/chunk-F7AIEHSS.js +46 -0
- package/dist/chunks/chunk-GAFFYJU3.js +37 -0
- package/dist/chunks/chunk-HVCNAZ52.js +365 -0
- package/dist/chunks/chunk-M7FXNPWV.js +22 -0
- package/dist/chunks/{chunk-44QXPEEE.js → chunk-MBAPT2R5.js} +1 -1
- package/dist/chunks/chunk-MLEAQTCD.js +151 -0
- package/dist/chunks/chunk-OG6DRNKV.js +755 -0
- package/dist/chunks/{chunk-SX2WFHIS.js → chunk-PFH53O4M.js} +1 -1
- package/dist/chunks/chunk-V4F6IYNK.js +73 -0
- package/dist/chunks/chunk-WQ6PWGK5.js +320 -0
- package/dist/chunks/chunk-XXQLPTAN.js +78 -0
- package/dist/chunks/compaction-config-IHJBP4GO.js +2 -0
- package/dist/chunks/{construction-bootstrap-LI2FP7KZ.js → construction-bootstrap-EGRUHKLP.js} +1 -1
- package/dist/chunks/dist-5N3I2RTW.js +2 -0
- package/dist/chunks/{dist-GOUP4YVE.js → dist-EVEJAII2.js} +1 -1
- package/dist/chunks/host-MECITNE3.js +2 -0
- package/dist/chunks/run-manager-AY7RQOWM.js +2 -0
- package/dist/chunks/{utils-O4PT6SHQ.js → utils-2GAE4XIM.js} +1 -1
- package/dist/index.d.ts +18 -18
- package/dist/index.js +5 -5
- package/dist/kodax_bootstrap.js +28 -0
- package/dist/kodax_cli.js +1476 -1463
- package/dist/kodax_resume.js +44 -0
- package/dist/provider-capabilities.json +234 -53
- package/dist/runtime-worker.js +1347 -1344
- package/dist/sdk-a2a.d.ts +12 -11
- package/dist/sdk-a2a.js +1 -1
- package/dist/sdk-agent.d.ts +385 -209
- package/dist/sdk-agent.js +1 -1
- package/dist/sdk-coding.d.ts +162 -144
- package/dist/sdk-coding.js +1 -1
- package/dist/sdk-experimental-memory.d.ts +1 -1
- package/dist/sdk-experimental-memory.js +1 -1
- package/dist/sdk-llm.d.ts +8 -49
- package/dist/sdk-llm.js +1 -1
- package/dist/sdk-mcp.js +1 -1
- package/dist/sdk-media.d.ts +4 -1
- package/dist/sdk-media.js +1 -1
- package/dist/sdk-repl.d.ts +197 -27
- package/dist/sdk-repl.js +2 -2
- package/dist/sdk-runtime.d.ts +230 -36
- package/dist/sdk-runtime.js +1 -1
- package/dist/sdk-session.d.ts +8 -7
- package/dist/sdk-session.js +1 -1
- package/dist/sdk-skills.d.ts +5 -5
- package/dist/sdk-skills.js +1 -1
- package/dist/semantic-worker.js +14 -14
- package/dist/types-chunks/{base.d-Cz_rwpOi.d.ts → base.d-ChvpaKjZ.d.ts} +1 -1
- package/dist/types-chunks/{bash-prefix-extractor.d-YoiZl5yt.d.ts → bash-prefix-extractor.d-bApf5nGw.d.ts} +109 -250
- package/dist/types-chunks/{capability-learning.d-_lR0J4iR.d.ts → capability-learning.d-DPrYxRjF.d.ts} +1 -1
- package/dist/types-chunks/{capsule.d-CK5Pfz1k.d.ts → capsule.d-CGWltwno.d.ts} +25 -96
- package/dist/types-chunks/center-types.d-BBT122uJ.d.ts +91 -0
- package/dist/types-chunks/{commands.d-D6g2jq8V.d.ts → commands.d-CEHGwRok.d.ts} +64 -6
- package/dist/types-chunks/{guardrail.d-DilYC1dh.d.ts → guardrail.d-CC4vAQl7.d.ts} +2 -1
- package/dist/types-chunks/{guardrail.d-DdeDWnVu.d.ts → guardrail.d-CXIPlWP3.d.ts} +91 -18
- package/dist/types-chunks/public-api.d-FBmX0kxo.d.ts +1343 -0
- package/dist/types-chunks/{run-manager.d-DxU3SSGR.d.ts → run-manager.d-DUNnJcpE.d.ts} +1 -1
- package/dist/types-chunks/sdk-session-XqacVOs8.d.ts +82 -0
- package/dist/types-chunks/{resolver.d-ssgNSlrh.d.ts → side-query.d-DWTMsndP.d.ts} +68 -5
- package/dist/types-chunks/{types.d-CRCaLt_s.d.ts → types.d-BnPhGmar.d.ts} +287 -165
- package/dist/types-chunks/{types.d-Cqaw71Ax.d.ts → types.d-CSmF0t0n.d.ts} +6 -5
- package/dist/types-chunks/{types.d-vJExiRje.d.ts → types.d-DCQVBqVn.d.ts} +10 -5
- package/dist/types-chunks/{types.d-CzsLFqmf.d.ts → types.d-DKr6TCXL.d.ts} +23 -17
- package/dist/types-chunks/{types.d-CEZZSY9s.d.ts → types.d-DgciGHoG.d.ts} +3 -3
- package/dist/types-chunks/{utils.d-Cb6vdvFM.d.ts → utils.d-BPYX7-KN.d.ts} +99 -18
- package/docs/SDK_EMBEDDER_GUIDE.md +287 -35
- package/package.json +5 -5
- package/scripts/kodax-bin.cjs +4 -2
- package/scripts/production-env.cjs +9 -0
- package/dist/chunks/agent-A3N27WVN.js +0 -2
- package/dist/chunks/argument-completer-BWTLOPZG.js +0 -2
- package/dist/chunks/chunk-23X6REO4.js +0 -46
- package/dist/chunks/chunk-52JSZ77P.js +0 -37
- package/dist/chunks/chunk-5R2SJ2EU.js +0 -306
- package/dist/chunks/chunk-64ATCY3Q.js +0 -22
- package/dist/chunks/chunk-BRQWYBEY.js +0 -70
- package/dist/chunks/chunk-OUMXYT55.js +0 -624
- package/dist/chunks/chunk-QDZUOLSM.js +0 -7
- package/dist/chunks/chunk-QTXG7B2J.js +0 -366
- package/dist/chunks/chunk-RKYTSURE.js +0 -422
- package/dist/chunks/chunk-VDJZWXSW.js +0 -329
- package/dist/chunks/chunk-X5PDRSXM.js +0 -151
- package/dist/chunks/chunk-Y5XKAN7C.js +0 -755
- package/dist/chunks/chunk-ZJIMT5I3.js +0 -78
- package/dist/chunks/compaction-config-OCZPAJQO.js +0 -2
- package/dist/chunks/dist-Y2HGGI7W.js +0 -2
- package/dist/chunks/host-ADFTZO6T.js +0 -2
- package/dist/chunks/run-manager-QU6EBSHJ.js +0 -2
- package/dist/types-chunks/public-api.d-BvCp5VkW.d.ts +0 -601
- 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-
|
|
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>
|
|
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 (
|
|
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
|
-
│ │ ├──
|
|
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
|
-
│ │ │ #
|
|
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- │ │(
|
|
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 (
|
|
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.
|
|
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 |
|
|
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
|
|
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
|
|
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
|
|
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
|
-
- **
|
|
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.
|
|
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 (
|
|
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.
|
|
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
|
|
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
|
|
872
|
-
/auto # Alias for auto
|
|
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'; //
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
//
|
|
1106
|
-
|
|
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) · `
|
|
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`/`
|
|
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) ·
|
|
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;
|
|
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
|
|
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-
|
|
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
|
|
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
|
-
| `
|
|
1308
|
-
| `send_message` |
|
|
1309
|
-
| `
|
|
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
|
|
1312
|
-
| `run_workflow` | Author and run a
|
|
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-
|
|
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>
|
|
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
|
-
|
|
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 抽象(
|
|
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(
|
|
499
|
+
| zhipu-coding | `ZHIPU_CODING_API_KEY` | Native | glm-5.2(1M 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-
|
|
501
|
+
| minimax-coding | `MINIMAX_CODING_API_KEY` | Native | MiniMax-M3(Frontier 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
|
-
| `
|
|
537
|
-
| `send_message` |
|
|
538
|
-
| `
|
|
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` |
|
|
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 抽象层(
|
|
561
|
-
| `@kodax-ai/agent` | 通用 Agent 框架 —— Runner / runFanOut / runWithIdleYield /
|
|
562
|
-
| `@kodax-ai/coding` | Coding Agent:50+
|
|
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
|
|
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
|
-
|
|
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
|
|
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 ——
|
|
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
|
|
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};
|