@kodax-ai/kodax 0.7.48 → 0.7.50
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 +1773 -1720
- package/README.md +91 -35
- package/README_CN.md +70 -23
- package/dist/builtin/code-review/SKILL.md +1 -1
- package/dist/chunks/argument-completer-3WX5B42G.js +2 -0
- package/dist/chunks/chunk-5UJQ2GKJ.js +574 -0
- package/dist/chunks/chunk-HR64F32V.js +2 -0
- package/dist/chunks/chunk-MFOMFMSK.js +1056 -0
- package/dist/chunks/{chunk-DEODZG6Q.js → chunk-SK4HOYT2.js} +1 -1
- package/dist/chunks/chunk-UB5IAZHF.js +476 -0
- package/dist/chunks/chunk-XZY4CIDV.js +31 -0
- package/dist/chunks/chunk-YJLRBIEW.js +301 -0
- package/dist/chunks/{compaction-config-YWCHOP2U.js → compaction-config-DDJSQ4OT.js} +1 -1
- package/dist/chunks/{construction-bootstrap-AIWATBWW.js → construction-bootstrap-4QNM2BVM.js} +1 -1
- package/dist/chunks/{dist-IDNOAB4M.js → dist-OJSNNI7P.js} +1 -1
- package/dist/chunks/dist-T256OSDI.js +2 -0
- package/dist/chunks/{utils-OG57XTPC.js → utils-JHIEOX6Z.js} +1 -1
- package/dist/index.d.ts +11 -11
- package/dist/index.js +2 -2
- package/dist/kodax_cli.js +1406 -892
- package/dist/provider-capabilities.json +193 -190
- package/dist/sdk-agent.d.ts +213 -103
- package/dist/sdk-agent.js +1 -1
- package/dist/sdk-coding.d.ts +644 -33
- package/dist/sdk-coding.js +1 -1
- package/dist/sdk-llm.d.ts +5 -5
- package/dist/sdk-llm.js +1 -1
- package/dist/sdk-mcp.js +1 -1
- package/dist/sdk-repl.d.ts +36 -13
- package/dist/sdk-repl.js +2 -2
- package/dist/sdk-session.d.ts +32 -5
- package/dist/sdk-session.js +1 -1
- package/dist/sdk-skills.js +1 -1
- package/dist/types-chunks/{base.d-BdJKSPO2.d.ts → base.d-C4jYVjJh.d.ts} +2 -1
- package/dist/types-chunks/{bash-prefix-extractor.d-DNO2-ycp.d.ts → bash-prefix-extractor.d-B0CIb0N3.d.ts} +137 -23
- package/dist/types-chunks/{file-tracker.d-D7L_SbRm.d.ts → capsule.d-CwBEm6M-.d.ts} +173 -5
- package/dist/types-chunks/{types.d-BCnbYG_A.d.ts → process.d-BbiXD24v.d.ts} +502 -4
- package/dist/types-chunks/{resolver.d-DkgJlEzr.d.ts → resolver.d-CQfaJbht.d.ts} +24 -6
- package/dist/types-chunks/{storage.d-B1Jk6ryM.d.ts → storage.d-J2GqOgaX.d.ts} +4 -1
- package/dist/types-chunks/{types.d-B_MIIApc.d.ts → types.d-BnjX2Gn4.d.ts} +6 -1
- package/dist/types-chunks/{types.d-Cf-GCzac.d.ts → types.d-rPRl2LSB.d.ts} +4 -0
- package/dist/types-chunks/{utils.d-Dgy5SVrq.d.ts → utils.d-D_-jrRku.d.ts} +44 -8
- package/package.json +1 -1
- package/dist/chunks/chunk-66B6ZOU7.js +0 -31
- package/dist/chunks/chunk-6Z75SHX3.js +0 -2
- package/dist/chunks/chunk-EP46H5P3.js +0 -415
- package/dist/chunks/chunk-LNJNRREL.js +0 -903
- package/dist/chunks/chunk-UHAP234X.js +0 -567
- package/dist/chunks/dist-4WABQRJU.js +0 -2
- package/dist/types-chunks/types.d-C5mHR87z.d.ts +0 -119
package/README.md
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
<a href="LICENSE"><img alt="license" src="https://img.shields.io/badge/license-Apache--2.0-blue?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-14_aliases_+_custom-2ecc71?style=flat-square">
|
|
21
21
|
</p>
|
|
22
22
|
|
|
23
23
|
<p align="center">
|
|
@@ -103,7 +103,7 @@ That's it. You're in the REPL — ask anything in natural language.
|
|
|
103
103
|
5-stage self-modification staircase (scaffold → validate → stage → test → activate) gated by an 8-invariant admission contract.
|
|
104
104
|
</td>
|
|
105
105
|
<td align="center" valign="top">
|
|
106
|
-
<h3>🛠
|
|
106
|
+
<h3>🛠 50+ built-in tools</h3>
|
|
107
107
|
<sub>File · shell · search · MCP · ACP</sub>
|
|
108
108
|
<br><br>
|
|
109
109
|
Repo intelligence, semantic search, git worktree, web fetch — all addressable through one clean tool surface.
|
|
@@ -119,7 +119,7 @@ That's it. You're in the REPL — ask anything in natural language.
|
|
|
119
119
|
| Node-free single binary | ✅ Bun | ❌ Node | ❌ Python | ✅ Rust | ❌ Electron | ❌ Extension |
|
|
120
120
|
| Native China providers<br><sub>(Zhipu · Kimi · MiniMax · MiMo · Ark · Qwen)</sub> | ✅ 6 native | ❌ | ⚠ via LiteLLM | ❌ OpenAI-first | ❌ no provider menu | ⚠ Kimi / Qwen / DeepSeek |
|
|
121
121
|
| Branchable session lineage | ✅ fork & rewind | ⚠ routines / sessions | ❌ | ❌ | ❌ | ⚠ checkpoints |
|
|
122
|
-
| Multi-agent + MCP +
|
|
122
|
+
| Multi-agent + MCP + 50+ tools | ✅ all three | ✅ all three | ⚠ tools, no MCP | ✅ all three | ⚠ Composer + MCP | ✅ all three |
|
|
123
123
|
|
|
124
124
|
<sub>Data verified May 2026 against public docs ([Claude Code](https://github.com/anthropics/claude-code) · [Aider](https://aider.chat/docs/llms.html) · [Codex CLI](https://github.com/openai/codex) · [Cursor](https://cursor.com) · [Cline](https://github.com/cline/cline)). ⚠ = partial / requires extra setup / not first-class. Corrections welcome via PR.</sub>
|
|
125
125
|
|
|
@@ -178,9 +178,43 @@ If you need a custom base URL or an OpenAI/Anthropic-compatible endpoint, define
|
|
|
178
178
|
|
|
179
179
|
`userAgentMode` defaults to `"compat"`, which sends `KodaX` instead of the official SDK User-Agent. Switch it to `"sdk"` only when your gateway expects the upstream SDK header.
|
|
180
180
|
|
|
181
|
+
#### OpenAI-compatible reasoning providers
|
|
182
|
+
|
|
183
|
+
Some OpenAI-compatible reasoning models require KodaX to replay the previous assistant turn's `reasoning_content` on later requests. DeepSeek V4 thinking mode is the known load-bearing case. Built-in DeepSeek already opts in; custom providers must say so explicitly:
|
|
184
|
+
|
|
185
|
+
```json
|
|
186
|
+
{
|
|
187
|
+
"customProviders": [
|
|
188
|
+
{
|
|
189
|
+
"name": "my-deepseek-v4",
|
|
190
|
+
"protocol": "openai",
|
|
191
|
+
"baseUrl": "https://example.com/v1",
|
|
192
|
+
"apiKeyEnv": "MY_DEEPSEEK_API_KEY",
|
|
193
|
+
"model": "deepseek-v4-flash",
|
|
194
|
+
"supportsThinking": true,
|
|
195
|
+
"reasoningCapability": "native-toggle",
|
|
196
|
+
"replayReasoningContent": true
|
|
197
|
+
}
|
|
198
|
+
]
|
|
199
|
+
}
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
Keep `replayReasoningContent` unset or `false` for OpenAI proper and gateways that reject unknown assistant-message fields. If one gateway routes mixed models, prefer per-model overrides:
|
|
203
|
+
|
|
204
|
+
```json
|
|
205
|
+
{
|
|
206
|
+
"models": [
|
|
207
|
+
{ "id": "deepseek-v4-flash", "replayReasoningContent": true },
|
|
208
|
+
{ "id": "gpt-5", "replayReasoningContent": false }
|
|
209
|
+
]
|
|
210
|
+
}
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
Sidecar verifier judge calls use provider-level forced tool choice when supported. If a compatible endpoint rejects the `tool_choice` parameter, KodaX retries that verifier request once without forced tool choice and still fails open rather than blocking the main Worker.
|
|
214
|
+
|
|
181
215
|
#### Opting a custom provider into image / vision input (FEATURE_134 v0.7.40)
|
|
182
216
|
|
|
183
|
-
If your custom provider's underlying model supports image input (vision), add a `capabilityProfile.multimodalSupport: "image-input"` block so KodaX does not artificially block multimodal requests at the SA-path policy gate.
|
|
217
|
+
If your custom provider's underlying model supports image input (vision), add a `capabilityProfile.multimodalSupport: "image-input"` block so KodaX does not artificially block multimodal requests at the SA-path policy gate. Built-in vision-capable aliases (Anthropic, OpenAI, Anthropic-/OpenAI-compatible aliases such as DeepSeek, Kimi, Qwen, Zhipu, MiniMax, MiMo, Ark, plus Gemini-CLI via the CLI's `@<path>` file-include syntax) already ship with this flag enabled by default; Codex-CLI and custom providers need to opt in when their underlying model supports image input.
|
|
184
218
|
|
|
185
219
|
```json
|
|
186
220
|
{
|
|
@@ -273,12 +307,12 @@ Setup, runtime modes, REPL controls, config schema, and external-host integratio
|
|
|
273
307
|
|
|
274
308
|
## Architecture
|
|
275
309
|
|
|
276
|
-
KodaX uses a **monorepo architecture** with npm workspaces. Source layout has
|
|
310
|
+
KodaX uses a **monorepo architecture** with npm workspaces. Source layout currently has 4 workspace packages; published as a single bundled npm package `@kodax-ai/kodax` with 7 SDK subpath exports (`/agent`, `/llm`, `/coding`, `/repl`, `/skills`, `/mcp`, `/session`; ADR-024 + ADR-032 + ADR-038, with ADR-036 consolidation):
|
|
277
311
|
|
|
278
312
|
```
|
|
279
313
|
KodaX/
|
|
280
314
|
├── packages/ # 4 workspace packages (FEATURE_194 v0.7.43)
|
|
281
|
-
│ ├── llm/ # @kodax-ai/llm - LLM abstraction (
|
|
315
|
+
│ ├── llm/ # @kodax-ai/llm - LLM abstraction (14 built-in provider aliases)
|
|
282
316
|
│ │ └── providers/ # Anthropic, OpenAI, DeepSeek, Kimi, MiMo, MiniMax, Zhipu, Ark, …
|
|
283
317
|
│ │
|
|
284
318
|
│ ├── agent/ # @kodax-ai/agent - Generic Agent framework
|
|
@@ -290,7 +324,7 @@ KodaX/
|
|
|
290
324
|
│ │ └── tracing/ # tracing / observability (inline v0.7.43)
|
|
291
325
|
│ │
|
|
292
326
|
│ ├── coding/ # @kodax-ai/coding - Coding Agent (tools + prompts)
|
|
293
|
-
│ │ ├── tools/ #
|
|
327
|
+
│ │ ├── tools/ # 50+ tools: read, write, edit, bash, glob, grep, undo,
|
|
294
328
|
│ │ │ # dispatch_child_task, send_message, task_stop,
|
|
295
329
|
│ │ │ # ask_user_question, repo-intelligence, …
|
|
296
330
|
│ │ └── repo-intelligence/ # incl. protocol.ts (inline v0.7.43)
|
|
@@ -299,7 +333,7 @@ KodaX/
|
|
|
299
333
|
│
|
|
300
334
|
├── src/ # CLI entry + SDK subpath entries
|
|
301
335
|
│ ├── kodax_cli.ts # Main CLI entry point (bin: `kodax`)
|
|
302
|
-
│ └── sdk-*.ts # SDK subpath re-exports → @kodax-ai/kodax/{agent,llm,coding,repl}
|
|
336
|
+
│ └── sdk-*.ts # SDK subpath re-exports → @kodax-ai/kodax/{agent,llm,coding,repl,skills,mcp,session}
|
|
303
337
|
│
|
|
304
338
|
└── package.json # Root workspace config; release.mjs rewrites name + injects subpath exports
|
|
305
339
|
```
|
|
@@ -326,7 +360,7 @@ KodaX/
|
|
|
326
360
|
┌──────────────┐ ┌──────────────────────────┐ ┌──────────────┐
|
|
327
361
|
│@kodax-ai/ │ │@kodax-ai/agent │ │@kodax-ai/llm │
|
|
328
362
|
│coding (via │ │Runner + fan-out + │ │LLM Abstract │
|
|
329
|
-
│above) │ │idle-yield + session- │ │(
|
|
363
|
+
│above) │ │idle-yield + session- │ │(14 aliases) │
|
|
330
364
|
│ │ │lineage + skills + mcp + │ │ │
|
|
331
365
|
│ │ │tracing (FEATURE_194) │ │ │
|
|
332
366
|
└──────────────┘ └──────────────────────────┘ └──────────────┘
|
|
@@ -338,9 +372,9 @@ Source-side workspace package names (`@kodax-ai/*`). npm consumers install the s
|
|
|
338
372
|
|
|
339
373
|
| Workspace package | Purpose | Key Dependencies |
|
|
340
374
|
|---------|---------|------------------|
|
|
341
|
-
| `@kodax-ai/llm` | LLM abstraction (
|
|
375
|
+
| `@kodax-ai/llm` | LLM abstraction (14 built-in provider aliases + custom registration) | @anthropic-ai/sdk, openai |
|
|
342
376
|
| `@kodax-ai/agent` | Generic Agent framework — Runner, fan-out, idle-yield, session-lineage, capabilities (mcp + skills), tracing (ADR-036 v0.7.43 consolidation; subpaths: `/session-lineage`, `/capabilities/mcp`, `/capabilities/skills`, `/tracing`) | @kodax-ai/llm, js-tiktoken, fflate, yaml |
|
|
343
|
-
| `@kodax-ai/coding` | Coding Agent —
|
|
377
|
+
| `@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 |
|
|
344
378
|
| `@kodax-ai/repl` | Complete interactive terminal UI (Ink/React, permission modes, commands, streaming) | @kodax-ai/coding, ink, react |
|
|
345
379
|
|
|
346
380
|
### Source-side vs npm-published surface
|
|
@@ -354,29 +388,34 @@ KodaX has two layers that consumers should understand separately:
|
|
|
354
388
|
|
|
355
389
|
| Source package | npm subpath | Type | What you get | Example consumer |
|
|
356
390
|
|---|---|---|---|---|
|
|
357
|
-
| `packages/llm` | `@kodax-ai/kodax/llm` | Full package |
|
|
391
|
+
| `packages/llm` | `@kodax-ai/kodax/llm` | Full package | 14-alias LLM abstraction (77 exports) | Standalone LLM clients |
|
|
358
392
|
| `packages/agent` | `@kodax-ai/kodax/agent` | Full package | Runner / fan-out / session-lineage / capabilities / tracing (202 exports) | Custom agent frameworks |
|
|
359
393
|
| `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 |
|
|
360
394
|
| `packages/agent` | `@kodax-ai/kodax/mcp` | **Narrow subset** | MCP only — `McpCapabilityProvider` / `createMcpTransport` / `searchMcpCatalog` / ... (11 exports = pre-v0.7.43 `@kodax-ai/mcp` complete API) | MCP server hosts |
|
|
361
|
-
| `packages/coding` | `@kodax-ai/kodax/coding` | Full package | Coding agent +
|
|
395
|
+
| `packages/coding` | `@kodax-ai/kodax/coding` | Full package | Coding agent + 50+ tools + repo-intelligence (342 exports) | Build a Claude Code-shape product |
|
|
362
396
|
| `packages/repl` | `@kodax-ai/kodax/repl` | Full package | Ink TUI + permission modes + commands (193 exports) | Terminal-UI consumers |
|
|
363
397
|
| `packages/repl` | `@kodax-ai/kodax/session` | **Narrow subset** | Session management only — `listSessions` / `forkSession` / `watchSessions` / ... (9 exports) | IDE plugins reading session history |
|
|
364
398
|
|
|
365
399
|
**Rule of thumb**: if you need Runner / Agent / fan-out, import from `/agent`. If you only need skills or mcp APIs, import from `/skills` or `/mcp` to get a smaller bundle. The narrow subsets are subsets of the full packages — they do **not** expose extra symbols.
|
|
366
400
|
|
|
401
|
+
**Dynamic Workflows (FEATURE_217, v0.7.49)**: the domain-neutral workflow runtime is part of `/agent` — `import { createWorkflowRuntime, runWorkflow, WorkflowAbortError, WorkflowLimitError } from '@kodax-ai/kodax/agent'`. The coding-side integration (agent backend + built-in workflows + saved-workflow discovery/generation: `createCodingWorkflowBackend`, `runWorkflowFromOptions`, `parallelInvestigation`, `discoverSavedWorkflows`, `generateWorkflowFromOptions`, …) is part of `/coding`. FEATURE_217 is the v0.7.49 home for the full Dynamic Workflow product loop: `/workflow create <request>` generates restricted scripts, `/workflow save <runId> <name>` stores `.workflow.json` rerunnable workflows, generated/saved scripts coordinate agents through `WorkflowApi`, run lifecycle state stays observable, opt-in `isolation:"worktree"` routes selected children to parent-managed worktrees, and all file/shell effects still pass through agent tools and the existing permission gates. There is **no** separate `@kodax-ai/kodax/agent/workflow` root-package subpath; source-package consumers of `@kodax-ai/agent` can still use that package's `./workflow` subpath.
|
|
402
|
+
|
|
403
|
+
**Workflow Process Surface (FEATURE_229, v0.7.50 implementation complete; release validation pending)**: workflow progress is now a reusable Agent-layer process contract rather than private REPL text. SDK hosts can subscribe to `WorkflowProcessEvent`/poll `WorkflowProcessSnapshot`, use `createWorkflowRunManager` and `createWorkflowLifecycleController` for stop/pause/resume/result/artifact/delete/prune/identity/preflight controls, and receive ANSI-free provenance fields (`source`, `sourceRunId`, `sourceWorkflowName`, `savedWorkflowName`, `revisionOf`) plus `resultSummary`. `/coding` owns the coding workflow backend and run graph, `/repl` renders the same snapshots, and the terminal UI is not the hidden source of truth. `KodaXEvents` callbacks also take an optional metadata arg (`KodaXToolEventMeta` / `KodaXActivityEventMeta` / `KodaXWorkflowEventMeta`) so a host can attribute every child-agent tool/thinking/progress event to its workflow run and child id without a second event protocol, and generated/saved workflow scripts pass `validateRestrictedWorkflowSource` (compile + source-policy check) plus a generator repair/smoke loop before they run. See [docs/ADR.md ADR-040](docs/ADR.md) for the layering rationale.
|
|
404
|
+
|
|
367
405
|
---
|
|
368
406
|
|
|
369
407
|
## Features
|
|
370
408
|
|
|
371
409
|
- **Modular Architecture** - Use as CLI, as a library, or as a Node-free single binary
|
|
372
|
-
- **
|
|
373
|
-
- **
|
|
410
|
+
- **14 Built-in Provider Aliases** - Anthropic, OpenAI, DeepSeek, Kimi, Kimi Code, Qwen, Zhipu, Zhipu Coding, MiniMax Coding, MiMo Coding, MiMo, Ark Coding, Gemini CLI, Codex CLI - plus user-defined OpenAI/Anthropic-compatible providers
|
|
411
|
+
- **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
|
|
412
|
+
- **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`.
|
|
374
413
|
- **Reasoning Modes** - Unified `off/auto/quick/balanced/deep` interface across providers
|
|
375
414
|
- **Streaming Output** - Real-time response display
|
|
376
415
|
- **Session Management** - JSONL format with branchable session lineage tree
|
|
377
416
|
- **Skills System** - Natural language triggering, extensible, role-projected in AMA
|
|
378
417
|
- **Repo Intelligence** - OSS baseline + optional `repointel` premium engine, with native KodaX auto-injection lane
|
|
379
|
-
- **Rich Tool Surface** -
|
|
418
|
+
- **Rich Tool Surface** - 50+ built-in tools across file ops, shell, search, repo intelligence, MCP capabilities, git worktree, and agent control
|
|
380
419
|
- **Permission Control** - 3 permission modes with pattern-based control
|
|
381
420
|
- **Standalone Binary** - `bun --compile` releases for Win/macOS/Linux x64+arm64, no Node.js required on target machines
|
|
382
421
|
- **Cross-Platform** - Windows/macOS/Linux
|
|
@@ -466,14 +505,15 @@ For smaller surface and tree-shake-friendly imports, the SDK is also exposed via
|
|
|
466
505
|
|
|
467
506
|
```typescript
|
|
468
507
|
import { Runner } from '@kodax-ai/kodax/agent'; // agent runtime
|
|
469
|
-
import {
|
|
508
|
+
import { getProvider } from '@kodax-ai/kodax/llm'; // LLM abstraction (14 aliases)
|
|
470
509
|
import { runKodaX } from '@kodax-ai/kodax/coding'; // coding tools + prompts
|
|
471
510
|
import { SkillRegistry } from '@kodax-ai/kodax/skills'; // zero-dep skill loader
|
|
472
511
|
import { loadConfig } from '@kodax-ai/kodax/repl'; // REPL config / session helpers
|
|
473
512
|
import { createMcpManager } from '@kodax-ai/kodax/mcp'; // MCP popout manager (v0.7.42)
|
|
513
|
+
import { listSessions } from '@kodax-ai/kodax/session'; // session history helpers
|
|
474
514
|
```
|
|
475
515
|
|
|
476
|
-
All
|
|
516
|
+
All 8 SDK entries (root + 7 subpaths) share internal code via ESM chunk splitting — importing from `/agent` does not pull in `/repl`'s Ink + React surface.
|
|
477
517
|
|
|
478
518
|
> **ESM-only.** The SDK is published as ES Modules. In a CommonJS context (Electron main process, legacy Webpack CJS bundles, `require()`-based code) you must use `await import(...)` instead of `require()`. See [docs/SDK_EMBEDDER_GUIDE.md §5](docs/SDK_EMBEDDER_GUIDE.md#5-consuming-from-a-commonjs-context-electron-main-cjs-bundles) for the canonical recipe + the technical reason most subpaths cannot ship a dual ESM/CJS build.
|
|
479
519
|
|
|
@@ -656,6 +696,20 @@ Related variables: `KODAX_MAX_TOKENS` (global fallback when no provider/model ca
|
|
|
656
696
|
|
|
657
697
|
> **Retired in v0.7.42**: `KODAX_RST_PRONE_PROVIDERS` and `KODAX_WRITE_TURN_MAX_TOKENS` (the v0.7.28 P2b write-turn cap mechanism) are no longer recognized. The 2026-04 bench measured RST as time-based (zhipu-coding 308s server kill window), not payload-size-based, so the cap was retired in favor of the per-provider `streamMaxDurationMs` watchdog + non-streaming fallback chain (configured in `registry.ts`). Existing env exports become silent no-ops; remove them from shell profiles when convenient.
|
|
658
698
|
|
|
699
|
+
#### Sidecar verifier diagnostics
|
|
700
|
+
|
|
701
|
+
Use these when diagnosing Worker text-only completion stalls or custom provider verifier behavior:
|
|
702
|
+
|
|
703
|
+
```bash
|
|
704
|
+
export KODAX_VERIFIER_LOG=1
|
|
705
|
+
export KODAX_VERIFIER_PROVIDER=anthropic
|
|
706
|
+
export KODAX_VERIFIER_MODEL=claude-haiku-4-5-20251001
|
|
707
|
+
```
|
|
708
|
+
|
|
709
|
+
- `KODAX_VERIFIER_LOG=1` shows verifier gate/elapsed/trace information and is equivalent to `"verifierLog": true` in `~/.kodax/config.json`.
|
|
710
|
+
- `KODAX_VERIFIER_PROVIDER` + `KODAX_VERIFIER_MODEL` route the verifier to a separate provider/model instead of inheriting the main Worker model. Set both together.
|
|
711
|
+
- `KODAX_VERIFIER_ALWAYS=1` forces the verifier to fire on every text-only completion for debugging/regression sweeps.
|
|
712
|
+
|
|
659
713
|
## Advanced Library Usage
|
|
660
714
|
|
|
661
715
|
#### Simple Mode (runKodaX)
|
|
@@ -740,7 +794,7 @@ await runKodaX({
|
|
|
740
794
|
|
|
741
795
|
## SDK Usage
|
|
742
796
|
|
|
743
|
-
KodaX ships as a single npm package `@kodax-ai/kodax` with
|
|
797
|
+
KodaX ships as a single npm package `@kodax-ai/kodax` with 7 SDK subpath exports (ADR-024 v0.7.39 + ADR-032 v0.7.42 + ADR-038 v0.7.49). Each subpath is tree-shake-friendly so consumers pull only what they need:
|
|
744
798
|
|
|
745
799
|
```bash
|
|
746
800
|
npm install @kodax-ai/kodax
|
|
@@ -749,18 +803,19 @@ npm install @kodax-ai/kodax
|
|
|
749
803
|
```typescript
|
|
750
804
|
import { runKodaX } from '@kodax-ai/kodax'; // root: CLI helpers + runKodaX
|
|
751
805
|
import { Runner, runFanOut } from '@kodax-ai/kodax/agent'; // generic Agent framework
|
|
752
|
-
import { getProvider } from '@kodax-ai/kodax/llm'; //
|
|
806
|
+
import { getProvider } from '@kodax-ai/kodax/llm'; // 14-alias LLM abstraction
|
|
753
807
|
import { KODAX_TOOLS } from '@kodax-ai/kodax/coding'; // tools + prompts + agent loop
|
|
754
|
-
import {
|
|
808
|
+
import { runInkInteractiveMode } from '@kodax-ai/kodax/repl'; // Ink TUI entrypoint
|
|
755
809
|
import { SkillRegistry } from '@kodax-ai/kodax/skills'; // zero-dep skill loader
|
|
756
810
|
import { createMcpManager } from '@kodax-ai/kodax/mcp'; // MCP popout manager (v0.7.42)
|
|
811
|
+
import { listSessions } from '@kodax-ai/kodax/session'; // session history helpers
|
|
757
812
|
```
|
|
758
813
|
|
|
759
814
|
> The SDK is **ESM-only**. CommonJS consumers (Electron main / Webpack CJS / `require()` callers) must use `await import('@kodax-ai/kodax/...')` — see [docs/SDK_EMBEDDER_GUIDE.md §5](docs/SDK_EMBEDDER_GUIDE.md#5-consuming-from-a-commonjs-context-electron-main-cjs-bundles).
|
|
760
815
|
|
|
761
816
|
### `@kodax-ai/kodax/llm` — LLM Abstraction
|
|
762
817
|
|
|
763
|
-
|
|
818
|
+
14 built-in provider aliases (Anthropic, OpenAI, DeepSeek, Kimi, Kimi-Code, Qwen, Zhipu, Zhipu-Coding, MiniMax-Coding, MiMo, MiMo-Coding, Ark-Coding, Gemini-CLI, Codex-CLI) + custom provider registration.
|
|
764
819
|
|
|
765
820
|
```typescript
|
|
766
821
|
import { getProvider, KodaXBaseProvider } from '@kodax-ai/kodax/llm';
|
|
@@ -838,7 +893,7 @@ const result = await executeSkill({
|
|
|
838
893
|
|
|
839
894
|
### `@kodax-ai/kodax/coding` — Coding Agent
|
|
840
895
|
|
|
841
|
-
Complete coding agent:
|
|
896
|
+
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.
|
|
842
897
|
|
|
843
898
|
```typescript
|
|
844
899
|
import { runKodaX, KodaXClient, KODAX_TOOLS } from '@kodax-ai/kodax/coding';
|
|
@@ -860,14 +915,14 @@ await client.send('Create a new file');
|
|
|
860
915
|
await client.send('Add a function to it'); // Has context from previous message
|
|
861
916
|
```
|
|
862
917
|
|
|
863
|
-
**Key Features**:
|
|
918
|
+
**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.
|
|
864
919
|
|
|
865
920
|
### `@kodax-ai/kodax/repl` — Interactive Terminal UI
|
|
866
921
|
|
|
867
922
|
Ink/React-based interactive REPL. Permission modes, command system, themed streaming display.
|
|
868
923
|
|
|
869
924
|
```typescript
|
|
870
|
-
import {
|
|
925
|
+
import { runInkInteractiveMode } from '@kodax-ai/kodax/repl';
|
|
871
926
|
|
|
872
927
|
// Usually used via the `kodax` bin command; can be embedded:
|
|
873
928
|
// - Interactive terminal UI (Ink components)
|
|
@@ -875,6 +930,7 @@ import { InkREPL } from '@kodax-ai/kodax/repl';
|
|
|
875
930
|
// - Command system (/help, /mode, /clear, /status, …)
|
|
876
931
|
// - Skills integration
|
|
877
932
|
// - Theme support
|
|
933
|
+
await runInkInteractiveMode({ provider: 'zhipu-coding', reasoningMode: 'auto' });
|
|
878
934
|
```
|
|
879
935
|
|
|
880
936
|
**Key Features**: Ink-based React components · 3 permission modes (auto / plan / accept-edits) · built-in commands · real-time streaming display · context-usage indicator.
|
|
@@ -897,7 +953,7 @@ import { InkREPL } from '@kodax-ai/kodax/repl';
|
|
|
897
953
|
|
|
898
954
|
| Use Case | Subpath | Why |
|
|
899
955
|
|----------|---------|-----|
|
|
900
|
-
| Only need LLM abstraction | `@kodax-ai/kodax/llm` | Minimal deps;
|
|
956
|
+
| Only need LLM abstraction | `@kodax-ai/kodax/llm` | Minimal deps; 14 built-in aliases |
|
|
901
957
|
| Building custom agent | `@kodax-ai/kodax/agent` | Runner + fan-out + idle-yield + session-lineage + capabilities |
|
|
902
958
|
| Coding tasks | `@kodax-ai/kodax/coding` | Complete coding agent + tools |
|
|
903
959
|
| Terminal app | `@kodax-ai/kodax/repl` | Full interactive experience |
|
|
@@ -906,18 +962,18 @@ import { InkREPL } from '@kodax-ai/kodax/repl';
|
|
|
906
962
|
|
|
907
963
|
| Provider | Environment Variable | Reasoning Support | Default Model |
|
|
908
964
|
|----------|----------------------|-------------------|---------------|
|
|
909
|
-
| anthropic | `ANTHROPIC_API_KEY` | Native | claude-sonnet-4-6 |
|
|
910
|
-
| openai | `OPENAI_API_KEY` | Native | gpt-5.3-codex |
|
|
911
|
-
| kimi | `KIMI_API_KEY` | Native | kimi-k2.6 |
|
|
965
|
+
| anthropic | `ANTHROPIC_API_KEY` | Native | claude-sonnet-4-6 (`claude-opus-4-6` / `claude-haiku-4-5` via `/model`) |
|
|
966
|
+
| openai | `OPENAI_API_KEY` | Native | gpt-5.3-codex (`gpt-5.4` / `gpt-5.3-codex-spark` via `/model`) |
|
|
967
|
+
| kimi | `KIMI_API_KEY` | Native | kimi-k2.6 (`kimi-k2.7-code` 256K / `k2.5` via `/model`) |
|
|
912
968
|
| kimi-code | `KIMI_CODE_API_KEY` | Native | kimi-for-coding |
|
|
913
969
|
| qwen | `QWEN_API_KEY` | Native | qwen3.5-plus |
|
|
914
|
-
| zhipu | `ZHIPU_API_KEY` | Native | glm-5 |
|
|
915
|
-
| zhipu-coding | `ZHIPU_CODING_API_KEY` | Native | glm-5 |
|
|
916
|
-
| minimax-coding | `MINIMAX_CODING_API_KEY` | Native | MiniMax-M2.7 (
|
|
970
|
+
| zhipu | `ZHIPU_API_KEY` | Native | glm-5 (`glm-5.2` 1M ctx / `glm-5.1` / `glm-5-turbo` via `/model`) |
|
|
971
|
+
| zhipu-coding | `ZHIPU_CODING_API_KEY` | Native | glm-5 (`glm-5.2` 1M ctx / `glm-5.1` / `glm-5-turbo` via `/model`) |
|
|
972
|
+
| 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`) |
|
|
917
973
|
| mimo | `MIMO_API_KEY` | Native | mimo-v2.5-pro (Xiaomi MiMo pay-per-token, Anthropic-compat) |
|
|
918
974
|
| mimo-coding | `MIMO_CODING_API_KEY` | Native | mimo-v2.5-pro (Xiaomi Token Plan, Anthropic-compat) |
|
|
919
|
-
| ark-coding | `ARK_CODING_API_KEY` | Native | glm-5.1 (Volcengine Ark Coding Plan,
|
|
920
|
-
| deepseek | `DEEPSEEK_API_KEY` | Native | deepseek-v4-flash |
|
|
975
|
+
| ark-coding | `ARK_CODING_API_KEY` | Native | glm-5.1 (Volcengine Ark Coding Plan: GLM, Kimi, MiniMax M3/M2.7, DeepSeek V3.2/V4, Doubao Seed 2.0 routes) |
|
|
976
|
+
| deepseek | `DEEPSEEK_API_KEY` | Native | deepseek-v4-flash (`deepseek-v4-pro` via `/model`) |
|
|
921
977
|
| gemini-cli | `GEMINI_API_KEY` | Prompt-only / CLI bridge | (via gemini CLI) |
|
|
922
978
|
| codex-cli | `OPENAI_API_KEY` | Prompt-only / CLI bridge | (via codex CLI) |
|
|
923
979
|
|
|
@@ -950,7 +1006,7 @@ kodax --agent-mode ama "Analyze code structure, check test coverage, find bugs"
|
|
|
950
1006
|
|
|
951
1007
|
## Tools
|
|
952
1008
|
|
|
953
|
-
KodaX ships
|
|
1009
|
+
KodaX ships 50+ built-in tools, grouped below. They are registered as a single flat tool surface to the LLM; the categories here are just for navigation.
|
|
954
1010
|
|
|
955
1011
|
### File operations
|
|
956
1012
|
| Tool | Description |
|
package/README_CN.md
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
<a href="LICENSE"><img alt="license" src="https://img.shields.io/badge/license-Apache--2.0-blue?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-14_aliases_+_custom-2ecc71?style=flat-square">
|
|
21
21
|
</p>
|
|
22
22
|
|
|
23
23
|
<p align="center">
|
|
@@ -103,7 +103,7 @@ kodax
|
|
|
103
103
|
5 阶自改造阶梯(scaffold → validate → stage → test → activate),由 8 条 admission invariant 守护。
|
|
104
104
|
</td>
|
|
105
105
|
<td align="center" valign="top">
|
|
106
|
-
<h3>🛠
|
|
106
|
+
<h3>🛠 50+ 内置工具</h3>
|
|
107
107
|
<sub>文件 · shell · 搜索 · MCP · ACP</sub>
|
|
108
108
|
<br><br>
|
|
109
109
|
repo intelligence、语义搜索、git worktree、web fetch,统一从干净的 tool definition 接口暴露。
|
|
@@ -119,7 +119,7 @@ kodax
|
|
|
119
119
|
| 免 Node 单文件 | ✅ Bun | ❌ 需 Node | ❌ 需 Python | ✅ Rust | ❌ Electron | ❌ 插件 |
|
|
120
120
|
| 国内 6 家原生<br><sub>(智谱·Kimi·MiniMax·MiMo·方舟·Qwen)</sub> | ✅ 6 家原生 | ❌ | ⚠ 走 LiteLLM | ❌ OpenAI 主线 | ❌ 无 provider 菜单 | ⚠ Kimi/Qwen/DeepSeek |
|
|
121
121
|
| 可分叉会话血缘 | ✅ fork & rewind | ⚠ routines/sessions | ❌ | ❌ | ❌ | ⚠ checkpoints |
|
|
122
|
-
| Multi-agent + MCP +
|
|
122
|
+
| Multi-agent + MCP + 50+ 工具 | ✅ 三项全有 | ✅ 三项全有 | ⚠ 有 tools, 无 MCP | ✅ 三项全有 | ⚠ Composer + MCP | ✅ 三项全有 |
|
|
123
123
|
|
|
124
124
|
<sub>数据于 2026-05 对照官方公开文档核对([Claude Code](https://github.com/anthropics/claude-code) · [Aider](https://aider.chat/docs/llms.html) · [Codex CLI](https://github.com/openai/codex) · [Cursor](https://cursor.com) · [Cline](https://github.com/cline/cline))。⚠ 表示部分支持 / 需额外配置 / 非 first-class。欢迎 PR 修正。</sub>
|
|
125
125
|
|
|
@@ -206,14 +206,15 @@ const result = await runKodaX(
|
|
|
206
206
|
|
|
207
207
|
```typescript
|
|
208
208
|
import { Runner } from '@kodax-ai/kodax/agent'; // Agent runtime
|
|
209
|
-
import {
|
|
209
|
+
import { getProvider } from '@kodax-ai/kodax/llm'; // LLM 抽象(14 个内置 alias)
|
|
210
210
|
import { runKodaX } from '@kodax-ai/kodax/coding'; // Coding tools + prompts
|
|
211
211
|
import { SkillRegistry } from '@kodax-ai/kodax/skills'; // 零依赖 skill loader
|
|
212
212
|
import { loadConfig } from '@kodax-ai/kodax/repl'; // REPL 配置 / session 工具
|
|
213
213
|
import { createMcpManager } from '@kodax-ai/kodax/mcp'; // MCP popout manager(v0.7.42 起)
|
|
214
|
+
import { listSessions } from '@kodax-ai/kodax/session'; // session 历史工具
|
|
214
215
|
```
|
|
215
216
|
|
|
216
|
-
|
|
217
|
+
8 个 SDK 入口(root + 7 subpath)通过 ESM 共享 chunk 复用底层代码 —— 只 import `/agent` 不会把 `/repl` 的 Ink + React 一起拉进来。
|
|
217
218
|
|
|
218
219
|
> **SDK 是 ESM-only**。在 CommonJS 上下文(Electron main 进程、传统 Webpack CJS bundle、`require()` 调用方)必须用 `await import('@kodax-ai/kodax/...')` 代替 `require()`。详见 [docs/SDK_EMBEDDER_GUIDE.md §5](docs/SDK_EMBEDDER_GUIDE.md#5-consuming-from-a-commonjs-context-electron-main-cjs-bundles),含 Electron main 完整 recipe + 为什么大多数 subpath 物理上无法做 dual ESM/CJS bundle。
|
|
219
220
|
|
|
@@ -239,9 +240,53 @@ import { createMcpManager } from '@kodax-ai/kodax/mcp'; // MCP popout ma
|
|
|
239
240
|
|
|
240
241
|
`userAgentMode` 默认 `"compat"`(发送 `KodaX` 而非上游 SDK 的 User-Agent);如果你的网关要求原生 SDK header,再切到 `"sdk"`。
|
|
241
242
|
|
|
243
|
+
#### OpenAI 兼容推理模型
|
|
244
|
+
|
|
245
|
+
部分 OpenAI-compatible 推理模型要求多轮请求时回放上一轮 assistant 的 `reasoning_content`。DeepSeek V4 thinking mode 是已知必须开启的场景;内置 DeepSeek provider 已经默认开启,但自定义 provider 需要显式配置:
|
|
246
|
+
|
|
247
|
+
```json
|
|
248
|
+
{
|
|
249
|
+
"customProviders": [
|
|
250
|
+
{
|
|
251
|
+
"name": "my-deepseek-v4",
|
|
252
|
+
"protocol": "openai",
|
|
253
|
+
"baseUrl": "https://example.com/v1",
|
|
254
|
+
"apiKeyEnv": "MY_DEEPSEEK_API_KEY",
|
|
255
|
+
"model": "deepseek-v4-flash",
|
|
256
|
+
"supportsThinking": true,
|
|
257
|
+
"reasoningCapability": "native-toggle",
|
|
258
|
+
"replayReasoningContent": true
|
|
259
|
+
}
|
|
260
|
+
]
|
|
261
|
+
}
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
如果网关同时代理 DeepSeek 和 OpenAI proper,建议用 per-model override,避免把 `reasoning_content` 发给不接受该字段的模型:
|
|
265
|
+
|
|
266
|
+
```json
|
|
267
|
+
{
|
|
268
|
+
"models": [
|
|
269
|
+
{ "id": "deepseek-v4-flash", "replayReasoningContent": true },
|
|
270
|
+
{ "id": "gpt-5", "replayReasoningContent": false }
|
|
271
|
+
]
|
|
272
|
+
}
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
Sidecar verifier 的结构化裁决请求会优先使用 provider 级 `tool_choice` 强制工具调用;如果某个兼容端点明确拒绝 `tool_choice` 参数,KodaX 会对该 verifier 请求自动重试一次“不强制但仍带 tools”的兼容模式,并保持 fail-open,不会阻塞主 Worker。
|
|
276
|
+
|
|
277
|
+
调试 Worker 结束后的 verifier 行为时可设置:
|
|
278
|
+
|
|
279
|
+
```bash
|
|
280
|
+
export KODAX_VERIFIER_LOG=1
|
|
281
|
+
export KODAX_VERIFIER_PROVIDER=anthropic
|
|
282
|
+
export KODAX_VERIFIER_MODEL=claude-haiku-4-5-20251001
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
`KODAX_VERIFIER_LOG=1` 等价于在 `~/.kodax/config.json` 写 `"verifierLog": true`,会显示 verifier gate、elapsedMs 和 trace;`KODAX_VERIFIER_PROVIDER` / `KODAX_VERIFIER_MODEL` 需要成对设置,用独立模型执行 verifier;`KODAX_VERIFIER_ALWAYS=1` 仅建议调试和回归测试时使用。
|
|
286
|
+
|
|
242
287
|
#### 给自定义 provider 开图片 / vision 输入(FEATURE_134 v0.7.40)
|
|
243
288
|
|
|
244
|
-
如果你的自定义 provider 后面的模型支持 vision,加 `capabilityProfile.multimodalSupport: "image-input"` 显式开启,KodaX 的 SA-path policy gate
|
|
289
|
+
如果你的自定义 provider 后面的模型支持 vision,加 `capabilityProfile.multimodalSupport: "image-input"` 显式开启,KodaX 的 SA-path policy gate 就不会人为拦截多模态请求。内置 vision-capable alias(Anthropic、OpenAI、DeepSeek、Kimi、Qwen、Zhipu、MiniMax、MiMo、Ark,以及通过 CLI `@<path>` file-include 语法传图的 Gemini-CLI)已经默认开了这个 flag。Codex-CLI 和自定义 provider 在底层模型支持图片输入时需要手动 opt-in。
|
|
245
290
|
|
|
246
291
|
```json
|
|
247
292
|
{
|
|
@@ -324,18 +369,18 @@ dist/binary/linux-x64/
|
|
|
324
369
|
|
|
325
370
|
| Provider | 环境变量 | Reasoning | 默认 Model |
|
|
326
371
|
|----------|----------|-----------|-----------|
|
|
327
|
-
| anthropic | `ANTHROPIC_API_KEY` | Native | claude-sonnet-4-6 |
|
|
328
|
-
| openai | `OPENAI_API_KEY` | Native | gpt-5.3-codex |
|
|
329
|
-
| kimi | `KIMI_API_KEY` | Native | kimi-k2.6 |
|
|
372
|
+
| anthropic | `ANTHROPIC_API_KEY` | Native | claude-sonnet-4-6(可 `/model` 切换 `claude-opus-4-6` / `claude-haiku-4-5`) |
|
|
373
|
+
| openai | `OPENAI_API_KEY` | Native | gpt-5.3-codex(可 `/model` 切换 `gpt-5.4` / `gpt-5.3-codex-spark`) |
|
|
374
|
+
| kimi | `KIMI_API_KEY` | Native | kimi-k2.6(可 `/model` 切换 `kimi-k2.7-code` 256K / `k2.5`) |
|
|
330
375
|
| kimi-code | `KIMI_CODE_API_KEY` | Native | kimi-for-coding |
|
|
331
376
|
| qwen | `QWEN_API_KEY` | Native | qwen3.5-plus |
|
|
332
|
-
| zhipu | `ZHIPU_API_KEY` | Native | glm-5 |
|
|
333
|
-
| zhipu-coding | `ZHIPU_CODING_API_KEY` | Native | glm-5(GLM Coding Plan
|
|
334
|
-
| minimax-coding | `MINIMAX_CODING_API_KEY` | Native | MiniMax-M2.7
|
|
377
|
+
| zhipu | `ZHIPU_API_KEY` | Native | glm-5(可 `/model` 切换 `glm-5.2` 1M ctx / `glm-5.1` / `glm-5-turbo`) |
|
|
378
|
+
| zhipu-coding | `ZHIPU_CODING_API_KEY` | Native | glm-5(GLM Coding Plan;可 `/model` 切换 `glm-5.2` 1M ctx / `glm-5.1` / `glm-5-turbo`) |
|
|
379
|
+
| minimax-coding | `MINIMAX_CODING_API_KEY` | Native | MiniMax-M2.7(可 `/model` 切换 `MiniMax-M3` Frontier Coding,原生多模态 + 1M ctx;以及 `MiniMax-M2.7-highspeed`) |
|
|
335
380
|
| mimo | `MIMO_API_KEY` | Native | mimo-v2.5-pro(小米 MiMo 按量计费,Anthropic 协议) |
|
|
336
381
|
| mimo-coding | `MIMO_CODING_API_KEY` | Native | mimo-v2.5-pro(小米 MiMo Token Plan,Anthropic 协议) |
|
|
337
|
-
| ark-coding | `ARK_CODING_API_KEY` | Native | glm-5.1(火山方舟 Coding Plan
|
|
338
|
-
| deepseek | `DEEPSEEK_API_KEY` | Native | deepseek-v4-flash |
|
|
382
|
+
| ark-coding | `ARK_CODING_API_KEY` | Native | glm-5.1(火山方舟 Coding Plan:GLM、Kimi、MiniMax M3/M2.7、DeepSeek V3.2/V4、Doubao Seed 2.0 路由) |
|
|
383
|
+
| deepseek | `DEEPSEEK_API_KEY` | Native | deepseek-v4-flash(可 `/model` 切换 `deepseek-v4-pro`) |
|
|
339
384
|
| gemini-cli | `GEMINI_API_KEY` | Prompt-only / CLI bridge | (通过 gemini CLI) |
|
|
340
385
|
| codex-cli | `OPENAI_API_KEY` | Prompt-only / CLI bridge | (通过 codex CLI) |
|
|
341
386
|
|
|
@@ -343,7 +388,7 @@ dist/binary/linux-x64/
|
|
|
343
388
|
|
|
344
389
|
## 内置工具一览
|
|
345
390
|
|
|
346
|
-
KodaX 有
|
|
391
|
+
KodaX 有 50+ 个内置工具,按类别分组如下(实际暴露给 LLM 是一张扁平表)。
|
|
347
392
|
|
|
348
393
|
**文件操作**
|
|
349
394
|
|
|
@@ -418,13 +463,13 @@ kodax --repo-intelligence premium-native --repo-intelligence-trace
|
|
|
418
463
|
|
|
419
464
|
## 仓库结构
|
|
420
465
|
|
|
421
|
-
KodaX 是基于 npm workspaces 的 TypeScript monorepo,**源码层 4 个 workspace 包**(FEATURE_194 v0.7.43 包合并 — 9 → 4,ADR-036),npm 上以单 bundle 包 `@kodax-ai/kodax` 发布 + SDK subpath exports(`/agent`、`/llm`、`/coding`、`/repl`;ADR-
|
|
466
|
+
KodaX 是基于 npm workspaces 的 TypeScript monorepo,**源码层 4 个 workspace 包**(FEATURE_194 v0.7.43 包合并 — 9 → 4,ADR-036),npm 上以单 bundle 包 `@kodax-ai/kodax` 发布 + 7 个 SDK subpath exports(`/agent`、`/llm`、`/coding`、`/repl`、`/skills`、`/mcp`、`/session`;ADR-024 + ADR-032 + ADR-038)。核心包:
|
|
422
467
|
|
|
423
468
|
| Workspace 包 | 作用 | 主要依赖 |
|
|
424
469
|
|----|------|---------|
|
|
425
|
-
| `@kodax-ai/llm` | LLM 抽象层(
|
|
470
|
+
| `@kodax-ai/llm` | LLM 抽象层(14 个内置 provider alias + 自定义 provider 注册),可独立使用 | `@anthropic-ai/sdk`, `openai` |
|
|
426
471
|
| `@kodax-ai/agent` | 通用 Agent 框架 —— Runner / runFanOut / runWithIdleYield / ChildTaskRegistry + 会话管理 + tokenization + 可插拔 compaction + **inline 后**:session-lineage 子树 + capabilities (mcp + skills + builtin) + tracing(subpaths: `/session-lineage`、`/capabilities/mcp`、`/capabilities/skills`、`/tracing`) | `@kodax-ai/llm`, `js-tiktoken`, `fflate`, `yaml` |
|
|
427
|
-
| `@kodax-ai/coding` | Coding Agent:
|
|
472
|
+
| `@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` |
|
|
428
473
|
| `@kodax-ai/repl` | 完整交互式终端 UI(Ink / React、权限模式、命令系统、流式渲染) | `@kodax-ai/coding`, `ink`, `react` |
|
|
429
474
|
|
|
430
475
|
根目录 `src/kodax_cli.ts` 是 CLI 入口;`src/sdk-{agent,llm,coding,repl,skills,mcp,session}.ts` 是 SDK subpath 入口;构建产物在 `dist/`,单文件二进制在 `dist/binary/<target>/`。
|
|
@@ -440,20 +485,22 @@ KodaX 有两层结构,SDK 用户需要分开理解:
|
|
|
440
485
|
|
|
441
486
|
| 源码包 | npm subpath | 类型 | 内容 | 典型消费者 |
|
|
442
487
|
|---|---|---|---|---|
|
|
443
|
-
| `packages/llm` | `@kodax-ai/kodax/llm` | 完整包 |
|
|
488
|
+
| `packages/llm` | `@kodax-ai/kodax/llm` | 完整包 | 14-alias LLM 抽象 (77 exports) | 独立 LLM 客户端 |
|
|
444
489
|
| `packages/agent` | `@kodax-ai/kodax/agent` | 完整包 | Runner / fan-out / session-lineage / capabilities / tracing (202 exports) | 自定义 agent 框架 |
|
|
445
490
|
| `packages/agent` | `@kodax-ai/kodax/skills` | **窄子集** | 仅 Skills 系统 —— `SkillRegistry` / `loadFullSkill` / `expandSkillForLLM` 等 (26 exports = v0.7.43 之前 `@kodax-ai/skills` 完整 API) | Skill 加载器、IDE 插件 |
|
|
446
491
|
| `packages/agent` | `@kodax-ai/kodax/mcp` | **窄子集** | 仅 MCP —— `McpCapabilityProvider` / `createMcpTransport` / `searchMcpCatalog` 等 (11 exports = v0.7.43 之前 `@kodax-ai/mcp` 完整 API) | MCP server 宿主 |
|
|
447
|
-
| `packages/coding` | `@kodax-ai/kodax/coding` | 完整包 | Coding agent +
|
|
492
|
+
| `packages/coding` | `@kodax-ai/kodax/coding` | 完整包 | Coding agent + 50+ 工具 + repo-intelligence (342 exports) | 构建 Claude Code 形态产品 |
|
|
448
493
|
| `packages/repl` | `@kodax-ai/kodax/repl` | 完整包 | Ink TUI + 权限模式 + 命令系统 (193 exports) | 终端 UI 消费者 |
|
|
449
494
|
| `packages/repl` | `@kodax-ai/kodax/session` | **窄子集** | 仅会话管理 —— `listSessions` / `forkSession` / `watchSessions` 等 (9 exports) | 读取 session 历史的 IDE 插件 |
|
|
450
495
|
|
|
451
496
|
**经验法则**:需要 Runner / Agent / fan-out 时从 `/agent` 引入;只需要 skills 或 mcp API 时从 `/skills` 或 `/mcp` 引入,bundle 更小。窄子集是完整包的真子集 —— **不会**有额外符号。
|
|
452
497
|
|
|
498
|
+
**Workflow process surface(FEATURE_229,v0.7.50 实现已完成,发布验证待跑)**:动态工作流不再只是 REPL 私有文本,而是 Agent 层可复用的 process/event/snapshot 契约。SDK 宿主可以订阅 `WorkflowProcessEvent`、轮询 `WorkflowProcessSnapshot`,并通过 `createWorkflowRunManager` / `createWorkflowLifecycleController` 做 stop/pause/resume、读取 final result/artifact、删除/清理 terminal runs、管理 workflow identity/preflight。`/coding` 负责 coding workflow backend 与 run graph,`/repl` 只是消费同一份 snapshot 渲染 UI;SDK 不需要解析 slash-command 输出或 Ink view-model。`KodaXEvents` 回调新增可选 meta 尾参(`KodaXToolEventMeta` / `KodaXActivityEventMeta` / `KodaXWorkflowEventMeta`),宿主据此把每个子 Agent 的 tool/thinking/progress 事件归因到对应 workflow run 与 child id,无需第二套事件协议;生成/保存的工作流脚本在运行前过 `validateRestrictedWorkflowSource`(编译 + 源策略检查)与 generator 的 repair/smoke 循环。分层取舍见 [docs/ADR.md ADR-040](docs/ADR.md)。
|
|
499
|
+
|
|
453
500
|
```
|
|
454
501
|
KodaX/ # 4 workspace packages(FEATURE_194 v0.7.43)
|
|
455
502
|
├── packages/
|
|
456
|
-
│ ├── llm/ # @kodax-ai/llm ——
|
|
503
|
+
│ ├── llm/ # @kodax-ai/llm —— 14 个内置 provider alias
|
|
457
504
|
│ ├── agent/ # @kodax-ai/agent —— Runner / fan-out / idle-yield + 子树:
|
|
458
505
|
│ │ ├── session-lineage/ # 分支 session tree (v0.7.43 inline)
|
|
459
506
|
│ │ ├── capabilities/
|
|
@@ -465,9 +512,9 @@ KodaX/ # 4 workspace packages(FEATURE_194 v0.7.43)
|
|
|
465
512
|
│ └── repl/ # @kodax-ai/repl —— Ink TUI
|
|
466
513
|
├── src/
|
|
467
514
|
│ ├── kodax_cli.ts # CLI 主入口(bin: `kodax`)
|
|
468
|
-
│ └── sdk-*.ts # SDK subpath 入口 → @kodax-ai/kodax/{agent,llm,coding,repl}
|
|
515
|
+
│ └── sdk-*.ts # SDK subpath 入口 → @kodax-ai/kodax/{agent,llm,coding,repl,skills,mcp,session}
|
|
469
516
|
├── scripts/
|
|
470
|
-
│ ├── build-bundle.mjs # esbuild 单 bundle 多 entry 打包(CLI +
|
|
517
|
+
│ ├── build-bundle.mjs # esbuild 单 bundle 多 entry 打包(CLI + root + 7 SDK subpath + chunks)
|
|
471
518
|
│ ├── build-binary.mjs # Bun --compile 单文件二进制打包
|
|
472
519
|
│ └── release.mjs # ADR-024 release-time pkg name/exports 注入
|
|
473
520
|
└── .github/workflows/
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @kodax-ai/kodax — bundled distribution. See docs/ADR.md ADR-022 + ADR-024.
|
|
2
|
+
import{ia as a,ja as b}from"./chunk-UB5IAZHF.js";import"./chunk-HR64F32V.js";import"./chunk-SK4HOYT2.js";import"./chunk-MFOMFMSK.js";import"./chunk-XZY4CIDV.js";import"./chunk-5UJQ2GKJ.js";import"./chunk-V4WSBIXB.js";export{a as ArgumentCompleter,b as createArgumentCompleter};
|