@kodax-ai/kodax 0.7.68 → 0.7.69

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 (102) hide show
  1. package/CHANGELOG.md +137 -3
  2. package/README.md +56 -9
  3. package/README_CN.md +53 -8
  4. package/config-templates/config.example.jsonc +26 -0
  5. package/config-templates/integrations/a2a.example.jsonc +54 -0
  6. package/config-templates/integrations/extensions.example.jsonc +7 -0
  7. package/config-templates/integrations/mcp.example.jsonc +16 -0
  8. package/dist/chunks/agent-DQRXT6M7.js +2 -0
  9. package/dist/chunks/argument-completer-RSK6CCGP.js +2 -0
  10. package/dist/chunks/chunk-4WIODYOH.js +329 -0
  11. package/dist/chunks/chunk-AWMTNUDS.js +37 -0
  12. package/dist/chunks/chunk-F7C7J6IM.js +7 -0
  13. package/dist/chunks/{chunk-PEGSHZAA.js → chunk-I4TPQEJN.js} +1 -1
  14. package/dist/chunks/chunk-M7TCFYTO.js +107 -0
  15. package/dist/chunks/chunk-NGHQIGVW.js +46 -0
  16. package/dist/chunks/chunk-NGJURAY5.js +306 -0
  17. package/dist/chunks/{chunk-KGAI32VS.js → chunk-PA76WUBL.js} +2 -2
  18. package/dist/chunks/chunk-PQ3XUSY2.js +357 -0
  19. package/dist/chunks/chunk-UJEMSPM5.js +78 -0
  20. package/dist/chunks/{chunk-CC4BVVE7.js → chunk-URC6ZI6P.js} +1 -1
  21. package/dist/chunks/{chunk-CTHUX5ZH.js → chunk-VAZ25MDX.js} +122 -122
  22. package/dist/chunks/chunk-VYKFM3TB.js +751 -0
  23. package/dist/chunks/{chunk-TOGESFRN.js → chunk-WW2O2DEP.js} +1 -1
  24. package/dist/chunks/chunk-Y4WOTWUC.js +2 -0
  25. package/dist/chunks/chunk-Z4PPLJF2.js +60 -0
  26. package/dist/chunks/chunk-ZG4DMYBS.js +422 -0
  27. package/dist/chunks/compaction-config-ABLL6UH3.js +2 -0
  28. package/dist/chunks/{construction-bootstrap-PYWJHO35.js → construction-bootstrap-GH6RW6ST.js} +1 -1
  29. package/dist/chunks/dist-DRBKYVHF.js +2 -0
  30. package/dist/chunks/dist-RWL2RBO4.js +2 -0
  31. package/dist/chunks/host-7SAB4WEC.js +2 -0
  32. package/dist/chunks/run-manager-XMDKTONJ.js +2 -0
  33. package/dist/chunks/utils-QYE5Y73D.js +2 -0
  34. package/dist/index.d.ts +19 -19
  35. package/dist/index.js +6 -6
  36. package/dist/kodax_cli.js +1590 -1316
  37. package/dist/runtime-worker.js +1355 -1105
  38. package/dist/sdk-a2a.d.ts +397 -0
  39. package/dist/sdk-a2a.js +9 -0
  40. package/dist/sdk-agent.d.ts +61 -30
  41. package/dist/sdk-agent.js +1 -1
  42. package/dist/sdk-coding.d.ts +126 -51
  43. package/dist/sdk-coding.js +1 -1
  44. package/dist/sdk-experimental-memory.d.ts +1 -1
  45. package/dist/sdk-experimental-memory.js +1 -1
  46. package/dist/sdk-llm.d.ts +16 -9
  47. package/dist/sdk-llm.js +1 -1
  48. package/dist/sdk-mcp.d.ts +1 -1
  49. package/dist/sdk-mcp.js +1 -1
  50. package/dist/sdk-media.d.ts +1 -1
  51. package/dist/sdk-media.js +1 -1
  52. package/dist/sdk-repl.d.ts +35 -101
  53. package/dist/sdk-repl.js +2 -2
  54. package/dist/sdk-runtime.d.ts +744 -21
  55. package/dist/sdk-runtime.js +1 -1
  56. package/dist/sdk-session.d.ts +7 -7
  57. package/dist/sdk-session.js +1 -1
  58. package/dist/sdk-skills.js +1 -1
  59. package/dist/semantic-worker.js +100 -12
  60. package/dist/types-chunks/{base.d-C8mXDhLL.d.ts → base.d-CYjtB68X.d.ts} +1 -1
  61. package/dist/types-chunks/{bash-prefix-extractor.d-Dm-T865v.d.ts → bash-prefix-extractor.d-BkIA8Wto.d.ts} +68 -17
  62. package/dist/types-chunks/{capability-learning.d-BLEmCib0.d.ts → capability-learning.d-WtsyRv3O.d.ts} +1 -1
  63. package/dist/types-chunks/{capsule.d-CzaamUUv.d.ts → capsule.d-xJvfh4YR.d.ts} +3 -3
  64. package/dist/types-chunks/{commands.d-DxKjVSNU.d.ts → commands.d-DkPfcQWG.d.ts} +4 -4
  65. package/dist/types-chunks/{cost-tracker.d-CBLk1fiD.d.ts → cost-tracker.d-BeaenODW.d.ts} +4 -1
  66. package/dist/types-chunks/{guardrail.d-D7r6zVSR.d.ts → guardrail.d-6ZDbNbHO.d.ts} +1 -1
  67. package/dist/types-chunks/{guardrail.d-CPDfZyJp.d.ts → guardrail.d-R7AiGfrI.d.ts} +4 -4
  68. package/dist/types-chunks/integration-config.d-ojG4swOP.d.ts +95 -0
  69. package/dist/types-chunks/{manager.d-Zum9cGHU.d.ts → manager.d-CoEuPRAo.d.ts} +4 -1
  70. package/dist/types-chunks/{public-api.d-BcKbBy1E.d.ts → public-api.d-7G4--RZE.d.ts} +3 -3
  71. package/dist/types-chunks/{resolver.d-DmBnoilY.d.ts → resolver.d-CIVoGc97.d.ts} +2 -2
  72. package/dist/types-chunks/{run-manager.d-CSj7_kWk.d.ts → run-manager.d-BaXtkryp.d.ts} +1 -1
  73. package/dist/types-chunks/{sdk-session-C6nDgyh8.d.ts → sdk-session-BQccrODn.d.ts} +6 -4
  74. package/dist/types-chunks/{types.d-D2frCRaY.d.ts → types.d-BtC4yLYO.d.ts} +35 -8
  75. package/dist/types-chunks/{types.d-CzscbsG0.d.ts → types.d-C9YHEAmA.d.ts} +38 -7
  76. package/dist/types-chunks/{types.d-D9FKbAmf.d.ts → types.d-CJR7t6iW.d.ts} +2 -2
  77. package/dist/types-chunks/{types.d-CO_ZkmOd.d.ts → types.d-TTvpAGWf.d.ts} +5 -0
  78. package/dist/types-chunks/{utils.d-DOXxnOnI.d.ts → utils.d-BbB5jzi1.d.ts} +15 -7
  79. package/docs/SDK_EMBEDDER_GUIDE.md +627 -9
  80. package/package.json +10 -2
  81. package/dist/chunks/agent-DATNZOBK.js +0 -2
  82. package/dist/chunks/argument-completer-X7MMM7Y6.js +0 -2
  83. package/dist/chunks/chunk-5GL55MOH.js +0 -36
  84. package/dist/chunks/chunk-67XJ4YUA.js +0 -703
  85. package/dist/chunks/chunk-C4SBXBWH.js +0 -346
  86. package/dist/chunks/chunk-D6QVXQNI.js +0 -1
  87. package/dist/chunks/chunk-HFM2D5BP.js +0 -2
  88. package/dist/chunks/chunk-HLBHSA2B.js +0 -325
  89. package/dist/chunks/chunk-K2NCKRVY.js +0 -33
  90. package/dist/chunks/chunk-KIQRCGVR.js +0 -419
  91. package/dist/chunks/chunk-MP52BDK5.js +0 -15
  92. package/dist/chunks/chunk-O5OJQFPY.js +0 -307
  93. package/dist/chunks/chunk-OIELNE6Z.js +0 -56
  94. package/dist/chunks/chunk-PZTG2C33.js +0 -7
  95. package/dist/chunks/chunk-QJJKMNZF.js +0 -2
  96. package/dist/chunks/compaction-config-BXEDHIQP.js +0 -2
  97. package/dist/chunks/dist-76PJHNSG.js +0 -2
  98. package/dist/chunks/dist-HTDJRAD6.js +0 -2
  99. package/dist/chunks/host-UAXIDZ6V.js +0 -2
  100. package/dist/chunks/paste-C33GZQV5.js +0 -2
  101. package/dist/chunks/run-manager-UCXB4G22.js +0 -2
  102. package/dist/chunks/utils-S63V5UCM.js +0 -2
