@kodax-ai/kodax 0.7.78 → 0.7.79

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 (124) hide show
  1. package/CHANGELOG.md +3475 -3197
  2. package/README.md +346 -275
  3. package/README_CN.md +274 -214
  4. package/config-templates/config.example.jsonc +11 -1
  5. package/config-templates/integrations/a2a.example.jsonc +23 -7
  6. package/dist/builtin/skill-creator/scripts/aggregate-benchmark.js +2 -1
  7. package/dist/builtin/skill-creator/scripts/analyze-benchmark.d.ts +1 -0
  8. package/dist/builtin/skill-creator/scripts/analyze-benchmark.js +4 -3
  9. package/dist/builtin/skill-creator/scripts/compare-runs.d.ts +1 -0
  10. package/dist/builtin/skill-creator/scripts/compare-runs.js +4 -3
  11. package/dist/builtin/skill-creator/scripts/generate-review.js +2 -1
  12. package/dist/builtin/skill-creator/scripts/grade-evals.d.ts +1 -0
  13. package/dist/builtin/skill-creator/scripts/grade-evals.js +4 -3
  14. package/dist/builtin/skill-creator/scripts/improve-description.js +2 -1
  15. package/dist/builtin/skill-creator/scripts/init-skill.d.ts +1 -0
  16. package/dist/builtin/skill-creator/scripts/init-skill.js +4 -3
  17. package/dist/builtin/skill-creator/scripts/install-skill.d.ts +1 -0
  18. package/dist/builtin/skill-creator/scripts/install-skill.js +4 -3
  19. package/dist/builtin/skill-creator/scripts/package-skill.d.ts +1 -0
  20. package/dist/builtin/skill-creator/scripts/package-skill.js +4 -3
  21. package/dist/builtin/skill-creator/scripts/quick-validate.d.ts +1 -0
  22. package/dist/builtin/skill-creator/scripts/quick-validate.js +4 -3
  23. package/dist/builtin/skill-creator/scripts/run-eval.d.ts +1 -0
  24. package/dist/builtin/skill-creator/scripts/run-eval.js +4 -3
  25. package/dist/builtin/skill-creator/scripts/run-loop.js +2 -1
  26. package/dist/builtin/skill-creator/scripts/run-trigger-eval.js +2 -1
  27. package/dist/builtin/skill-creator/scripts/utils.d.ts +3 -0
  28. package/dist/builtin/skill-creator/scripts/utils.js +5 -1
  29. package/dist/chunks/{agent-ASP4MS3X.js → agent-V4AC5JZD.js} +1 -1
  30. package/dist/chunks/argument-completer-ZPC2MLES.js +2 -0
  31. package/dist/chunks/{chunk-Z3KFRTSB.js → chunk-67THZRM6.js} +1 -1
  32. package/dist/chunks/chunk-6GVQDQTQ.js +292 -0
  33. package/dist/chunks/{chunk-TQDBTTIM.js → chunk-B6UY3VHV.js} +40 -40
  34. package/dist/chunks/{chunk-7OEBJGHK.js → chunk-BBOVVDQJ.js} +1 -1
  35. package/dist/chunks/chunk-CR2IF7VF.js +30 -0
  36. package/dist/chunks/{chunk-UID7BLAB.js → chunk-CXHEZY5G.js} +1 -1
  37. package/dist/chunks/chunk-EDZ4QILG.js +266 -0
  38. package/dist/chunks/chunk-GEECPO2H.js +218 -0
  39. package/dist/chunks/chunk-H5LLM7DB.js +89 -0
  40. package/dist/chunks/chunk-KLWP7POA.js +467 -0
  41. package/dist/chunks/{chunk-2CFHBKRE.js → chunk-M4N2JZTZ.js} +2 -2
  42. package/dist/chunks/{chunk-YAZQTC2L.js → chunk-OWQT3FTE.js} +1 -1
  43. package/dist/chunks/chunk-Q4M7DJOD.js +319 -0
  44. package/dist/chunks/{chunk-6FOJVETH.js → chunk-QCZLCLFL.js} +7 -7
  45. package/dist/chunks/chunk-RQPMGRTR.js +810 -0
  46. package/dist/chunks/chunk-SG6P4SZS.js +123 -0
  47. package/dist/chunks/chunk-TSTVAU5E.js +386 -0
  48. package/dist/chunks/chunk-ZCZZUE5E.js +662 -0
  49. package/dist/chunks/compaction-config-AEUGVROL.js +2 -0
  50. package/dist/chunks/{construction-bootstrap-VQLQGWPY.js → construction-bootstrap-K3ZGEN5N.js} +1 -1
  51. package/dist/chunks/dist-GFJFRPAV.js +2 -0
  52. package/dist/chunks/{dist-BFT5YIGU.js → dist-JMO47GJV.js} +1 -1
  53. package/dist/chunks/host-23K2Q6RZ.js +2 -0
  54. package/dist/chunks/run-manager-PGIR6ITA.js +2 -0
  55. package/dist/chunks/{utils-SID4HW2Q.js → utils-6LEKJPQN.js} +1 -1
  56. package/dist/index.d.ts +20 -20
  57. package/dist/index.js +2 -2
  58. package/dist/kodax_bootstrap.js +2 -1
  59. package/dist/kodax_cli.js +1816 -1458
  60. package/dist/kodax_resume.js +570 -34
  61. package/dist/provider-capabilities.json +85 -50
  62. package/dist/runtime-worker.js +1713 -1361
  63. package/dist/sandbox-workspace-session.js +285 -19
  64. package/dist/sdk-a2a.d.ts +19 -13
  65. package/dist/sdk-a2a.js +8 -8
  66. package/dist/sdk-agent.d.ts +73 -141
  67. package/dist/sdk-agent.js +1 -1
  68. package/dist/sdk-coding.d.ts +29 -60
  69. package/dist/sdk-coding.js +1 -1
  70. package/dist/sdk-experimental-memory.d.ts +3 -3
  71. package/dist/sdk-experimental-memory.js +1 -1
  72. package/dist/sdk-llm.d.ts +7 -7
  73. package/dist/sdk-llm.js +1 -1
  74. package/dist/sdk-mcp.d.ts +1 -1
  75. package/dist/sdk-mcp.js +1 -1
  76. package/dist/sdk-media.d.ts +1 -1
  77. package/dist/sdk-media.js +1 -1
  78. package/dist/sdk-repl.d.ts +25 -26
  79. package/dist/sdk-repl.js +2 -2
  80. package/dist/sdk-runtime.d.ts +227 -31
  81. package/dist/sdk-runtime.js +1 -1
  82. package/dist/sdk-sandbox.js +1 -1
  83. package/dist/sdk-session.d.ts +8 -8
  84. package/dist/sdk-session.js +1 -1
  85. package/dist/sdk-skills.js +1 -1
  86. package/dist/semantic-worker.js +283 -18
  87. package/dist/types-chunks/{base.d-4e74xDdy.d.ts → base.d-DxG0m09Z.d.ts} +1 -1
  88. package/dist/types-chunks/{bash-prefix-extractor.d-uAe2Oqda.d.ts → bash-prefix-extractor.d-CNSidpmv.d.ts} +28 -7
  89. package/dist/types-chunks/{capability-learning.d-CVsdHw4j.d.ts → capability-learning.d-iPSiAmc_.d.ts} +1 -1
  90. package/dist/types-chunks/{capsule.d-BlSv9l3V.d.ts → capsule.d-B3q98pLQ.d.ts} +9 -7
  91. package/dist/types-chunks/{types.d-BA-Jwpfs.d.ts → controller.d-RGV7Pjv9.d.ts} +328 -3
  92. package/dist/types-chunks/{guardrail.d-CXDYRgZ3.d.ts → guardrail.d-1NLSFTyN.d.ts} +126 -52
  93. package/dist/types-chunks/{history-retrieval.d-DtCy7x64.d.ts → history-retrieval.d-BAegI14A.d.ts} +16 -3
  94. package/dist/types-chunks/{oauth-login.d-Bgb4rdLN.d.ts → oauth-login.d-6i-vidxv.d.ts} +6 -2
  95. package/dist/types-chunks/{public-api.d-B3AohsxN.d.ts → public-api.d-BpJhHoa7.d.ts} +334 -25
  96. package/dist/types-chunks/{repl.d-Ie_ZXb_U.d.ts → repl.d-CZ12Ow3X.d.ts} +5 -5
  97. package/dist/types-chunks/{resolver.d-iAQ9ocLB.d.ts → resolver.d-C9IW4fmU.d.ts} +5 -2
  98. package/dist/types-chunks/{run-manager.d-D1twIhF9.d.ts → run-manager.d-CX3AUocA.d.ts} +1 -1
  99. package/dist/types-chunks/{sdk-session-DB9KksIx.d.ts → sdk-session-B3cfJKqF.d.ts} +3 -3
  100. package/dist/types-chunks/{side-query.d-DTuLPcC5.d.ts → side-query.d-CP1LiRiH.d.ts} +8 -2
  101. package/dist/types-chunks/{types-D3g6XUQr.d.ts → types-Bf3Y3mW-.d.ts} +1 -1
  102. package/dist/types-chunks/{types.d-BH0ZkTGf.d.ts → types.d-BZ9oXvTV.d.ts} +2 -2
  103. package/dist/types-chunks/{types.d-DVDTIfB_.d.ts → types.d-C0_rn--1.d.ts} +4 -4
  104. package/dist/types-chunks/{types.d-DIpZJKUl.d.ts → types.d-CgrXrFrq.d.ts} +16 -2
  105. package/dist/types-chunks/{utils.d-CVp6bFl9.d.ts → utils.d-CGpHavsU.d.ts} +14 -6
  106. package/docs/SDK_EMBEDDER_GUIDE.md +1144 -598
  107. package/package.json +4 -1
  108. package/dist/chunks/argument-completer-JYQ7FX3W.js +0 -2
  109. package/dist/chunks/chunk-35PPHOQ2.js +0 -292
  110. package/dist/chunks/chunk-43QNNDHR.js +0 -29
  111. package/dist/chunks/chunk-5GO6FH7L.js +0 -458
  112. package/dist/chunks/chunk-5NDCSFOP.js +0 -78
  113. package/dist/chunks/chunk-6XM4B6K2.js +0 -48
  114. package/dist/chunks/chunk-6YZUE6NC.js +0 -240
  115. package/dist/chunks/chunk-KQLQYHWU.js +0 -386
  116. package/dist/chunks/chunk-NXO6GWSY.js +0 -46
  117. package/dist/chunks/chunk-T2XZTLYE.js +0 -316
  118. package/dist/chunks/chunk-VAT2QYXM.js +0 -765
  119. package/dist/chunks/chunk-YVRYHC4C.js +0 -655
  120. package/dist/chunks/compaction-config-BQSSIWK5.js +0 -2
  121. package/dist/chunks/dist-PCFE24YP.js +0 -2
  122. package/dist/chunks/host-UTFXCYYM.js +0 -2
  123. package/dist/chunks/run-manager-PJU3WIFJ.js +0 -2
  124. package/dist/types-chunks/guardrail.d-BRE_ErEj.d.ts +0 -156
