@kodax-ai/kodax 0.7.69 → 0.7.71

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (87) hide show
  1. package/CHANGELOG.md +187 -1
  2. package/LICENSE +158 -191
  3. package/README.md +100 -17
  4. package/README_CN.md +77 -11
  5. package/config-templates/integrations/a2a.example.jsonc +62 -18
  6. package/dist/chunks/{agent-DQRXT6M7.js → agent-X2EWQADL.js} +1 -1
  7. package/dist/chunks/argument-completer-BLNXDO2F.js +2 -0
  8. package/dist/chunks/chunk-23X6REO4.js +46 -0
  9. package/dist/chunks/{chunk-Y4WOTWUC.js → chunk-44QXPEEE.js} +1 -1
  10. package/dist/chunks/chunk-4DY756KL.js +70 -0
  11. package/dist/chunks/{chunk-AWMTNUDS.js → chunk-52JSZ77P.js} +1 -1
  12. package/dist/chunks/{chunk-I4TPQEJN.js → chunk-64NQBOSN.js} +1 -1
  13. package/dist/chunks/{chunk-URC6ZI6P.js → chunk-A2TFSV5M.js} +1 -1
  14. package/dist/chunks/{chunk-ZG4DMYBS.js → chunk-A574DBTV.js} +2 -2
  15. package/dist/chunks/{chunk-VAZ25MDX.js → chunk-F7KGYHJ3.js} +2 -2
  16. package/dist/chunks/{chunk-M7TCFYTO.js → chunk-GVTM4Z6O.js} +66 -22
  17. package/dist/chunks/{chunk-PA76WUBL.js → chunk-PHH4TRGF.js} +2 -2
  18. package/dist/chunks/chunk-PVUXONQB.js +366 -0
  19. package/dist/chunks/{chunk-WW2O2DEP.js → chunk-SX2WFHIS.js} +1 -1
  20. package/dist/chunks/{chunk-4WIODYOH.js → chunk-T7LYK53M.js} +2 -2
  21. package/dist/chunks/{chunk-F7C7J6IM.js → chunk-VRSVNU2Y.js} +3 -3
  22. package/dist/chunks/chunk-Y5XKAN7C.js +755 -0
  23. package/dist/chunks/{chunk-NGJURAY5.js → chunk-Z535BARK.js} +4 -4
  24. package/dist/chunks/chunk-ZJIMT5I3.js +78 -0
  25. package/dist/chunks/compaction-config-5KKKXYFT.js +2 -0
  26. package/dist/chunks/{construction-bootstrap-GH6RW6ST.js → construction-bootstrap-OXDDDW6O.js} +1 -1
  27. package/dist/chunks/{dist-DRBKYVHF.js → dist-GOUP4YVE.js} +1 -1
  28. package/dist/chunks/{dist-RWL2RBO4.js → dist-IXJRJ27U.js} +1 -1
  29. package/dist/chunks/host-VRKDAN26.js +2 -0
  30. package/dist/chunks/run-manager-Z3W6MDO7.js +2 -0
  31. package/dist/chunks/{utils-QYE5Y73D.js → utils-CFOXDCB5.js} +1 -1
  32. package/dist/index.d.ts +18 -18
  33. package/dist/index.js +6 -6
  34. package/dist/kodax_cli.js +1365 -1296
  35. package/dist/provider-capabilities.json +101 -57
  36. package/dist/runtime-worker.js +1224 -1156
  37. package/dist/sdk-a2a.d.ts +187 -22
  38. package/dist/sdk-a2a.js +8 -7
  39. package/dist/sdk-agent.d.ts +49 -20
  40. package/dist/sdk-agent.js +1 -1
  41. package/dist/sdk-coding.d.ts +33 -25
  42. package/dist/sdk-coding.js +1 -1
  43. package/dist/sdk-experimental-memory.d.ts +1 -1
  44. package/dist/sdk-experimental-memory.js +1 -1
  45. package/dist/sdk-llm.d.ts +7 -7
  46. package/dist/sdk-llm.js +1 -1
  47. package/dist/sdk-mcp.d.ts +2 -2
  48. package/dist/sdk-mcp.js +1 -1
  49. package/dist/sdk-media.d.ts +1 -1
  50. package/dist/sdk-media.js +1 -1
  51. package/dist/sdk-repl.d.ts +17 -17
  52. package/dist/sdk-repl.js +1 -1
  53. package/dist/sdk-runtime.d.ts +96 -17
  54. package/dist/sdk-runtime.js +1 -1
  55. package/dist/sdk-session.d.ts +7 -7
  56. package/dist/sdk-session.js +1 -1
  57. package/dist/sdk-skills.js +1 -1
  58. package/dist/semantic-worker.js +10 -10
  59. package/dist/types-chunks/{base.d-CYjtB68X.d.ts → base.d-Cz_rwpOi.d.ts} +2 -1
  60. package/dist/types-chunks/{bash-prefix-extractor.d-BkIA8Wto.d.ts → bash-prefix-extractor.d-YoiZl5yt.d.ts} +15 -5
  61. package/dist/types-chunks/{capability-learning.d-WtsyRv3O.d.ts → capability-learning.d-_lR0J4iR.d.ts} +1 -1
  62. package/dist/types-chunks/{capability.d-3C62G8Eq.d.ts → capability.d-K664nHOS.d.ts} +21 -6
  63. package/dist/types-chunks/{capsule.d-xJvfh4YR.d.ts → capsule.d-CK5Pfz1k.d.ts} +3 -3
  64. package/dist/types-chunks/{commands.d-DkPfcQWG.d.ts → commands.d-D6g2jq8V.d.ts} +4 -4
  65. package/dist/types-chunks/{guardrail.d-R7AiGfrI.d.ts → guardrail.d-DdeDWnVu.d.ts} +3 -3
  66. package/dist/types-chunks/{guardrail.d-6ZDbNbHO.d.ts → guardrail.d-DilYC1dh.d.ts} +1 -1
  67. package/dist/types-chunks/{manager.d-CoEuPRAo.d.ts → manager.d-B67TmPO1.d.ts} +27 -3
  68. package/dist/types-chunks/{public-api.d-7G4--RZE.d.ts → public-api.d-BvCp5VkW.d.ts} +3 -3
  69. package/dist/types-chunks/{resolver.d-CIVoGc97.d.ts → resolver.d-ssgNSlrh.d.ts} +2 -2
  70. package/dist/types-chunks/{run-manager.d-BaXtkryp.d.ts → run-manager.d-DxU3SSGR.d.ts} +1 -1
  71. package/dist/types-chunks/{sdk-session-BQccrODn.d.ts → sdk-session-wGpa7X_U.d.ts} +4 -4
  72. package/dist/types-chunks/{types.d-CJR7t6iW.d.ts → types.d-CEZZSY9s.d.ts} +2 -2
  73. package/dist/types-chunks/{types.d-BtC4yLYO.d.ts → types.d-CRCaLt_s.d.ts} +55 -7
  74. package/dist/types-chunks/{types.d-TTvpAGWf.d.ts → types.d-Cqaw71Ax.d.ts} +4 -2
  75. package/dist/types-chunks/{types.d-C9YHEAmA.d.ts → types.d-CzsLFqmf.d.ts} +5 -5
  76. package/dist/types-chunks/{utils.d-BbB5jzi1.d.ts → utils.d-Cb6vdvFM.d.ts} +5 -5
  77. package/docs/SDK_EMBEDDER_GUIDE.md +357 -55
  78. package/package.json +5 -2
  79. package/dist/chunks/argument-completer-RSK6CCGP.js +0 -2
  80. package/dist/chunks/chunk-NGHQIGVW.js +0 -46
  81. package/dist/chunks/chunk-PQ3XUSY2.js +0 -357
  82. package/dist/chunks/chunk-UJEMSPM5.js +0 -78
  83. package/dist/chunks/chunk-VYKFM3TB.js +0 -751
  84. package/dist/chunks/chunk-Z4PPLJF2.js +0 -60
  85. package/dist/chunks/compaction-config-ABLL6UH3.js +0 -2
  86. package/dist/chunks/host-7SAB4WEC.js +0 -2
  87. package/dist/chunks/run-manager-XMDKTONJ.js +0 -2
package/README.md CHANGED
@@ -7,14 +7,14 @@
7
7
  </p>
8
8
 
9
9
  <p align="center">
10
- <b>Open-source AI coding agent on every LLM you can reach.</b><br>
10
+ <b>Source-available AI coding agent on every LLM you can reach.</b><br>
11
11
  Anthropic · OpenAI · DeepSeek · Kimi · Zhipu · MiniMax · MiMo · Ark · Qwen · Gemini · Codex.<br>
12
12
  REPL · CLI · library · Node-free single binary.
13
13
  </p>
14
14
 
15
15
  <p align="center">
16
16
  <a href="https://www.npmjs.com/package/@kodax-ai/kodax"><img alt="npm version" src="https://img.shields.io/npm/v/@kodax-ai/kodax?style=flat-square&color=cb3837"></a>
17
- <a href="LICENSE"><img alt="license" src="https://img.shields.io/badge/license-Apache--2.0-blue?style=flat-square"></a>
17
+ <a href="LICENSE"><img alt="license" src="https://img.shields.io/badge/license-KAI--FCL_1.0-orange?style=flat-square"></a>
18
18
  <a href="https://github.com/icetomoyo/KodaX/stargazers"><img alt="GitHub stars" src="https://img.shields.io/github/stars/icetomoyo/KodaX?style=flat-square&logo=github&color=f1c40f"></a>