package/CHANGELOG.md CHANGED
@@ -6,6 +6,136 @@ All notable changes to this project will be documented in this file.
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.7.69] - Unreleased
10
+
11
+ > Scope note: this release delivers **FEATURE_267**, **FEATURE_268**, and
12
+ > **FEATURE_269** as one bounded interoperability/runtime release: bidirectional
13
+ > A2A 1.0, split hot-reloadable integration configuration, and one authoritative
14
+ > shared Coder daemon with secure host bridges. It does not expose the daemon
15
+ > remotely, migrate Partner from its private embedded Runtime, or publish
16
+ > credentials/Host Tools outside their bound run.
17
+
18
+ ### Added
19
+
20
+ - **Bidirectional A2A 1.0 interoperability (FEATURE_267).** Added the
21
+ `@kodax-ai/kodax/a2a` integration edge: allowlisted Agent Card discovery and
22
+ a JSON-RPC/SSE executor over the existing F258 plane, plus an authenticated,
23
+ caller-scoped, durable Runtime-backed KodaX Agent server with continuation,
24
+ cancellation, ordered replay/subscription, and restart reattachment.
25
+ - **No-code A2A product path and Runtime binding.** Added declarative
26
+ `a2a add/list/test/call/remove`, automatic `external:<name>` registration for
27
+ built-in Runtime owners, and explicit `a2a expose` / loopback-only `a2a
28
+ serve`. The inbound server can publish the Runtime default or one validated
29
+ user Markdown Agent with pinned Agent/Skill/tool/workspace revisions,
30
+ structured `toolPolicy`, `~/.agents/skills` discovery, and exact Skill-script
31
+ execution through the fail-closed ASRT adapter.
32
+ - **Split integration configuration and hot reload (FEATURE_268).** MCP, A2A,
33
+ and Extensions now use one user-level versioned file per domain, backed by
34
+ four canonical templates, explicit lossless migration, locked atomic writes,
35
+ last-known-good watchers with metadata fallback, whole-provider MCP draining,
36
+ entry-transactional Extension/outbound-A2A reconciliation, and explicit
37
+ restart-required handling for inbound execution/store authority changes.
38
+ - **A2A network and publication boundaries.** Outbound fetches enforce origin,
39
+ DNS/private-address, TLS, redirect, credential, timeout, content-type, and
40
+ size policy. The built-in server listener is loopback-only; public hosts use
41
+ `handle()` behind TLS. A2A 0.3, gRPC, HTTP+JSON, push notifications, automatic
42
+ public Agent exposure, and remote Runtime configuration are not advertised.
43
+ - **Authoritative shared Coder daemon (FEATURE_269).** Added atomic
44
+ `sessions.observe()` join/resync, durable operation identities and receipts,
45
+ stable same-session ordering, settings/grant CAS, transport-safe AskUser and
46
+ permission resolution, live run projection, structured restart outcomes, and
47
+ a truthful per-capability Coder compatibility matrix for CLI, Space, IDE, and
48
+ SDK clients.
49
+ - **Shared-daemon SDK completion.** Server-side Coder/Partner admission now
50
+ covers every session and run path; late-join snapshots include transcript
51
+ revision, managed tasks, queued continuation metadata, and reverse
52
+ requirements. The SDK adds prompt connection lifecycle signals, typed event
53
+ parsing with per-event degradation, daemon-safe run DTOs,
54
+ `agentMode`/`autoModeEngine` settings CAS, durable operation/Host Tool outcome
55
+ queries, and daemon stop/rollback preflight.
56
+ - **Secure host bridges and owner fencing.** Provider credentials are supplied
57
+ just in time through stable-client/run/provider-bound leases and never
58
+ persisted. A keychain-held stable client secret can reattach credential and
59
+ Host Tool handlers after Space reconnects; Host Tools remain immutable and
60
+ run-bound, with fsynced dispatch truth and explicit unknown outcomes rather
61
+ than blind replay. Daemon and inline Coder ownership share one revisioned
62
+ fence with sticky rollback, while Partner remains isolated.
63
+
64
+ ### Changed
65
+
66
+ - **Tool-result delivery now optimizes end-to-end context use.** Tool handlers
67
+ collect complete results and one aggregate next-request capacity owner keeps
68
+ every result inline when the batch fits. Default Bash processing no longer
69
+ applies command-specific lossy filters; its former 512 KiB capture limit is
70
+ now only a memory-to-disk spool threshold. Capacity is solved against the
71
+ final input (`Pmax`), so the 3% uncertainty margin grows with the admitted
72
+ batch instead of being frozen at the smaller pre-batch request.
73
+ - **History compaction is physical-capacity driven.** Default automatic
74
+ compaction waits until the final provider envelope (system prompt, actual
75
+ tools, messages/framing, output reserve, and safety margin) cannot fit.
76
+ Default microcompaction and destructive pre-summary/fallback pruning are off;
77
+ pressure uses semantic summary first and stops as soon as the next request
78
+ fits. Static early percentages remain explicit opt-ins, and manual
79
+ `/compact` remains an explicit force operation.
80
+ - **Self-knowledge follows the v0.7.69 capability surface.** `kodax_manual`
81
+ now documents the three split integration files and migration/hot-reload
82
+ behavior, the `/a2a` SDK subpath, atomic shared-daemon observation, durable
83
+ controls, run-scoped credentials/Host Tools, and daemon/inline ownership.
84
+
85
+ ### Fixed
86
+
87
+ - **Recoverable overflow and hidden output caps.** Overflow of the final
88
+ operational request budget saves the complete result and emits one explicit
89
+ incomplete marker. Long lines have exact continuation offsets, completed task
90
+ output is complete, and hidden caps were removed from grep, glob, code search,
91
+ and retrieval rendering.
92
+ - **Cache token accounting and history preservation.** Cache tokens are charged
93
+ once. Empty, failed, or insufficient summaries now surface a typed capacity
94
+ error while retaining the canonical transcript and immutable Worker prompt.
95
+ - **Tool-result completeness and retention edge cases.** No-usage accounting
96
+ includes the final system prompt, active schemas, and same-request recovery;
97
+ explicit limits use one-extra-item probes; delayed Bash drain remains
98
+ recoverable. Referenced result/image artifacts and fresh checkpoints are no
99
+ longer removed by age-only cleanup.
100
+ - **Post-review capacity correctness.** Trusted artifact metadata cannot be
101
+ forged by raw tool text; failures carry the last legal transcript; observers
102
+ see admitted content; child evidence uses the routed model's physical budget;
103
+ bounded acquisition exposes continuation instead of silent loss; direct Bash
104
+ artifacts remain canonical without nested spill markers.
105
+ - **Windows process-tree fallback.** A failed or timed-out `taskkill /t` now
106
+ triggers a native Toolhelp parent snapshot before direct escalation, with
107
+ CIM/WMIC retained only as fallback. Agent and LLM cleanup stay aligned and a
108
+ real nested-process regression proves descendants exit.
109
+ - **Windows lock deletion races.** Proposal and lifecycle lock probes treat
110
+ transient `EPERM`/`EACCES`/`EBUSY` as non-stale and retry, preserving the
111
+ fail-closed owner-token contract during concurrent removal.
112
+ - **Frozen FEATURE_259 eval inputs.** The pre-iteration dispatch schema is
113
+ reconstructed from its historical bytes, so later production tool-schema
114
+ improvements cannot mutate the baseline or invite a hash-only CI workaround.
115
+ - **Governed-memory Bash guard bypasses.** Commands that directly address
116
+ recognized scoped or legacy memory roots now permit only one simple read-only
117
+ inspection; command chaining, pipelines, redirects, home-relative paths, and
118
+ interpreter writes fail closed at the Bash tool boundary.
119
+ - **Memory proposal and review persistence integrity.** Invalid approval
120
+ metadata now produces a store warning and blocks rewrites; project-less review
121
+ drains no longer claim project-owned work; persisted outcome evidence receives
122
+ full shape validation; atomic writes clean temporary files on failure.
123
+ - **Memory store lock ownership.** Proposal and lifecycle locks now carry a PID
124
+ plus random owner token, avoid reclaiming stale locks held by a live process,
125
+ and remove a lock only when the releasing owner token still matches. Lifecycle
126
+ state writes now use temporary-file rename instead of direct truncating writes.
127
+ - **Interactive resume handoff and large-store startup.** Bare `kodax -r` now
128
+ keeps the selected session through the picker-to-TUI handoff instead of
129
+ exiting, and the picker uses bounded metadata paging instead of repeatedly
130
+ full-reading every matching session before it opens.
131
+ - **A2A/configuration release hardening.** Review gaps in remote execution,
132
+ Skill-script admission/isolation, hot reload, listener preparation, binding
133
+ pinning, last-known-good reconciliation, and redacted diagnostics now fail
134
+ closed or retain the prior healthy revision as specified. The public A2A
135
+ server type now exposes its existing readiness wait, validated DNS results
136
+ narrow explicitly to IPv4/IPv6, and safe request-body typing no longer
137
+ depends on an undeclared DOM global, keeping root TypeScript validation green.
138
+
9
139
  ## [0.7.68] - 2026-07-12