package/README.md CHANGED
@@ -41,30 +41,30 @@
41
41
  ```bash
42
42
  npm i -g @kodax-ai/kodax
43
43
 
44
- # Pick any one you have an API key for (`kodax setup --help` lists all):
45
- export ZHIPU_API_KEY=... # ANTHROPIC_API_KEY / OPENAI_API_KEY / DEEPSEEK_API_KEY /
46
- # KIMI_API_KEY / KIMI_CODE_API_KEY / QWEN_API_KEY /
47
- # QWEN_TOKEN_API_KEY / ZHIPU_CODING_API_KEY /
48
- # ZAI_CODING_API_KEY / MINIMAX_CODING_API_KEY /
49
- # MIMO_API_KEY / MIMO_CODING_API_KEY / ARK_CODING_API_KEY
44
+ # Pick any one you have an API key for (`kodax setup --help` lists all):
45
+ export ZHIPU_API_KEY=... # ANTHROPIC_API_KEY / OPENAI_API_KEY / DEEPSEEK_API_KEY /
46
+ # KIMI_API_KEY / KIMI_CODE_API_KEY / QWEN_API_KEY /
47
+ # QWEN_TOKEN_API_KEY / ZHIPU_CODING_API_KEY /
48
+ # ZAI_CODING_API_KEY / MINIMAX_CODING_API_KEY /
49
+ # MIMO_API_KEY / MIMO_CODING_API_KEY / ARK_CODING_API_KEY
50
50
 
51
51
  kodax
52
52
  ```
53
53
 
54
- That's it. You're in the REPL — ask anything in natural language. On a new
55
- machine with no selected provider, bare interactive `kodax` opens setup first,
56
- even if a supported credential environment variable already exists. Setup
57
- checks core, MCP, Extensions, and A2A active files plus all annotated templates
58
- without overwriting existing files. It never asks for the key itself; after
59
- choosing a provider/model, set the named environment variable, restart the
60
- terminal, and run `kodax` again. Use `kodax setup` to rerun the flow,
61
- `kodax setup --custom` for a guided custom provider, and `kodax setup --help`
62
- (or REPL `/setup --help`) for paths, provider variables, commands, and
63
- shortcuts. Interactive setup also checks the optional ASRT sandbox once:
64
- Windows may show a one-time UAC prompt; macOS/Linux report any required
65
- Seatbelt/bubblewrap dependencies. Declining or missing a dependency does not
66
- break ordinary permission handling, and normal startup will not keep reminding
67
- you.
54
+ That's it. You're in the REPL — ask anything in natural language. On a new
55
+ machine, bare interactive `kodax` first checks for supported API-key environment
56
+ variables. If none exists, KodaX only prints Windows, macOS, and Linux setup
57
+ instructions and exits without creating configuration or collecting a key.
58
+ After setting the variable, close the current terminal, open a new one, and run
59
+ `kodax` again. If a supported credential exists but no provider is selected,
60
+ KodaX opens the provider/model metadata setup. Use `kodax setup` to rerun the
61
+ flow, `kodax setup --custom` for a guided custom provider, and
62
+ `kodax setup --help` (or REPL `/setup --help`) for paths, provider variables,
63
+ commands, and shortcuts. Interactive setup also checks the optional ASRT sandbox once:
64
+ Windows may show a one-time UAC prompt; macOS/Linux report any required
65
+ Seatbelt/bubblewrap dependencies. Declining or missing a dependency does not
66
+ break ordinary permission handling, and normal startup will not keep reminding
67
+ you.
68
68
 