19
19
  <a href="https://github.com/icetomoyo/KodaX/actions"><img alt="CI" src="https://img.shields.io/github/actions/workflow/status/icetomoyo/KodaX/release.yml?style=flat-square&label=release"></a>
20
20
  <img alt="providers" src="https://img.shields.io/badge/LLMs-15_aliases_+_custom-2ecc71?style=flat-square">
@@ -115,7 +115,7 @@ That's it. You're in the REPL — ask anything in natural language.
115
115
 
116
116
  | Feature | **KodaX** | Claude Code | Aider | Codex CLI | Cursor | Cline |
117
117
  |---|---|---|---|---|---|---|
118
- | Open source | Apache&nbsp;2.0 | ❌ Source-available | ✅ Apache&nbsp;2.0 | ✅ Apache&nbsp;2.0 | ❌ Proprietary | ✅ Apache&nbsp;2.0 |
118
+ | Source license | ⚠️ KAI-FCL, non-commercial | ❌ Source-available | ✅ Apache&nbsp;2.0 | ✅ Apache&nbsp;2.0 | ❌ Proprietary | ✅ Apache&nbsp;2.0 |
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 |
@@ -347,14 +347,21 @@ temporary environment override. The same rule applies to other paired settings,
347
347
  for example `provider` ↔ `KODAX_PROVIDER` and `effort` ↔ `KODAX_EFFORT`.
348
348
  JSON names stay camelCase while environment names use `KODAX_UPPER_SNAKE_CASE`.
349
349
 
350
- By default, daemon state, config, and runtime session storage are scoped under
351
- the OS user home directory, so `kodax --runtime-mode daemon` and SDK clients
352
- using `createKodaXRuntime({ mode: 'daemon' })` converge on the same local daemon
353
- profile. The high-level `createKodaXRuntime({ mode: 'daemon' })` API starts or
350
+ By default, daemon state, config, and runtime session storage use the exact
351
+ resolved `KODAX_HOME` (normally `<OS user home>/.kodax`), so CLI and SDK clients
352
+ converge on the same local daemon even when `KODAX_HOME` is an arbitrary custom
353
+ directory. The high-level `createKodaXRuntime({ mode: 'daemon' })` API starts or
354
354
  reuses that daemon unless you pass an explicit endpoint/transport or
355
- `autoStartDaemon: false`. Pass `--home <dir>` or `homeDir` only when you
356
- intentionally want an isolated daemon namespace for tests, CI, or project-local
357
- experiments.
355
+ `autoStartDaemon: false`. An explicit `--home <dir>` or `homeDir` selects the
356
+ isolated `<dir>/.kodax` namespace for tests, CI, or project-local experiments.
357
+
358
+ **v0.7.71 packaged Electron patch:** packaged/asar Electron hosts can use daemon
359
+ auto-start without relaunching the GUI. `ELECTRON_RUN_AS_NODE` is limited to a
360
+ bootstrap-only child exec boundary and removed before daemon or ordinary user
361
+ child code loads. The default-enabled Electron `RunAsNode` fuse is required;
362
+ hosts that disable it must start the daemon through ordinary Node/KodaX CLI and
363
+ connect in attach-only mode. For SDK calls, `homeDir` is the CLI-style base
364
+ directory that owns `.kodax`, not the `.kodax` path itself.
358
365
 
359
366
  One daemon owns many sessions. Different sessions may run concurrently; starts
360
367
  within the same session are queued so that only one run is active for that
@@ -509,7 +516,35 @@ KodaX has two layers that consumers should understand separately:
509
516
 