10
140
 
11
141
  > Scope note: this release delivers **FEATURE_260**, the KodaX Memory Agent,
@@ -393,7 +523,11 @@ All notable changes to this project will be documented in this file.
393
523
  stale wide-char or skipped-cell residue cannot remain after user-driven
394
524
  transcript scrolling.
395
525
 
396
- ## [0.7.61] - 2026-07-06
526
+ ## [0.7.61] - 2026-07-06
527
+
528
+ > Historical release record: the command-aware lossy-filter behavior below is
529
+ > what v0.7.61 shipped, not the current default. The 2026-07-14 correction is
530
+ > recorded under Unreleased, ADR-050, and the FEATURE_251 design/test guide.
397
531
 
398
532
  > Scope note: a token-efficiency + workflow-reliability release. **FEATURE_251** adds command-aware
399
533
  > in-tool output compression (an rtk-style Token Killer port) inside KodaX's own `bash` tool layer,
@@ -407,7 +541,7 @@ All notable changes to this project will be documented in this file.
407
541
 
408
542
  ### Added
409
543
 
410
- - **Tool-output semantic compression command-aware in-tool Token Killer (FEATURE_251, ADR-050).** A new `packages/coding/src/tools/output-filters/` module compresses bash `stdout`/`stderr` **body** after decode, before the `Command:` / `Exit:` header is assembled, at the single `bash.ts` close-handler integration point (so both the SA and AMA dispatch paths are covered by one change). It ships a lossless generic layer (ANSI strip), compiled stateful filters (`git-diff`, `git-log`, `git-status`, `test-runner` failure-focus, `lint` diagnostic grouping, `json-output` / NDJSON structural summary), and a built-in declarative long-tail table (package-manager / docker / infra CLI progress). Hard constraints: the `Command:` / `Exit:` header is preserved verbatim (FEATURE_185 hits-ledger depends on it); the generic layer is lossless-by-construction with `never_worse` as a size-only backstop; content-signature detection is preferred over command-name matching (robust to compound commands and pipes); and every lossy filter (`lossiness: tail | whole`) first persists the raw decoded body via `persistToolOutput` and appends a recovery hint, falling back to the raw body + existing tail-truncation if the persist fails. `background` / `timeout` / `abort` paths do not reach the completion assembly and are naturally excluded. Isolated Layer-1 measurements (`context-savings.test.ts`) show ~66–99% body-token reduction on high-noise commands (e.g. a 120-file `git diff` 9,960 → 1,344 tokens; a `terraform apply` progress stream 10,617 → 59). Deterministic code no prompt change, no FEATURE_104 eval. Human test guide: `docs/test-guides/FEATURE_251_v0.7.61_TEST_GUIDE.md`.
544
+ - **Historical implementation — tool-output semantic compression / command-aware in-tool Token Killer (FEATURE_251, ADR-050).** A new `packages/coding/src/tools/output-filters/` module compressed bash `stdout`/`stderr` **body** after decode, before the `Command:` / `Exit:` header was assembled, at the single `bash.ts` close-handler integration point (so both the SA and AMA dispatch paths were covered by one change). It shipped a lossless generic layer (ANSI strip), compiled stateful filters (`git-diff`, `git-log`, `git-status`, `test-runner` failure-focus, `lint` diagnostic grouping, `json-output` / NDJSON structural summary), and a built-in declarative long-tail table (package-manager / docker / infra CLI progress). Hard constraints at release time: the `Command:` / `Exit:` header was preserved verbatim (FEATURE_185 hits-ledger depends on it); the generic layer was lossless-by-construction with `never_worse` as a size-only backstop; and every lossy filter persisted raw decoded body before appending a recovery hint. Isolated Layer-1 fixtures measured shorter bodies, but did not measure recovery reads, extra inference rounds, or task-level evidence quality; they are historical measurements, not current release gates or end-to-end benefit claims. Current default behavior is the correction described above. Human test guide: `docs/test-guides/FEATURE_251_v0.7.61_TEST_GUIDE.md`.
411
545
  - **Deterministic workflow-quality preflight lint (FEATURE_252).** A new `packages/agent/src/workflow/quality-lint.ts` (`lintRestrictedWorkflowSource` / `assertRestrictedWorkflowQuality`, exported from the workflow package) runs inside restricted workflow module materialization (`script-runner.ts` `createRestrictedWorkflowModule`) and in the coding workflow host with host-policy `maxAgents`, so structural contract violations fail before a run can start — matching the existing inline-smoke hard-fail feedback loop. It hard-fails three deterministic contract classes only: (1) an unawaited workflow-command variable (`wf.runAgent` / `wf.spawnAgent` / `wf.wait` / `wf.synthesize` / `wf.workflow` / `wf.artifact`) used in a boolean position (`if (x)`, `!x`, ternary test, `x && …`, `x || …`, loop test) — a case a runtime Proxy cannot catch because object truthiness has no Proxy trap; (2) top-level structured-output field access (`result.findings`, `result.summary`, …) when the fields belong under `result.structured`; and (3) a literal `[...]`/`[...].map(...)` agent fanout whose static upper bound exceeds `manifest.maxAgents` or a known host cap. Review/verifier/generic quality heuristics are intentionally **not** emitted as model-visible warnings (a lightweight AST pass cannot distinguish a weak workflow from a valid optimized one, and surfacing them causes needless rewrite churn). Human test guide: `docs/test-guides/FEATURE_252_v0.7.61_TEST_GUIDE.md`.