69
69
  > **No-Node target machines:** download a Bun-compiled single binary for Windows / macOS / Linux × x64 + arm64 from the [GitHub Releases](https://github.com/icetomoyo/KodaX/releases) page. See [docs/release.md](docs/release.md) for the build pipeline.
70
70
 
@@ -156,69 +156,94 @@ npm link
156
156
 
157
157
  KodaX reads API keys from environment variables. For built-in providers, the fastest path is:
158
158
 
159
- ```bash
160
- # Interactive metadata-only provider/model setup (does not collect a key)
161
- kodax setup
162
-
163
- # Guided custom OpenAI/Anthropic-compatible provider
164
- kodax setup --custom
165
-
166
- # Complete guide; does not change files
167
- kodax setup --help
168
- ```
169
-
170
- Setup checks these active files and matching `*.example.jsonc` references:
171
-
172
- - `~/.kodax/config.json` and `~/.kodax/config.example.jsonc`
173
- - `~/.kodax/integrations/mcp.json`
174
- - `~/.kodax/integrations/extensions.json`
175
- - `~/.kodax/integrations/a2a.json`
176
-
177
- The core active file remains strict JSON. The first line of the annotated
178
- `config.example.jsonc` points to all split files and documents every supported
179
- core setting. Setup preserves existing files and stages readable legacy
180
- `config.json#mcpServers` / `config.json#extensions` before creating empty
181
- authoritative split files. It tells you the exact environment-variable name to
182
- set and exits so you can restart the terminal. Existing active files are
183
- validated first; an invalid file is reported without creating or overwriting
184
- configuration. You can also configure it directly:
159
+ ```bash
160
+ # Interactive metadata-only provider/model setup (does not collect a key)
161
+ kodax setup
162
+
163
+ # Guided custom OpenAI/Anthropic-compatible provider
164
+ kodax setup --custom
165
+
166
+ # Complete guide; does not change files
167
+ kodax setup --help
168
+ ```
169
+
170
+ Setup checks these active files and matching `*.example.jsonc` references:
171
+
172
+ - `~/.kodax/config.json` and `~/.kodax/config.example.jsonc`
173
+ - `~/.kodax/integrations/mcp.json`
174
+ - `~/.kodax/integrations/extensions.json`
175
+ - `~/.kodax/integrations/a2a.json`
176
+
177
+ The core active file remains strict JSON. The first line of the annotated
178
+ `config.example.jsonc` points to all split files and documents every supported
179
+ core setting. Setup preserves existing files and stages readable legacy
180
+ `config.json#mcpServers` / `config.json#extensions` before creating empty
181
+ authoritative split files. It tells you the exact environment-variable name to
182
+ set and exits so you can restart the terminal. Existing active files are
183
+ validated first; an invalid file is reported without creating or overwriting
184
+ configuration. For a custom provider, setup asks for an `apiKeyEnv` name such
185
+ as `MY_LLM_API_KEY`, not the API key itself. `config.json` stores that name
186
+ only; after setup, set the environment variable with exactly that name to the
187
+ provider's actual API key. KodaX does not set the OS environment variable for
188
+ you. You can also configure it directly:
185
189
 
186
190
  ```bash
187
191
  # macOS / Linux
188
192
  export ZHIPU_API_KEY=your_api_key
189
193
 
190
194
  # PowerShell
191
- $env:ZHIPU_API_KEY="your_api_key"
192
- ```
193
-
194
- ### 2.1 Activate the optional sandbox
195
-
196
- `kodax setup` and first-run setup check sandbox readiness. You can inspect or
197
- activate it explicitly:
198
-
199
- ```bash
200
- kodax sandbox doctor
201
- kodax sandbox setup
202
- ```
203
-
204
- - Windows uses a restricted sandbox account and network policy. A normal
205
- terminal is sufficient; approve the one-time UAC prompt.
206
- - macOS uses Seatbelt/`sandbox-exec` and requires ripgrep
207
- (`brew install ripgrep`).
208
- - Linux uses bubblewrap and requires `bubblewrap`, `socat`, and `ripgrep`
209
- (install them with your distro's `apt`, `dnf`, or `pacman`).
210
-
211
- KodaX never runs `sudo` or a package manager automatically. If the sandbox is
212
- not active, deterministic safe operations and Auto[LLM] decisions keep the
213
- same permission behavior; only OS-level containment is absent. Ordinary runs
214
- do not repeatedly prompt for setup. In the REPL, `/sandbox` refreshes readiness
215
- and diagnostics without activating the backend or requesting elevation.
216
- Per-command sandbox routing remains internal and is not shown in normal command
217
- history. SDK embedders can use the same capability independently through
218
- `@kodax-ai/kodax/sandbox`; see the
219
- [SDK sandbox guide](docs/SDK_EMBEDDER_GUIDE.md#30-standalone-sandbox-sdk-v0778).
220
-
221
- For Qwen Token Plan, select `qwen-token-plan` and use its separate credential;
195
+ $env:ZHIPU_API_KEY="your_api_key"
196
+ ```
197
+
198
+ ### 2.1 Activate the optional sandbox
199
+
200
+ `kodax setup` and first-run setup check sandbox readiness. You can inspect or
201
+ activate it explicitly:
202
+
203
+ ```bash
204
+ kodax sandbox doctor
205
+ kodax sandbox setup
206
+ ```
207
+
208
+ - Windows uses a restricted sandbox account and network policy. A normal
209
+ terminal is sufficient; approve the one-time UAC prompt.
210
+ - macOS uses Seatbelt/`sandbox-exec` and requires ripgrep
211
+ (`brew install ripgrep`).
212
+ - Linux uses bubblewrap and requires `bubblewrap`, `socat`, and `ripgrep`
213
+ (install them with your distro's `apt`, `dnf`, or `pacman`).
214
+
215
+ KodaX never runs `sudo` or a package manager automatically. If the sandbox is
216
+ not active, deterministic safe operations and Auto[LLM] decisions keep the
217
+ same permission behavior; only OS-level containment is absent. Ordinary runs
218
+ do not repeatedly prompt for setup. In the REPL, `/sandbox` refreshes readiness
219
+ and diagnostics without activating the backend or requesting elevation.
220
+ Per-command sandbox routing remains internal and is not shown in normal command
221
+ history. SDK embedders can use the same capability independently through
222
+ `@kodax-ai/kodax/sandbox`; see the
223
+ [SDK sandbox guide](docs/SDK_EMBEDDER_GUIDE.md#30-standalone-sandbox-sdk-v0778).
224
+
225
+ Credential-shaped environment variables are filtered from model-issued shell
226
+ commands by default. To expose exact host variables to those command targets,
227
+ including ASRT, add only their names to the user-level core config:
228
+
229
+ ```json
230
+ {
231
+ "sandbox": {
232
+ "envPass": ["GH_TOKEN", "GITHUB_TOKEN", "OPENAI_API_KEY"]
233
+ }
234
+ }
235
+ ```
236
+
237
+ The default list is empty. Values remain in the host environment and are never
238
+ stored in `config.json`; project configuration cannot extend the list.
239
+ Matching is exact (case-insensitive on Windows), and execution-control
240
+ variables such as `NODE_OPTIONS` and `BASH_ENV` remain blocked. Restart KodaX
241
+ after changing the host variables or this setting; stop/restart a persistent
242
+ KodaX daemon so it receives the new environment and configuration.
243
+ SDK callers pass the same shape per Run as `KodaXOptions.sandbox`, so concurrent
244
+ Runs can use different lists without mutating process-global configuration.
245
+
246
+ For Qwen Token Plan, select `qwen-token-plan` and use its separate credential;
222
247
  `QWEN_API_KEY` does not authenticate this route:
223
248
 
224
249
  ```bash
@@ -257,6 +282,11 @@ If you need a custom base URL or an OpenAI/Anthropic-compatible endpoint, define
257
282
  }
258
283
  ```
259
284
 
285
+ Here, `"apiKeyEnv": "MY_LLM_API_KEY"` is a reference to an environment-variable
286
+ name, not an API key value. Put the custom provider's actual API key in the
287
+ `MY_LLM_API_KEY` environment variable, then close the current terminal and open
288
+ a new one before running `kodax`.
289
+
260
290
  `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.
261
291
  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.
262
292
 
@@ -273,36 +303,45 @@ Some OpenAI-compatible reasoning models require KodaX to replay the previous ass
273
303
  "baseUrl": "https://example.com/v1",
274
304
  "apiKeyEnv": "MY_DEEPSEEK_API_KEY",
275
305
  "model": "deepseek-v4-flash",
276
- "reasoningPreset": "deepseek-v4-openai",
306
+ "maxOutputTokensField": "max_tokens",
307
+ "reasoningPreset": "deepseek-v4-flash-openai",
277
308
  "replayReasoningContent": true
278
309
  }
279
310
  ]
280
311
  }
281
312
  ```
282
313
 
283
- Keep `replayReasoningContent` unset or `false` for OpenAI proper and gateways that reject unknown assistant-message fields. If one gateway routes mixed models, prefer per-model overrides:
314
+ DeepSeek Chat Completions uses `max_tokens`; OpenAI proper defaults to
315
+ `max_completion_tokens`. Keep `replayReasoningContent` unset or `false` for
316
+ OpenAI proper and gateways that reject unknown assistant-message fields. If one
317
+ gateway routes mixed models, prefer per-model overrides for both fields:
284
318
 
285
319
  ```json
286
320
  {
287
321
  "models": [
288
- { "id": "deepseek-v4-flash", "replayReasoningContent": true },
322
+ {
323
+ "id": "deepseek-v4-flash",
324
+ "maxOutputTokensField": "max_tokens",
325
+ "reasoningPreset": "deepseek-v4-flash-openai",
326
+ "replayReasoningContent": true
327
+ },
289
328
  { "id": "gpt-5", "replayReasoningContent": false }
290
329
  ]
291
- }
292
- ```
293
-
294
- If a custom endpoint is confirmed to support cache-affinity routing, set
295
- `"promptCacheAffinity": true`. Anthropic-compatible requests then receive the
296
- opaque logical-context key as `metadata.user_id`; OpenAI-compatible requests
297
- receive `prompt_cache_key`. The default is `false` because some strict
298
- compatible gateways reject unknown request fields. Do not enable it solely
299
- because an endpoint claims protocol compatibility.
300
-
301
- Sidecar verifier judge calls use provider-level forced tool choice when supported. If a compatible endpoint rejects the `tool_choice` parameter, KodaX retries that verifier request once without forced tool choice and still fails open rather than blocking the main Worker.
330
+ }
331
+ ```
332
+
333
+ If a custom endpoint is confirmed to support cache-affinity routing, set
334
+ `"promptCacheAffinity": true`. Anthropic-compatible requests then receive the
335
+ opaque logical-context key as `metadata.user_id`; OpenAI-compatible requests
336
+ receive `prompt_cache_key`. The default is `false` because some strict
337
+ compatible gateways reject unknown request fields. Do not enable it solely
338
+ because an endpoint claims protocol compatibility.
339
+
340
+ Sidecar verifier judge calls use provider-level forced tool choice when supported. If a compatible endpoint rejects the `tool_choice` parameter, KodaX retries that verifier request once without forced tool choice and still fails open rather than blocking the main Worker.
302
341
 
303
342
  #### Opting a custom provider into image / vision input (FEATURE_134 v0.7.40)
304
343
 
