@kodax-ai/kodax 0.7.56 → 0.7.58
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 +2004 -1887
- package/README.md +52 -48
- package/README_CN.md +37 -32
- package/dist/builtin/code-review/SKILL.md +22 -3
- package/dist/chunks/agent-YJNC2755.js +2 -0
- package/dist/chunks/argument-completer-QGBNXTYJ.js +2 -0
- package/dist/chunks/chunk-526OILYL.js +2 -0
- package/dist/chunks/{chunk-ZBK3DZ3S.js → chunk-6AU6EPO6.js} +1 -1
- package/dist/chunks/chunk-73Z7BK5H.js +15 -0
- package/dist/chunks/chunk-7QB55SYG.js +326 -0
- package/dist/chunks/chunk-CQ6EQG7E.js +322 -0
- package/dist/chunks/chunk-CV6JHPEO.js +2 -0
- package/dist/chunks/chunk-D6QVXQNI.js +1 -0
- package/dist/chunks/chunk-HS2K74I4.js +31 -0
- package/dist/chunks/chunk-NKHXRN7G.js +403 -0
- package/dist/chunks/chunk-OBPB5BQ6.js +310 -0
- package/dist/chunks/chunk-P4VF3JEP.js +7 -0
- package/dist/chunks/chunk-PIQWODWN.js +18 -0
- package/dist/chunks/chunk-QHWXPJEG.js +601 -0
- package/dist/chunks/chunk-XXEIFNBE.js +52 -0
- package/dist/chunks/chunk-ZZDC75H4.js +681 -0
- package/dist/chunks/compaction-config-OPMRZSAK.js +2 -0
- package/dist/chunks/{construction-bootstrap-EDDVNP2B.js → construction-bootstrap-CIXFH5SE.js} +4 -4
- package/dist/chunks/dist-JSE7NICF.js +2 -0
- package/dist/chunks/dist-SDNQOW52.js +2 -0
- package/dist/chunks/host-H7FQMMRC.js +2 -0
- package/dist/chunks/{paste-5IDBBQQ3.js → paste-Y4DVUWSM.js} +1 -1
- package/dist/chunks/run-manager-4H5HWMVW.js +2 -0
- package/dist/chunks/utils-FLVVQHM7.js +2 -0
- package/dist/index.d.ts +22 -18
- package/dist/index.js +6 -6
- package/dist/kodax_cli.js +1303 -1108
- package/dist/provider-capabilities.json +986 -197
- package/dist/sdk-agent.d.ts +162 -14
- package/dist/sdk-agent.js +1 -1
- package/dist/sdk-coding.d.ts +285 -255
- package/dist/sdk-coding.js +1 -1
- package/dist/sdk-llm.d.ts +66 -43
- package/dist/sdk-llm.js +1 -1
- package/dist/sdk-mcp.d.ts +1 -1
- package/dist/sdk-mcp.js +1 -1
- package/dist/sdk-media.d.ts +64 -5
- package/dist/sdk-media.js +1 -1
- package/dist/sdk-repl.d.ts +114 -107
- package/dist/sdk-repl.js +2 -2
- package/dist/sdk-session.d.ts +7 -7
- package/dist/sdk-session.js +1 -1
- package/dist/sdk-skills.js +1 -1
- package/dist/semantic-worker.js +11 -0
- package/dist/types-chunks/{base.d-CwPfI8WQ.d.ts → base.d-BA9Doaj_.d.ts} +38 -8
- package/dist/types-chunks/{bash-prefix-extractor.d-DZF1gDDz.d.ts → bash-prefix-extractor.d-D3cddmyV.d.ts} +639 -163
- package/dist/types-chunks/capability-learning.d-DRV80ISB.d.ts +29 -0
- package/dist/types-chunks/{cost-tracker.d-wRtyEW9d.d.ts → cost-tracker.d-CBLk1fiD.d.ts} +24 -2
- package/dist/types-chunks/{guardrail.d-DQQknOfb.d.ts → guardrail.d-iK7FwMdW.d.ts} +32 -10
- package/dist/types-chunks/{manager.d-DLmDhX3i.d.ts → manager.d-DBD7SOTT.d.ts} +7 -2
- package/dist/types-chunks/{process.d-BdiIUr8T.d.ts → process.d-DHow2y2G.d.ts} +170 -14
- package/dist/types-chunks/{resolver.d-Djq8KlCE.d.ts → resolver.d-DDOfVYDr.d.ts} +111 -18
- package/dist/types-chunks/{capsule.d-D0kjnqYy.d.ts → run-manager.d-ByDcJc5g.d.ts} +124 -13
- package/dist/types-chunks/{sdk-session-BP6ZNpOp.d.ts → sdk-session-21Tt3N_x.d.ts} +74 -9
- package/dist/types-chunks/{storage.d-CkydxFsV.d.ts → storage.d-BsZrBPYu.d.ts} +2 -2
- package/dist/types-chunks/{types.d-BJmoMf5H.d.ts → types.d-Ci5YPFEh.d.ts} +135 -22
- package/dist/types-chunks/{types.d-BKuHSiR0.d.ts → types.d-D4ZA8LJV.d.ts} +7 -3
- package/dist/types-chunks/{utils.d-bC97IuQZ.d.ts → utils.d-BURxOxFd.d.ts} +94 -19
- package/package.json +12 -7
- package/dist/chunks/agent-MAAKRAF2.js +0 -2
- package/dist/chunks/argument-completer-OWEXGWNL.js +0 -2
- package/dist/chunks/chunk-4OHXHC2S.js +0 -314
- package/dist/chunks/chunk-5YJIAP6C.js +0 -551
- package/dist/chunks/chunk-7EAGBLRV.js +0 -2
- package/dist/chunks/chunk-CDGOEK3T.js +0 -31
- package/dist/chunks/chunk-DHETLULC.js +0 -425
- package/dist/chunks/chunk-JCDO2FR4.js +0 -584
- package/dist/chunks/chunk-NZVJ3DFC.js +0 -656
- package/dist/chunks/chunk-QI3MRJGU.js +0 -5
- package/dist/chunks/chunk-XXQ3RLA2.js +0 -2
- package/dist/chunks/compaction-config-NAJEEPG5.js +0 -2
- package/dist/chunks/dist-2267YGB5.js +0 -2
- package/dist/chunks/dist-GW32CHO5.js +0 -2
- package/dist/chunks/utils-J7XBBZGB.js +0 -2
package/README.md
CHANGED
|
@@ -154,7 +154,7 @@ For CLI defaults, create `~/.kodax/config.json`:
|
|
|
154
154
|
```json
|
|
155
155
|
{
|
|
156
156
|
"provider": "zhipu-coding",
|
|
157
|
-
"
|
|
157
|
+
"effort": "auto"
|
|
158
158
|
}
|
|
159
159
|
```
|
|
160
160
|
|
|
@@ -170,13 +170,18 @@ If you need a custom base URL or an OpenAI/Anthropic-compatible endpoint, define
|
|
|
170
170
|
"baseUrl": "https://example.com/v1",
|
|
171
171
|
"apiKeyEnv": "MY_LLM_API_KEY",
|
|
172
172
|
"model": "my-model",
|
|
173
|
-
"userAgentMode": "compat"
|
|
173
|
+
"userAgentMode": "compat",
|
|
174
|
+
"reasoning": {
|
|
175
|
+
"efforts": ["off", "low", "medium", "high", "max"],
|
|
176
|
+
"default": "high"
|
|
177
|
+
}
|
|
174
178
|
}
|
|
175
179
|
]
|
|
176
180
|
}
|
|
177
181
|
```
|
|
178
182
|
|
|
179
183
|
`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.
|
|
184
|
+
For custom reasoning models, `reasoning: { efforts, default }` is the preferred v0.7.57 shape; use `"reasoning": "none"` for models without thinking capability. SDK hosts should render effort pickers from `reasoningProfile.supportedEfforts` / `defaultEffort` rather than assuming a fixed five-option ladder.
|
|
180
185
|
|
|
181
186
|
#### OpenAI-compatible reasoning providers
|
|
182
187
|
|
|
@@ -191,8 +196,7 @@ Some OpenAI-compatible reasoning models require KodaX to replay the previous ass
|
|
|
191
196
|
"baseUrl": "https://example.com/v1",
|
|
192
197
|
"apiKeyEnv": "MY_DEEPSEEK_API_KEY",
|
|
193
198
|
"model": "deepseek-v4-flash",
|
|
194
|
-
"
|
|
195
|
-
"reasoningCapability": "native-toggle",
|
|
199
|
+
"reasoningPreset": "deepseek-v4-openai",
|
|
196
200
|
"replayReasoningContent": true
|
|
197
201
|
}
|
|
198
202
|
]
|
|
@@ -281,7 +285,7 @@ registerCustomProviders([
|
|
|
281
285
|
const result = await runKodaX(
|
|
282
286
|
{
|
|
283
287
|
provider: 'my-openai-compatible',
|
|
284
|
-
|
|
288
|
+
effort: 'auto',
|
|
285
289
|
},
|
|
286
290
|
'Explain this codebase'
|
|
287
291
|
);
|
|
@@ -292,27 +296,25 @@ const result = await runKodaX(
|
|
|
292
296
|
> surface (`startKodaX` + `RunningSession`), MCP popout manager API (`McpManager`),
|
|
293
297
|
> Skill `` !`cmd` `` host hook, and per-app data dir namespacing (`getAppDataDir`).
|
|
294
298
|
|
|
295
|
-
## Repo Intelligence
|
|
299
|
+
## Repo Intelligence
|
|
296
300
|
|
|
297
|
-
KodaX ships with built-in
|
|
301
|
+
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.
|
|
298
302
|
|
|
299
|
-
|
|
303
|
+
Use `/repo-intel status` in the REPL to inspect the active engine. The former standalone `repointel` host skill has been removed; repo intelligence is built into KodaX and requires no external installation.
|
|
300
304
|
|
|
301
305
|
```bash
|
|
302
|
-
# Pick a runtime mode (
|
|
303
|
-
kodax --repo-intelligence
|
|
306
|
+
# Pick a runtime mode (auto | full | light | off)
|
|
307
|
+
kodax --repo-intelligence full --repo-intelligence-trace
|
|
304
308
|
```
|
|
305
309
|
|
|
306
|
-
Setup, runtime modes, REPL controls, config schema, and external-host integrations: see [docs/REPOINTEL.md](docs/REPOINTEL.md).
|
|
307
|
-
|
|
308
310
|
## Architecture
|
|
309
311
|
|
|
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
|
|
312
|
+
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 8 SDK subpath exports (`/agent`, `/llm`, `/coding`, `/media`, `/repl`, `/skills`, `/mcp`, `/session`; ADR-024 + ADR-032 + ADR-038, with ADR-036 consolidation):
|
|
311
313
|
|
|
312
314
|
```
|
|
313
315
|
KodaX/
|
|
314
316
|
├── packages/ # 4 workspace packages (FEATURE_194 v0.7.43)
|
|
315
|
-
│ ├── llm/ # @kodax-ai/llm - LLM abstraction (
|
|
317
|
+
│ ├── llm/ # @kodax-ai/llm - LLM abstraction (15 built-in provider aliases)
|
|
316
318
|
│ │ └── providers/ # Anthropic, OpenAI, DeepSeek, Kimi, MiMo, MiniMax, Zhipu, Ark, …
|
|
317
319
|
│ │
|
|
318
320
|
│ ├── agent/ # @kodax-ai/agent - Generic Agent framework
|
|
@@ -333,7 +335,7 @@ KodaX/
|
|
|
333
335
|
│
|
|
334
336
|
├── src/ # CLI entry + SDK subpath entries
|
|
335
337
|
│ ├── kodax_cli.ts # Main CLI entry point (bin: `kodax`)
|
|
336
|
-
│ └── sdk-*.ts # SDK subpath re-exports → @kodax-ai/kodax/{agent,llm,coding,repl,skills,mcp,session}
|
|
338
|
+
│ └── sdk-*.ts # SDK subpath re-exports → @kodax-ai/kodax/{agent,llm,coding,media,repl,skills,mcp,session}
|
|
337
339
|
│
|
|
338
340
|
└── package.json # Root workspace config; release.mjs rewrites name + injects subpath exports
|
|
339
341
|
```
|
|
@@ -360,7 +362,7 @@ KodaX/
|
|
|
360
362
|
┌──────────────┐ ┌──────────────────────────┐ ┌──────────────┐
|
|
361
363
|
│@kodax-ai/ │ │@kodax-ai/agent │ │@kodax-ai/llm │
|
|
362
364
|
│coding (via │ │Runner + fan-out + │ │LLM Abstract │
|
|
363
|
-
│above) │ │idle-yield + session- │ │(
|
|
365
|
+
│above) │ │idle-yield + session- │ │(15 aliases) │
|
|
364
366
|
│ │ │lineage + skills + mcp + │ │ │
|
|
365
367
|
│ │ │tracing (FEATURE_194) │ │ │
|
|
366
368
|
└──────────────┘ └──────────────────────────┘ └──────────────┘
|
|
@@ -372,8 +374,8 @@ Source-side workspace package names (`@kodax-ai/*`). npm consumers install the s
|
|
|
372
374
|
|
|
373
375
|
| Workspace package | Purpose | Key Dependencies |
|
|
374
376
|
|---------|---------|------------------|
|
|
375
|
-
| `@kodax-ai/llm` | LLM abstraction (
|
|
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 |
|
|
377
|
+
| `@kodax-ai/llm` | LLM abstraction (15 built-in provider aliases + custom registration) | @anthropic-ai/sdk, openai |
|
|
378
|
+
| `@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 |
|
|
377
379
|
| `@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 |
|
|
378
380
|
| `@kodax-ai/repl` | Complete interactive terminal UI (Ink/React, permission modes, commands, streaming) | @kodax-ai/coding, ink, react |
|
|
379
381
|
|
|
@@ -382,13 +384,13 @@ Source-side workspace package names (`@kodax-ai/*`). npm consumers install the s
|
|
|
382
384
|
KodaX has two layers that consumers should understand separately:
|
|
383
385
|
|
|
384
386
|
- **Source-side**: 4 workspace packages above (what developers see when reading the repo).
|
|
385
|
-
- **npm-published**: a single bundled package `@kodax-ai/kodax` with
|
|
387
|
+
- **npm-published**: a single bundled package `@kodax-ai/kodax` with 8 SDK subpaths (what SDK consumers `import` from). The subpaths are split into two roles:
|
|
386
388
|
- **Full-package subpaths** (`/agent`, `/llm`, `/coding`, `/repl`) — each one maps 1:1 to a source workspace and exposes its complete public API.
|
|
387
|
-
- **Narrow-subset subpaths** (`/skills`, `/mcp`, `/session`) — each one exposes only a focused capability slice carved out of `/agent` or `/repl`. This lets consumers who only need (say) the Skills system import a much smaller surface without pulling in the full agent framework.
|
|
389
|
+
- **Narrow-subset subpaths** (`/media`, `/skills`, `/mcp`, `/session`) — each one exposes only a focused capability slice carved out of `/agent` or `/repl`. This lets consumers who only need (say) the Skills system import a much smaller surface without pulling in the full agent framework.
|
|
388
390
|
|
|
389
391
|
| Source package | npm subpath | Type | What you get | Example consumer |
|
|
390
392
|
|---|---|---|---|---|
|
|
391
|
-
| `packages/llm` | `@kodax-ai/kodax/llm` | Full package |
|
|
393
|
+
| `packages/llm` | `@kodax-ai/kodax/llm` | Full package | 15-alias LLM abstraction (77 exports) | Standalone LLM clients |
|
|
392
394
|
| `packages/agent` | `@kodax-ai/kodax/agent` | Full package | Runner / fan-out / session-lineage / capabilities / tracing (202 exports) | Custom agent frameworks |
|
|
393
395
|
| `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 |
|
|
394
396
|
| `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 |
|
|
@@ -409,14 +411,14 @@ KodaX has two layers that consumers should understand separately:
|
|
|
409
411
|
## Features
|
|
410
412
|
|
|
411
413
|
- **Modular Architecture** - Use as CLI, as a library, or as a Node-free single binary
|
|
412
|
-
- **
|
|
414
|
+
- **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
|
|
413
415
|
- **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
|
|
414
416
|
- **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`.
|
|
415
|
-
- **Reasoning
|
|
417
|
+
- **Reasoning Effort** - Effort-first control (`off/auto/low/medium/high` plus model-supported extras) across providers
|
|
416
418
|
- **Streaming Output** - Real-time response display
|
|
417
419
|
- **Session Management** - JSONL format with branchable session lineage tree
|
|
418
420
|
- **Skills System** - Natural language triggering, extensible, role-projected in AMA
|
|
419
|
-
- **Repo Intelligence** -
|
|
421
|
+
- **Repo Intelligence** - Built-in full/light repository intelligence with native KodaX auto-injection lane
|
|
420
422
|
- **Rich Tool Surface** - 50+ built-in tools across file ops, shell, search, repo intelligence, MCP capabilities, git worktree, and agent control
|
|
421
423
|
- **Permission Control** - 3 permission modes with pattern-based control
|
|
422
424
|
- **Standalone Binary** - `bun --compile` releases for Win/macOS/Linux x64+arm64, no Node.js required on target machines
|
|
@@ -491,7 +493,7 @@ process.env.ZHIPU_API_KEY = process.env.ZHIPU_API_KEY ?? 'your_api_key';
|
|
|
491
493
|
|
|
492
494
|
const result = await runKodaX({
|
|
493
495
|
provider: 'zhipu-coding',
|
|
494
|
-
|
|
496
|
+
effort: 'auto',
|
|
495
497
|
events: {
|
|
496
498
|
onTextDelta: (text) => process.stdout.write(text),
|
|
497
499
|
onComplete: () => console.log('\nDone!'),
|
|
@@ -507,7 +509,7 @@ For smaller surface and tree-shake-friendly imports, the SDK is also exposed via
|
|
|
507
509
|
|
|
508
510
|
```typescript
|
|
509
511
|
import { Runner } from '@kodax-ai/kodax/agent'; // agent runtime
|
|
510
|
-
import { getProvider } from '@kodax-ai/kodax/llm'; // LLM abstraction (
|
|
512
|
+
import { getProvider } from '@kodax-ai/kodax/llm'; // LLM abstraction (15 aliases)
|
|
511
513
|
import { runKodaX } from '@kodax-ai/kodax/coding'; // coding tools + prompts
|
|
512
514
|
import { SkillRegistry } from '@kodax-ai/kodax/skills'; // zero-dep skill loader
|
|
513
515
|
import { loadConfig } from '@kodax-ai/kodax/repl'; // REPL config / session helpers
|
|
@@ -515,7 +517,7 @@ import { createMcpManager } from '@kodax-ai/kodax/mcp'; // MCP popout ma
|
|
|
515
517
|
import { listSessions } from '@kodax-ai/kodax/session'; // session history helpers
|
|
516
518
|
```
|
|
517
519
|
|
|
518
|
-
All
|
|
520
|
+
All 9 SDK entries (root + 8 subpaths) share internal code via ESM chunk splitting — importing from `/agent` does not pull in `/repl`'s Ink + React surface.
|
|
519
521
|
|
|
520
522
|
> **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.
|
|
521
523
|
|
|
@@ -554,8 +556,8 @@ kodax "Help me create a TypeScript project"
|
|
|
554
556
|
# Choose a provider explicitly
|
|
555
557
|
kodax --provider openai --model gpt-5.4 "Create a REST API"
|
|
556
558
|
|
|
557
|
-
# Use
|
|
558
|
-
kodax --
|
|
559
|
+
# Use higher reasoning effort
|
|
560
|
+
kodax --effort high "Review this architecture"
|
|
559
561
|
```
|
|
560
562
|
|
|
561
563
|
### Session Workflows
|
|
@@ -664,7 +666,7 @@ kodax -h init # Long-running project initialization
|
|
|
664
666
|
kodax -h project # Project mode / harness workflow
|
|
665
667
|
kodax -h auto # Auto-continue mode
|
|
666
668
|
kodax -h provider # LLM provider configuration
|
|
667
|
-
kodax -h thinking # Thinking/reasoning
|
|
669
|
+
kodax -h thinking # Thinking/reasoning effort and compatibility modes
|
|
668
670
|
kodax -h team # Multi-agent parallel execution
|
|
669
671
|
kodax -h print # Print configuration
|
|
670
672
|
```
|
|
@@ -735,7 +737,7 @@ const events: KodaXEvents = {
|
|
|
735
737
|
|
|
736
738
|
const result = await runKodaX({
|
|
737
739
|
provider: 'zhipu-coding',
|
|
738
|
-
|
|
740
|
+
effort: 'auto',
|
|
739
741
|
events,
|
|
740
742
|
}, 'What is 1+1?');
|
|
741
743
|
|
|
@@ -749,7 +751,7 @@ import { KodaXClient } from '@kodax-ai/kodax';
|
|
|
749
751
|
|
|
750
752
|
const client = new KodaXClient({
|
|
751
753
|
provider: 'zhipu-coding',
|
|
752
|
-
|
|
754
|
+
effort: 'auto',
|
|
753
755
|
events: {
|
|
754
756
|
onTextDelta: (t) => process.stdout.write(t),
|
|
755
757
|
},
|
|
@@ -802,7 +804,7 @@ await runKodaX({
|
|
|
802
804
|
|
|
803
805
|
## SDK Usage
|
|
804
806
|
|
|
805
|
-
KodaX ships as a single npm package `@kodax-ai/kodax` with
|
|
807
|
+
KodaX ships as a single npm package `@kodax-ai/kodax` with 8 SDK subpath exports (ADR-024 v0.7.39 + ADR-032 v0.7.42 + ADR-038 v0.7.49 + v0.7.56 `/media`). Each subpath is tree-shake-friendly so consumers pull only what they need:
|
|
806
808
|
|
|
807
809
|
```bash
|
|
808
810
|
npm install @kodax-ai/kodax
|
|
@@ -811,8 +813,9 @@ npm install @kodax-ai/kodax
|
|
|
811
813
|
```typescript
|
|
812
814
|
import { runKodaX } from '@kodax-ai/kodax'; // root: CLI helpers + runKodaX
|
|
813
815
|
import { Runner, runFanOut } from '@kodax-ai/kodax/agent'; // generic Agent framework
|
|
814
|
-
import { getProvider } from '@kodax-ai/kodax/llm'; //
|
|
816
|
+
import { getProvider } from '@kodax-ai/kodax/llm'; // 15-alias LLM abstraction
|
|
815
817
|
import { KODAX_TOOLS } from '@kodax-ai/kodax/coding'; // tools + prompts + agent loop
|
|
818
|
+
import { createImageArtifactFromPath } from '@kodax-ai/kodax/media'; // input artifact helpers
|
|
816
819
|
import { runInkInteractiveMode } from '@kodax-ai/kodax/repl'; // Ink TUI entrypoint
|
|
817
820
|
import { SkillRegistry } from '@kodax-ai/kodax/skills'; // zero-dep skill loader
|
|
818
821
|
import { createMcpManager } from '@kodax-ai/kodax/mcp'; // MCP popout manager (v0.7.42)
|
|
@@ -823,7 +826,7 @@ import { listSessions } from '@kodax-ai/kodax/session'; // session his
|
|
|
823
826
|
|
|
824
827
|
### `@kodax-ai/kodax/llm` — LLM Abstraction
|
|
825
828
|
|
|
826
|
-
|
|
829
|
+
15 built-in provider aliases (Anthropic, OpenAI, DeepSeek, Kimi, Kimi-Code, Qwen, Zhipu, Zhipu-Coding, Zai-Coding, MiniMax-Coding, MiMo, MiMo-Coding, Ark-Coding, Gemini-CLI, Codex-CLI) + custom provider registration.
|
|
827
830
|
|
|
828
831
|
```typescript
|
|
829
832
|
import { getProvider, KodaXBaseProvider } from '@kodax-ai/kodax/llm';
|
|
@@ -840,7 +843,7 @@ for await (const result of stream) {
|
|
|
840
843
|
}
|
|
841
844
|
```
|
|
842
845
|
|
|
843
|
-
**Key Features**: unified provider interface · streaming · reasoning
|
|
846
|
+
**Key Features**: unified provider interface · streaming · reasoning effort (`off/auto/low/medium/high` plus model-supported extras) · per-provider retry + error handling · zero business-logic dependencies.
|
|
844
847
|
|
|
845
848
|
### `@kodax-ai/kodax/agent` — Agent Framework (standalone-consumable)
|
|
846
849
|
|
|
@@ -909,14 +912,14 @@ import { runKodaX, KodaXClient, KODAX_TOOLS } from '@kodax-ai/kodax/coding';
|
|
|
909
912
|
// Single-task helper
|
|
910
913
|
const result = await runKodaX({
|
|
911
914
|
provider: 'zhipu-coding',
|
|
912
|
-
|
|
915
|
+
effort: 'auto',
|
|
913
916
|
events: { onTextDelta: (text) => process.stdout.write(text) },
|
|
914
917
|
}, 'Read package.json and explain the dependencies');
|
|
915
918
|
|
|
916
919
|
// Continuous session
|
|
917
920
|
const client = new KodaXClient({
|
|
918
921
|
provider: 'anthropic',
|
|
919
|
-
|
|
922
|
+
effort: 'auto',
|
|
920
923
|
events: { /* … */ },
|
|
921
924
|
});
|
|
922
925
|
await client.send('Create a new file');
|
|
@@ -938,7 +941,7 @@ import { runInkInteractiveMode } from '@kodax-ai/kodax/repl';
|
|
|
938
941
|
// - Command system (/help, /mode, /clear, /status, …)
|
|
939
942
|
// - Skills integration
|
|
940
943
|
// - Theme support
|
|
941
|
-
await runInkInteractiveMode({ provider: 'zhipu-coding',
|
|
944
|
+
await runInkInteractiveMode({ provider: 'zhipu-coding', effort: 'auto' });
|
|
942
945
|
```
|
|
943
946
|
|
|
944
947
|
**Key Features**: Ink-based React components · 3 permission modes (auto / plan / accept-edits) · built-in commands · real-time streaming display · context-usage indicator.
|
|
@@ -961,7 +964,7 @@ await runInkInteractiveMode({ provider: 'zhipu-coding', reasoningMode: 'auto' })
|
|
|
961
964
|
|
|
962
965
|
| Use Case | Subpath | Why |
|
|
963
966
|
|----------|---------|-----|
|
|
964
|
-
| Only need LLM abstraction | `@kodax-ai/kodax/llm` | Minimal deps;
|
|
967
|
+
| Only need LLM abstraction | `@kodax-ai/kodax/llm` | Minimal deps; 15 built-in aliases |
|
|
965
968
|
| Building custom agent | `@kodax-ai/kodax/agent` | Runner + fan-out + idle-yield + session-lineage + capabilities |
|
|
966
969
|
| Coding tasks | `@kodax-ai/kodax/coding` | Complete coding agent + tools |
|
|
967
970
|
| Terminal app | `@kodax-ai/kodax/repl` | Full interactive experience |
|
|
@@ -977,6 +980,7 @@ await runInkInteractiveMode({ provider: 'zhipu-coding', reasoningMode: 'auto' })
|
|
|
977
980
|
| qwen | `QWEN_API_KEY` | Native | qwen3.5-plus |
|
|
978
981
|
| zhipu | `ZHIPU_API_KEY` | Native | glm-5 (`glm-5.2` 1M ctx / `glm-5.1` / `glm-5-turbo` via `/model`) |
|
|
979
982
|
| zhipu-coding | `ZHIPU_CODING_API_KEY` | Native | glm-5 (`glm-5.2` 1M ctx / `glm-5.1` / `glm-5-turbo` via `/model`) |
|
|
983
|
+
| 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) |
|
|
980
984
|
| 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`) |
|
|
981
985
|
| mimo | `MIMO_API_KEY` | Native | mimo-v2.5-pro (Xiaomi MiMo pay-per-token, Anthropic-compat) |
|
|
982
986
|
| mimo-coding | `MIMO_CODING_API_KEY` | Native | mimo-v2.5-pro (Xiaomi Token Plan, Anthropic-compat) |
|
|
@@ -1168,20 +1172,20 @@ npm run clean
|
|
|
1168
1172
|
|
|
1169
1173
|
### Repo Intelligence cache directories
|
|
1170
1174
|
|
|
1171
|
-
KodaX
|
|
1175
|
+
KodaX uses one repo-intelligence cache root with separate built-in engine profiles:
|
|
1172
1176
|
|
|
1173
1177
|
- `.agent/repo-intelligence/`
|
|
1174
|
-
-
|
|
1175
|
-
- `.
|
|
1176
|
-
-
|
|
1178
|
+
- Full-engine repo-intelligence artifacts and existing task-engine snapshots.
|
|
1179
|
+
- `.agent/repo-intelligence/light/`
|
|
1180
|
+
- Light-mode heuristic index artifacts.
|
|
1177
1181
|
|
|
1178
1182
|
They are intentionally separated so:
|
|
1179
1183
|
|
|
1180
|
-
-
|
|
1181
|
-
-
|
|
1182
|
-
-
|
|
1184
|
+
- full and light profiles can be rebuilt independently.
|
|
1185
|
+
- light-mode confidence/capability state cannot be mistaken for full-engine state.
|
|
1186
|
+
- future cache migrations can delete one profile without corrupting the other.
|
|
1183
1187
|
|
|
1184
|
-
`.
|
|
1188
|
+
`.agent/repo-intelligence/` is local generated state and should not be committed.
|
|
1185
1189
|
|
|
1186
1190
|
---
|
|
1187
1191
|
|
package/README_CN.md
CHANGED
|
@@ -160,7 +160,7 @@ $env:ZHIPU_API_KEY="your_api_key"
|
|
|
160
160
|
```json
|
|
161
161
|
{
|
|
162
162
|
"provider": "zhipu-coding",
|
|
163
|
-
"
|
|
163
|
+
"effort": "auto"
|
|
164
164
|
}
|
|
165
165
|
```
|
|
166
166
|
|
|
@@ -194,7 +194,7 @@ import { runKodaX } from '@kodax-ai/kodax';
|
|
|
194
194
|
const result = await runKodaX(
|
|
195
195
|
{
|
|
196
196
|
provider: 'zhipu-coding',
|
|
197
|
-
|
|
197
|
+
effort: 'auto',
|
|
198
198
|
},
|
|
199
199
|
'Explain this codebase'
|
|
200
200
|
);
|
|
@@ -206,15 +206,16 @@ const result = await runKodaX(
|
|
|
206
206
|
|
|
207
207
|
```typescript
|
|
208
208
|
import { Runner } from '@kodax-ai/kodax/agent'; // Agent runtime
|
|
209
|
-
import { getProvider } from '@kodax-ai/kodax/llm'; // LLM 抽象(
|
|
209
|
+
import { getProvider } from '@kodax-ai/kodax/llm'; // LLM 抽象(15 个内置 alias)
|
|
210
210
|
import { runKodaX } from '@kodax-ai/kodax/coding'; // Coding tools + prompts
|
|
211
|
+
import { createImageArtifactFromPath } from '@kodax-ai/kodax/media'; // 输入 artifact helpers
|
|
211
212
|
import { SkillRegistry } from '@kodax-ai/kodax/skills'; // 零依赖 skill loader
|
|
212
213
|
import { loadConfig } from '@kodax-ai/kodax/repl'; // REPL 配置 / session 工具
|
|
213
214
|
import { createMcpManager } from '@kodax-ai/kodax/mcp'; // MCP popout manager(v0.7.42 起)
|
|
214
215
|
import { listSessions } from '@kodax-ai/kodax/session'; // session 历史工具
|
|
215
216
|
```
|
|
216
217
|
|
|
217
|
-
|
|
218
|
+
9 个 SDK 入口(root + 8 subpath)通过 ESM 共享 chunk 复用底层代码 —— 只 import `/agent` 不会把 `/repl` 的 Ink + React 一起拉进来。
|
|
218
219
|
|
|
219
220
|
> **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。
|
|
220
221
|
|
|
@@ -232,7 +233,11 @@ import { listSessions } from '@kodax-ai/kodax/session'; // session 历
|
|
|
232
233
|
"baseUrl": "https://example.com/v1",
|
|
233
234
|
"apiKeyEnv": "MY_LLM_API_KEY",
|
|
234
235
|
"model": "my-model",
|
|
235
|
-
"userAgentMode": "compat"
|
|
236
|
+
"userAgentMode": "compat",
|
|
237
|
+
"reasoning": {
|
|
238
|
+
"efforts": ["off", "low", "medium", "high", "max"],
|
|
239
|
+
"default": "high"
|
|
240
|
+
}
|
|
236
241
|
}
|
|
237
242
|
]
|
|
238
243
|
}
|
|
@@ -240,6 +245,8 @@ import { listSessions } from '@kodax-ai/kodax/session'; // session 历
|
|
|
240
245
|
|
|
241
246
|
`userAgentMode` 默认 `"compat"`(发送 `KodaX` 而非上游 SDK 的 User-Agent);如果你的网关要求原生 SDK header,再切到 `"sdk"`。
|
|
242
247
|
|
|
248
|
+
自定义 reasoning 模型优先使用 v0.7.57 的 `reasoning: { efforts, default }`;无 thinking 能力的模型使用 `"reasoning": "none"`。SDK 宿主的 effort 选择器应从 `reasoningProfile.supportedEfforts` / `defaultEffort` 动态生成,不要假定固定五档。
|
|
249
|
+
|
|
243
250
|
#### OpenAI 兼容推理模型
|
|
244
251
|
|
|
245
252
|
部分 OpenAI-compatible 推理模型要求多轮请求时回放上一轮 assistant 的 `reasoning_content`。DeepSeek V4 thinking mode 是已知必须开启的场景;内置 DeepSeek provider 已经默认开启,但自定义 provider 需要显式配置:
|
|
@@ -253,8 +260,7 @@ import { listSessions } from '@kodax-ai/kodax/session'; // session 历
|
|
|
253
260
|
"baseUrl": "https://example.com/v1",
|
|
254
261
|
"apiKeyEnv": "MY_DEEPSEEK_API_KEY",
|
|
255
262
|
"model": "deepseek-v4-flash",
|
|
256
|
-
"
|
|
257
|
-
"reasoningCapability": "native-toggle",
|
|
263
|
+
"reasoningPreset": "deepseek-v4-openai",
|
|
258
264
|
"replayReasoningContent": true
|
|
259
265
|
}
|
|
260
266
|
]
|
|
@@ -380,6 +386,7 @@ dist/binary/linux-x64/
|
|
|
380
386
|
| qwen | `QWEN_API_KEY` | Native | qwen3.5-plus |
|
|
381
387
|
| zhipu | `ZHIPU_API_KEY` | Native | glm-5(可 `/model` 切换 `glm-5.2` 1M ctx / `glm-5.1` / `glm-5-turbo`) |
|
|
382
388
|
| zhipu-coding | `ZHIPU_CODING_API_KEY` | Native | glm-5(GLM Coding Plan;可 `/model` 切换 `glm-5.2` 1M ctx / `glm-5.1` / `glm-5-turbo`) |
|
|
389
|
+
| zai-coding | `ZAI_CODING_API_KEY` | Native | glm-5.2(GLM Coding Plan 海外站,通过 `api.z.ai` 接入,Anthropic 协议 — 模型清单和 `zhipu-coding` 完全一致) |
|
|
383
390
|
| minimax-coding | `MINIMAX_CODING_API_KEY` | Native | MiniMax-M2.7(可 `/model` 切换 `MiniMax-M3` Frontier Coding,原生多模态 + 1M ctx;以及 `MiniMax-M2.7-highspeed`) |
|
|
384
391
|
| mimo | `MIMO_API_KEY` | Native | mimo-v2.5-pro(小米 MiMo 按量计费,Anthropic 协议) |
|
|
385
392
|
| mimo-coding | `MIMO_CODING_API_KEY` | Native | mimo-v2.5-pro(小米 MiMo Token Plan,Anthropic 协议) |
|
|
@@ -452,44 +459,42 @@ KodaX 有 50+ 个内置工具,按类别分组如下(实际暴露给 LLM 是
|
|
|
452
459
|
| `exit_plan_mode` | Plan 模式下提交最终方案给用户审批(仅 REPL) |
|
|
453
460
|
| `emit_managed_protocol` | managed-task 协议侧信道(verdict role payload)。v0.7.42 FEATURE_184 起默认走 V2 Worker 单循环 + Sidecar Verifier;v0.7.43 FEATURE_193 退役 V1 chain。 |
|
|
454
461
|
|
|
455
|
-
## Repo Intelligence
|
|
462
|
+
## Repo Intelligence(内置 full/light 引擎)
|
|
456
463
|
|
|
457
|
-
KodaX 内置
|
|
464
|
+
KodaX 内置 repo intelligence(`repo_overview` / `module_context` / `symbol_context` / `process_context` / `impact_estimate` 等),让 coding agent 不靠零散 grep/glob 就能理解大型仓库。
|
|
458
465
|
|
|
459
|
-
|
|
466
|
+
REPL 中使用 `/repo-intel status` 查看当前引擎状态。旧的独立 `repointel` host skill 已移除;repo intelligence 已内置于 KodaX,无需任何外部安装。
|
|
460
467
|
|
|
461
468
|
```bash
|
|
462
|
-
# 选一个运行模式(
|
|
463
|
-
kodax --repo-intelligence
|
|
469
|
+
# 选一个运行模式(auto | full | light | off)
|
|
470
|
+
kodax --repo-intelligence full --repo-intelligence-trace
|
|
464
471
|
```
|
|
465
472
|
|
|
466
|
-
完整安装 / 运行模式 / REPL 控制 / config schema / 第三方宿主接入,详见 [docs/REPOINTEL.md](docs/REPOINTEL.md)。
|
|
467
|
-
|
|
468
473
|
## 仓库结构
|
|
469
474
|
|
|
470
|
-
KodaX 是基于 npm workspaces 的 TypeScript monorepo,**源码层 4 个 workspace 包**(FEATURE_194 v0.7.43 包合并 — 9 → 4,ADR-036),npm 上以单 bundle 包 `@kodax-ai/kodax` 发布 +
|
|
475
|
+
KodaX 是基于 npm workspaces 的 TypeScript monorepo,**源码层 4 个 workspace 包**(FEATURE_194 v0.7.43 包合并 — 9 → 4,ADR-036),npm 上以单 bundle 包 `@kodax-ai/kodax` 发布 + 8 个 SDK subpath exports(`/agent`、`/llm`、`/coding`、`/media`、`/repl`、`/skills`、`/mcp`、`/session`;ADR-024 + ADR-032 + ADR-038)。核心包:
|
|
471
476
|
|
|
472
477
|
| Workspace 包 | 作用 | 主要依赖 |
|
|
473
478
|
|----|------|---------|
|
|
474
|
-
| `@kodax-ai/llm` | LLM 抽象层(
|
|
475
|
-
| `@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` |
|
|
479
|
+
| `@kodax-ai/llm` | LLM 抽象层(15 个内置 provider alias + 自定义 provider 注册),可独立使用 | `@anthropic-ai/sdk`, `openai` |
|
|
480
|
+
| `@kodax-ai/agent` | 通用 Agent 框架 —— Runner / runFanOut / runWithIdleYield / ChildTaskRegistry + media/input artifacts + 会话管理 + tokenization + 可插拔 compaction + **inline 后**:session-lineage 子树 + capabilities (mcp + skills + builtin) + tracing(subpaths: `/media`、`/session-lineage`、`/capabilities/mcp`、`/capabilities/skills`、`/tracing`) | `@kodax-ai/llm`, `js-tiktoken`, `fflate`, `jimp`, `yaml` |
|
|
476
481
|
| `@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` |
|
|
477
482
|
| `@kodax-ai/repl` | 完整交互式终端 UI(Ink / React、权限模式、命令系统、流式渲染) | `@kodax-ai/coding`, `ink`, `react` |
|
|
478
483
|
|
|
479
|
-
根目录 `src/kodax_cli.ts` 是 CLI 入口;`src/sdk-{agent,llm,coding,repl,skills,mcp,session}.ts` 是 SDK subpath 入口;构建产物在 `dist/`,单文件二进制在 `dist/binary/<target>/`。
|
|
484
|
+
根目录 `src/kodax_cli.ts` 是 CLI 入口;`src/sdk-{agent,llm,coding,media,repl,skills,mcp,session}.ts` 是 SDK subpath 入口;构建产物在 `dist/`,单文件二进制在 `dist/binary/<target>/`。
|
|
480
485
|
|
|
481
486
|
### 源码层 vs npm 发布层
|
|
482
487
|
|
|
483
488
|
KodaX 有两层结构,SDK 用户需要分开理解:
|
|
484
489
|
|
|
485
490
|
- **源码层**:上面 4 个 workspace 包(开发者读代码时看到的物理结构)。
|
|
486
|
-
- **npm 发布层**:单个 bundled 包 `@kodax-ai/kodax`,对外暴露
|
|
491
|
+
- **npm 发布层**:单个 bundled 包 `@kodax-ai/kodax`,对外暴露 8 个 SDK subpath(SDK 消费者 `import` 时看到的接口)。subpath 分两种角色:
|
|
487
492
|
- **完整包 subpath**(`/agent`、`/llm`、`/coding`、`/repl`)—— 每个 1:1 对应一个源码包,暴露完整公开 API。
|
|
488
|
-
- **窄子集 subpath**(`/skills`、`/mcp`、`/session`)—— 从 `/agent` 或 `/repl` 切出聚焦的能力子集,让"只用 Skills/MCP/会话管理"的消费者引入更小的依赖。
|
|
493
|
+
- **窄子集 subpath**(`/media`、`/skills`、`/mcp`、`/session`)—— 从 `/agent` 或 `/repl` 切出聚焦的能力子集,让"只用 Skills/MCP/会话管理"的消费者引入更小的依赖。
|
|
489
494
|
|
|
490
495
|
| 源码包 | npm subpath | 类型 | 内容 | 典型消费者 |
|
|
491
496
|
|---|---|---|---|---|
|
|
492
|
-
| `packages/llm` | `@kodax-ai/kodax/llm` | 完整包 |
|
|
497
|
+
| `packages/llm` | `@kodax-ai/kodax/llm` | 完整包 | 15-alias LLM 抽象 (77 exports) | 独立 LLM 客户端 |
|
|
493
498
|
| `packages/agent` | `@kodax-ai/kodax/agent` | 完整包 | Runner / fan-out / session-lineage / capabilities / tracing (202 exports) | 自定义 agent 框架 |
|
|
494
499
|
| `packages/agent` | `@kodax-ai/kodax/skills` | **窄子集** | 仅 Skills 系统 —— `SkillRegistry` / `loadFullSkill` / `expandSkillForLLM` 等 (26 exports = v0.7.43 之前 `@kodax-ai/skills` 完整 API) | Skill 加载器、IDE 插件 |
|
|
495
500
|
| `packages/agent` | `@kodax-ai/kodax/mcp` | **窄子集** | 仅 MCP —— `McpCapabilityProvider` / `createMcpTransport` / `searchMcpCatalog` 等 (11 exports = v0.7.43 之前 `@kodax-ai/mcp` 完整 API) | MCP server 宿主 |
|
|
@@ -506,7 +511,7 @@ KodaX 有两层结构,SDK 用户需要分开理解:
|
|
|
506
511
|
```
|
|
507
512
|
KodaX/ # 4 workspace packages(FEATURE_194 v0.7.43)
|
|
508
513
|
├── packages/
|
|
509
|
-
│ ├── llm/ # @kodax-ai/llm ——
|
|
514
|
+
│ ├── llm/ # @kodax-ai/llm —— 15 个内置 provider alias
|
|
510
515
|
│ ├── agent/ # @kodax-ai/agent —— Runner / fan-out / idle-yield + 子树:
|
|
511
516
|
│ │ ├── session-lineage/ # 分支 session tree (v0.7.43 inline)
|
|
512
517
|
│ │ ├── capabilities/
|
|
@@ -518,9 +523,9 @@ KodaX/ # 4 workspace packages(FEATURE_194 v0.7.43)
|
|
|
518
523
|
│ └── repl/ # @kodax-ai/repl —— Ink TUI
|
|
519
524
|
├── src/
|
|
520
525
|
│ ├── kodax_cli.ts # CLI 主入口(bin: `kodax`)
|
|
521
|
-
│ └── sdk-*.ts # SDK subpath 入口 → @kodax-ai/kodax/{agent,llm,coding,repl,skills,mcp,session}
|
|
526
|
+
│ └── sdk-*.ts # SDK subpath 入口 → @kodax-ai/kodax/{agent,llm,coding,media,repl,skills,mcp,session}
|
|
522
527
|
├── scripts/
|
|
523
|
-
│ ├── build-bundle.mjs # esbuild 单 bundle 多 entry 打包(CLI + root +
|
|
528
|
+
│ ├── build-bundle.mjs # esbuild 单 bundle 多 entry 打包(CLI + root + 8 SDK subpath + chunks)
|
|
524
529
|
│ ├── build-binary.mjs # Bun --compile 单文件二进制打包
|
|
525
530
|
│ └── release.mjs # ADR-024 release-time pkg name/exports 注入
|
|
526
531
|
└── .github/workflows/
|
|
@@ -594,20 +599,20 @@ npm run clean
|
|
|
594
599
|
|
|
595
600
|
### Repo Intelligence 缓存目录
|
|
596
601
|
|
|
597
|
-
KodaX 现在会把 Repo Intelligence
|
|
602
|
+
KodaX 现在会把 Repo Intelligence 的本地缓存分成内置引擎 profile:
|
|
598
603
|
|
|
599
604
|
- `.agent/repo-intelligence/`
|
|
600
|
-
-
|
|
601
|
-
- `.
|
|
602
|
-
-
|
|
605
|
+
- full 引擎索引、缓存和现有 task-engine 产物。
|
|
606
|
+
- `.agent/repo-intelligence/light/`
|
|
607
|
+
- light 模式启发式索引缓存。
|
|
603
608
|
|
|
604
609
|
这样拆开的目的很明确:
|
|
605
610
|
|
|
606
|
-
-
|
|
607
|
-
-
|
|
608
|
-
-
|
|
611
|
+
- full 和 light profile 可以独立重建。
|
|
612
|
+
- light 模式的低置信度状态不会被误认为 full 引擎状态。
|
|
613
|
+
- 未来缓存迁移可以删除一个 profile,而不破坏另一个。
|
|
609
614
|
|
|
610
|
-
`.
|
|
615
|
+
`.agent/repo-intelligence/` 是本地生成目录,不应该提交到 Git。
|
|
611
616
|
|
|
612
617
|
---
|
|
613
618
|
|
|
@@ -58,6 +58,25 @@ compatibility: "Works best in a git repository or when the review target is prov
|
|
|
58
58
|
|
|
59
59
|
## 使用示例
|
|
60
60
|
|
|
61
|
-
- `/code-review src/auth.ts` - 审查单个文件
|
|
62
|
-
- `/code-review packages/coding/src/` - 审查目录
|
|
63
|
-
- `/code-review` - 审查当前 git 变更
|
|
61
|
+
- `/code-review src/auth.ts` - 审查单个文件
|
|
62
|
+
- `/code-review packages/coding/src/` - 审查目录
|
|
63
|
+
- `/code-review` - 审查当前 git 变更
|
|
64
|
+
|
|
65
|
+
## Lean Review Lens
|
|
66
|
+
|
|
67
|
+
When the user asks for lean review, minimal diff, YAGNI, over-engineering, or
|
|
68
|
+
native/stdlib replacement opportunities, add this lens after correctness and
|
|
69
|
+
security findings:
|
|
70
|
+
|
|
71
|
+
- Look for code, files, abstractions, dependencies, configuration, or workflow
|
|
72
|
+
changes that can be deleted without losing requested behavior.
|
|
73
|
+
- Prefer existing repository code, stdlib/native platform features, or an
|
|
74
|
+
already-installed dependency when that is verifiably simpler than new custom
|
|
75
|
+
code.
|
|
76
|
+
- Do not recommend cutting trust-boundary validation, security checks,
|
|
77
|
+
data-loss protection, accessibility basics, observability needed for safety,
|
|
78
|
+
or explicitly requested behavior.
|
|
79
|
+
- Do not present optional cleanup as a high-severity finding. Put non-blocking
|
|
80
|
+
deletion/replacement ideas under `## Lean Suggestions`.
|
|
81
|
+
- For each lean suggestion, explain what can be skipped or removed and when it
|
|
82
|
+
should be added back.
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @kodax-ai/kodax — bundled distribution. See docs/ADR.md ADR-022 + ADR-024.
|
|
2
|
+
import{I as c,J as d,K as e,L as f,Z as g,_ as h,ia as i,oa as j}from"./chunk-CQ6EQG7E.js";import"./chunk-D6QVXQNI.js";import"./chunk-526OILYL.js";import"./chunk-7QB55SYG.js";import"./chunk-HS2K74I4.js";import{mb as a,nb as b}from"./chunk-ZZDC75H4.js";import"./chunk-P4VF3JEP.js";import"./chunk-V4WSBIXB.js";export{d as bucketProviderPayloadSize,g as buildAutoRepoIntelligenceContext,e as checkPromiseSignal,b as cleanupIncompleteToolCalls,h as describeTransientProviderRetry,f as emitResilienceDebug,c 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{Aa as b,za as a}from"./chunk-QHWXPJEG.js";import"./chunk-6AU6EPO6.js";import"./chunk-XXEIFNBE.js";import"./chunk-NKHXRN7G.js";import"./chunk-73Z7BK5H.js";import"./chunk-PIQWODWN.js";import"./chunk-CQ6EQG7E.js";import"./chunk-D6QVXQNI.js";import"./chunk-526OILYL.js";import"./chunk-7QB55SYG.js";import"./chunk-HS2K74I4.js";import"./chunk-ZZDC75H4.js";import"./chunk-P4VF3JEP.js";import"./chunk-V4WSBIXB.js";export{a as ArgumentCompleter,b as createArgumentCompleter};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @kodax-ai/kodax — bundled distribution. See docs/ADR.md ADR-022 + ADR-024.
|
|
2
|
+
import{l as o}from"./chunk-HS2K74I4.js";import{a as i}from"./chunk-V4WSBIXB.js";function r(u){let e=o(u?.llm);if(!e)return;let t={};return e.requestTimeoutMs!==void 0&&(t.requestTimeoutMs=e.requestTimeoutMs),e.streamIdleTimeoutMs!==void 0&&(t.streamIdleTimeoutMs=e.streamIdleTimeoutMs),e.chunkTimeoutMs!==void 0&&(t.chunkTimeoutMs=e.chunkTimeoutMs),e.maxRetryDelayMs!==void 0&&(t.maxRetryDelayMs=e.maxRetryDelayMs),Object.keys(t).length>0?t:void 0}i(r,"providerResilienceConfigFromTimeouts");export{r as a};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @kodax-ai/kodax — bundled distribution. See docs/ADR.md ADR-022 + ADR-024.
|
|
2
|
-
import{wa as e}from"./chunk-
|
|
2
|
+
import{wa as e}from"./chunk-ZZDC75H4.js";import{a as n}from"./chunk-V4WSBIXB.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};
|