412
546
 
413
547
  ### Changed
@@ -2294,7 +2428,7 @@ repl → coding, skills
2294
2428
  ### Tests
2295
2429
  - Added / expanded tests for `task-engine`, `reasoning`, `tool-display`, `live-streaming`, `StatusBar`, `invocation-runtime`, `types-legacy`, and `InkREPL.interrupted`
2296
2430
 
2297
- <!-- last-sync: fe6ca81a -->
2431
+ <!-- last-sync: cf5f273b -->
2298
2432
 
2299
2433
  ### Added
2300
2434
  - **Repository intelligence substrate (FEATURE_018)**: Task-aware repository intelligence layer under `.agent/repo-intelligence/` with durable artifacts — `repo-overview.json`, `changed-scope.json`, `module-index.json`, `symbol-index.json`, `process-index.json`, `repo-intelligence-manifest.json` — supporting incremental refresh, freshness metadata, and language-tiered extraction (TS/JS via AST, Python, Go, Rust, Java, C++)
package/README.md CHANGED
@@ -359,13 +359,26 @@ experiments.
359
359
  One daemon owns many sessions. Different sessions may run concurrently; starts
360
360
  within the same session are queued so that only one run is active for that
361
361
  session. Multiple `kodax` processes can attach to the same daemon and open or
362
- observe different sessions.
362
+ observe the same session. FEATURE_269 adds atomic snapshot-plus-stream joining,
363
+ durable idempotent mutations, revision-safe settings and grants, transport-safe
364
+ AskUser/permission responses, run-scoped credential and Host Tool bridges, and
365
+ one daemon/inline Coder owner fence. In-flight external effects are never
366
+ blindly replayed after a crash; clients receive explicit interrupted/unknown
367
+ terminal facts and resync when `runtimeId` changes.
368
+
369
+ Space and IDE hosts should require these capabilities through the Runtime SDK.
370
+ Partner remains on its private inline Runtime and must use a distinct product
371
+ data/session root. A missing daemon capability is an error, not permission to
372
+ silently fall back to inline Coder.
363
373
 
364
374
  For the full host-integration contract, including inline/Worker/daemon selection,
365
375
  multi-client permission handling, config/catalog/MCP admin APIs, artifacts,
366
376
  context diagnostics, and daemon protocol schemas, see