510
517
  **Experimental Memory Agent SDK (FEATURE_260, v0.7.68)**: `/experimental-memory` exposes the thin agent-layer `MemoryAgent` and scoped `MemorySession` lifecycle over the existing governed F228 plane. Passive recall is zero-wait; `query()` is read-only and deliberate; durable changes still require the proposal/preview/fingerprint/apply path. The Action LLM remains the final decision maker, recalled content stays low-authority, and safety/scope gates remain deterministic. See the [direct session and boundary guide](docs/SDK_EMBEDDER_GUIDE.md#21-experimental-governed-memory--experimental-memory-feature_260-v0768).
511
518
 
512
- **Bidirectional A2A 1.0 (FEATURE_267, v0.7.69)**: `/a2a` discovers allowed Agent Cards and installs a JSON-RPC/SSE executor through the existing F258 plane. Configured outbound Agents are also registered automatically as `external:<name>` in embedded CLI and user-daemon Runtimes, so the main Agent can orchestrate them without host code. The same module can publish the Runtime default or one validated `~/.kodax/agents/*.md` Agent behind an authenticated Runtime facade. The built-in listener is loopback-only; public deployment uses `handle()` behind host-owned TLS and authorization. A2A 0.3, gRPC, HTTP+JSON, push notifications, and automatic public exposure are not advertised. See the [client/server recipes and security boundaries](docs/SDK_EMBEDDER_GUIDE.md#22-bidirectional-a2a-10--a2a-feature_267-v0769).
519
+ **Bidirectional A2A 1.0 (FEATURE_267, v0.7.69)**: `/a2a` discovers allowed Agent Cards and installs a JSON-RPC/SSE executor through the existing F258 plane. Configured outbound Agents are also registered automatically as `external:<name>` in embedded CLI and user-daemon Runtimes, so the main Agent can orchestrate them without host code. One `a2a.json` may hold many outbound registrations and at most one inbound server, which publishes either the Runtime default or one validated `~/.kodax/agents/*.md` Agent behind an authenticated Runtime facade. The built-in listener is loopback-only; public deployment uses `handle()` behind host-owned TLS and authorization. A2A 0.3, gRPC, HTTP+JSON, push notifications, and automatic public exposure are not advertised. See the [client/server recipes and security boundaries](docs/SDK_EMBEDDER_GUIDE.md#22-bidirectional-a2a-10--a2a-feature_267-v0769).
520
+
521
+ **A2A interoperability and authentication hardening** keeps a discovered
522
+ interface on the trusted Agent Card origin and sends credentials only when one
523
+ complete Card/Skill security requirement is satisfiable. The no-code client
524
+ supports HTTP Bearer compatibility and OAuth 2.0 Client Credentials; for OAuth,
525
+ an external Authorization Server issues short-lived access tokens and KodaX
526
+ caches them only in memory. Inbound `a2a serve` can validate RFC 9068 JWT access
527
+ tokens from an external issuer/JWKS, but never signs or issues production
528
+ tokens itself. It resolves its provider from CLI, then environment, config, and
529
+ the built-in default; a Markdown Agent can pin its own provider. Input
530
+ continuation resumes the original Runtime run, task history and retention are
531
+ bounded with stable cursor pagination, and authenticated SSE is correlated
532
+ before falling back to polling after an early normal EOF. Only direct remote
533
+ artifacts, broker-staged outputs, and outputs from a successfully admitted
534
+ Skill script can be published; ordinary workspace writes and local paths stay
535
+ private.
536
+
537
+ This authentication and per-Agent activation hardening is a post-release
538
+ closure of the v0.7.69 F267/F268 design and ships in the v0.7.71 patch; it is
539
+ not a claim that older v0.7.69 binaries contained the
540
+ later OAuth profiles.
541
+
542
+ **v0.7.70 MCP discovery hardening** uses exact capability IDs and revisioned
543
+ cursors while admitting results against real physical capacity. Compact CJK
544
+ queries are segmented, and a cross-language lexical zero match either returns a
545
+ lossless bounded grouped inventory or one concise retry in the catalog language.
546
+ Partial provider failure remains explicit rather than disappearing into an
547
+ apparently complete result.
513
548
 
514
549
  The complete built-in path is available without writing TypeScript:
515
550
 
@@ -519,8 +554,23 @@ kodax a2a add research https://agent.example/.well-known/agent-card.json --effec
519
554
  kodax a2a test research
520
555
  kodax a2a call research "Summarize this topic"
521
556
 
557
+ # Stage an OAuth-protected Agent, then hot-activate/deactivate it
558
+ export RESEARCH_A2A_CLIENT_SECRET='provisioned-by-your-authorization-server'
559
+ # PowerShell: $env:RESEARCH_A2A_CLIENT_SECRET='provisioned-by-your-authorization-server'
560
+ # PowerShell: run the command on one line or replace each trailing \ with a backtick.
561
+ kodax a2a add reviewer https://reviewer.example/.well-known/agent-card.json \
562
+ --disabled --effect read --oauth-scheme enterprise-oauth \
563
+ --oauth-issuer https://identity.example/ \
564
+ --oauth-token-url https://identity.example/oauth/token \
565
+ --oauth-client-id kodax-reviewer \
566
+ --oauth-client-secret-env RESEARCH_A2A_CLIENT_SECRET \
567
+ --oauth-scope a2a.invoke --oauth-resource https://reviewer.example/
568
+ kodax a2a enable reviewer
569
+ kodax a2a disable reviewer # blocks new dispatch; does not cancel in-flight tasks
570
+
522
571
  # Expose the Runtime default Agent, or pass a name from ~/.kodax/agents/*.md
523
572
  export KODAX_A2A_TOKEN='replace-with-a-long-random-token'
573
+ # PowerShell: $env:KODAX_A2A_TOKEN='replace-with-a-long-random-token'
524
574
  kodax a2a expose # or: kodax a2a expose document-agent
525
575
  kodax a2a serve # loopback http://127.0.0.1:8765
526
576
  ```
@@ -528,14 +578,38 @@ kodax a2a serve # loopback http://127.0.0.1:8765
528
578
  MCP, A2A, and Extension declarations live in one user file per domain under
529
579
  `~/.kodax/integrations/`. Use `kodax config template <mcp|a2a|extensions>`,
530
580
  `kodax integrations migrate --apply`, and the `kodax mcp`, `kodax a2a`, or
531
- `kodax extensions` commands to manage them. Running CLI/daemon hosts retain the
581
+ `kodax extensions` commands to manage them. Migration imports only legacy
582
+ `config.json#mcpServers` and `config.json#extensions`; A2A has no legacy source.
583
+ It never overwrites an existing destination. The first MCP/Extension mutation
584
+ can stage legacy entries. Remove legacy keys only with
585
+ `--apply --cleanup-legacy`, after reviewing destination files and
586
+ literal-secret warnings. Running
587
+ CLI/daemon hosts retain the
532
588
  last valid revision, atomically replace the complete MCP provider, reconcile
533
- Extensions per entry, and hot-register outbound A2A Agents. `a2a serve` loads
589
+ Extensions per entry, and hot-register outbound A2A Agents. Each A2A entry has
590
+ a desired `enabled` switch; `kodax a2a list` shows configuration, while the
591
+ owning Runtime is authoritative for live applied registrations. Disabled
592
+ entries are not fetched during automatic reconciliation and, after the owning
593
+ Runtime applies the revision, cannot accept new dispatch. The mutation command
594
+ itself is not cross-process acknowledgement. `a2a add --disabled` still checks
595
+ the Card by default unless `--no-test` is supplied, while `a2a test` performs
596
+ discovery/security planning without requesting an OAuth token. The fixed
597
+ `KODAX_A2A_TOKEN` example is an operator-provisioned compatibility credential;
598
+ KodaX does not generate or issue it. Disabled entries remain available for
599
+ later re-enable. `a2a serve` loads
534
600
  its configured MCP/Extension capability surface before listening and pins that
535
601
  execution authority; it hot-reloads publication, authentication, and limits.
602
+
603
+ A2A configuration migration and retained task ownership are separate. If a
604
+ v0.7.70 task store must remain addressable after the realm-aware upgrade, stop
605
+ the A2A server, run `kodax a2a migrate-tasks` to inspect the exact-owner plan,
606
+ then apply it with `--apply --confirm-server-stopped`. OAuth migration also
607
+ requires the known historical `--subject`; normal serving never guesses or
608
+ dual-reads a legacy owner key.
609
+
536
610
  Agent, Skill, Extension-tool authority, workspace, tool-policy, or task-store
537
611
  changes require an explicit server restart. Managed
538
- A2A contexts default to `~/kodax_a2a_server_workspace/<profile>/contexts/`.
612
+ A2A contexts default to `~/kodax_a2a_server_workspace/<runtime-profile>/contexts/`.
539
613
  Exact Skill scripts require the opt-in isolated policy and a passing
540
614
  `kodax sandbox doctor` (`kodax sandbox setup` performs the explicit Windows
541
615
  one-time provisioning).
@@ -1137,8 +1211,8 @@ await runInkInteractiveMode({ provider: 'zhipu-coding', effort: 'auto' });
1137
1211
  |----------|----------------------|-------------------|---------------|
1138
1212
  | anthropic | `ANTHROPIC_API_KEY` | Native | claude-sonnet-4-6 (`claude-opus-4-6` / `claude-haiku-4-5` via `/model`) |
1139
1213
  | openai | `OPENAI_API_KEY` | Native | gpt-5.3-codex (`gpt-5.4` / `gpt-5.3-codex-spark` via `/model`) |
1140
- | kimi | `KIMI_API_KEY` | Native | kimi-k2.6 (`kimi-k2.7-code` 256K / `k2.5` via `/model`) |
1141
- | kimi-code | `KIMI_CODE_API_KEY` | Native | kimi-for-coding |
1214
+ | kimi | `KIMI_API_KEY` | Native | kimi-k2.7-code (262,144-token context; `kimi-k2.7-code-highspeed` / `kimi-k2.6` / `kimi-k2.5` via `/model`) |
1215
+ | 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`) |
1142
1216
  | qwen | `QWEN_API_KEY` | Native | qwen3.5-plus |
1143
1217
  | zhipu | `ZHIPU_API_KEY` | Native | glm-5 (`glm-5.2` 1M ctx / `glm-5.1` / `glm-5-turbo` via `/model`) |
1144
1218
  | zhipu-coding | `ZHIPU_CODING_API_KEY` | Native | glm-5 (`glm-5.2` 1M ctx / `glm-5.1` / `glm-5-turbo` via `/model`) |
@@ -1385,4 +1459,13 @@ KodaX uses an **English-first** comment style with selective Chinese brief notes
1385
1459
 
1386
1460
  ## License
1387
1461
 
1388
- [Apache License 2.0](LICENSE) - Copyright 2026 [icetomoyo](mailto:icetomoyo@gmail.com)
1462
+ [KodaX-AI Fair Core License (KAI-FCL) 1.0](LICENSE) - Copyright 2026 [icetomoyo](mailto:icetomoyo@gmail.com).
1463
+
1464
+ KAI-FCL is source-available / fair-core, not OSI open source. Commercial,
1465
+ enterprise, managed deployment, paid service, or customer redistribution use
1466
+ requires KodaX-AI authorization and a valid entitlement where required.
1467
+
1468
+ Official KodaX 0.7.70 and later distributions use KAI-FCL or accompanying
1469
+ KodaX-AI customer terms. Historical tags, archives, binaries, npm packages, or
1470
+ other copies already distributed with Apache-2.0 notices remain Apache-2.0 for
1471
+ those specific copies.
package/README_CN.md CHANGED
@@ -7,14 +7,14 @@
7
7
  </p>
8
8
 
9
9
  <p align="center">
10
- <b>开源 AI Coding Agent,跑你能拿到的任何 LLM。</b><br>
10
+ <b>源代码可用的 AI Coding Agent,跑你能拿到的任何 LLM。</b><br>
11
11
  Anthropic · OpenAI · DeepSeek · Kimi · 智谱 · MiniMax · 小米 MiMo · 火山方舟 · Qwen · Gemini · Codex<br>
12
12
  REPL · CLI · 库 · 免 Node 单文件二进制
13
13
  </p>
14
14
 
15
15
  <p align="center">
16
16
  <a href="https://www.npmjs.com/package/@kodax-ai/kodax"><img alt="npm version" src="https://img.shields.io/npm/v/@kodax-ai/kodax?style=flat-square&color=cb3837"></a>
17
- <a href="LICENSE"><img alt="license" src="https://img.shields.io/badge/license-Apache--2.0-blue?style=flat-square"></a>
17
+ <a href="LICENSE"><img alt="license" src="https://img.shields.io/badge/license-KAI--FCL_1.0-orange?style=flat-square"></a>
18
18
  <a href="https://github.com/icetomoyo/KodaX/stargazers"><img alt="GitHub stars" src="https://img.shields.io/github/stars/icetomoyo/KodaX?style=flat-square&logo=github&color=f1c40f"></a>
19
19
  <a href="https://github.com/icetomoyo/KodaX/actions"><img alt="CI" src="https://img.shields.io/github/actions/workflow/status/icetomoyo/KodaX/release.yml?style=flat-square&label=release"></a>
20
20
  <img alt="providers" src="https://img.shields.io/badge/LLMs-15_aliases_+_custom-2ecc71?style=flat-square">
@@ -81,6 +81,13 @@ data/session root 下的 inline Runtime,不参与 Coder owner fence。capabili
81
81
  fail closed,不能静默退回 inline Coder。完整接入说明见
82
82
  [SDK Embedder Guide §23](docs/SDK_EMBEDDER_GUIDE.md#23-shared-coder-daemon-for-space-and-ide-hosts-feature_269-v0769)。
83
83
 
84
+ **v0.7.71 Electron 打包修复**:packaged/asar Electron 宿主可以直接自动启动
85
+ daemon,不会再次打开 GUI。`ELECTRON_RUN_AS_NODE` 只存在于子进程启动边界,
86
+ 在 daemon 与普通用户子进程代码加载前即被移除。该路径要求 Electron 默认开启的
87
+ `RunAsNode` fuse;主动关闭该 fuse 的宿主必须通过普通 Node/KodaX CLI 启动 daemon,
88
+ 再使用 attach-only 模式连接。SDK 的 `homeDir` 是拥有 `.kodax` 的 CLI 风格基础目录,
89
+ 不是 `.kodax` 目录本身。
90
+
84
91
  ## 为什么用 KodaX
85
92
 
86
93
  <table>
@@ -130,7 +137,7 @@ fail closed,不能静默退回 inline Coder。完整接入说明见
130
137
 
131
138
  | 能力 | **KodaX** | Claude Code | Aider | Codex CLI | Cursor | Cline |
132
139
  |---|---|---|---|---|---|---|
133
- | 开源协议 | Apache&nbsp;2.0 | ❌ source-available | ✅ Apache&nbsp;2.0 | ✅ Apache&nbsp;2.0 | ❌ 闭源 | ✅ Apache&nbsp;2.0 |
140
+ | 源代码许可 | ⚠️ KAI-FCL,非商业 | ❌ source-available | ✅ Apache&nbsp;2.0 | ✅ Apache&nbsp;2.0 | ❌ 闭源 | ✅ Apache&nbsp;2.0 |
134
141
  | 免 Node 单文件 | ✅ Bun | ❌ 需 Node | ❌ 需 Python | ✅ Rust | ❌ Electron | ❌ 插件 |
135
142
  | 国内 6 家原生<br><sub>(智谱·Kimi·MiniMax·MiMo·方舟·Qwen)</sub> | ✅ 6 家原生 | ❌ | ⚠ 走 LiteLLM | ❌ OpenAI 主线 | ❌ 无 provider 菜单 | ⚠ Kimi/Qwen/DeepSeek |
136
143
  | 可分叉会话血缘 | ✅ fork & rewind | ⚠ routines/sessions | ❌ | ❌ | ❌ | ⚠ checkpoints |
@@ -455,8 +462,8 @@ dist/binary/linux-x64/
455
462
  |----------|----------|-----------|-----------|
456
463
  | anthropic | `ANTHROPIC_API_KEY` | Native | claude-sonnet-4-6(可 `/model` 切换 `claude-opus-4-6` / `claude-haiku-4-5`) |
457
464
  | openai | `OPENAI_API_KEY` | Native | gpt-5.3-codex(可 `/model` 切换 `gpt-5.4` / `gpt-5.3-codex-spark`) |
458
- | kimi | `KIMI_API_KEY` | Native | kimi-k2.6(可 `/model` 切换 `kimi-k2.7-code` 256K / `k2.5`) |
459
- | kimi-code | `KIMI_CODE_API_KEY` | Native | kimi-for-coding |
465
+ | kimi | `KIMI_API_KEY` | Native | kimi-k2.7-code(262,144 token;可 `/model` 切换 `kimi-k2.7-code-highspeed` / `kimi-k2.6` / `kimi-k2.5`) |
466
+ | kimi-code | `KIMI_CODE_API_KEY` | Native | kimi-for-coding(可 `/model` 切换 `k3-256k`〔Moderato,256K〕/ `k3`〔Allegretto+,1M〕/ `kimi-for-coding-highspeed`;两个 K3 选项均请求上游 `k3`) |
460
467
  | qwen | `QWEN_API_KEY` | Native | qwen3.5-plus |
461
468
  | zhipu | `ZHIPU_API_KEY` | Native | glm-5(可 `/model` 切换 `glm-5.2` 1M ctx / `glm-5.1` / `glm-5-turbo`) |
462
469
  | zhipu-coding | `ZHIPU_CODING_API_KEY` | Native | glm-5(GLM Coding Plan;可 `/model` 切换 `glm-5.2` 1M ctx / `glm-5.1` / `glm-5-turbo`) |
@@ -590,7 +597,26 @@ KodaX 有两层结构,SDK 用户需要分开理解:
590
597
 
591
598
  **实验性 Memory Agent SDK(FEATURE_260,v0.7.68)**:`/experimental-memory` 暴露基于既有 F228 治理平面的薄 `MemoryAgent` 与 scoped `MemorySession`。被动 recall 零等待,`query()` 只读且由主 Action LLM 主动选择;持久化仍必须经过 proposal/preview/fingerprint/apply。召回内容保持低权限,安全与 scope 边界仍由确定性代码门禁承担。直接 session 示例与宿主边界见 [SDK Embedder Guide §21](docs/SDK_EMBEDDER_GUIDE.md#21-experimental-governed-memory--experimental-memory-feature_260-v0768)。
592
599
 
593
- **双向 A2A 1.0(FEATURE_267,v0.7.69)**:`/a2a` 可发现 allowlist 内的 Agent Card,并通过既有 F258 plane 安装 JSON-RPC/SSE executor。配置中的出站 Agent 还会作为 `external:<name>` 自动注册到 embedded CLI 与用户 daemon Runtime,因此主 Agent 无需宿主代码即可编排。入站方向可以发布 Runtime 默认 Agent,或发布一个经过验证的 `~/.kodax/agents/*.md` Agent。内置 listener 仅允许 loopback;公网部署必须由宿主用 TLS、鉴权和授权包住 `handle()`。不宣称支持 A2A 0.3、gRPC、HTTP+JSON、push notification,也不会自动把本地 Agent 暴露到网络。详见 [SDK Embedder Guide §22](docs/SDK_EMBEDDER_GUIDE.md#22-bidirectional-a2a-10--a2a-feature_267-v0769)。
600
+ **双向 A2A 1.0(FEATURE_267,v0.7.69)**:`/a2a` 可发现 allowlist 内的 Agent Card,并通过既有 F258 plane 安装 JSON-RPC/SSE executor。配置中的出站 Agent 还会作为 `external:<name>` 自动注册到 embedded CLI 与用户 daemon Runtime,因此主 Agent 无需宿主代码即可编排。一个 `a2a.json` 可保存多个出站注册,但最多只有一个入站 server;入站可发布 Runtime 默认 Agent,或发布一个经过验证的 `~/.kodax/agents/*.md` Agent。内置 listener 仅允许 loopback;公网部署必须由宿主用 TLS、鉴权和授权包住 `handle()`。不宣称支持 A2A 0.3、gRPC、HTTP+JSON、push notification,也不会自动把本地 Agent 暴露到网络。详见 [SDK Embedder Guide §22](docs/SDK_EMBEDDER_GUIDE.md#22-bidirectional-a2a-10--a2a-feature_267-v0769)。
601
+
602
+ **A2A 互操作与认证加固**:发现得到的 interface 必须与受信 Agent Card 同源,且只有
603
+ 完整满足 Card/Skill 的一个 security requirement 时才会携带凭据。无代码 client
604
+ 支持 HTTP Bearer 兼容模式与 OAuth 2.0 Client Credentials;OAuth 的短期 access
605
+ token 由外部 Authorization Server 签发,KodaX 只在进程内缓存。入站 `a2a serve`
606
+ 可以按外部 issuer/JWKS 校验 RFC 9068 JWT access token,但不会自行签发生产 token。
607
+ 服务按 CLI、环境变量、配置、内置默认值的顺序解析 provider,Markdown Agent 也可
608
+ 固定自己的 provider。补充输入会继续原 Runtime run;任务历史、保留策略与稳定
609
+ cursor 分页均有边界;带鉴权的 SSE 会先校验关联信息,流在正常终止但未给出终态时
610
+ 回退 polling。仅远端直接 artifact、输出 broker 暂存结果,以及成功授权执行的 Skill
611
+ 脚本输出可以发布;普通工作区写入与本地路径不会暴露。
612
+
613
+ 这里的认证与逐 Agent 激活加固,是对 v0.7.69 F267/F268 设计的发布后补全,
614
+ 随 v0.7.71 补丁交付;并不表示早期 v0.7.69 二进制已经包含后续 OAuth profile。
615
+
616
+ **v0.7.70 MCP 发现加固**:能力使用精确 ID 和带 revision 的 cursor,结果按真实物理
617
+ 容量准入。紧凑 CJK 查询会分词;跨语言 lexical 零匹配只会返回容量内的无损分组
618
+ 清单,或一条使用 catalog 语言的简短重试提示。部分 provider 失败会显式保留,
619
+ 不会伪装成完整结果。
594
620
 
595
621
  完整的内置调用路径不需要再写 TypeScript:
596
622
 
@@ -600,8 +626,23 @@ kodax a2a add research https://agent.example/.well-known/agent-card.json --effec
600
626
  kodax a2a test research
601
627
  kodax a2a call research "总结这个主题"
602
628
 
629
+ # 先保存受 OAuth 保护的 Agent,再热启用/停用
630
+ export RESEARCH_A2A_CLIENT_SECRET='由你的授权服务器分配'
631
+ # PowerShell:$env:RESEARCH_A2A_CLIENT_SECRET='由你的授权服务器分配'
632
+ # PowerShell:将命令写成一行,或把每个行尾反斜杠替换为反引号。
633
+ kodax a2a add reviewer https://reviewer.example/.well-known/agent-card.json \
634
+ --disabled --effect read --oauth-scheme enterprise-oauth \
635
+ --oauth-issuer https://identity.example/ \
636
+ --oauth-token-url https://identity.example/oauth/token \
637
+ --oauth-client-id kodax-reviewer \
638
+ --oauth-client-secret-env RESEARCH_A2A_CLIENT_SECRET \
639
+ --oauth-scope a2a.invoke --oauth-resource https://reviewer.example/
640
+ kodax a2a enable reviewer
641
+ kodax a2a disable reviewer # 只阻止新调度,不取消已运行任务
642
+
603
643
  # 暴露 Runtime 默认 Agent,或指定 ~/.kodax/agents/*.md 中的 Agent 名称
604
644
  export KODAX_A2A_TOKEN='请替换为足够长的随机令牌'
645
+ # PowerShell:$env:KODAX_A2A_TOKEN='请替换为足够长的随机令牌'
605
646
  kodax a2a expose # 或:kodax a2a expose document-agent
606
647
  kodax a2a serve # 仅监听 http://127.0.0.1:8765
607
648
  ```
@@ -609,12 +650,30 @@ kodax a2a serve # 仅监听 http://127.0.0.1:8765
609
650
  MCP、A2A、Extension 分别使用 `~/.kodax/integrations/` 下的一个用户级文件。
610
651
  可以通过 `kodax config template <mcp|a2a|extensions>` 查看模板,通过
611
652
  `kodax integrations migrate --apply` 迁移旧配置,并用 `kodax mcp`、
612
- `kodax a2a`、`kodax extensions` 管理。运行中的 CLI/daemon 保留最后一个
653
+ `kodax a2a`、`kodax extensions` 管理。迁移只导入旧
654
+ `config.json#mcpServers` 与 `config.json#extensions`;A2A 没有旧来源,且不会
655
+ 覆盖已有目标文件。第一次 MCP/Extension 修改可以暂存旧条目;只有在检查目标文件
656
+ 和明文 secret 警告后,才应同时使用 `--apply --cleanup-legacy` 清理旧 key。
657
+ 运行中的 CLI/daemon 保留最后一个
613
658
  有效版本,完整替换 MCP provider、逐条协调 Extension,并热注册出站 A2A Agent。
659
+ 每个 A2A 条目都有期望态 `enabled`;`kodax a2a list` 显示配置,实际已应用注册以
660
+ 拥有该 Runtime 的进程为准。自动协调不会获取已停用条目的 Card 或 token;拥有者
661
+ 观察并应用该 revision 后,停用条目才会阻止新调度,CLI 写入返回本身不是跨进程生效
662
+ 确认。`a2a add --disabled` 默认仍会校验 Card,除非显式使用 `--no-test`;`a2a test`
663
+ 只做 discovery/security planning,不会申请 OAuth token。示例中的固定
664
+ `KODAX_A2A_TOKEN` 是运维侧预先提供的兼容凭据,并非 KodaX 自行生成或签发。
665
+ 停用条目可随时重新启用。
614
666
  `a2a serve` 会在监听前装载已配置的 MCP/Extension 能力并固定执行权威,同时热加载
615
667
  公开信息、鉴权和限额。Agent、Skill、Extension 工具权威、工作区、tool policy
616
668
  或任务存储变更必须显式重启服务。
617
- 托管 A2A 上下文默认位于 `~/kodax_a2a_server_workspace/<profile>/contexts/`。
669
+
670
+ A2A 配置迁移与历史任务 owner 迁移是两件事。如果升级 realm-aware owner key
671
+ 后仍需访问 v0.7.70 的任务库,应先停止 A2A server,执行
672
+ `kodax a2a migrate-tasks` 查看精确 owner 计划,再用
673
+ `--apply --confirm-server-stopped` 应用。OAuth 还必须提供已知历史
674
+ `--subject`;正常服务不会猜测或双读 legacy owner key。
675
+
676
+ 托管 A2A 上下文默认位于 `~/kodax_a2a_server_workspace/<runtime-profile>/contexts/`。
618
677
  精确授权的 Skill 脚本必须使用隔离策略,并通过 `kodax sandbox doctor`;
619
678
  Windows 的一次性显式初始化由 `kodax sandbox setup` 完成。
620
679
 
@@ -741,7 +800,7 @@ KodaX 现在会把 Repo Intelligence 的本地缓存分成内置引擎 profile
741
800
  ## 文档
742
801
 
743
802
  - [README.md](README.md) - 英文版 README
744
- - [docs/SDK_EMBEDDER_GUIDE.md](docs/SDK_EMBEDDER_GUIDE.md) - SDK 宿主集成与 v0.7.69 公共 API 契约
803
+ - [docs/SDK_EMBEDDER_GUIDE.md](docs/SDK_EMBEDDER_GUIDE.md) - SDK 宿主集成与 v0.7.70 公共 API 契约
745
804
  - [docs/release.md](docs/release.md) - 单文件二进制构建与发布流程
746
805
  - [docs/PRD.md](docs/PRD.md) - 产品需求
747
806
  - [docs/ADR.md](docs/ADR.md) - 架构决策
@@ -756,9 +815,16 @@ KodaX 现在会把 Repo Intelligence 的本地缓存分成内置引擎 profile
756
815
 
757
816
  ## 许可证
758
817
 
759
- 公共仓库当前采用:
818
+ [KodaX-AI Fair Core License (KAI-FCL) 1.0](LICENSE) - Copyright 2026 icetomoyo。
819
+
820
+ KAI-FCL 是 source-available / fair-core 协议,不是 OSI open source。商业、
821
+ 企业、托管部署、付费服务或客户再分发用途,需要 KodaX-AI 授权,并在需要时
822
+ 具备有效 entitlement。
760
823
 
761
- - `Apache-2.0`
824
+ KodaX-AI 当前官方许可政策:KodaX 0.7.70 及之后版本,在由 KodaX-AI 带有该
825
+ notice 分发时,适用 KAI-FCL 或配套 KodaX-AI 客户条款。此前已带 Apache-2.0
826
+ notice 分发的历史 tag、source archive、二进制、npm 包或其他副本,仍只对那些
827
+ 特定副本保留 Apache-2.0。
762
828
 
763
829
  ## 相关仓库
764
830
 
@@ -1,23 +1,17 @@
1
1
  // Bidirectional A2A configuration: ~/.kodax/integrations/a2a.json.
2
- // `agents` calls third-party Agents. The optional singleton `server` exposes
3
- // one KodaX general task Agent; ACP remains the coding/editor protocol.
2
+ // `agents` calls many third-party Agents. The optional singleton `server`
3
+ // exposes exactly one KodaX general task Agent; ACP remains the coding/editor
4
+ // protocol. Uncomment only the entries you need; no token value belongs here.
5
+ // Legacy version 1 files remain readable. Non-empty files require an explicit
6
+ // stopped-daemon migration; new/empty files and every later write use version 2.
4
7
  {
5
- "version": 1,
6
- "agents": {}
8
+ "version": 2,
7
9
 
8
- // Outbound example (keep tokens in the named environment variable):
9
- // "agents": {
10
- // "reporting": {
11
- // "cardUrl": "https://agents.example.com/.well-known/agent-card.json",
12
- // "credentialEnv": "REPORTING_A2A_TOKEN",
13
- // "effect": "read"
14
- // }
15
- // },
16
-
17
- // Create the inbound block with `kodax a2a expose`; do not copy private
18
- // Agent instructions, Runtime Skills, model names, or local paths into the
19
- // public `published.skills` list. Managed workspaces default below
20
- // ~/kodax_a2a_server_workspace/<server>/contexts/<caller-context>/.
10
+ // Create this inbound block with `kodax a2a expose`; config never starts a
11
+ // listener by itself. Do not copy private Agent instructions, Runtime Skills,
12
+ // model names, or local paths into the public `published.skills` list.
13
+ // Managed workspaces default below
14
+ // ~/kodax_a2a_server_workspace/<runtime-profile>/contexts/<context-key>/.
21
15
  // Native read/grep/glob remains available according to workspace access.
22
16
  // Arbitrary shell is never exposed. Skill instructions/assets need no
23
17
  // process authority. An exact checked-in scripts/... entry requires
@@ -43,12 +37,62 @@
43
37
  // "published": {
44
38
  // "name": "KodaX Agent",
45
39
  // "description": "Completes approved general tasks.",
46
- // "version": "0.7.69",
40
+ // "version": "0.7.71",
47
41
  // "skills": [{ "id": "general", "name": "General", "description": "Complete general tasks.", "tags": [] }],
48
42
  // "inputModes": ["text/plain"],
49
43
  // "outputModes": ["text/plain"]
50
44
  // },
51
45
  // "authentication": { "type": "bearer-env", "tokenEnv": "KODAX_A2A_TOKEN", "principalId": "configured-client" },
52
46
  // "dataDir": "~/.kodax/a2a/tasks"
47
+ // },
48
+
49
+ // Production OAuth2 resource-server alternative for the server above. The
50
+ // external Authorization Server issues access tokens and, for JWT tokens,
51
+ // signs them. KodaX holds no issuer signing key; it validates RFC 9068 tokens
52
+ // against the issuer's rotating JWKS, audience, expiry, subject, and scopes.
53
+ // Replace the server.authentication value above with:
54
+ // {
55
+ // "type": "oauth2-jwt",
56
+ // "scheme": "enterprise-oauth",
57
+ // "issuer": "https://identity.example.com",
58
+ // "audience": "https://agent.example.com/a2a",
59
+ // "jwksUrl": "https://identity.example.com/.well-known/jwks.json",
60
+ // "tokenUrl": "https://identity.example.com/oauth/token",
61
+ // "metadataUrl": "https://identity.example.com/.well-known/oauth-authorization-server",
62
+ // "requiredScopes": ["a2a.invoke"]
53
63
  // }
64
+
65
+ "agents": {
66
+ // Fixed Bearer compatibility example. `enabled` is hot desired state:
67
+ // disabled Agents remain configured but are not candidates for new
68
+ // orchestration, while already admitted remote tasks may finish.
69
+ // "reporting": {
70
+ // "cardUrl": "https://agents.example.com/.well-known/agent-card.json",
71
+ // "enabled": true,
72
+ // "credentialEnv": "REPORTING_A2A_TOKEN",
73
+ // "effect": "read"
74
+ // },
75
+
76
+ // Standards-based machine-to-machine OAuth2 example. The external
77
+ // Authorization Server issues access tokens; KodaX obtains and caches them
78
+ // only in process memory. `tokenUrl` must exactly match the selected Card
79
+ // OAuth2 clientCredentials flow. Use `kodax a2a enable|disable <name>` to
80
+ // mutate `enabled` atomically; the owning Runtime applies it asynchronously.
81
+ // "reviewer": {
82
+ // "cardUrl": "https://reviewer.example.com/.well-known/agent-card.json",
83
+ // "enabled": false,
84
+ // "effect": "read",
85
+ // "authentication": {
86
+ // "type": "oauth2-client-credentials",
87
+ // "scheme": "enterprise-oauth",
88
+ // "issuer": "https://identity.example.com",
89
+ // "tokenUrl": "https://identity.example.com/oauth/token",
90
+ // "clientId": "kodax-reviewer",
91
+ // "clientSecretEnv": "REVIEWER_CLIENT_SECRET",
92
+ // "scopes": ["a2a.invoke"],
93
+ // "resource": "https://reviewer.example.com/",
94
+ // "clientAuthentication": "client-secret-basic"
95
+ // }
96
+ // }
97
+ }
54
98
  }
@@ -1,2 +1,2 @@
1
1
  // @kodax-ai/kodax — bundled distribution. See docs/ADR.md ADR-022 + ADR-024.
2
- import{Ga as i,K as c,L as d,M as e,Ma as j,N as f,ma as g,na as h}from"./chunk-4WIODYOH.js";import"./chunk-I4TPQEJN.js";import"./chunk-Y4WOTWUC.js";import"./chunk-PQ3XUSY2.js";import"./chunk-UJEMSPM5.js";import{sb as a,tb as b}from"./chunk-VYKFM3TB.js";import"./chunk-AWMTNUDS.js";import"./chunk-F7C7J6IM.js";import"./chunk-NGHQIGVW.js";import"./chunk-ONUPGMER.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};
2
+ import{Ga as i,K as c,L as d,M as e,Ma as j,N as f,ma as g,na as h}from"./chunk-T7LYK53M.js";import"./chunk-64NQBOSN.js";import"./chunk-44QXPEEE.js";import"./chunk-PVUXONQB.js";import"./chunk-ZJIMT5I3.js";import{vb as a,wb as b}from"./chunk-Y5XKAN7C.js";import"./chunk-52JSZ77P.js";import"./chunk-VRSVNU2Y.js";import"./chunk-23X6REO4.js";import"./chunk-ONUPGMER.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{Ba as a,Ca as b}from"./chunk-F7KGYHJ3.js";import"./chunk-GVTM4Z6O.js";import"./chunk-SX2WFHIS.js";import"./chunk-A574DBTV.js";import"./chunk-A2TFSV5M.js";import"./chunk-PHH4TRGF.js";import"./chunk-T7LYK53M.js";import"./chunk-64NQBOSN.js";import"./chunk-44QXPEEE.js";import"./chunk-PVUXONQB.js";import"./chunk-ZJIMT5I3.js";import"./chunk-Y5XKAN7C.js";import"./chunk-52JSZ77P.js";import"./chunk-VRSVNU2Y.js";import"./chunk-23X6REO4.js";import"./chunk-ONUPGMER.js";export{a as ArgumentCompleter,b as createArgumentCompleter};
@@ -0,0 +1,46 @@
1
+ // @kodax-ai/kodax — bundled distribution. See docs/ADR.md ADR-022 + ADR-024.
2
+ import{a as o}from"./chunk-ONUPGMER.js";import{AsyncLocalStorage as Be}from"node:async_hooks";var Ne=new Be;function Le(e){let t=Ne.getStore()?.credential;return t?M(e,t,new WeakMap):e}o(Le,"redactScopedProviderCredential");function M(e,t,n){if(typeof e=="string")return e.split(t).join("[REDACTED_CREDENTIAL]");if(e===null||typeof e!="object")return e;let r=n.get(e);if(r!==void 0)return r;if(e instanceof Error){let s=new Error(M(e.message,t,n));return n.set(e,s),s.name=e.name,e.stack!==void 0&&(s.stack=M(e.stack,t,n)),s}if(Array.isArray(e)){let s=[];n.set(e,s);for(let l of e)s.push(M(l,t,n));return s}let i={};n.set(e,i);for(let[s,l]of Object.entries(Object.getOwnPropertyDescriptors(e))){if(!l.enumerable||!("value"in l))continue;let u=s.split(t).join("[REDACTED_CREDENTIAL]");i[u]=M(l.value,t,n)}return i}o(M,"redactCredentialValue");function A(e,t){return`${e}/${t??""}`}o(A,"capabilityCacheKey");function je(e,t,n){return e[A(t,n)]?.rejected??[]}o(je,"getRejectedEfforts");function $e(e,t,n,r,i,s){let l=A(t,n),u=e[l],g=u?.rejected.includes(r)?u.rejected:[...u?.rejected??[],r];return{...e,[l]:{rejected:g,source:i,updatedAt:s}}}o($e,"addRejectedEffort");function Fe(e,t,n){if(!t)return{};let r={...e};return delete r[A(t,n)],r}o(Fe,"removeCacheEntry");function Ue(e){if(!e||typeof e!="object")return{};let t={};for(let[n,r]of Object.entries(e)){if(!r||typeof r!="object")continue;let i=r,s=Array.isArray(i.rejected)?i.rejected.filter(g=>typeof g=="string"):[],l=i.source==="probed"?"probed":"observed",u=typeof i.updatedAt=="string"?i.updatedAt:"";t[n]={rejected:s,source:l,updatedAt:u}}return t}o(Ue,"sanitizeCapabilityCache");import{AsyncLocalStorage as We}from"node:async_hooks";var Ve=new We,J=8,Y=32;function ze(e){if(e===void 0)return;let t=Number.parseInt(e,10);return Number.isInteger(t)&&t>0?t:void 0}o(ze,"parsePositiveInt");function qe(){let e=I()?.workflow?.maxConcurrency,t=typeof e=="number"&&Number.isInteger(e)&&e>0?e:ze(process.env.KODAX_WORKFLOW_MAX_CONCURRENCY)??J;return Math.max(1,Math.min(Y,t))}o(qe,"resolveWorkflowMaxConcurrency");function I(){return Ve.getStore()}o(I,"getRunScopedConfig");var K={transport:"native-api",conversationSemantics:"full-history",mcpSupport:"none",contextFidelity:"full",toolCallingFidelity:"full",sessionSupport:"full",longRunningSupport:"full",multimodalSupport:"none",evidenceSupport:"full"},Q={...K,multimodalSupport:"image-input"},O={transport:"cli-bridge",conversationSemantics:"last-user-message",mcpSupport:"none",contextFidelity:"lossy",toolCallingFidelity:"limited",sessionSupport:"stateless",longRunningSupport:"limited",multimodalSupport:"none",evidenceSupport:"limited"},Z={...O,multimodalSupport:"image-input"};function j(e){return{transport:e.transport,conversationSemantics:e.conversationSemantics,mcpSupport:e.mcpSupport,contextFidelity:e.contextFidelity??"full",toolCallingFidelity:e.toolCallingFidelity??"full",sessionSupport:e.sessionSupport??"full",longRunningSupport:e.longRunningSupport??"full",multimodalSupport:e.multimodalSupport??"none",evidenceSupport:e.evidenceSupport??"full"}}o(j,"normalizeCapabilityProfile");import tn from"@anthropic-ai/sdk";import{parse as $o}from"partial-json";import hn from"openai";import{ClientSideConnection as _n,PROTOCOL_VERSION as Xn,ndJsonStream as An}from"@agentclientprotocol/sdk";var Sn=String.raw`
3
+ using System;
4
+ using System.Runtime.InteropServices;
5
+ using System.Text;
6
+ public static class KodaXNativeProcessSnapshot {
7
+ [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
8
+ private struct ProcessEntry32 {
9
+ public uint dwSize;
10
+ public uint cntUsage;
11
+ public uint th32ProcessID;
12
+ public IntPtr th32DefaultHeapID;
13
+ public uint th32ModuleID;
14
+ public uint cntThreads;
15
+ public uint th32ParentProcessID;
16
+ public int pcPriClassBase;
17
+ public uint dwFlags;
18
+ [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 260)]
19
+ public string szExeFile;
20
+ }
21
+ [DllImport("kernel32.dll", SetLastError = true)]
22
+ private static extern IntPtr CreateToolhelp32Snapshot(uint flags, uint processId);
23
+ [DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)]
24
+ private static extern bool Process32First(IntPtr snapshot, ref ProcessEntry32 entry);
25
+ [DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)]
26
+ private static extern bool Process32Next(IntPtr snapshot, ref ProcessEntry32 entry);
27
+ [DllImport("kernel32.dll")]
28
+ private static extern bool CloseHandle(IntPtr handle);
29
+ public static string ReadRows() {
30
+ var snapshot = CreateToolhelp32Snapshot(2, 0);
31
+ if (snapshot == new IntPtr(-1)) return string.Empty;
32
+ var rows = new StringBuilder();
33
+ var entry = new ProcessEntry32();
34
+ entry.dwSize = (uint)Marshal.SizeOf(entry);
35
+ try {
36
+ if (!Process32First(snapshot, ref entry)) return string.Empty;
37
+ do {
38
+ rows.Append(entry.th32ProcessID).Append(',').Append(entry.th32ParentProcessID).Append('\n');
39
+ entry.dwSize = (uint)Marshal.SizeOf(entry);
40
+ } while (Process32Next(snapshot, ref entry));
41
+ return rows.ToString();
42
+ } finally {
43
+ CloseHandle(snapshot);
44
+ }
45
+ }
46
+ }`;import ie from"node:fs";import se from"node:os";import ae from"node:path";var pt="gpt-5.4",gt="auto-gemini-3",mt=["gpt-5.4","gpt-5.3-codex","gpt-5.3-codex-spark"],ht=["auto-gemini-3","gemini-3.1-pro-preview","gemini-3-flash-preview","gemini-2.5-pro","gemini-2.5-flash"];function de(e){let t=new Set,n=[];for(let r of e){let i=r.trim();if(!i)continue;let s=i.toLowerCase();t.has(s)||(t.add(s),n.push(i))}return n}o(de,"dedupePreserveOrder");function yt(){let e=ae.join(se.homedir(),".codex","config.toml");try{return ie.readFileSync(e,"utf8").match(/^\s*model\s*=\s*"([^"]+)"/m)?.[1]?.trim()||null}catch{return null}}o(yt,"readCodexConfiguredModel");function bt(){let e=ae.join(se.homedir(),".gemini","settings.json");try{let t=JSON.parse(ie.readFileSync(e,"utf8")),n=typeof t.model=="string"?t.model.trim():"";return n||(typeof t.general?.model=="string"?t.general.model.trim():"")||null}catch{return null}}o(bt,"readGeminiConfiguredModel");function E(){return yt()||pt}o(E,"getCodexCliDefaultModel");function T(){return bt()||gt}o(T,"getGeminiCliDefaultModel");function w(){return de([E(),...mt])}o(w,"getCodexCliKnownModels");function _(){return de([T(),...ht])}o(_,"getGeminiCliKnownModels");var pr=T(),gr=_();var xr=E(),Sr=w();import{existsSync as wt,readFileSync as _t}from"node:fs";import S from"node:path";import{fileURLToPath as Xt}from"node:url";var le=["none","prompt-only","native-effort","native-budget","native-toggle","native-adaptive","unknown"],ue=["openai-responses-effort","openai-chat-effort","codex-cli-config","anthropic-output-effort","provider-budget","provider-toggle","prompt-only","none"],ce=["anthropic-adaptive","anthropic-budget","provider-budget","provider-toggle","none"],fe=["zai-glm-5.2","zai-glm-toggle","deepseek-v4-openai","deepseek-v4-anthropic","deepseek-toggle","kimi-k3","kimi-k2.7-code","kimi-hybrid-toggle","minimax-m3","minimax-m2-always","mimo-v2.5-toggle","qwen-hybrid-thinking","openai-chat-reasoning","openai-responses-reasoning","codex-cli-effort","claude-adaptive-xhigh","claude-adaptive-max","anthropic-budget","generic-thinking-toggle","none"],pe=["native","image-input-native","cli-bridge","image-input-cli-bridge"],ge=["count-tokens","models-list","minimal-message","unsupported"];function h(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}o(h,"isPlainObject");function R(e,t){if(typeof e!="string"||e.length===0)throw new Error(`provider-capabilities.json: ${t} must be a non-empty string`);return e}o(R,"requireString");function x(e,t){if(e!==void 0)return R(e,t)}o(x,"optionalString");function P(e,t){if(e!==void 0){if(typeof e!="number"||!Number.isFinite(e)||e<0)throw new Error(`provider-capabilities.json: ${t} must be a non-negative finite number`);return e}}o(P,"optionalNumber");function f(e,t){if(e!==void 0){if(typeof e!="boolean")throw new Error(`provider-capabilities.json: ${t} must be a boolean`);return e}}o(f,"optionalBoolean");function me(e,t){if(e!==void 0){if(!Array.isArray(e))throw new Error(`provider-capabilities.json: ${t} must be an array`);return e.map((n,r)=>R(n,`${t}[${r}]`))}}o(me,"optionalStringArray");function Ct(e,t){if(e===void 0)return;if(!h(e))throw new Error(`provider-capabilities.json: ${t} must be an object`);let n={};for(let[r,i]of Object.entries(e))n[r]=R(i,`${t}.${r}`);return n}o(Ct,"optionalStringMap");function Pt(e,t){if(e!==void 0){if(typeof e!="string"||!fe.includes(e))throw new Error(`provider-capabilities.json: ${t} must be one of ${fe.join(", ")}, got ${JSON.stringify(e)}`);return e}}o(Pt,"optionalReasoningPreset");function F(e,t){if(typeof e!="string"||!le.includes(e))throw new Error(`provider-capabilities.json: ${t} must be one of ${le.join(", ")}, got ${JSON.stringify(e)}`);return e}o(F,"requireReasoningCapability");function Rt(e,t){if(typeof e!="string"||!ue.includes(e))throw new Error(`provider-capabilities.json: ${t} must be one of ${ue.join(", ")}, got ${JSON.stringify(e)}`);return e}o(Rt,"requireEffortStrategy");function Et(e,t){if(e!==void 0){if(typeof e!="string"||!ce.includes(e))throw new Error(`provider-capabilities.json: ${t} must be one of ${ce.join(", ")}, got ${JSON.stringify(e)}`);return e}}o(Et,"optionalThinkingStrategy");function he(e,t){if(e===void 0)return;if(!h(e))throw new Error(`provider-capabilities.json: ${t} must be an object`);let n=Rt(e.effortStrategy,`${t}.effortStrategy`),r=Pt(e.reasoningPreset,`${t}.reasoningPreset`),i=Et(e.thinkingStrategy,`${t}.thinkingStrategy`),s=x(e.defaultEffort,`${t}.defaultEffort`),l=Ct(e.effortAliases,`${t}.effortAliases`),u=me(e.disabledEfforts,`${t}.disabledEfforts`),g=me(e.localRejectEfforts,`${t}.localRejectEfforts`),y=f(e.allowCustomEffort,`${t}.allowCustomEffort`),b=f(e.supportsReasoningEffort,`${t}.supportsReasoningEffort`),v=f(e.supportsReasoningSummary,`${t}.supportsReasoningSummary`),k=f(e.supportsEncryptedReasoningReplay,`${t}.supportsEncryptedReasoningReplay`),d=f(e.supportsAdaptiveThinking,`${t}.supportsAdaptiveThinking`),C=f(e.supportsManualThinkingBudget,`${t}.supportsManualThinkingBudget`),p=f(e.supportsDisabledThinking,`${t}.supportsDisabledThinking`),X=f(e.requiresEffortBetaHeader,`${t}.requiresEffortBetaHeader`),a={effortStrategy:n};if(r!==void 0&&(a.reasoningPreset=r),i!==void 0&&(a.thinkingStrategy=i),s!==void 0&&(a.defaultEffort=s),l!==void 0&&(a.effortAliases=l),u!==void 0&&(a.disabledEfforts=u),g!==void 0&&(a.localRejectEfforts=g),e.supportedEfforts!==void 0){if(!Array.isArray(e.supportedEfforts))throw new Error(`provider-capabilities.json: ${t}.supportedEfforts must be an array`);a.supportedEfforts=e.supportedEfforts.map((c,m)=>{if(!h(c))throw new Error(`provider-capabilities.json: ${t}.supportedEfforts[${m}] must be an object`);return{value:R(c.value,`${t}.supportedEfforts[${m}].value`),...x(c.description,`${t}.supportedEfforts[${m}].description`)!==void 0?{description:x(c.description,`${t}.supportedEfforts[${m}].description`)}:{},...f(c.isDefault,`${t}.supportedEfforts[${m}].isDefault`)!==void 0?{isDefault:f(c.isDefault,`${t}.supportedEfforts[${m}].isDefault`)}:{},...f(c.isUserVisible,`${t}.supportedEfforts[${m}].isUserVisible`)!==void 0?{isUserVisible:f(c.isUserVisible,`${t}.supportedEfforts[${m}].isUserVisible`)}:{}}})}if(e.budgetByEffort!==void 0){if(!h(e.budgetByEffort))throw new Error(`provider-capabilities.json: ${t}.budgetByEffort must be an object`);let c={};for(let[m,G]of Object.entries(e.budgetByEffort))c[m]=P(G,`${t}.budgetByEffort.${m}`)??0;a.budgetByEffort=c}return y!==void 0&&(a.allowCustomEffort=y),b!==void 0&&(a.supportsReasoningEffort=b),v!==void 0&&(a.supportsReasoningSummary=v),k!==void 0&&(a.supportsEncryptedReasoningReplay=k),d!==void 0&&(a.supportsAdaptiveThinking=d),C!==void 0&&(a.supportsManualThinkingBudget=C),p!==void 0&&(a.supportsDisabledThinking=p),X!==void 0&&(a.requiresEffortBetaHeader=X),a}o(he,"validateReasoningProfile");function ye(e,t){let n=e.reasoningProfile,r=e.reasoningCapabilityV2;if(n!==void 0&&r!==void 0)throw new Error(`provider-capabilities.json: ${t} must not define both reasoningProfile and deprecated reasoningCapabilityV2`);return n!==void 0?he(n,`${t}.reasoningProfile`):he(r,`${t}.reasoningCapabilityV2`)}o(ye,"validateReasoningProfileField");function Tt(e,t){if(typeof e!="string"||!pe.includes(e))throw new Error(`provider-capabilities.json: ${t} must be one of ${pe.join(", ")}, got ${JSON.stringify(e)}`);return e}o(Tt,"requireProfileName");function xt(e,t){if(typeof e!="string"||!ge.includes(e))throw new Error(`provider-capabilities.json: ${t} must be one of ${ge.join(", ")}, got ${JSON.stringify(e)}`);return e}o(xt,"requireVerifyStrategy");function St(e,t){if(!h(e))throw new Error(`provider-capabilities.json: ${t} must be an object`);let n=R(e.id,`${t}.id`),r=x(e.wireModel,`${t}.wireModel`),i=x(e.displayName,`${t}.displayName`),s=P(e.contextWindow,`${t}.contextWindow`),l=P(e.maxOutputTokens,`${t}.maxOutputTokens`),u=P(e.thinkingBudgetCap,`${t}.thinkingBudgetCap`),g=f(e.replayReasoningContent,`${t}.replayReasoningContent`),y=f(e.strictThinkingSignature,`${t}.strictThinkingSignature`),b=P(e.streamMaxDurationMs,`${t}.streamMaxDurationMs`),v=e.reasoningCapability===void 0?void 0:F(e.reasoningCapability,`${t}.reasoningCapability`),k=ye(e,t),d={id:n};return r!==void 0&&(d.wireModel=r),i!==void 0&&(d.displayName=i),s!==void 0&&(d.contextWindow=s),l!==void 0&&(d.maxOutputTokens=l),u!==void 0&&(d.thinkingBudgetCap=u),v!==void 0&&(d.reasoningCapability=v),k!==void 0&&(d.reasoningProfile=k),g!==void 0&&(d.replayReasoningContent=g),y!==void 0&&(d.strictThinkingSignature=y),b!==void 0&&(d.streamMaxDurationMs=b),d}o(St,"validateModelDescriptor");function Mt(e,t){if(e===void 0)return;if(!h(e))throw new Error(`provider-capabilities.json: ${t} must be an object`);let n={};for(let[r,i]of Object.entries(e))n[r]=F(i,`${t}.${r}`);return n}o(Mt,"validateModelReasoningCapabilities");function Kt(e,t){if(!h(e))throw new Error(`provider-capabilities.json: providers.${t} must be an object`);let n=f(e.cliBridge,`providers.${t}.cliBridge`),r=R(e.apiKeyEnv,`providers.${t}.apiKeyEnv`),i=F(e.reasoningCapability,`providers.${t}.reasoningCapability`),s=ye(e,`providers.${t}`),l=Tt(e.capabilityProfile,`providers.${t}.capabilityProfile`),u=xt(e.verifyStrategy,`providers.${t}.verifyStrategy`);if(n&&u!=="unsupported")throw new Error(`provider-capabilities.json: providers.${t} is a cliBridge entry but verifyStrategy="${u}" \u2014 must be "unsupported" (CLI binary owns credentials)`);let g=P(e.contextWindow,`providers.${t}.contextWindow`),y=P(e.maxOutputTokens,`providers.${t}.maxOutputTokens`),b=P(e.thinkingBudgetCap,`providers.${t}.thinkingBudgetCap`),v=f(e.supportsThinking,`providers.${t}.supportsThinking`),k=Mt(e.modelReasoningCapabilities,`providers.${t}.modelReasoningCapabilities`),d=x(e.model,`providers.${t}.model`);if(n&&(d!==void 0||e.models!==void 0))throw new Error(`provider-capabilities.json: providers.${t} is a cliBridge entry but defines model/models \u2014 must be omitted (filled at load time)`);if(!n&&d===void 0)throw new Error(`provider-capabilities.json: providers.${t}.model is required (only cliBridge entries may omit)`);let C;if(e.models!==void 0){if(!Array.isArray(e.models))throw new Error(`provider-capabilities.json: providers.${t}.models must be an array`);C=e.models.map((a,c)=>St(a,`providers.${t}.models[${c}]`));let X=new Set([...d===void 0?[]:[d],...C.map(a=>a.id)]);for(let[a,c]of C.entries())if(c.wireModel!==void 0&&!X.has(c.wireModel))throw new Error(`provider-capabilities.json: providers.${t}.models[${a}].wireModel must reference a declared model, got ${JSON.stringify(c.wireModel)}`)}let p={apiKeyEnv:r,reasoningCapability:i,capabilityProfile:l,verifyStrategy:u};return s!==void 0&&(p.reasoningProfile=s),d!==void 0&&(p.model=d),C!==void 0&&(p.models=C),g!==void 0&&(p.contextWindow=g),y!==void 0&&(p.maxOutputTokens=y),b!==void 0&&(p.thinkingBudgetCap=b),v!==void 0&&(p.supportsThinking=v),k!==void 0&&(p.modelReasoningCapabilities=k),n&&(p.cliBridge=!0),p}o(Kt,"validateProviderEntry");function be(e){if(!h(e))throw new Error("provider-capabilities.json: root must be an object");if(e.version!==1)throw new Error(`provider-capabilities.json: version must be 1, got ${JSON.stringify(e.version)}`);let t=R(e.updatedAt,"updatedAt");if(!h(e.providers))throw new Error("provider-capabilities.json: providers must be an object");let n={};for(let[r,i]of Object.entries(e.providers))n[r]=Kt(i,r);return{version:1,updatedAt:t,providers:n}}o(be,"validateProviderCapabilitiesJson");var At=Object.freeze({native:K,"image-input-native":Q,"cli-bridge":O,"image-input-cli-bridge":Z}),L=null;function It(){if(process.env.KODAX_BUNDLED==="true")return S.join(S.dirname(process.execPath),"provider-capabilities.json");let e=S.dirname(Xt(import.meta.url)),t=[S.join(e,"provider-capabilities.json"),S.join(S.dirname(e),"provider-capabilities.json")];for(let n of t)if(wt(n))return n;return t[0]}o(It,"resolveJsonPath");function Ot(e){if(e.models){for(let t of e.models)t.reasoningProfile&&ve(t.reasoningProfile);for(let t of e.models)Object.freeze(t);Object.freeze(e.models)}return e.reasoningProfile&&ve(e.reasoningProfile),e.modelReasoningCapabilities&&Object.freeze(e.modelReasoningCapabilities),Object.freeze(e)}o(Ot,"deepFreezeSnapshot");function ve(e){if(e.supportedEfforts){for(let t of e.supportedEfforts)Object.freeze(t);Object.freeze(e.supportedEfforts)}e.budgetByEffort&&Object.freeze(e.budgetByEffort),e.effortAliases&&Object.freeze(e.effortAliases),e.disabledEfforts&&Object.freeze(e.disabledEfforts),e.localRejectEfforts&&Object.freeze(e.localRejectEfforts),Object.freeze(e)}o(ve,"freezeReasoningProfile");function Dt(e){if(e==="gemini-cli"){let t=T();return{model:t,models:_().filter(n=>n!==t).map(n=>({id:n}))}}if(e==="codex-cli"){let t=E();return{model:t,models:w().filter(n=>n!==t).map(n=>({id:n}))}}throw new Error(`provider-capabilities loader: unknown cliBridge provider '${e}'`)}o(Dt,"resolveCliBridgeModels");function Bt(e,t){let n=At[t.capabilityProfile];if(!n)throw new Error(`provider-capabilities loader: unknown capabilityProfile '${t.capabilityProfile}' for provider '${e}'`);if(t.cliBridge){let i=Dt(e),s={model:i.model,models:i.models,apiKeyEnv:t.apiKeyEnv,reasoningCapability:t.reasoningCapability,capabilityProfile:n,verifyStrategy:t.verifyStrategy};return t.reasoningProfile!==void 0&&(s.reasoningProfile=t.reasoningProfile),t.supportsThinking!==void 0&&(s.supportsThinking=t.supportsThinking),s}let r={model:t.model,apiKeyEnv:t.apiKeyEnv,reasoningCapability:t.reasoningCapability,capabilityProfile:n,verifyStrategy:t.verifyStrategy};return t.reasoningProfile!==void 0&&(r.reasoningProfile=t.reasoningProfile),t.models!==void 0&&(r.models=t.models),t.modelReasoningCapabilities!==void 0&&(r.modelReasoningCapabilities=t.modelReasoningCapabilities),t.contextWindow!==void 0&&(r.contextWindow=t.contextWindow),t.maxOutputTokens!==void 0&&(r.maxOutputTokens=t.maxOutputTokens),t.thinkingBudgetCap!==void 0&&(r.thinkingBudgetCap=t.thinkingBudgetCap),t.supportsThinking!==void 0&&(r.supportsThinking=t.supportsThinking),r}o(Bt,"buildSnapshot");function ke(){if(L)return L;let e=It(),t;try{let i=_t(e,"utf8");t=JSON.parse(i)}catch(i){let s=i instanceof Error?i.message:String(i);throw new Error(`provider-capabilities loader: failed to read ${e}: ${s}`)}let n=be(t),r={};for(let[i,s]of Object.entries(n.providers))r[i]=Ot(Bt(i,s));return L=Object.freeze(r),L}o(ke,"getProviderSnapshots");import Yr from"@anthropic-ai/sdk";var V=ke();var Ce=process.env.KODAX_PROVIDER??"zhipu-coding";export{Le as a,je as b,$e as c,Fe as d,Ue as e,qe as f,j as g,V as h};
@@ -1,2 +1,2 @@
1
1
  // @kodax-ai/kodax — bundled distribution. See docs/ADR.md ADR-022 + ADR-024.
2
- import{o}from"./chunk-UJEMSPM5.js";import{a as i}from"./chunk-ONUPGMER.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};
2
+ import{o}from"./chunk-ZJIMT5I3.js";import{a as i}from"./chunk-ONUPGMER.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};