305
- If your custom provider's underlying model supports image input (vision), add a `capabilityProfile.multimodalSupport: "image-input"` block so KodaX does not artificially block multimodal requests at the SA-path policy gate. Built-in vision-capable aliases (Anthropic, OpenAI, Anthropic-/OpenAI-compatible aliases such as DeepSeek, Kimi, Qwen, Zhipu, MiniMax, MiMo, Ark, plus Gemini-CLI via the CLI's `@<path>` file-include syntax) already ship with this flag enabled by default; Codex-CLI and custom providers need to opt in when their underlying model supports image input.
344
+ If your custom provider's underlying model supports image input (vision), add a `capabilityProfile.multimodalSupport: "image-input"` block so KodaX does not artificially block multimodal requests at the SA-path policy gate. Built-in vision-capable aliases (Anthropic, OpenAI, compatible aliases such as Kimi, Qwen, Zhipu, MiniMax, MiMo, Ark, plus Gemini-CLI via the CLI's `@<path>` file-include syntax) already ship with this flag enabled by default. DeepSeek V4 and Codex-CLI are text-only; custom providers need to opt in when their underlying model supports image input.
306
345
 
307
346
  ```json
308
347
  {
@@ -461,101 +500,124 @@ clarification required to finish the current request, emits budget-approval
461
500
  state only for eligible Sidecar revisions, and preserves structured blocked
462
501
  reasons across embedded and daemon Runtime boundaries.
463
502
 
464
- **v0.7.76 Kimi Code catalog refresh:** `kimi-code` now defaults to the official
465
- `k3-256k` Model ID and sends it unchanged. `kimi-for-coding` remains selectable
466
- for K2.7 Code, alongside `kimi-for-coding-highspeed` and the 1M `k3` tier. K3
467
- supports `low` / `high` / `max` reasoning with `high` as default; the 256K
468
- route supports image input but not video input.
469
-
470
- **v0.7.77 release:** AMA now chooses and composes six named
471
- problem-solving patterns through the existing Actor control plane instead of
472
- using a fixed topology or hidden Workflow. Optional strategy metadata becomes
473
- a bounded, fact-only `PatternTrace`; the existing Sidecar remains the only
474
- terminal-answer quality judge. Governed memory can also react sparsely after a
475
- tool failure, verification failure, or committed compaction and place at most
476
- three prompt-safe, low-authority evidence items before the next Action-LLM
477
- request. The default path adds no selector model call; SDK hosts may opt into
478
- `memoryRecallRunner` in process. Public `kimi` also gains the 1M `kimi-k3`
479
- route while retaining K2.7 Code as its default. See the
480
- [v0.7.77 design](docs/features/v0.7.77.md) and
481
- [release checklist](docs/release.md#v0777-release-ready-candidate-verification).
482
- The frozen F274/F275 paid evaluation completed with `recommend-ship` from the
483
- final F274 Layer 2/Layer 3 reviews and the F275 pilot review, followed by a
484
- joint `SHIP` decision for the deterministic contracts. Semantic memory
485
- selection remains experimental and host opt-in; no task-quality, token, or
486
- latency improvement is claimed.
487
-
488
- **v0.7.78 evidence-gated learning, setup, and permission/sandbox release:**
489
- Background learning is Memory-first. Only repeated independently verified
490
- evidence, or an explicit preserve-as-Skill request with verified terminal
491
- evidence, can admit a low-risk declarative Skill to a bounded immutable
492
- project canary; three exact-revision uses and independently verified success
493
- are required before automatic project trust. Every revision remains visible
494
- and reversible in `/learn`. Protected/formal Skills, global promotion, and
495
- Extension authoring remain explicit user actions.
496
-
497
- First-run setup now creates and validates the split core/MCP/Extensions/A2A
498
- files and annotated templates without overwriting existing configuration or
499
- collecting secrets. Auto[LLM] admits precisely modeled ordinary reads and
500
- workspace/temp mutations before classifier latency, retries classifier
501
- infrastructure failure once, then falls back at the Accept-edits boundary
502
- without switching to rules. ASRT is optional execution containment rather
503
- than permission authority; `/sandbox` is the explicit diagnostic surface, and
504
- SDK hosts can use the standalone `/sandbox` subpath without a silent
505
- unsandboxed fallback. KodaX's workspace containment denies reads from common
506
- home credential paths and the complete resolved agent home without turning
507
- ordinary external reads into an allowlist. See the
508
- [v0.7.78 design](docs/features/v0.7.78.md), the
509
- [release checklist](docs/release.md#v0778-release-verification), and
510
- [SDK guide sections 29–30](docs/SDK_EMBEDDER_GUIDE.md#29-evidence-gated-background-skill-learning-feature_263-v0778).
511
-
512
- The release closure also preserves intent across adjacent surfaces: static
513
- Skill instructions load in Edit/Plan without granting later side effects,
514
- dynamic Skill commands require an explicit host-controlled executor, root AMA
515
- uses the governed `memory_intent` lifecycle (including explicit intent captured
516
- before a later cancellation), Workflow Actor waits remain
517
- unbounded unless the workflow sets a deadline, and Runtime Auto capability v4
518
- advertises `fallbackPersistsEngine:false` across embedded, Worker, and daemon
519
- hosts. Actor ownership additionally uses Runtime identity rather than PID alone,
520
- so PID reuse cannot pin a crashed owner. The resume Session picker also renders
521
- timestamps in the host's local timezone.
522
-
523
- The v0.7.77 release also adds an opt-in, host-configurable Shell Execution Contract.
524
- Runtime Session settings or an individual Run can select `pwsh`, Windows
525
- PowerShell, `cmd`, `bash`, `zsh`, or an explicit Git Bash executable; KodaX
526
- resolves the shell environment in the effective project cwd and then executes
527
- the command through that same interpreter. Resolved environments are isolated
528
- by contract and cwd, expire after a bounded TTL, and can be explicitly
529
- refreshed. Provider credentials and execution-control variables are removed
530
- before profile/setup code and again before the command starts. When
531
- `shellExecution` is absent, established command behavior is unchanged. See
532
- [SDK Embedder Guide section 28](docs/SDK_EMBEDDER_GUIDE.md#28-host-configurable-shell-execution-contract-v0777)
533
- and the [Issue 214 regression guide](docs/test-guides/ISSUE_214_v0.7.77_REGRESSION_GUIDE.md).
534
-
535
- Kimi Code requests also receive a stable, opaque prompt-cache affinity key
536
- derived from the logical Runtime context. It is reused across Runs, retries,
537
- fallback, resume, and compaction; recursive child Agents receive distinct keys
538
- based on their canonical Agent path rather than their temporary transcript
539
- Session. Public Kimi and official OpenAI use the corresponding
540
- `prompt_cache_key` field, while other compatible gateways remain opt-in because
541
- some reject unknown request fields. This improves routing stability but cannot
542
- override Provider TTL or cache sharding. See the
543
- [Issue 215 regression guide](docs/test-guides/ISSUE_215_v0.7.77_REGRESSION_GUIDE.md).
544
- Codex CLI cache reads/writes and Gemini CLI cache reads now flow through the
545
- CLI bridge and Runtime diagnostics without estimation. A reported `0` remains
546
- distinct from an unreported field; see the
547
- [Issue 216 regression guide](docs/test-guides/ISSUE_216_v0.7.77_REGRESSION_GUIDE.md).
548
- The bridge also starts the first native CLI turn fresh, resumes only a native
549
- session ID reported by that CLI, creates fresh ACP sessions for stateless
550
- calls, recreates a closed pseudo transport, and validates the process exit even
551
- after a terminal CLI event. User cancellation stays quiet, while hard/idle
552
- timeout aborts remain failures eligible for Runtime recovery, and a CLI that
553
- reports success but never exits is terminated at its configured deadline; see the
554
- [Issue 217 regression guide](docs/test-guides/ISSUE_217_v0.7.77_REGRESSION_GUIDE.md).
555
-
556
- One daemon owns many sessions. Different sessions may run concurrently; starts
557
- within the same session are queued so that only one run is active for that
558
- session. Multiple `kodax` processes can attach to the same daemon and open or
503
+ **v0.7.76 Kimi Code catalog refresh:** `kimi-code` now defaults to the official
504
+ `k3-256k` Model ID and sends it unchanged. `kimi-for-coding` remains selectable
505
+ for K2.7 Code, alongside `kimi-for-coding-highspeed` and the 1M `k3` tier. K3
506
+ supports `low` / `high` / `max` reasoning with `high` as default; the 256K
507
+ route supports image input but not video input.
508
+
509
+ **v0.7.77 release:** AMA now chooses and composes six named
510
+ problem-solving patterns through the existing Actor control plane instead of
511
+ using a fixed topology or hidden Workflow. Optional strategy metadata becomes
512
+ a bounded, fact-only `PatternTrace`; the existing Sidecar remains the only
513
+ terminal-answer quality judge. Governed memory can also react sparsely after a
514
+ tool failure, verification failure, or committed compaction and place at most
515
+ three prompt-safe, low-authority evidence items before the next Action-LLM
516
+ request. The default path adds no selector model call; SDK hosts may opt into
517
+ `memoryRecallRunner` in process. Public `kimi` also gains the 1M `kimi-k3`
518
+ route while retaining K2.7 Code as its default. See the
519
+ [v0.7.77 design](docs/features/v0.7.77.md) and
520
+ [release checklist](docs/release.md#v0777-release-ready-candidate-verification).
521
+ The frozen F274/F275 paid evaluation completed with `recommend-ship` from the
522
+ final F274 Layer 2/Layer 3 reviews and the F275 pilot review, followed by a
523
+ joint `SHIP` decision for the deterministic contracts. Semantic memory
524
+ selection remains experimental and host opt-in; no task-quality, token, or
525
+ latency improvement is claimed.
526
+
527
+ **v0.7.78 evidence-gated learning, setup, and permission/sandbox release:**
528
+ Background learning is Memory-first. Only repeated independently verified
529
+ evidence, or an explicit preserve-as-Skill request with verified terminal
530
+ evidence, can admit a low-risk declarative Skill to a bounded immutable
531
+ project canary; three exact-revision uses and independently verified success
532
+ are required before automatic project trust. Every revision remains visible
533
+ and reversible in `/learn`. Protected/formal Skills, global promotion, and
534
+ Extension authoring remain explicit user actions.
535
+
536
+ First-run setup now creates and validates the split core/MCP/Extensions/A2A
537
+ files and annotated templates without overwriting existing configuration or
538
+ collecting secrets. Auto[LLM] admits precisely modeled ordinary reads and
539
+ workspace/temp mutations before classifier latency, retries classifier
540
+ infrastructure failure once, then falls back at the Accept-edits boundary
541
+ without switching to rules. ASRT is optional execution containment rather
542
+ than permission authority; `/sandbox` is the explicit diagnostic surface, and
543
+ SDK hosts can use the standalone `/sandbox` subpath without a silent
544
+ unsandboxed fallback. KodaX's workspace containment denies reads from common
545
+ home credential paths and the complete resolved agent home without turning
546
+ ordinary external reads into an allowlist. See the
547
+ [v0.7.78 design](docs/features/v0.7.78.md), the
548
+ [release checklist](docs/release.md#v0778-release-verification), and
549
+ [SDK guide sections 29–30](docs/SDK_EMBEDDER_GUIDE.md#29-evidence-gated-background-skill-learning-feature_263-v0778).
550
+
551
+ The release closure also preserves intent across adjacent surfaces: static
552
+ Skill instructions load in Edit/Plan without granting later side effects,
553
+ dynamic Skill commands require an explicit host-controlled executor, root AMA
554
+ uses the governed `memory_intent` lifecycle (including explicit intent captured
555
+ before a later cancellation), Workflow Actor waits remain
556
+ unbounded unless the workflow sets a deadline, and Runtime Auto capability v4
557
+ advertises `fallbackPersistsEngine:false` across embedded, Worker, and daemon
558
+ hosts. Actor ownership additionally uses Runtime identity rather than PID alone,
559
+ so PID reuse cannot pin a crashed owner. The resume Session picker also renders
560
+ timestamps in the host's local timezone.
561
+
562
+ **v0.7.79 release-preparation candidate:** Configured outbound A2A Agents can persist two
563
+ independent, default-deny network permissions: private-address access and
564
+ non-loopback plaintext HTTP. The embedded Worker and shared daemon reconcile
565
+ and execute the same authorized configuration. Runtime embedders also gain one
566
+ authoritative Session status, bounded read-only diagnostics, byte-preserving
567
+ Session export, strict transcript observation, a provenance-checked ordinary
568
+ conversation projection, and bounded streaming-event coalescing with
569
+ capability-gated idle daemon upgrade. Standalone child-process, Session lineage,
570
+ shell cleanup, packaged sidecar, and parallel admission paths receive the
571
+ corresponding release hardening.
572
+
573
+ OpenAI-compatible custom providers can now choose `max_tokens` or
574
+ `max_completion_tokens` per provider or model. DeepSeek V4 Flash and Pro use
575
+ separate reasoning profiles and are advertised as text-only. See the
576
+ [v0.7.79 design](docs/features/v0.7.79.md) and
577
+ [release preparation checklist](docs/release.md#v0779-release-preparation).
578
+ FEATURE_280 was explicitly rescheduled to v0.7.81 and is not represented as
579
+ shipped by this candidate.
580
+ Issue 256 was explicitly rescheduled to v0.7.84 and is likewise not represented
581
+ as shipped by this candidate.
582
+
583
+ The v0.7.77 release also adds an opt-in, host-configurable Shell Execution Contract.
584
+ Runtime Session settings or an individual Run can select `pwsh`, Windows
585
+ PowerShell, `cmd`, `bash`, `zsh`, or an explicit Git Bash executable; KodaX
586
+ resolves the shell environment in the effective project cwd and then executes
587
+ the command through that same interpreter. Resolved environments are isolated
588
+ by contract and cwd, expire after a bounded TTL, and can be explicitly
589
+ refreshed. Provider credentials and execution-control variables are removed
590
+ before profile/setup code and again before the command starts. Credential-shaped
591
+ variables are also filtered on the legacy platform-shell path; explicit names
592
+ in user-level `sandbox.envPass` are restored only for the final command target.
593
+ When `shellExecution` is absent, the established interpreter path is unchanged. See
594
+ [SDK Embedder Guide section 28](docs/SDK_EMBEDDER_GUIDE.md#28-host-configurable-shell-execution-contract-v0777)
595
+ and the [Issue 214 regression guide](docs/test-guides/ISSUE_214_v0.7.77_REGRESSION_GUIDE.md).
596
+
597
+ Kimi Code requests also receive a stable, opaque prompt-cache affinity key
598
+ derived from the logical Runtime context. It is reused across Runs, retries,
599
+ fallback, resume, and compaction; recursive child Agents receive distinct keys
600
+ based on their canonical Agent path rather than their temporary transcript
601
+ Session. Public Kimi and official OpenAI use the corresponding
602
+ `prompt_cache_key` field, while other compatible gateways remain opt-in because
603
+ some reject unknown request fields. This improves routing stability but cannot
604
+ override Provider TTL or cache sharding. See the
605
+ [Issue 215 regression guide](docs/test-guides/ISSUE_215_v0.7.77_REGRESSION_GUIDE.md).
606
+ Codex CLI cache reads/writes and Gemini CLI cache reads now flow through the
607
+ CLI bridge and Runtime diagnostics without estimation. A reported `0` remains
608
+ distinct from an unreported field; see the
609
+ [Issue 216 regression guide](docs/test-guides/ISSUE_216_v0.7.77_REGRESSION_GUIDE.md).
610
+ The bridge also starts the first native CLI turn fresh, resumes only a native
611
+ session ID reported by that CLI, creates fresh ACP sessions for stateless
612
+ calls, recreates a closed pseudo transport, and validates the process exit even
613
+ after a terminal CLI event. User cancellation stays quiet, while hard/idle
614
+ timeout aborts remain failures eligible for Runtime recovery, and a CLI that
615
+ reports success but never exits is terminated at its configured deadline; see the
616
+ [Issue 217 regression guide](docs/test-guides/ISSUE_217_v0.7.77_REGRESSION_GUIDE.md).
617
+
618
+ One daemon owns many sessions. Different sessions may run concurrently; starts
619
+ within the same session are queued so that only one run is active for that
620
+ session. Multiple `kodax` processes can attach to the same daemon and open or
559
621
  observe the same session. FEATURE_269 adds atomic snapshot-plus-stream joining,
560
622
  durable idempotent mutations, revision-safe settings and grants, transport-safe
561
623
  AskUser/permission responses, run-scoped credential and Host Tool bridges, and
@@ -577,14 +639,14 @@ The Space/IDE shared-daemon contract is documented in
577
639
  [SDK Embedder Guide section 23](docs/SDK_EMBEDDER_GUIDE.md#23-shared-coder-daemon-for-space-and-ide-hosts-feature_269-v0769).
578
640
 
579
641
  **v0.7.72–v0.7.73 Runtime permission contract:** Auto Mode is owned by the Runtime session,
580
- not by a UI hook. It reuses its LLM/rules guardrail across turns, classifies
581
- before the shared permission bridge, and persists explicit engine selection.
582
- The same session settings can select a classifier model and bounded
583
- timeout; `auto` defaults to LLM classification and fails with a recoverable
584
- configuration error when no effective classifier model exists, rather than
585
- silently falling back. In v0.7.78, classifier failures retry once and then use
586
- the Accept-edits safety boundary; they never change the engine to rules.
587
- Runtime permission prompts offer opaque, exact
642
+ not by a UI hook. It reuses its LLM/rules guardrail across turns, classifies
643
+ before the shared permission bridge, and persists explicit engine selection.
644
+ The same session settings can select a classifier model and bounded
645
+ timeout; `auto` defaults to LLM classification and fails with a recoverable
646
+ configuration error when no effective classifier model exists, rather than
647
+ silently falling back. In v0.7.78, classifier failures retry once and then use
648
+ the Accept-edits safety boundary; they never change the engine to rules.
649
+ Runtime permission prompts offer opaque, exact
588
650
  allow-once/session/persistent grant suggestions; persistent grants are
589
651
  daemon-owned and revisioned. Host plan exit is exposed only when the host
590
652
  supplies an approval callback. See the [Runtime Auto Mode integration guide](docs/SDK_EMBEDDER_GUIDE.md#24-runtime-owned-auto-mode-and-plan-approval-bridges-v0772v0773).
@@ -602,7 +664,7 @@ kodax --repo-intelligence full --repo-intelligence-trace
602
664
 
603
665
  ## Architecture
604
666
 
605
- 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 12 SDK subpath exports (`/agent`, `/llm`, `/coding`, `/media`, `/repl`, `/skills`, `/mcp`, `/session`, `/runtime`, `/sandbox`, `/a2a`, `/experimental-memory`; ADR-024 + ADR-032 + ADR-038, with ADR-036 consolidation):
667
+ 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 12 SDK subpath exports (`/agent`, `/llm`, `/coding`, `/media`, `/repl`, `/skills`, `/mcp`, `/session`, `/runtime`, `/sandbox`, `/a2a`, `/experimental-memory`; ADR-024 + ADR-032 + ADR-038, with ADR-036 consolidation):
606
668
 
607
669
  ```