367
377
  [docs/SDK_EMBEDDER_GUIDE.md §17](docs/SDK_EMBEDDER_GUIDE.md#17-runtime-sdk-worker-isolation-and-local-daemon-feature_253-feature_257).
368
378
 
379
+ The Space/IDE shared-daemon contract is documented in
380
+ [SDK Embedder Guide section 23](docs/SDK_EMBEDDER_GUIDE.md#23-shared-coder-daemon-for-space-and-ide-hosts-feature_269-v0769).
381
+
369
382
  ## Repo Intelligence
370
383
 
371
384
  KodaX ships with built-in repo intelligence (`repo_overview`, `module_context`, `symbol_context`, `process_context`, `impact_estimate`, and related tools) that helps the coding agent understand large codebases without ad-hoc grep/glob exploration.
@@ -379,7 +392,7 @@ kodax --repo-intelligence full --repo-intelligence-trace
379
392
 
380
393
  ## Architecture
381
394
 
382
- 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 10 SDK subpath exports (`/agent`, `/llm`, `/coding`, `/media`, `/repl`, `/skills`, `/mcp`, `/session`, `/runtime`, `/experimental-memory`; ADR-024 + ADR-032 + ADR-038, with ADR-036 consolidation):
395
+ 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 11 SDK subpath exports (`/agent`, `/llm`, `/coding`, `/media`, `/repl`, `/skills`, `/mcp`, `/session`, `/runtime`, `/a2a`, `/experimental-memory`; ADR-024 + ADR-032 + ADR-038, with ADR-036 consolidation):
383
396
 
384
397
  ```
385
398
  KodaX/
@@ -405,7 +418,7 @@ KodaX/
405
418
 
406
419
  ├── src/ # CLI entry + SDK subpath entries
407
420
  │ ├── kodax_cli.ts # Main CLI entry point (bin: `kodax`)
408
- │ └── sdk-*.ts # SDK subpath re-exports → @kodax-ai/kodax/{agent,llm,coding,media,repl,skills,mcp,session,runtime,experimental-memory}
421
+ │ └── sdk-*.ts # SDK subpath re-exports → @kodax-ai/kodax/{agent,llm,coding,media,repl,skills,mcp,session,runtime,a2a,experimental-memory}
409
422
 
410
423
  └── package.json # Root workspace config; release.mjs rewrites name + injects subpath exports
411
424
  ```
@@ -454,9 +467,9 @@ Source-side workspace package names (`@kodax-ai/*`). npm consumers install the s
454
467
  KodaX has two layers that consumers should understand separately:
455
468
 
456
469
  - **Source-side**: 4 workspace packages above (what developers see when reading the repo).
457
- - **npm-published**: a single bundled package `@kodax-ai/kodax` with 10 SDK subpaths (what SDK consumers `import` from). The subpaths are split into two roles:
470
+ - **npm-published**: a single bundled package `@kodax-ai/kodax` with 11 SDK subpaths (what SDK consumers `import` from). The subpaths are split into two roles:
458
471
  - **Full-package subpaths** (`/agent`, `/llm`, `/coding`, `/repl`) — each one maps 1:1 to a source workspace and exposes its complete public API.
459
- - **Narrow-subset subpaths** (`/media`, `/skills`, `/mcp`, `/session`, `/experimental-memory`) — each one exposes only a focused capability slice carved out of `/agent` or `/repl`. `/experimental-memory` is intentionally unstable and opt-in; the others are stable focused surfaces.
472
+ - **Integration and narrow subpaths** (`/media`, `/skills`, `/mcp`, `/session`, `/runtime`, `/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`.
460
473
 
461
474
  | Source package | npm subpath | Type | What you get | Example consumer |
462
475
  |---|---|---|---|---|
@@ -470,6 +483,7 @@ KodaX has two layers that consumers should understand separately:
470
483
  | `packages/repl` | `@kodax-ai/kodax/repl` | Full package | Ink TUI + permission modes + commands (217 exports) | Terminal-UI consumers |
471
484
  | `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 |
472
485
  | `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 |
486
+ | `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 |
473
487
 
474
488
  **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.
475
489
 
@@ -485,7 +499,7 @@ KodaX has two layers that consumers should understand separately:
485
499
 
486
500
  **Progressive Disclosure on the Managed Tool Path (FEATURE_250, v0.7.60)**: the deferred-tool progressive-disclosure mechanism — previously SA-path-only — now applies to the AMA/AMAW **managed** path too. Cache-cold managed turns carry one-line search hints instead of full descriptions for the 13 non-mcp deferred tools (repo-intelligence + web/code + goal); each tool's `input_schema` is unchanged, so it stays directly callable and the full description is fetched on demand via `tool_search`. `mcp_*` stay resident and `run_workflow` is untouched. Transparent to users; validated by two 5-alias eval panels (DEFER_SAFE 5/5, 0% read/grep fallback). See [docs/features/v0.7.60.md](docs/features/v0.7.60.md).
487
501
 
488
- **Tool-Output Compression + Workflow Quality Preflight (FEATURE_251 + FEATURE_252, v0.7.61)**: KodaX's own `bash` tool now compresses noisy command output **inside the tool**, so a big `git diff`, test run, package install, or `docker build` no longer spends thousands of context tokens command-aware filters (git/test/lint/JSON + a declarative package/docker/infra long-tail) summarize the stdout/stderr body while the `Command:`/`Exit:` header stays verbatim and every lossy summary keeps a raw-recovery path; isolated measurements show ~66–99% body-token reduction. Alongside it, inline `run_workflow` gains a deterministic pre-start quality lint that hard-fails weak-model authoring contract bugs (unawaited workflow-command used as a boolean, top-level access of `result.structured` fields, literal agent fanout above manifest/host caps) before a run starts. Both are deterministic (no prompt change). See [docs/features/v0.7.61.md](docs/features/v0.7.61.md) and [docs/ADR.md ADR-050](docs/ADR.md).
502
+ **Context-Efficient Tool Results + Workflow Quality Preflight (FEATURE_251 + FEATURE_252, v0.7.61; corrected 2026-07-14)**: local tools collect complete output and apply only contract-equivalent normalization that is strictly shorter; command-specific lossy Bash filters are off by default, and compound Bash uses no semantic adapter. One owner evaluates the complete parallel-result batch against the final provider request: it solves the largest final input `Pmax` for which `Pmax + output reserve + max(2048, 3% of Pmax) <= context window`, then admits only the remaining physical capacity. Results stay verbatim whenever they fit; only real overflow persists the complete value and emits `KODAX_RESULT_INCOMPLETE`. History follows the same physical-capacity rule: no default lossy microcompaction below capacity, summary-first at actual pressure, and typed failure without silent message deletion when a recoverable request cannot be formed. Static early percentages are explicit opt-ins. FEATURE_252's deterministic pre-start workflow contract lint is unchanged. See [docs/features/v0.7.61.md](docs/features/v0.7.61.md) and [docs/ADR.md ADR-050](docs/ADR.md).
489
503
 
490
504
  **External Agent SDK Plane (FEATURE_258, v0.7.67)**: `/agent` exports the protocol-neutral executor, registration, policy, credential-broker, artifact-policy, catalog, and durable task contracts. `/runtime` exposes the installed plane through `admin.agentRegistrations`, `agents`, and `agentTasks`, with the same DTO service methods over embedded and daemon clients. Executor factories are host functions: install them in an inline owner or while creating a new in-process daemon owner; they cannot be injected through an existing daemon connection or across a Runtime Worker boundary. Plane shutdown is terminal: pending waits and all later service calls reject. Restricted Workflow scripts preserve validated `phase` and external `target` routing. See the [complete owner/consumer recipes and safety contract](docs/SDK_EMBEDDER_GUIDE.md#18-external-agent-executor-plane-feature_258-v0767).
491
505
 
@@ -495,6 +509,37 @@ KodaX has two layers that consumers should understand separately:
495
509
 
496
510
  **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).
497
511
 
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).
513
+
514
+ The complete built-in path is available without writing TypeScript:
515
+
516
+ ```bash
517
+ # Call another A2A Agent
518
+ kodax a2a add research https://agent.example/.well-known/agent-card.json --effect read
519
+ kodax a2a test research
520
+ kodax a2a call research "Summarize this topic"
521
+
522
+ # Expose the Runtime default Agent, or pass a name from ~/.kodax/agents/*.md
523
+ export KODAX_A2A_TOKEN='replace-with-a-long-random-token'
524
+ kodax a2a expose # or: kodax a2a expose document-agent
525
+ kodax a2a serve # loopback http://127.0.0.1:8765
526
+ ```
527
+
528
+ MCP, A2A, and Extension declarations live in one user file per domain under
529
+ `~/.kodax/integrations/`. Use `kodax config template <mcp|a2a|extensions>`,
530
+ `kodax integrations migrate --apply`, and the `kodax mcp`, `kodax a2a`, or
531
+ `kodax extensions` commands to manage them. Running CLI/daemon hosts retain the
532
+ last valid revision, atomically replace the complete MCP provider, reconcile
533
+ Extensions per entry, and hot-register outbound A2A Agents. `a2a serve` loads
534
+ its configured MCP/Extension capability surface before listening and pins that
535
+ execution authority; it hot-reloads publication, authentication, and limits.
536
+ Agent, Skill, Extension-tool authority, workspace, tool-policy, or task-store
537
+ changes require an explicit server restart. Managed
538
+ A2A contexts default to `~/kodax_a2a_server_workspace/<profile>/contexts/`.
539
+ Exact Skill scripts require the opt-in isolated policy and a passing
540
+ `kodax sandbox doctor` (`kodax sandbox setup` performs the explicit Windows
541
+ one-time provisioning).
542
+
498
543
  ---
499
544
 
500
545
  ## Features
@@ -610,9 +655,10 @@ import { loadConfig } from '@kodax-ai/kodax/repl'; // REPL config /
610
655
  import { createMcpManager } from '@kodax-ai/kodax/mcp'; // MCP popout manager (v0.7.42)
611
656
  import { listSessions } from '@kodax-ai/kodax/session'; // session history helpers
612
657
  import { createKodaXRuntime } from '@kodax-ai/kodax/runtime'; // embedded/daemon runtime API
658
+ import { createKodaXA2AServer } from '@kodax-ai/kodax/a2a'; // A2A 1.0 client/server edge
613
659
  ```
614
660
 
615
- All 11 SDK entries (root + 10 subpaths) share internal code via ESM chunk splitting — importing from `/agent` does not pull in `/repl`'s Ink + React surface.
661
+ All 12 SDK entries (root + 11 subpaths) share internal code via ESM chunk splitting — importing from `/agent` does not pull in `/repl`'s Ink + React surface.
616
662
 
617
663
  For the complete host-facing contract — including embedded/Worker/daemon ownership,
618
664
  external-agent registration and task control, session cursor pagination, workflow
@@ -915,7 +961,7 @@ await runKodaX({
915
961
 
916
962
  ## SDK Usage
917
963
 
918
- KodaX ships as a single npm package `@kodax-ai/kodax` with 10 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`). Each subpath is tree-shake-friendly so consumers pull only what they need:
964
+ KodaX ships as a single npm package `@kodax-ai/kodax` with 11 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`). Each subpath is tree-shake-friendly so consumers pull only what they need:
919
965
 
920
966
  ```bash
921
967
  npm install @kodax-ai/kodax
@@ -932,6 +978,7 @@ import { SkillRegistry } from '@kodax-ai/kodax/skills'; // zero-dep sk
932
978
  import { createMcpManager } from '@kodax-ai/kodax/mcp'; // MCP popout manager (v0.7.42)
933
979
  import { listSessions } from '@kodax-ai/kodax/session'; // session history helpers
934
980
  import { createKodaXRuntime } from '@kodax-ai/kodax/runtime'; // embedded/daemon runtime API
981
+ import { createKodaXA2AServer } from '@kodax-ai/kodax/a2a'; // A2A 1.0 client/server edge
935
982
  import { createMemoryAgent } from '@kodax-ai/kodax/experimental-memory'; // opt-in experimental memory SDK
936
983
  ```
937
984
 
@@ -1148,7 +1195,7 @@ KodaX ships 50+ built-in tools, grouped below. They are registered as a single f
1148
1195
  ### Shell & search
1149
1196
  | Tool | Description |
1150
1197
  |------|-------------|
1151
- | `bash` | Execute a shell command (supports `run_in_background`, output truncation) |
1198
+ | `bash` | Execute a shell command (supports `run_in_background`; complete capture with recoverable capacity fallback) |
1152
1199
  | `glob` | Find files by pattern |
1153
1200
  | `grep` | Regex content search (context lines, multiline, file-type filter, pagination) |
1154
1201
  | `code_search` | Lower-noise code search (extension-provider aware) |
package/README_CN.md CHANGED
@@ -66,6 +66,21 @@ kodax
66
66
 
67
67
  ---
68
68
 
69
+ ## Runtime SDK 与共享 daemon
70
+
71
+ `@kodax-ai/kodax/runtime` 支持 inline、Worker 和本机共享 daemon。FEATURE_269
72
+ 让 CLI、Space、IDE 与其他本地 SDK 客户端可以原子加入同一个 Coder
73
+ session/run,共享 transcript、Todo、tool、AskUser、permission、队列与唯一终态。
74
+ daemon mutation 使用持久 operation identity 和 revision CAS;崩溃后不会盲目重放
75
+ 可能已有副作用的 provider、run 或 Host Tool 调用。
76
+
77
+ Space 的 provider credential 仍由 OS keychain 持有,只通过 run/provider-scoped
78
+ broker 使用;Space Artifact/Office/Control 只通过显式绑定到该 run 的 Host Tool
79
+ lease 暴露。CLI run 不会因为 Space 后来加入而继承这些能力。Partner 继续使用独立
80
+ data/session root 下的 inline Runtime,不参与 Coder owner fence。capability 缺失时必须
81
+ fail closed,不能静默退回 inline Coder。完整接入说明见
82
+ [SDK Embedder Guide §23](docs/SDK_EMBEDDER_GUIDE.md#23-shared-coder-daemon-for-space-and-ide-hosts-feature_269-v0769)。
83
+
69
84
  ## 为什么用 KodaX
70
85
 
71
86
  <table>
@@ -214,10 +229,11 @@ import { loadConfig } from '@kodax-ai/kodax/repl'; // REPL 配置 /
214
229
  import { createMcpManager } from '@kodax-ai/kodax/mcp'; // MCP popout manager(v0.7.42 起)
215
230
  import { listSessions } from '@kodax-ai/kodax/session'; // session 历史工具
216
231
  import { createKodaXRuntime } from '@kodax-ai/kodax/runtime'; // embedded/Worker/daemon 宿主 API
232
+ import { createKodaXA2AServer } from '@kodax-ai/kodax/a2a'; // A2A 1.0 双向接入
217
233
  import { createMemoryAgent } from '@kodax-ai/kodax/experimental-memory'; // opt-in 实验性记忆 SDK
218
234
  ```
219
235
 
220
- 11 个 SDK 入口(root + 10 subpath)通过 ESM 共享 chunk 复用底层代码 —— 只 import `/agent` 不会把 `/repl` 的 Ink + React 一起拉进来。
236
+ 12 个 SDK 入口(root + 11 subpath)通过 ESM 共享 chunk 复用底层代码 —— 只 import `/agent` 不会把 `/repl` 的 Ink + React 一起拉进来。
221
237
 
222
238
  完整的宿主集成契约——包括 embedded/Worker/daemon 所有权、外部 Agent 注册与任务控制、session cursor 分页、workflow 模型分层和效率遥测——见 [SDK Embedder Integration Guide](docs/SDK_EMBEDDER_GUIDE.md)。
223
239
 
@@ -530,7 +546,7 @@ kodax --repo-intelligence full --repo-intelligence-trace
530
546
 
531
547
  ## 仓库结构
532
548
 
533
- KodaX 是基于 npm workspaces 的 TypeScript monorepo,**源码层 4 个 workspace 包**(FEATURE_194 v0.7.43 包合并 — 9 → 4,ADR-036),npm 上以单 bundle 包 `@kodax-ai/kodax` 发布 + 10 个 SDK subpath exports(`/agent`、`/llm`、`/coding`、`/media`、`/repl`、`/skills`、`/mcp`、`/session`、`/runtime`、`/experimental-memory`;ADR-024 + ADR-032 + ADR-038)。核心包:
549
+ KodaX 是基于 npm workspaces 的 TypeScript monorepo,**源码层 4 个 workspace 包**(FEATURE_194 v0.7.43 包合并 — 9 → 4,ADR-036),npm 上以单 bundle 包 `@kodax-ai/kodax` 发布 + 11 个 SDK subpath exports(`/agent`、`/llm`、`/coding`、`/media`、`/repl`、`/skills`、`/mcp`、`/session`、`/runtime`、`/a2a`、`/experimental-memory`;ADR-024 + ADR-032 + ADR-038)。核心包:
534
550
 
535
551
  | Workspace 包 | 作用 | 主要依赖 |
536
552
  |----|------|---------|
@@ -539,14 +555,14 @@ KodaX 是基于 npm workspaces 的 TypeScript monorepo,**源码层 4 个 works
539
555
  | `@kodax-ai/coding` | Coding Agent:50+ 工具(含 `dispatch_child_task`/`send_message`/`task_stop`)、role prompts、agent loop、auto-continue + repo-intelligence protocol(v0.7.43 inline) | `@kodax-ai/llm`, `@kodax-ai/agent` |
540
556
  | `@kodax-ai/repl` | 完整交互式终端 UI(Ink / React、权限模式、命令系统、流式渲染) | `@kodax-ai/coding`, `ink`, `react` |
541
557
 
542
- 根目录 `src/kodax_cli.ts` 是 CLI 入口;`src/sdk-{agent,llm,coding,media,repl,skills,mcp,session,runtime,experimental-memory}.ts` 是 SDK subpath 入口;构建产物在 `dist/`,单文件二进制在 `dist/binary/<target>/`。
558
+ 根目录 `src/kodax_cli.ts` 是 CLI 入口;`src/sdk-{agent,llm,coding,media,repl,skills,mcp,session,runtime,a2a,experimental-memory}.ts` 是 SDK subpath 入口;构建产物在 `dist/`,单文件二进制在 `dist/binary/<target>/`。
543
559
 
544
560
  ### 源码层 vs npm 发布层
545
561
 
546
562
  KodaX 有两层结构,SDK 用户需要分开理解:
547
563
 
548
564
  - **源码层**:上面 4 个 workspace 包(开发者读代码时看到的物理结构)。
549
- - **npm 发布层**:单个 bundled 包 `@kodax-ai/kodax`,对外暴露 10 个 SDK subpath(SDK 消费者 `import` 时看到的接口)。subpath 分两种角色:
565
+ - **npm 发布层**:单个 bundled 包 `@kodax-ai/kodax`,对外暴露 11 个 SDK subpath(SDK 消费者 `import` 时看到的接口)。subpath 分两种角色:
550
566
  - **完整包 subpath**(`/agent`、`/llm`、`/coding`、`/repl`)—— 每个 1:1 对应一个源码包,暴露完整公开 API。
551
567
  - **窄子集 subpath**(`/media`、`/skills`、`/mcp`、`/session`、`/experimental-memory`)—— 从 `/agent` 或 `/repl` 切出聚焦能力;`/experimental-memory` 明确为 opt-in 不稳定接口。
552
568
 
@@ -562,6 +578,7 @@ KodaX 有两层结构,SDK 用户需要分开理解:
562
578
  | `packages/repl` | `@kodax-ai/kodax/repl` | 完整包 | Ink TUI + 权限模式 + 命令系统 (217 exports) | 终端 UI 消费者 |
563
579
  | `packages/repl` | `@kodax-ai/kodax/session` | **窄子集** | 仅会话管理 —— `listSessions` / `loadFullTranscript` / `appendClientNotice` / `forkSession` / `compactSession` / `watchSessions` 等 (17 exports) | 读取 session 历史的 IDE 插件和桌面宿主 |
564
580
  | `src` | `@kodax-ai/kodax/runtime` | 宿主 API | Embedded/Worker/daemon facade,含 sessions/runs/events/permissions/catalog/MCP/artifacts/diagnostics/外部 Agent 和 daemon schema (10 exports) | SDK 宿主、Space/IDE、daemon client |
581
+ | `src` | `@kodax-ai/kodax/a2a` | 集成边界 | A2A 1.0 Agent Card 发现、JSON-RPC/SSE F258 executor、安全 fetch 与鉴权 Runtime Agent server | Agent 编排器和 KodaX 宿主 |
565
582
 
566
583
  **经验法则**:需要 Runner / Agent / fan-out 时从 `/agent` 引入;只需要 skills 或 mcp API 时从 `/skills` 或 `/mcp` 引入,bundle 更小。窄子集是完整包的真子集 —— **不会**有额外符号。
567
584
 
@@ -573,6 +590,34 @@ KodaX 有两层结构,SDK 用户需要分开理解:
573
590
 
574
591
  **实验性 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)。
575
592
 
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)。
594
+
595
+ 完整的内置调用路径不需要再写 TypeScript:
596
+
597
+ ```bash
598
+ # 调用外部 A2A Agent
599
+ kodax a2a add research https://agent.example/.well-known/agent-card.json --effect read
600
+ kodax a2a test research
601
+ kodax a2a call research "总结这个主题"
602
+
603
+ # 暴露 Runtime 默认 Agent,或指定 ~/.kodax/agents/*.md 中的 Agent 名称
604
+ export KODAX_A2A_TOKEN='请替换为足够长的随机令牌'
605
+ kodax a2a expose # 或:kodax a2a expose document-agent
606
+ kodax a2a serve # 仅监听 http://127.0.0.1:8765
607
+ ```
608
+
609
+ MCP、A2A、Extension 分别使用 `~/.kodax/integrations/` 下的一个用户级文件。
610
+ 可以通过 `kodax config template <mcp|a2a|extensions>` 查看模板,通过
611
+ `kodax integrations migrate --apply` 迁移旧配置,并用 `kodax mcp`、
612
+ `kodax a2a`、`kodax extensions` 管理。运行中的 CLI/daemon 保留最后一个
613
+ 有效版本,完整替换 MCP provider、逐条协调 Extension,并热注册出站 A2A Agent。
614
+ `a2a serve` 会在监听前装载已配置的 MCP/Extension 能力并固定执行权威,同时热加载
615
+ 公开信息、鉴权和限额。Agent、Skill、Extension 工具权威、工作区、tool policy
616
+ 或任务存储变更必须显式重启服务。
617
+ 托管 A2A 上下文默认位于 `~/kodax_a2a_server_workspace/<profile>/contexts/`。
618
+ 精确授权的 Skill 脚本必须使用隔离策略,并通过 `kodax sandbox doctor`;
619
+ Windows 的一次性显式初始化由 `kodax sandbox setup` 完成。
620
+
576
621
  **外部 Agent SDK plane(FEATURE_258,v0.7.67)**:`/agent` 导出协议中立的 executor、registration、policy、credential broker、artifact policy、catalog 和 durable task 契约;`/runtime` 通过 `admin.agentRegistrations`、`agents`、`agentTasks` 向 embedded 与 daemon client 提供同一组 DTO API。Executor factory 是宿主函数,只能装入 inline owner,或在创建新的 in-process daemon owner 时装入;不能通过既有 daemon 连接或 Runtime Worker 边界注入。Plane 关闭后是终态:未完成的 wait 和后续所有服务调用都会拒绝;受限 Workflow 脚本会完整校验并传递 `phase` 与外部 `target`。完整所有权、注册、preflight、启动/等待/继续/取消/对账和安全边界见 [SDK Embedder Guide §18](docs/SDK_EMBEDDER_GUIDE.md#18-external-agent-executor-plane-feature_258-v0767)。
577
622
 
578
623
  **成本受控 Workflow SDK(FEATURE_259,v0.7.67)**:SDK 调用方用 run-scoped `modelTiers` 与 `workflow.maxConcurrency` 配置路由和并发,workflow 作者只表达 `fast` / `balanced` / `deep` 语义意图。terminal workflow event 回显 tier/source/fallback/usage/duration,持久化 `run.json.efficiencyReport` 给出 token coverage、role/tier 启动数、packet-read 拓扑、review wave 和 quality gate 结果。完整配置与遥测读取方式见 [SDK Embedder Guide §20](docs/SDK_EMBEDDER_GUIDE.md#20-cost-disciplined-workflow-routing-and-telemetry-feature_259-v0767)。
@@ -583,7 +628,7 @@ KodaX 有两层结构,SDK 用户需要分开理解:
583
628
 
584
629
  **managed 工具路径的渐进披露(FEATURE_250,v0.7.60)**:deferred-tool 渐进披露机制——此前仅 SA path 拥有——现在也应用于 AMA/AMAW 的 **managed** path。缓存冷启的 managed 轮次对 13 个 non-mcp 延迟工具(repo-intelligence + web/code + goal)携带一行 search hint 而非完整描述;每个工具的 `input_schema` 不变,因此仍可直接调用,完整描述按需通过 `tool_search` 拉取。`mcp_*` 保持常驻,`run_workflow` 不动。对用户透明;由两个 5-alias eval panel 验证(DEFER_SAFE 5/5,0% read/grep 回退)。详见 [docs/features/v0.7.60.md](docs/features/v0.7.60.md)。
585
630
 
586
- **工具输出压缩 + Workflow 质量预检(FEATURE_251 + FEATURE_252,v0.7.61)**:KodaX 自有的 `bash` 工具现在**在工具内**压缩高噪声命令输出,一次大 `git diff`、测试、包安装或 `docker build` 不再吞掉数千 context token——命令感知过滤器(git/test/lint/JSON + 声明式 package/docker/infra 长尾)摘要 stdout/stderr 正文,`Command:`/`Exit:` 头部逐字保留,所有有损摘要都保留 raw 恢复路径;隔离测量显示正文 token 降幅约 66–99%。同时,inline `run_workflow` 新增确定性启动前质量 lint,在运行前硬失败弱模型的编写合约 bug(未 await 的 workflow-command 用作布尔、顶层访问本应位于 `result.structured` 的字段、字面 agent fanout 超 manifest/host 上限)。二者均为确定性(无 prompt 改动)。详见 [docs/features/v0.7.61.md](docs/features/v0.7.61.md) 与 [docs/ADR.md ADR-050](docs/ADR.md)。
631
+ **上下文高效的工具结果 + Workflow 质量预检(FEATURE_251 + FEATURE_252,v0.7.61;2026-07-14 纠偏)**:本地工具先完整采集,只采用契约等价且严格更短的无损规范化;命令专用 Bash 有损过滤默认关闭,compound Bash 不使用语义 adapter。并行结果由唯一 owner 按最终 provider 请求统一判容:先求满足 `Pmax + 输出预留 + max(2048, Pmax 3%) <= 上下文窗口` 的最大最终输入,再只使用剩余物理容量。能放下就逐字交付,只有真实溢出才持久化完整结果并返回 `KODAX_RESULT_INCOMPLETE`。历史压缩使用同一物理容量规则:容量内不做默认有损 microcompaction,真实压力下 summary-first,无法形成可恢复请求时 typed failure,禁止静默删消息;静态提前百分比仅为显式 opt-in。FEATURE_252 的确定性 workflow 启动前合约 lint 保持不变。详见 [docs/features/v0.7.61.md](docs/features/v0.7.61.md) 与 [docs/ADR.md ADR-050](docs/ADR.md)。
587
632
 
588
633
  ```
589
634
  KodaX/ # 4 workspace packages(FEATURE_194 v0.7.43)
@@ -600,9 +645,9 @@ KodaX/ # 4 workspace packages(FEATURE_194 v0.7.43)
600
645
  │ └── repl/ # @kodax-ai/repl —— Ink TUI
601
646
  ├── src/
602
647
  │ ├── kodax_cli.ts # CLI 主入口(bin: `kodax`)
603
- │ └── sdk-*.ts # SDK subpath 入口 → @kodax-ai/kodax/{agent,llm,coding,media,repl,skills,mcp,session,runtime,experimental-memory}
648
+ │ └── sdk-*.ts # SDK subpath 入口 → @kodax-ai/kodax/{agent,llm,coding,media,repl,skills,mcp,session,runtime,a2a,experimental-memory}
604
649
  ├── scripts/
605
- │ ├── build-bundle.mjs # esbuild 单 bundle 多 entry 打包(CLI + root + 10 SDK subpath + chunks)
650
+ │ ├── build-bundle.mjs # esbuild 单 bundle 多 entry 打包(CLI + root + 11 SDK subpath + chunks)
606
651
  │ ├── build-binary.mjs # Bun --compile 单文件二进制打包
607
652
  │ └── release.mjs # ADR-024 release-time pkg name/exports 注入
608
653
  └── .github/workflows/
@@ -696,7 +741,7 @@ KodaX 现在会把 Repo Intelligence 的本地缓存分成内置引擎 profile
696
741
  ## 文档
697
742
 
698
743
  - [README.md](README.md) - 英文版 README
699
- - [docs/SDK_EMBEDDER_GUIDE.md](docs/SDK_EMBEDDER_GUIDE.md) - SDK 宿主集成与 v0.7.68 公共 API 契约
744
+ - [docs/SDK_EMBEDDER_GUIDE.md](docs/SDK_EMBEDDER_GUIDE.md) - SDK 宿主集成与 v0.7.69 公共 API 契约
700
745
  - [docs/release.md](docs/release.md) - 单文件二进制构建与发布流程
701
746
  - [docs/PRD.md](docs/PRD.md) - 产品需求
702
747
  - [docs/ADR.md](docs/ADR.md) - 架构决策
@@ -0,0 +1,26 @@
1
+ // KodaX core configuration template.
2
+ // Copy only the fields you need to ~/.kodax/config.json (strict JSON).
3
+ // MCP, A2A, and Extensions live in ~/.kodax/integrations/*.json; use
4
+ // `kodax integrations migrate --dry-run` for legacy declarations.
5
+ {
6
+ // "provider": "deepseek",
7
+ // "model": "deepseek-v4",
8
+ // "runtimeMode": "embedded",
9
+ // "effort": "high",
10
+ // "agentMode": "ama",
11
+ // "permissionMode": "accept-edits",
12
+ // "locale": "zh",
13
+ // "customProviders": [
14
+ // {
15
+ // "name": "my-relay",
16
+ // "protocol": "openai",
17
+ // "baseUrl": "https://api.example.com/v1",
18
+ // "apiKeyEnv": "MY_RELAY_API_KEY",
19
+ // "model": "provider/model",
20
+ // "reasoning": { "efforts": ["off", "low", "high"], "default": "high" }
21
+ // }
22
+ // ],
23
+ // "repoIntelligenceMode": "auto",
24
+ // "sessionRetentionDays": 0,
25
+ // "workflow": { "maxConcurrency": 8 }
26
+ }
@@ -0,0 +1,54 @@
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.
4
+ {
5
+ "version": 1,
6
+ "agents": {}
7
+
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>/.
21
+ // Native read/grep/glob remains available according to workspace access.
22
+ // Arbitrary shell is never exposed. Skill instructions/assets need no
23
+ // process authority. An exact checked-in scripts/... entry requires
24
+ // process="isolated", skillScripts admission, and `kodax sandbox doctor`.
25
+ // ASRT receives no KodaX credentials or ambient ~/.srt-settings.json and its
26
+ // script quota is observed; hostile tenants also require an outer container/VM.
27
+ //
28
+ // "server": {
29
+ // "execution": {
30
+ // "kind": "local-agent",
31
+ // "agentRef": { "source": "markdown:user", "name": "report-agent" },
32
+ // "workspace": { "mode": "managed" },
33
+ // "toolPolicy": {
34
+ // "workspace": "write",
35
+ // "process": "deny",
36
+ // "network": { "mode": "deny" },
37
+ // "tools": [],
38
+ // "mcp": {},
39
+ // "skillScripts": {},
40
+ // "subagents": "deny"
41
+ // }
42
+ // },
43
+ // "published": {
44
+ // "name": "KodaX Agent",
45
+ // "description": "Completes approved general tasks.",
46
+ // "version": "0.7.69",
47
+ // "skills": [{ "id": "general", "name": "General", "description": "Complete general tasks.", "tags": [] }],
48
+ // "inputModes": ["text/plain"],
49
+ // "outputModes": ["text/plain"]
50
+ // },
51
+ // "authentication": { "type": "bearer-env", "tokenEnv": "KODAX_A2A_TOKEN", "principalId": "configured-client" },
52
+ // "dataDir": "~/.kodax/a2a/tasks"
53
+ // }
54
+ }
@@ -0,0 +1,7 @@
1
+ // Trusted user Extension paths: ~/.kodax/integrations/extensions.json.
2
+ // Extensions are host code. Reload is whole-domain atomic; use MCP for
3
+ // capabilities that should remain outside the KodaX process.
4
+ {
5
+ "version": 1,
6
+ "paths": []
7
+ }
@@ -0,0 +1,16 @@
1
+ // User MCP declarations: ~/.kodax/integrations/mcp.json (strict JSON).
2
+ // The whole file hot-reloads; healthy entries remain active if one new entry
3
+ // fails to prepare. Keep credentials in ${env:NAME} references.
4
+ {
5
+ "version": 1,
6
+ "servers": {}
7
+ // Example:
8
+ // "servers": {
9
+ // "reporting": {
10
+ // "type": "streamable-http",
11
+ // "url": "https://mcp.example.com",
12
+ // "headers": { "Authorization": "Bearer ${env:REPORTING_MCP_TOKEN}" },
13
+ // "connect": "lazy"
14
+ // }
15
+ // }
16
+ }
@@ -0,0 +1,2 @@
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};
@@ -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-VAZ25MDX.js";import"./chunk-M7TCFYTO.js";import"./chunk-WW2O2DEP.js";import"./chunk-ZG4DMYBS.js";import"./chunk-URC6ZI6P.js";import"./chunk-PA76WUBL.js";import"./chunk-4WIODYOH.js";import"./chunk-I4TPQEJN.js";import"./chunk-Y4WOTWUC.js";import"./chunk-PQ3XUSY2.js";import"./chunk-UJEMSPM5.js";import"./chunk-VYKFM3TB.js";import"./chunk-AWMTNUDS.js";import"./chunk-F7C7J6IM.js";import"./chunk-NGHQIGVW.js";import"./chunk-ONUPGMER.js";export{a as ArgumentCompleter,b as createArgumentCompleter};