@kodax-ai/kodax 0.7.71 → 0.7.72
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 +602 -487
- package/README.md +46 -27
- package/README_CN.md +30 -13
- package/dist/chunks/agent-YKGU4USA.js +2 -0
- package/dist/chunks/argument-completer-QZETLNAB.js +2 -0
- package/dist/chunks/{chunk-SX2WFHIS.js → chunk-2RI252RN.js} +1 -1
- package/dist/chunks/chunk-CLFP6UGU.js +71 -0
- package/dist/chunks/chunk-E27LHEIP.js +37 -0
- package/dist/chunks/chunk-EDZ5KJFT.js +5 -0
- package/dist/chunks/chunk-GIK4SGAT.js +364 -0
- package/dist/chunks/chunk-GVWPHE23.js +310 -0
- package/dist/chunks/{chunk-A2TFSV5M.js → chunk-IR5KIK7E.js} +1 -1
- package/dist/chunks/chunk-JSDLBXME.js +755 -0
- package/dist/chunks/chunk-MVARIMQV.js +22 -0
- package/dist/chunks/chunk-PKQOEDHJ.js +628 -0
- package/dist/chunks/{chunk-64NQBOSN.js → chunk-SQODXBLX.js} +1 -1
- package/dist/chunks/chunk-VDGCGOQH.js +328 -0
- package/dist/chunks/chunk-VVE3UM4F.js +410 -0
- package/dist/chunks/chunk-WIBLZK4G.js +151 -0
- package/dist/chunks/{compaction-config-5KKKXYFT.js → compaction-config-TWCDFLX6.js} +1 -1
- package/dist/chunks/{construction-bootstrap-OXDDDW6O.js → construction-bootstrap-ZJPXUPXQ.js} +1 -1
- package/dist/chunks/dist-JT4ATXVM.js +2 -0
- package/dist/chunks/host-SVEDZUC5.js +2 -0
- package/dist/chunks/{run-manager-Z3W6MDO7.js → run-manager-RX42UNEM.js} +1 -1
- package/dist/chunks/{utils-CFOXDCB5.js → utils-OTT5CG5J.js} +1 -1
- package/dist/index.d.ts +13 -13
- package/dist/index.js +4 -4
- package/dist/kodax_bootstrap.js +28 -0
- package/dist/kodax_cli.js +1325 -1333
- package/dist/kodax_resume.js +44 -0
- package/dist/provider-capabilities.json +50 -48
- package/dist/runtime-worker.js +1322 -1330
- package/dist/sdk-a2a.d.ts +10 -9
- package/dist/sdk-a2a.js +1 -1
- package/dist/sdk-agent.d.ts +382 -206
- package/dist/sdk-agent.js +1 -1
- package/dist/sdk-coding.d.ts +80 -128
- package/dist/sdk-coding.js +1 -1
- package/dist/sdk-experimental-memory.js +1 -1
- package/dist/sdk-mcp.js +1 -1
- package/dist/sdk-media.d.ts +3 -0
- package/dist/sdk-media.js +1 -1
- package/dist/sdk-repl.d.ts +71 -23
- package/dist/sdk-repl.js +2 -2
- package/dist/sdk-runtime.d.ts +143 -31
- package/dist/sdk-runtime.js +1 -1
- package/dist/sdk-session.d.ts +6 -5
- 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/{bash-prefix-extractor.d-YoiZl5yt.d.ts → bash-prefix-extractor.d-CHJO5y94.d.ts} +107 -248
- package/dist/types-chunks/{capsule.d-CK5Pfz1k.d.ts → capsule.d-DxtdE-GD.d.ts} +24 -95
- package/dist/types-chunks/center-types.d-BBT122uJ.d.ts +91 -0
- package/dist/types-chunks/{commands.d-D6g2jq8V.d.ts → commands.d-DZxHzH5-.d.ts} +6 -4
- package/dist/types-chunks/{guardrail.d-DilYC1dh.d.ts → guardrail.d-DlpMnd-Y.d.ts} +1 -1
- package/dist/types-chunks/{guardrail.d-DdeDWnVu.d.ts → guardrail.d-auV61_h5.d.ts} +83 -10
- package/dist/types-chunks/public-api.d--IDNJsu1.d.ts +1342 -0
- package/dist/types-chunks/{run-manager.d-DxU3SSGR.d.ts → run-manager.d-Bh50OdVl.d.ts} +1 -1
- package/dist/types-chunks/sdk-session-Cfw6NFu-.d.ts +82 -0
- package/dist/types-chunks/{types.d-CEZZSY9s.d.ts → types.d-CNZgY52F.d.ts} +2 -2
- package/dist/types-chunks/{types.d-vJExiRje.d.ts → types.d-DCQVBqVn.d.ts} +10 -5
- package/dist/types-chunks/{types.d-CRCaLt_s.d.ts → types.d-DH1mvdcl.d.ts} +284 -164
- package/dist/types-chunks/{types.d-CzsLFqmf.d.ts → types.d-EqQmHztg.d.ts} +9 -10
- package/dist/types-chunks/{utils.d-Cb6vdvFM.d.ts → utils.d-gmn3c5U4.d.ts} +9 -12
- package/docs/SDK_EMBEDDER_GUIDE.md +171 -26
- package/package.json +4 -4
- package/scripts/kodax-bin.cjs +4 -2
- package/scripts/production-env.cjs +9 -0
- package/dist/chunks/agent-X2EWQADL.js +0 -2
- package/dist/chunks/argument-completer-BLNXDO2F.js +0 -2
- package/dist/chunks/chunk-4DY756KL.js +0 -70
- package/dist/chunks/chunk-52JSZ77P.js +0 -37
- package/dist/chunks/chunk-A574DBTV.js +0 -422
- package/dist/chunks/chunk-F7KGYHJ3.js +0 -624
- package/dist/chunks/chunk-GVTM4Z6O.js +0 -151
- package/dist/chunks/chunk-PHH4TRGF.js +0 -22
- package/dist/chunks/chunk-PVUXONQB.js +0 -366
- package/dist/chunks/chunk-T7LYK53M.js +0 -329
- package/dist/chunks/chunk-VRSVNU2Y.js +0 -7
- package/dist/chunks/chunk-Y5XKAN7C.js +0 -755
- package/dist/chunks/chunk-Z535BARK.js +0 -306
- package/dist/chunks/dist-IXJRJ27U.js +0 -2
- package/dist/chunks/host-VRKDAN26.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
|
@@ -94,7 +94,7 @@ That's it. You're in the REPL — ask anything in natural language.
|
|
|
94
94
|
<h3>🤖 Multi-agent by default</h3>
|
|
95
95
|
<sub>V2 Worker single-loop + Sidecar Verifier + async children</sub>
|
|
96
96
|
<br><br>
|
|
97
|
-
<code>
|
|
97
|
+
<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
98
|
</td>
|
|
99
99
|
<td align="center" valign="top">
|
|
100
100
|
<h3>🧩 Skills + self-construction</h3>
|
|
@@ -386,6 +386,13 @@ context diagnostics, and daemon protocol schemas, see
|
|
|
386
386
|
The Space/IDE shared-daemon contract is documented in
|
|
387
387
|
[SDK Embedder Guide section 23](docs/SDK_EMBEDDER_GUIDE.md#23-shared-coder-daemon-for-space-and-ide-hosts-feature_269-v0769).
|
|
388
388
|
|
|
389
|
+
**v0.7.72 Runtime correction:** Auto Mode is now owned by the Runtime session,
|
|
390
|
+
not by a UI hook. It reuses its LLM/rules guardrail across turns, classifies
|
|
391
|
+
before the shared permission bridge, and persists an automatic fallback to
|
|
392
|
+
rules. The same session settings can select a classifier model and bounded
|
|
393
|
+
timeout. Host plan exit is exposed only when the host supplies an approval
|
|
394
|
+
callback. See the [Runtime Auto Mode integration guide](docs/SDK_EMBEDDER_GUIDE.md#24-runtime-owned-auto-mode-and-plan-approval-bridges-v072).
|
|
395
|
+
|
|
389
396
|
## Repo Intelligence
|
|
390
397
|
|
|
391
398
|
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.
|
|
@@ -408,7 +415,7 @@ KodaX/
|
|
|
408
415
|
│ │ └── providers/ # Anthropic, OpenAI, DeepSeek, Kimi, MiMo, MiniMax, Zhipu, Ark, …
|
|
409
416
|
│ │
|
|
410
417
|
│ ├── agent/ # @kodax-ai/agent - Generic Agent framework
|
|
411
|
-
│ │ ├──
|
|
418
|
+
│ │ ├── actors/ # Runtime-owned Actor tree, scheduler, mailbox, events
|
|
412
419
|
│ │ ├── session-lineage/ # branchable session tree (inline v0.7.43)
|
|
413
420
|
│ │ ├── capabilities/
|
|
414
421
|
│ │ │ ├── mcp/ # MCP integration (inline v0.7.43)
|
|
@@ -417,7 +424,7 @@ KodaX/
|
|
|
417
424
|
│ │
|
|
418
425
|
│ ├── coding/ # @kodax-ai/coding - Coding Agent (tools + prompts)
|
|
419
426
|
│ │ ├── tools/ # 50+ tools: read, write, edit, bash, glob, grep, undo,
|
|
420
|
-
│ │ │ #
|
|
427
|
+
│ │ │ # spawn_agent, send_message, followup_task, wait_agent,
|
|
421
428
|
│ │ │ # ask_user_question, repo-intelligence, …
|
|
422
429
|
│ │ └── repo-intelligence/ # incl. protocol.ts (inline v0.7.43)
|
|
423
430
|
│ │
|
|
@@ -466,7 +473,7 @@ Source-side workspace package names (`@kodax-ai/*`). npm consumers install the s
|
|
|
466
473
|
|---------|---------|------------------|
|
|
467
474
|
| `@kodax-ai/llm` | LLM abstraction (15 built-in provider aliases + custom registration) | @anthropic-ai/sdk, openai |
|
|
468
475
|
| `@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.
|
|
476
|
+
| `@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
477
|
| `@kodax-ai/repl` | Complete interactive terminal UI (Ink/React, permission modes, commands, streaming) | @kodax-ai/coding, ink, react |
|
|
471
478
|
|
|
472
479
|
### Source-side vs npm-published surface
|
|
@@ -500,11 +507,11 @@ KodaX has two layers that consumers should understand separately:
|
|
|
500
507
|
|
|
501
508
|
**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
509
|
|
|
503
|
-
**Inline Workflow Authoring (FEATURE_246, v0.7.58
|
|
510
|
+
**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
511
|
|
|
505
|
-
**Workflow Activation Tiers (FEATURE_248 + FEATURE_249, v0.7.59
|
|
512
|
+
**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
513
|
|
|
507
|
-
**Progressive Disclosure on the Managed Tool Path (FEATURE_250, v0.7.60)**: the deferred-tool progressive-disclosure mechanism
|
|
514
|
+
**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
515
|
|
|
509
516
|
**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
517
|
|
|
@@ -621,7 +628,7 @@ one-time provisioning).
|
|
|
621
628
|
- **Modular Architecture** - Use as CLI, as a library, or as a Node-free single binary
|
|
622
629
|
- **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
|
|
623
630
|
- **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.
|
|
631
|
+
- **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
632
|
- **Reasoning Effort** - Effort-first control (`off/auto/low/medium/high` plus model-supported extras) across providers
|
|
626
633
|
- **Streaming Output** - Real-time response display
|
|
627
634
|
- **Session Management** - JSONL format with branchable session lineage tree
|
|
@@ -806,7 +813,12 @@ Bare `-r` opens an interactive picker with incremental search, arrow/PageUp/Page
|
|
|
806
813
|
navigation, Tab completion, full selected-session ID display, and Enter-to-resume.
|
|
807
814
|
An explicit value checks the complete session ID first, then an exact
|
|
808
815
|
case-insensitive title; duplicate titles open a narrowed picker instead of
|
|
809
|
-
silently choosing one.
|
|
816
|
+
silently choosing one. The picker loads before the full CLI, so session listing
|
|
817
|
+
remains responsive. After selection it hands terminal input to the resumed
|
|
818
|
+
REPL; Esc releases the picker's stdin ownership and immediately returns to the
|
|
819
|
+
invoking shell. Session replay preserves each recorded message/event timestamp.
|
|
820
|
+
|
|
821
|
+
Cleanup is preview-only unless
|
|
810
822
|
`--apply-session-cleanup` is also provided; matching sessions are archived rather
|
|
811
823
|
than permanently deleted.
|
|
812
824
|
|
|
@@ -862,14 +874,14 @@ KodaX provides 3 permission modes for fine-grained control:
|
|
|
862
874
|
|------|-------------|------------------------|
|
|
863
875
|
| `plan` | Read-only planning mode | All modification tools blocked |
|
|
864
876
|
| `accept-edits` | Auto-accept file edits | bash only |
|
|
865
|
-
| `auto
|
|
877
|
+
| `auto` | Runtime-owned LLM/rules classification within the project boundary | Only explicit classifier escalation |
|
|
866
878
|
|
|
867
879
|
```bash
|
|
868
880
|
# In REPL, use /mode command
|
|
869
881
|
/mode plan # Switch to plan mode (read-only)
|
|
870
882
|
/mode accept-edits # Switch to accept-edits mode
|
|
871
|
-
/mode auto
|
|
872
|
-
/auto # Alias for auto
|
|
883
|
+
/mode auto # Switch to Runtime-owned Auto Mode
|
|
884
|
+
/auto # Alias for auto
|
|
873
885
|
|
|
874
886
|
# Check current mode
|
|
875
887
|
/mode
|
|
@@ -881,6 +893,9 @@ KodaX provides 3 permission modes for fine-grained control:
|
|
|
881
893
|
- Permanent protection zones: `.kodax/`, `~/.kodax/`, paths outside project
|
|
882
894
|
- Pattern-based permission: Allow specific Bash commands (e.g., `Bash(npm install)`)
|
|
883
895
|
- Unified diff display for write/edit operations
|
|
896
|
+
- Auto Mode runs guardrail classification before the permission UI; a safe
|
|
897
|
+
allow verdict does not create a pending approval request. The session records
|
|
898
|
+
an automatic LLM-to-rules fallback for later turns.
|
|
884
899
|
|
|
885
900
|
### CLI Help Topics
|
|
886
901
|
|
|
@@ -1088,8 +1103,7 @@ import {
|
|
|
1088
1103
|
Runner,
|
|
1089
1104
|
runFanOut,
|
|
1090
1105
|
runWithIdleYield,
|
|
1091
|
-
|
|
1092
|
-
type ChildTaskRegistry,
|
|
1106
|
+
createAgentActorController,
|
|
1093
1107
|
generateSessionId,
|
|
1094
1108
|
estimateTokens,
|
|
1095
1109
|
DefaultSummaryCompaction,
|
|
@@ -1102,14 +1116,15 @@ const result = await runFanOut({
|
|
|
1102
1116
|
run: async (bundle) => doWork(bundle),
|
|
1103
1117
|
});
|
|
1104
1118
|
|
|
1105
|
-
//
|
|
1106
|
-
|
|
1119
|
+
// Runtime-owned Actor identity tree (inject an executor before starting Turns)
|
|
1120
|
+
const actors = await createAgentActorController();
|
|
1121
|
+
const tree = actors.list('/root');
|
|
1107
1122
|
|
|
1108
1123
|
// Pluggable compaction policy (FEATURE_081)
|
|
1109
1124
|
const policy = new DefaultSummaryCompaction({ thresholdRatio: 0.8, keepRecent: 10 });
|
|
1110
1125
|
```
|
|
1111
1126
|
|
|
1112
|
-
**Key Features**: `Runner` + per-step lifecycle · `runFanOut` (bounded-concurrency + abort + progress events) · `runWithIdleYield` (chat-while-waiting) · `
|
|
1127
|
+
**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
1128
|
|
|
1114
1129
|
### `@kodax-ai/kodax/skills` — Skills System
|
|
1115
1130
|
|
|
@@ -1138,7 +1153,7 @@ const result = await executeSkill({
|
|
|
1138
1153
|
|
|
1139
1154
|
### `@kodax-ai/kodax/coding` — Coding Agent
|
|
1140
1155
|
|
|
1141
|
-
Complete coding agent: 50+ tools (`read`/`write`/`edit`/`bash`/`grep`/`glob`/`
|
|
1156
|
+
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
1157
|
|
|
1143
1158
|
```typescript
|
|
1144
1159
|
import { runKodaX, KodaXClient, KODAX_TOOLS } from '@kodax-ai/kodax/coding';
|
|
@@ -1160,7 +1175,7 @@ await client.send('Create a new file');
|
|
|
1160
1175
|
await client.send('Add a function to it'); // Has context from previous message
|
|
1161
1176
|
```
|
|
1162
1177
|
|
|
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) ·
|
|
1178
|
+
**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
1179
|
|
|
1165
1180
|
### `@kodax-ai/kodax/repl` — Interactive Terminal UI
|
|
1166
1181
|
|
|
@@ -1215,9 +1230,9 @@ await runInkInteractiveMode({ provider: 'zhipu-coding', effort: 'auto' });
|
|
|
1215
1230
|
| 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
1231
|
| qwen | `QWEN_API_KEY` | Native | qwen3.5-plus |
|
|
1217
1232
|
| 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
|
|
1233
|
+
| 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
1234
|
| 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-
|
|
1235
|
+
| 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
1236
|
| mimo | `MIMO_API_KEY` | Native | mimo-v2.5-pro (Xiaomi MiMo pay-per-token, Anthropic-compat) |
|
|
1222
1237
|
| mimo-coding | `MIMO_CODING_API_KEY` | Native | mimo-v2.5-pro (Xiaomi Token Plan, Anthropic-compat) |
|
|
1223
1238
|
| 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 +1261,7 @@ kodax --session list
|
|
|
1246
1261
|
# Parallel tool execution
|
|
1247
1262
|
kodax --parallel "Read package.json and tsconfig.json"
|
|
1248
1263
|
|
|
1249
|
-
# Adaptive multi-agent (AMA) mode — V2 Worker single-loop with
|
|
1264
|
+
# Adaptive multi-agent (AMA) mode — V2 Worker single-loop with Actor collaboration
|
|
1250
1265
|
kodax --agent-mode ama "Analyze code structure, check test coverage, find bugs"
|
|
1251
1266
|
```
|
|
1252
1267
|
|
|
@@ -1304,12 +1319,16 @@ KodaX ships 50+ built-in tools, grouped below. They are registered as a single f
|
|
|
1304
1319
|
### Agent control & UX
|
|
1305
1320
|
| Tool | Description |
|
|
1306
1321
|
|------|-------------|
|
|
1307
|
-
| `
|
|
1308
|
-
| `send_message` |
|
|
1309
|
-
| `
|
|
1322
|
+
| `spawn_agent` | Create a named child Actor and start its first Turn under inherited capabilities, session capacity, and root work budget. |
|
|
1323
|
+
| `send_message` | Commit bounded information to an Actor mailbox without starting a new Turn. |
|
|
1324
|
+
| `followup_task` | Join a running Actor at a safe boundary or atomically start a new Turn for an idle Actor. |
|
|
1325
|
+
| `wait_agent` | Wait for one or more Actor state changes without polling a second task registry. |
|
|
1326
|
+
| `interrupt_agent` | Request interruption of an active Turn while preserving Actor identity. |
|
|
1327
|
+
| `list_agents` | Inspect the caller-visible Actor subtree and Turn states. |
|
|
1328
|
+
| `agent_output` | Read bounded durable output for an authorized Actor/Turn. |
|
|
1310
1329
|
| `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
|
|
1330
|
+
| `exit_plan_mode` | Present a finalized plan only when the active REPL/host supplied an approval callback |
|
|
1331
|
+
| `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
1332
|
| `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
1333
|
|
|
1315
1334
|
---
|
package/README_CN.md
CHANGED
|
@@ -88,6 +88,13 @@ daemon,不会再次打开 GUI。`ELECTRON_RUN_AS_NODE` 只存在于子进程
|
|
|
88
88
|
再使用 attach-only 模式连接。SDK 的 `homeDir` 是拥有 `.kodax` 的 CLI 风格基础目录,
|
|
89
89
|
不是 `.kodax` 目录本身。
|
|
90
90
|
|
|
91
|
+
**v0.7.72 Runtime 修正:**Auto Mode 的权限决策由 Runtime Session 持有,
|
|
92
|
+
不再由 UI hook 抢先决定。Runtime 会跨 turn 复用 LLM/rules guardrail,先分类、
|
|
93
|
+
仅在 `escalate` 时创建共享 permission 请求,并把自动降级到 rules 的结果持久化到
|
|
94
|
+
session。Session 也可设置 classifier model 和有界 timeout;没有宿主审批回调时,
|
|
95
|
+
不会向模型暴露 `exit_plan_mode`。完整 SDK 接入见
|
|
96
|
+
[Runtime Auto Mode 指引](docs/SDK_EMBEDDER_GUIDE.md#24-runtime-owned-auto-mode-and-plan-approval-bridges-v072)。
|
|
97
|
+
|
|
91
98
|
## 为什么用 KodaX
|
|
92
99
|
|
|
93
100
|
<table>
|
|
@@ -116,7 +123,7 @@ daemon,不会再次打开 GUI。`ELECTRON_RUN_AS_NODE` 只存在于子进程
|
|
|
116
123
|
<h3>🤖 默认多 agent</h3>
|
|
117
124
|
<sub>V2 Worker 单循环 + Sidecar Verifier + 异步子 agent</sub>
|
|
118
125
|
<br><br>
|
|
119
|
-
<code>
|
|
126
|
+
<code>spawn_agent</code>、<code>send_message</code>、<code>followup_task</code>、<code>interrupt_agent</code>,多实例自动协调(content-hash safety net)。
|
|
120
127
|
</td>
|
|
121
128
|
<td align="center" valign="top">
|
|
122
129
|
<h3>🧩 Skills + 自构造</h3>
|
|
@@ -466,9 +473,9 @@ dist/binary/linux-x64/
|
|
|
466
473
|
| 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
474
|
| qwen | `QWEN_API_KEY` | Native | qwen3.5-plus |
|
|
468
475
|
| 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(
|
|
476
|
+
| zhipu-coding | `ZHIPU_CODING_API_KEY` | Native | glm-5.2(1M ctx;仍可通过 `/model` 显式选择兼容模型 `glm-5.1` / `glm-5-turbo`) |
|
|
470
477
|
| 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-
|
|
478
|
+
| minimax-coding | `MINIMAX_CODING_API_KEY` | Native | MiniMax-M3(Frontier Coding,原生多模态 + 1M ctx;仍可通过 `/model` 显式选择兼容模型 `MiniMax-M2.7` / `MiniMax-M2.7-highspeed`) |
|
|
472
479
|
| mimo | `MIMO_API_KEY` | Native | mimo-v2.5-pro(小米 MiMo 按量计费,Anthropic 协议) |
|
|
473
480
|
| mimo-coding | `MIMO_CODING_API_KEY` | Native | mimo-v2.5-pro(小米 MiMo Token Plan,Anthropic 协议) |
|
|
474
481
|
| 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 +540,15 @@ KodaX 有 50+ 个内置工具,按类别分组如下(实际暴露给 LLM 是
|
|
|
533
540
|
|
|
534
541
|
| 工具 | 说明 |
|
|
535
542
|
|------|------|
|
|
536
|
-
| `
|
|
537
|
-
| `send_message` |
|
|
538
|
-
| `
|
|
543
|
+
| `spawn_agent` | 创建命名子 Actor,并在继承权限、会话并发和根工作预算约束下启动首个 Turn。 |
|
|
544
|
+
| `send_message` | 向 Actor 的持久 mailbox 提交有界信息,不启动新 Turn。 |
|
|
545
|
+
| `followup_task` | 在安全边界加入运行中的 Actor,或为 idle Actor 原子启动新 Turn。 |
|
|
546
|
+
| `wait_agent` | 等待一个或多个 Actor 状态变化,不轮询第二套任务注册表。 |
|
|
547
|
+
| `interrupt_agent` | 请求中断 active Turn,同时保留 Actor 身份。 |
|
|
548
|
+
| `list_agents` | 查看调用方有权访问的 Actor 子树与 Turn 状态。 |
|
|
549
|
+
| `agent_output` | 读取有权限的 Actor/Turn 有界持久输出。 |
|
|
539
550
|
| `ask_user_question` | 向用户发起单选 / 多选 / 自由文本提问 |
|
|
540
|
-
| `exit_plan_mode` |
|
|
551
|
+
| `exit_plan_mode` | 仅在当前 REPL/宿主提供审批回调时提交最终方案 |
|
|
541
552
|
| `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
553
|
|
|
543
554
|
## Repo Intelligence(内置 full/light 引擎)
|
|
@@ -558,8 +569,8 @@ KodaX 是基于 npm workspaces 的 TypeScript monorepo,**源码层 4 个 works
|
|
|
558
569
|
| Workspace 包 | 作用 | 主要依赖 |
|
|
559
570
|
|----|------|---------|
|
|
560
571
|
| `@kodax-ai/llm` | LLM 抽象层(15 个内置 provider alias + 自定义 provider 注册),可独立使用 | `@anthropic-ai/sdk`, `openai` |
|
|
561
|
-
| `@kodax-ai/agent` | 通用 Agent 框架 —— Runner / runFanOut / runWithIdleYield /
|
|
562
|
-
| `@kodax-ai/coding` | Coding Agent:50+
|
|
572
|
+
| `@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` |
|
|
573
|
+
| `@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
574
|
| `@kodax-ai/repl` | 完整交互式终端 UI(Ink / React、权限模式、命令系统、流式渲染) | `@kodax-ai/coding`, `ink`, `react` |
|
|
564
575
|
|
|
565
576
|
根目录 `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,15 +688,21 @@ A2A 配置迁移与历史任务 owner 迁移是两件事。如果升级 realm-aw
|
|
|
677
688
|
精确授权的 Skill 脚本必须使用隔离策略,并通过 `kodax sandbox doctor`;
|
|
678
689
|
Windows 的一次性显式初始化由 `kodax sandbox setup` 完成。
|
|
679
690
|
|
|
691
|
+
**v0.7.72 会话恢复与队列闭环:**裸 `kodax -r` 先加载可搜索选择器,不为列出
|
|
692
|
+
session 预加载完整 CLI;选中后才把 stdin 交给恢复后的 REPL,Esc 会释放选择器的
|
|
693
|
+
stdin 并立即回到原 shell。历史回放保留每条持久 event 的原始时间。用户 follow-up
|
|
694
|
+
使用 session-root Actor queue scope,避免一个 session/child 的待处理输入被另一个
|
|
695
|
+
REPL 显示、唤醒或消费。
|
|
696
|
+
|
|
680
697
|
**外部 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
698
|
|
|
682
699
|
**成本受控 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
700
|
|
|
684
|
-
**Inline workflow authoring(FEATURE_246,v0.7.58
|
|
701
|
+
**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
702
|
|
|
686
|
-
|
|
703
|
+
**历史工作流激活分层(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
704
|
|
|
688
|
-
**managed 工具路径的渐进披露(FEATURE_250,v0.7.60)**:deferred-tool
|
|
705
|
+
**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
706
|
|
|
690
707
|
**上下文高效的工具结果 + 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
708
|
|
|
@@ -800,7 +817,7 @@ KodaX 现在会把 Repo Intelligence 的本地缓存分成内置引擎 profile
|
|
|
800
817
|
## 文档
|
|
801
818
|
|
|
802
819
|
- [README.md](README.md) - 英文版 README
|
|
803
|
-
- [docs/SDK_EMBEDDER_GUIDE.md](docs/SDK_EMBEDDER_GUIDE.md) - SDK
|
|
820
|
+
- [docs/SDK_EMBEDDER_GUIDE.md](docs/SDK_EMBEDDER_GUIDE.md) - SDK 宿主集成、shared Runtime 与 v0.7.72 Auto Mode 契约
|
|
804
821
|
- [docs/release.md](docs/release.md) - 单文件二进制构建与发布流程
|
|
805
822
|
- [docs/PRD.md](docs/PRD.md) - 产品需求
|
|
806
823
|
- [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-VDGCGOQH.js";import"./chunk-SQODXBLX.js";import"./chunk-44QXPEEE.js";import"./chunk-GIK4SGAT.js";import"./chunk-ZJIMT5I3.js";import{sb as a,tb as b}from"./chunk-JSDLBXME.js";import"./chunk-E27LHEIP.js";import"./chunk-EDZ5KJFT.js";import"./chunk-23X6REO4.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{Da as a,Ea as b}from"./chunk-PKQOEDHJ.js";import"./chunk-WIBLZK4G.js";import"./chunk-2RI252RN.js";import"./chunk-VVE3UM4F.js";import"./chunk-IR5KIK7E.js";import"./chunk-MVARIMQV.js";import"./chunk-VDGCGOQH.js";import"./chunk-SQODXBLX.js";import"./chunk-44QXPEEE.js";import"./chunk-GIK4SGAT.js";import"./chunk-ZJIMT5I3.js";import"./chunk-JSDLBXME.js";import"./chunk-E27LHEIP.js";import"./chunk-EDZ5KJFT.js";import"./chunk-23X6REO4.js";import"./chunk-ONUPGMER.js";export{a as ArgumentCompleter,b as createArgumentCompleter};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @kodax-ai/kodax — bundled distribution. See docs/ADR.md ADR-022 + ADR-024.
|
|
2
|
-
import{f as e}from"./chunk-
|
|
2
|
+
import{f as e}from"./chunk-E27LHEIP.js";import{a as n}from"./chunk-ONUPGMER.js";import{readFile as i}from"fs/promises";var c={enabled:!0,triggerPercent:75};async function g(o){let t=e("config.json");try{let r=await a(t);if(r?.compaction)return{...c,...r.compaction}}catch{}return c}n(g,"loadCompactionConfig");async function a(o){try{let t=await i(o,"utf-8");return JSON.parse(t)}catch{return null}}n(a,"readConfigFile");export{g as a};
|