608
670
  KodaX/
@@ -628,9 +690,9 @@ KodaX/
628
690
 
629
691
  ├── src/ # CLI entry + SDK subpath entries
630
692
  │ ├── kodax_cli.ts # Main CLI entry point (bin: `kodax`)
631
- │ └── sdk-*.ts # SDK subpath re-exports → @kodax-ai/kodax/{agent,llm,coding,media,repl,skills,mcp,session,runtime,sandbox,a2a,experimental-memory}
632
-
633
- └── package.json # Publish-shaped exports; release.mjs only toggles private during pack/publish
693
+ │ └── sdk-*.ts # SDK subpath re-exports → @kodax-ai/kodax/{agent,llm,coding,media,repl,skills,mcp,session,runtime,sandbox,a2a,experimental-memory}
694
+
695
+ └── package.json # Publish-shaped exports; release.mjs only toggles private during pack/publish
634
696
  ```
635
697
 
636
698
  ### Package Dependencies
@@ -677,9 +739,9 @@ Source-side workspace package names (`@kodax-ai/*`). npm consumers install the s
677
739
  KodaX has two layers that consumers should understand separately:
678
740
 
679
741
  - **Source-side**: 4 workspace packages above (what developers see when reading the repo).
680
- - **npm-published**: a single bundled package `@kodax-ai/kodax` with 12 SDK subpaths (what SDK consumers `import` from). The subpaths are split into two roles:
742
+ - **npm-published**: a single bundled package `@kodax-ai/kodax` with 12 SDK subpaths (what SDK consumers `import` from). The subpaths are split into two roles:
681
743
  - **Full-package subpaths** (`/agent`, `/llm`, `/coding`, `/repl`) — each one maps 1:1 to a source workspace and exposes its complete public API.
682
- - **Integration and narrow subpaths** (`/media`, `/skills`, `/mcp`, `/session`, `/runtime`, `/sandbox`, `/a2a`, `/experimental-memory`) — focused host surfaces. `/a2a` composes the neutral F258 plane with the Runtime facade; it does not add A2A wire types to `/agent`.
744
+ - **Integration and narrow subpaths** (`/media`, `/skills`, `/mcp`, `/session`, `/runtime`, `/sandbox`, `/a2a`, `/experimental-memory`) — focused host surfaces. `/a2a` composes the neutral F258 plane with the Runtime facade; it does not add A2A wire types to `/agent`.
683
745
 
684
746
  | Source package | npm subpath | Type | What you get | Example consumer |
685
747
  |---|---|---|---|---|
@@ -691,10 +753,10 @@ KodaX has two layers that consumers should understand separately:
691
753
  | `packages/agent` | `@kodax-ai/kodax/experimental-memory` | **Experimental subset** | Thin F228-backed `MemoryAgent` / `MemorySession` contracts for scoped recall, deliberate query, observations, and outcomes | SDK hosts explicitly evaluating FEATURE_260 |
692
754
  | `packages/coding` | `@kodax-ai/kodax/coding` | Full package | Coding agent + 50+ tools + repo-intelligence (505 exports) | Build a Claude Code-shape product |
693
755
  | `packages/repl` | `@kodax-ai/kodax/repl` | Full package | Ink TUI + permission modes + commands (217 exports) | Terminal-UI consumers |
694
- | `packages/repl` | `@kodax-ai/kodax/session` | **Narrow subset** | Session management only — `listSessions` / `loadFullTranscript` / `appendClientNotice` / `forkSession` / `compactSession` / `watchSessions` / ... (17 exports) | IDE plugins and desktop hosts reading session history |
695
- | `src` | `@kodax-ai/kodax/runtime` | Host API | Embedded/Worker/daemon runtime facade, sessions/runs/events/permissions/catalog/MCP/artifacts/diagnostics/external agents, daemon protocol schema (10 exports) | SDK hosts, Space/IDE clients, daemon clients |
696
- | `src` | `@kodax-ai/kodax/sandbox` | Host API | Explicit ASRT capability/doctor/setup and host-owned contained command execution; unavailability never means silent ordinary execution | SDK hosts that need standalone process containment |
697
- | `src` | `@kodax-ai/kodax/a2a` | Integration edge | A2A 1.0 Agent Card discovery, JSON-RPC/SSE F258 executor, safe fetch policy, and authenticated Runtime-backed Agent server | Agent orchestrators and KodaX hosts |
756
+ | `packages/repl` | `@kodax-ai/kodax/session` | **Narrow subset** | Session management only — `listSessions` / `loadFullTranscript` / `appendClientNotice` / `forkSession` / `compactSession` / `watchSessions` / ... (17 exports) | IDE plugins and desktop hosts reading session history |
757
+ | `src` | `@kodax-ai/kodax/runtime` | Host API | Embedded/Worker/daemon runtime facade, sessions/runs/events/permissions/catalog/MCP/artifacts/diagnostics/external agents, daemon protocol schema (10 exports) | SDK hosts, Space/IDE clients, daemon clients |
758
+ | `src` | `@kodax-ai/kodax/sandbox` | Host API | Explicit ASRT capability/doctor/setup and host-owned contained command execution; unavailability never means silent ordinary execution | SDK hosts that need standalone process containment |
759
+ | `src` | `@kodax-ai/kodax/a2a` | Integration edge | A2A 1.0 Agent Card discovery, JSON-RPC/SSE F258 executor, safe fetch policy, and authenticated Runtime-backed Agent server | Agent orchestrators and KodaX hosts |
698
760
 
699
761
  **Rule of thumb**: if you need Runner / Agent / fan-out, import from `/agent`. If you only need skills or mcp APIs, import from `/skills` or `/mcp` to get a smaller bundle. The narrow subsets are subsets of the full packages — they do **not** expose extra symbols.
700
762
 
@@ -726,7 +788,7 @@ KodaX has two layers that consumers should understand separately:
726
788
 
727
789
  **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).
728
790
 
729
- **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 and will not return a port blocked by Fetch-compatible clients; 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).
791
+ **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 and will not return a port blocked by Fetch-compatible clients; 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).
730
792
 
731
793
  **A2A interoperability and authentication hardening** keeps a discovered
732
794
  interface on the trusted Agent Card origin and sends credentials only when one
@@ -764,6 +826,10 @@ kodax a2a add research https://agent.example/.well-known/agent-card.json --effec
764
826
  kodax a2a test research
765
827
  kodax a2a call research "Summarize this topic"
766
828
 
829
+ # Explicitly authorize a private plaintext endpoint (prefer HTTPS when available)
830
+ kodax a2a add intranet http://10.20.30.40/.well-known/agent-card.json \
831
+ --allow-private --allow-insecure-http --effect read
832
+
767
833
  # Stage an OAuth-protected Agent, then hot-activate/deactivate it
768
834
  export RESEARCH_A2A_CLIENT_SECRET='provisioned-by-your-authorization-server'
769
835
  # PowerShell: $env:RESEARCH_A2A_CLIENT_SECRET='provisioned-by-your-authorization-server'
@@ -785,9 +851,9 @@ kodax a2a expose # or: kodax a2a expose document-agent
785
851
  kodax a2a serve # loopback http://127.0.0.1:8765
786
852
  ```
787
853
 
788
- MCP, A2A, and Extension declarations live in one user file per domain under
789
- `~/.kodax/integrations/`. Use `kodax config paths`,
790
- `kodax config template <core|mcp|a2a|extensions>`,
854
+ MCP, A2A, and Extension declarations live in one user file per domain under
855
+ `~/.kodax/integrations/`. Use `kodax config paths`,
856
+ `kodax config template <core|mcp|a2a|extensions>`,
791
857
  `kodax integrations migrate --apply`, and the `kodax mcp`, `kodax a2a`, or
792
858
  `kodax extensions` commands to manage them. Migration imports only legacy
793
859
  `config.json#mcpServers` and `config.json#extensions`; A2A has no legacy source.
@@ -807,7 +873,12 @@ the Card by default unless `--no-test` is supplied, while `a2a test` performs
807
873
  discovery/security planning without requesting an OAuth token. The fixed
808
874
  `KODAX_A2A_TOKEN` example is an operator-provisioned compatibility credential;
809
875
  KodaX does not generate or issue it. Disabled entries remain available for
810
- later re-enable. `a2a serve` loads
876
+ later re-enable. Private-address access and non-loopback plaintext HTTP are
877
+ independent, persisted, default-deny permissions (`--allow-private` and
878
+ `--allow-insecure-http`); exact loopback HTTP remains available without either.
879
+ OAuth token endpoints retain their stricter HTTPS-or-exact-loopback rule.
880
+ Worker-hosted SDK Runtimes can load this same configured plane inside the Worker
881
+ owner with `worker: { configuredA2A: true }`. `a2a serve` loads
811
882
  its configured MCP/Extension capability surface before listening and pins that
812
883
  execution authority; it hot-reloads publication, authentication, and limits.
813
884
 
@@ -938,14 +1009,14 @@ import { createImageArtifactFromPath } from '@kodax-ai/kodax/media'; // input ar
938
1009
  import { SkillRegistry } from '@kodax-ai/kodax/skills'; // zero-dep skill loader
939
1010
  import { loadConfig } from '@kodax-ai/kodax/repl'; // REPL config / session helpers
940
1011
  import { createMcpManager } from '@kodax-ai/kodax/mcp'; // MCP popout manager (v0.7.42)
941
- import { listSessions } from '@kodax-ai/kodax/session'; // session history helpers
942
- import { createKodaXRuntime } from '@kodax-ai/kodax/runtime'; // embedded/daemon runtime API
943
- import { runKodaXSandboxed } from '@kodax-ai/kodax/sandbox'; // standalone ASRT containment
944
- import { createKodaXA2AServer } from '@kodax-ai/kodax/a2a'; // A2A 1.0 client/server edge
945
- import { createMemoryAgent } from '@kodax-ai/kodax/experimental-memory'; // opt-in memory SDK
946
- ```
947
-
948
- All 13 SDK entries (root + 12 subpaths) share internal code via ESM chunk splitting — importing from `/agent` does not pull in `/repl`'s Ink + React surface.
1012
+ import { listSessions } from '@kodax-ai/kodax/session'; // session history helpers
1013
+ import { createKodaXRuntime } from '@kodax-ai/kodax/runtime'; // embedded/daemon runtime API
1014
+ import { runKodaXSandboxed } from '@kodax-ai/kodax/sandbox'; // standalone ASRT containment
1015
+ import { createKodaXA2AServer } from '@kodax-ai/kodax/a2a'; // A2A 1.0 client/server edge
1016
+ import { createMemoryAgent } from '@kodax-ai/kodax/experimental-memory'; // opt-in memory SDK
1017
+ ```
1018
+
1019
+ All 13 SDK entries (root + 12 subpaths) share internal code via ESM chunk splitting — importing from `/agent` does not pull in `/repl`'s Ink + React surface.
949
1020
 
950
1021
  For the complete host-facing contract — including embedded/Worker/daemon ownership,
951
1022
  external-agent registration and task control, session cursor pagination, workflow
@@ -1096,19 +1167,19 @@ KodaX provides 3 permission modes for fine-grained control:
1096
1167
  **Features:**
1097
1168
  - In `accept-edits` mode, choosing "always" can persist safe Bash allow-patterns
1098
1169
  - Plan mode includes system prompt context for LLM awareness
1099
- - Sensitive/protected or unresolved targets enter Auto[LLM]/approval review;
1100
- ordinary reads outside the project are allowed
1170
+ - Sensitive/protected or unresolved targets enter Auto[LLM]/approval review;
1171
+ ordinary reads outside the project are allowed
1101
1172
  - Pattern-based permission: Allow specific Bash commands (e.g., `Bash(npm install)`)
1102
1173
  - Unified diff display for write/edit operations
1103
- - Auto Mode first admits exactly modeled safe reads and workspace/temp
1104
- mutations without classifier latency. Remaining actions are reviewed against
1105
- bounded user intent and exact operation facts; a safe verdict creates no
1106
- pending approval request. Classifier failures retry once, then use the
1107
- Accept-edits safety boundary rather than silently switching to Auto[rules].
1174
+ - Auto Mode first admits exactly modeled safe reads and workspace/temp
1175
+ mutations without classifier latency. Remaining actions are reviewed against
1176
+ bounded user intent and exact operation facts; a safe verdict creates no
1177
+ pending approval request. Classifier failures retry once, then use the
1178
+ Accept-edits safety boundary rather than silently switching to Auto[rules].
1108
1179
  - Shift-Tab cycles `Plan -> Edits -> Auto`; Shift+Enter inserts a newline. Auto
1109
1180
  immediately displays `Auto[LLM]` or `Auto[RULES]`, and rapid mode changes are
1110
- persisted in input order. `Auto[RULES]` remains an explicit/manual engine;
1111
- use `/auto-engine llm` to select LLM classification.
1181
+ persisted in input order. `Auto[RULES]` remains an explicit/manual engine;
1182
+ use `/auto-engine llm` to select LLM classification.
1112
1183
  - Runtime-backed prompts can offer exact `allow once`, `allow this session`,
1113
1184
  and `always allow` choices. Return the Runtime-issued opaque suggestion;
1114
1185
  never derive or widen a permission rule from the displayed command or path.
@@ -1275,7 +1346,7 @@ await runKodaX({
1275
1346
 
1276
1347
  ## SDK Usage
1277
1348
 
1278
- KodaX ships as a single npm package `@kodax-ai/kodax` with 12 SDK subpath exports (ADR-024 v0.7.39 + ADR-032 v0.7.42 + ADR-038 v0.7.49 + v0.7.56 `/media` + v0.7.64 `/runtime` + v0.7.68 `/experimental-memory` + v0.7.69 `/a2a` + v0.7.78 `/sandbox`). Each subpath is tree-shake-friendly so consumers pull only what they need:
1349
+ KodaX ships as a single npm package `@kodax-ai/kodax` with 12 SDK subpath exports (ADR-024 v0.7.39 + ADR-032 v0.7.42 + ADR-038 v0.7.49 + v0.7.56 `/media` + v0.7.64 `/runtime` + v0.7.68 `/experimental-memory` + v0.7.69 `/a2a` + v0.7.78 `/sandbox`). Each subpath is tree-shake-friendly so consumers pull only what they need:
1279
1350
 
1280
1351
  ```bash
1281
1352
  npm install @kodax-ai/kodax
@@ -1289,11 +1360,11 @@ import { KODAX_TOOLS } from '@kodax-ai/kodax/coding'; // tools + pro
1289
1360
  import { createImageArtifactFromPath } from '@kodax-ai/kodax/media'; // input artifact helpers
1290
1361
  import { runInkInteractiveMode } from '@kodax-ai/kodax/repl'; // Ink TUI entrypoint
1291
1362
  import { SkillRegistry } from '@kodax-ai/kodax/skills'; // zero-dep skill loader
1292
- import { createMcpManager } from '@kodax-ai/kodax/mcp'; // MCP popout manager (v0.7.42)
1293
- import { listSessions } from '@kodax-ai/kodax/session'; // session history helpers
1294
- import { createKodaXRuntime } from '@kodax-ai/kodax/runtime'; // embedded/daemon runtime API
1295
- import { runKodaXSandboxed } from '@kodax-ai/kodax/sandbox'; // explicit standalone containment
1296
- import { createKodaXA2AServer } from '@kodax-ai/kodax/a2a'; // A2A 1.0 client/server edge
1363
+ import { createMcpManager } from '@kodax-ai/kodax/mcp'; // MCP popout manager (v0.7.42)
1364
+ import { listSessions } from '@kodax-ai/kodax/session'; // session history helpers
1365
+ import { createKodaXRuntime } from '@kodax-ai/kodax/runtime'; // embedded/daemon runtime API
1366
+ import { runKodaXSandboxed } from '@kodax-ai/kodax/sandbox'; // explicit standalone containment
1367
+ import { createKodaXA2AServer } from '@kodax-ai/kodax/a2a'; // A2A 1.0 client/server edge
1297
1368
  import { createMemoryAgent } from '@kodax-ai/kodax/experimental-memory'; // opt-in experimental memory SDK
1298
1369
  ```
1299
1370
 
@@ -1459,7 +1530,7 @@ await runInkInteractiveMode({ provider: 'zhipu-coding', effort: 'auto' });
1459
1530
  | kimi | `KIMI_API_KEY` | Native | kimi-k2.7-code (262,144-token context; `kimi-k3` 1M / `kimi-k2.7-code-highspeed` / `kimi-k2.6` / `kimi-k2.5` via `/model`) |
1460
1531
  | kimi-code | `KIMI_CODE_API_KEY` | Native | k3-256k (Moderato+, 256K, direct upstream ID; `k3` 1M / `kimi-for-coding` K2.7 Code / `kimi-for-coding-highspeed` via `/model`) |
1461
1532
  | qwen | `QWEN_API_KEY` | Native | qwen3.5-plus |
1462
- | qwen-token-plan | `QWEN_TOKEN_API_KEY` | Native | qwen3.8-max-preview (Anthropic-compat; `qwen3.7-max` / `qwen3.7-plus` / `qwen3.6-flash` / `glm-5.2` / `deepseek-v4-pro` via `/model`; all 1M context; image input on Qwen 3.8 / 3.7 Plus / 3.6 Flash) |
1533
+ | qwen-token-plan | `QWEN_TOKEN_API_KEY` | Native | qwen3.8-max (Anthropic-compat; legacy `qwen3.8-max-preview` plus `qwen3.7-max` / `qwen3.7-plus` / `qwen3.6-flash` / `glm-5.2` / `deepseek-v4-pro` via `/model`; all 1M context; image input on both Qwen 3.8 IDs / 3.7 Plus / 3.6 Flash) |
1463
1534
  | zhipu | `ZHIPU_API_KEY` | Native | glm-5 (`glm-5.2` 1M ctx / `glm-5.1` / `glm-5-turbo` via `/model`) |
1464
1535
  | zhipu-coding | `ZHIPU_CODING_API_KEY` | Native | glm-5.2 (1M ctx; legacy `glm-5.1` and `glm-5-turbo` remain selectable via `/model`) |
1465
1536
  | 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) |
@@ -1468,8 +1539,8 @@ await runInkInteractiveMode({ provider: 'zhipu-coding', effort: 'auto' });
1468
1539
  | mimo-coding | `MIMO_CODING_API_KEY` | Native | mimo-v2.5-pro (Xiaomi Token Plan, Anthropic-compat) |
1469
1540
  | ark-coding | `ARK_CODING_API_KEY` | Native | glm-5.2 (Volcengine Ark Coding Plan — GLM-5.2 (alias: `glm-latest`) · Kimi K2.7 Code / K2.6 · MiniMax M3 / M2.7 · DeepSeek V4 Pro / V4 Flash · Doubao Seed 2.0 Code / Pro / Lite · Doubao Seed Code) |
1470
1541
  | deepseek | `DEEPSEEK_API_KEY` | Native | deepseek-v4-flash (`deepseek-v4-pro` via `/model`) |
1471
- | gemini-cli | Provider CLI authentication (no KodaX API-key variable) | Prompt-only / CLI bridge | (via gemini CLI) |
1472
- | codex-cli | Provider CLI authentication (no KodaX API-key variable) | Prompt-only / CLI bridge | (via codex CLI) |
1542
+ | gemini-cli | Provider CLI authentication (no KodaX API-key variable) | Prompt-only / CLI bridge | (via gemini CLI) |
1543
+ | codex-cli | Provider CLI authentication (no KodaX API-key variable) | Prompt-only / CLI bridge | (via codex CLI) |
1473
1544
 
1474
1545
  > **Custom providers**: any OpenAI- or Anthropic-compatible endpoint can be added via `customProviders[]` in `~/.kodax/config.json` (CLI) or `registerCustomProviders()` (library). See the [Quick Start](#2-configure-a-provider) for the configuration shape.
1475
1546
 
@@ -1583,45 +1654,45 @@ Built-in skills include:
1583
1654
  - **tdd** - Test-driven development workflow
1584
1655
  - **git-workflow** - Git commit and workflow automation
1585
1656
 
1586
- Skills are stored in `~/.kodax/skills/` and can be extended with custom skills.
1587
- F263 background learning is Memory-first: a single correction does not create
1588
- a Skill. Repeated independently verified evidence can create a low-risk,
1589
- immutable project-scoped testing revision for at most three exact-revision
1590
- uses. Promotion requires independently verified success. Use `/learn` to
1591
- inspect, disable, rollback, trust, or reject learned revisions. Protected or
1592
- formal Skills, user-global promotion, and Extension authoring remain explicit
1593
- user actions.
1594
-
1595
- ### Promote a learned Skill to the user catalog
1596
-
1597
- Automatic canary activation and user-catalog promotion are different:
1598
-
1599
- - independently verified canary success changes `testing` to
1600
- `active_learned` inside the project-scoped Learned Area;
1601
- - `/learn promote` is an explicit ownership transfer that copies one exact
1602
- reviewed `ready` or `active_learned` revision into the formal user Skill
1603
- catalog and changes its lifecycle to `promoted_user`.
1604
-
1605
- Inspect the revision first, then promote it by name, slug, or exact capability
1606
- ID:
1607
-
1608
- ```text
1609
- /learn show normalize-release-notes
1610
- /learn promote normalize-release-notes --scope user
1611
- ```
1612
-
1613
- `--scope user` is the only supported scope and may be omitted. Invalid scopes,
1614
- unknown options, duplicate scope options, and extra operands fail without
1615
- changing the catalog. Promotion writes to the configured KodaX user Skill
1616
- directory—normally `~/.kodax/skills/<slug>/SKILL.md`—and never overwrites
1617
- different formal Skill content.
1618
-
1619
- Use `/learn promote --help`, `/learn help promote`, or
1620
- `/help learn promote` for the dedicated command reference. In the Ink Learning
1621
- Center, open `/learn`, select an `active_learned` Skill, and choose
1622
- **Promote to user catalog**.
1623
-
1624
- ---
1657
+ Skills are stored in `~/.kodax/skills/` and can be extended with custom skills.
1658
+ F263 background learning is Memory-first: a single correction does not create
1659
+ a Skill. Repeated independently verified evidence can create a low-risk,
1660
+ immutable project-scoped testing revision for at most three exact-revision
1661
+ uses. Promotion requires independently verified success. Use `/learn` to
1662
+ inspect, disable, rollback, trust, or reject learned revisions. Protected or
1663
+ formal Skills, user-global promotion, and Extension authoring remain explicit
1664
+ user actions.
1665
+
1666
+ ### Promote a learned Skill to the user catalog
1667
+
1668
+ Automatic canary activation and user-catalog promotion are different:
1669
+
1670
+ - independently verified canary success changes `testing` to
1671
+ `active_learned` inside the project-scoped Learned Area;
1672
+ - `/learn promote` is an explicit ownership transfer that copies one exact
1673
+ reviewed `ready` or `active_learned` revision into the formal user Skill
1674
+ catalog and changes its lifecycle to `promoted_user`.
1675
+
1676
+ Inspect the revision first, then promote it by name, slug, or exact capability
1677
+ ID:
1678
+
1679
+ ```text
1680
+ /learn show normalize-release-notes
1681
+ /learn promote normalize-release-notes --scope user
1682
+ ```
1683
+
1684
+ `--scope user` is the only supported scope and may be omitted. Invalid scopes,
1685
+ unknown options, duplicate scope options, and extra operands fail without
1686
+ changing the catalog. Promotion writes to the configured KodaX user Skill
1687
+ directory—normally `~/.kodax/skills/<slug>/SKILL.md`—and never overwrites
1688
+ different formal Skill content.
1689
+
1690
+ Use `/learn promote --help`, `/learn help promote`, or
1691
+ `/help learn promote` for the dedicated command reference. In the Ink Learning
1692
+ Center, open `/learn`, select an `active_learned` Skill, and choose
1693
+ **Promote to user catalog**.
1694
+
1695
+ ---
1625
1696
 
1626
1697
  ## Commands (CLI)
1627
1698