@kodax-ai/kodax 0.7.66 → 0.7.68
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +180 -3
- package/README.md +51 -16
- package/README_CN.md +34 -13
- package/dist/chunks/agent-DATNZOBK.js +2 -0
- package/dist/chunks/argument-completer-X7MMM7Y6.js +2 -0
- package/dist/chunks/chunk-5GL55MOH.js +36 -0
- package/dist/chunks/chunk-67XJ4YUA.js +703 -0
- package/dist/chunks/chunk-C4SBXBWH.js +346 -0
- package/dist/chunks/{chunk-ALS32RNZ.js → chunk-CC4BVVE7.js} +9 -9
- package/dist/chunks/{chunk-VS4CDDEF.js → chunk-CTHUX5ZH.js} +221 -221
- package/dist/chunks/{chunk-YRBNXFHY.js → chunk-HFM2D5BP.js} +1 -1
- package/dist/chunks/chunk-HLBHSA2B.js +325 -0
- package/dist/chunks/{chunk-O7N22GJ3.js → chunk-K2NCKRVY.js} +16 -14
- package/dist/chunks/chunk-KGAI32VS.js +22 -0
- package/dist/chunks/{chunk-QAQ2HNXD.js → chunk-KIQRCGVR.js} +126 -112
- package/dist/chunks/chunk-MP52BDK5.js +15 -0
- package/dist/chunks/chunk-O5OJQFPY.js +307 -0
- package/dist/chunks/chunk-OIELNE6Z.js +56 -0
- package/dist/chunks/chunk-PEGSHZAA.js +5 -0
- package/dist/chunks/chunk-TOGESFRN.js +2 -0
- package/dist/chunks/compaction-config-BXEDHIQP.js +2 -0
- package/dist/chunks/{construction-bootstrap-3XDS2D5K.js → construction-bootstrap-PYWJHO35.js} +1 -1
- package/dist/chunks/dist-76PJHNSG.js +2 -0
- package/dist/chunks/{dist-4PXB7U22.js → dist-HTDJRAD6.js} +1 -1
- package/dist/chunks/host-UAXIDZ6V.js +2 -0
- package/dist/chunks/run-manager-UCXB4G22.js +2 -0
- package/dist/chunks/utils-S63V5UCM.js +2 -0
- package/dist/index.d.ts +19 -16
- package/dist/index.js +6 -6
- package/dist/kodax_cli.js +1292 -1255
- package/dist/runtime-worker.js +1196 -1153
- package/dist/sdk-agent.d.ts +143 -18
- package/dist/sdk-agent.js +1 -1
- package/dist/sdk-coding.d.ts +281 -20
- package/dist/sdk-coding.js +1 -1
- package/dist/sdk-experimental-memory.d.ts +618 -0
- package/dist/sdk-experimental-memory.js +2 -0
- package/dist/sdk-llm.d.ts +6 -6
- package/dist/sdk-llm.js +1 -1
- package/dist/sdk-mcp.js +1 -1
- package/dist/sdk-media.d.ts +1 -1
- package/dist/sdk-repl.d.ts +26 -17
- package/dist/sdk-repl.js +2 -2
- package/dist/sdk-runtime.d.ts +102 -14
- package/dist/sdk-runtime.js +1 -1
- package/dist/sdk-session.d.ts +6 -6
- package/dist/sdk-session.js +1 -1
- package/dist/sdk-skills.js +1 -1
- package/dist/semantic-worker.js +12 -12
- package/dist/types-chunks/{base.d-DalIRhbb.d.ts → base.d-C8mXDhLL.d.ts} +1 -1
- package/dist/types-chunks/{bash-prefix-extractor.d-BjkITAva.d.ts → bash-prefix-extractor.d-Dm-T865v.d.ts} +67 -12
- package/dist/types-chunks/{capability-learning.d-BQB0M70w.d.ts → capability-learning.d-BLEmCib0.d.ts} +1 -1
- package/dist/types-chunks/{capsule.d-hVhPNkHd.d.ts → capsule.d-CzaamUUv.d.ts} +5 -5
- package/dist/types-chunks/{commands.d-C3B1TdGM.d.ts → commands.d-DxKjVSNU.d.ts} +4 -4
- package/dist/types-chunks/{guardrail.d-wk-s0psS.d.ts → guardrail.d-CPDfZyJp.d.ts} +3 -3
- package/dist/types-chunks/{guardrail.d-C_Siraua.d.ts → guardrail.d-D7r6zVSR.d.ts} +1 -1
- package/dist/types-chunks/{public-api.d-jtREVfEq.d.ts → public-api.d-BcKbBy1E.d.ts} +12 -7
- package/dist/types-chunks/{resolver.d-CGkfRULj.d.ts → resolver.d-DmBnoilY.d.ts} +2 -2
- package/dist/types-chunks/{run-manager.d-CFknOfo1.d.ts → run-manager.d-CSj7_kWk.d.ts} +1 -1
- package/dist/types-chunks/{sdk-session-CLqyfAmf.d.ts → sdk-session-C6nDgyh8.d.ts} +4 -4
- package/dist/types-chunks/{types.d-Bp4Lm1jv.d.ts → types.d-CO_ZkmOd.d.ts} +6 -1
- package/dist/types-chunks/{types.d-CUN_bZU7.d.ts → types.d-CzscbsG0.d.ts} +4 -4
- package/dist/types-chunks/{process.d-CY2g03Mb.d.ts → types.d-D2frCRaY.d.ts} +505 -10
- package/dist/types-chunks/{types.d-BMLxKV69.d.ts → types.d-D9FKbAmf.d.ts} +2 -2
- package/dist/types-chunks/{utils.d-C1rpoeDh.d.ts → utils.d-DOXxnOnI.d.ts} +9 -5
- package/docs/SDK_EMBEDDER_GUIDE.md +3179 -0
- package/package.json +6 -1
- package/dist/chunks/agent-KER4WDNO.js +0 -2
- package/dist/chunks/argument-completer-HK3MHA3K.js +0 -2
- package/dist/chunks/chunk-3HKBBY74.js +0 -339
- package/dist/chunks/chunk-AKBH2EEE.js +0 -8
- package/dist/chunks/chunk-MHRN2LQV.js +0 -328
- package/dist/chunks/chunk-NBQW7PNZ.js +0 -18
- package/dist/chunks/chunk-QJVZZSEO.js +0 -56
- package/dist/chunks/chunk-TLJGOKBT.js +0 -729
- package/dist/chunks/chunk-WBBEJIAY.js +0 -306
- package/dist/chunks/chunk-WMIZCY2J.js +0 -2
- package/dist/chunks/compaction-config-7GMUFNPB.js +0 -2
- package/dist/chunks/dist-4YAYT2TO.js +0 -2
- package/dist/chunks/host-KG3456QP.js +0 -2
- package/dist/chunks/run-manager-6CAH3KTA.js +0 -2
- package/dist/chunks/utils-OT5ENFUL.js +0 -2
package/CHANGELOG.md
CHANGED
|
@@ -4,9 +4,186 @@ All notable changes to this project will be documented in this file.
|
|
|
4
4
|
|
|
5
5
|
> Full history for versions prior to v0.7.0: [CHANGELOG_ARCHIVE.md](docs/CHANGELOG_ARCHIVE.md)
|
|
6
6
|
|
|
7
|
-
## [Unreleased]
|
|
8
|
-
|
|
9
|
-
## [0.7.
|
|
7
|
+
## [Unreleased]
|
|
8
|
+
|
|
9
|
+
## [0.7.68] - 2026-07-12
|
|
10
|
+
|
|
11
|
+
> Scope note: this release delivers **FEATURE_260**, the KodaX Memory Agent,
|
|
12
|
+
> as a thin experimental SDK and governed runtime extension over the existing
|
|
13
|
+
> F228 Memory Control Plane. It does not add a second memory database, a
|
|
14
|
+
> resident specialist agent, filesystem memory actions, or online self-modification.
|
|
15
|
+
|
|
16
|
+
### Added
|
|
17
|
+
|
|
18
|
+
- **Thin experimental Memory Agent SDK.** Added
|
|
19
|
+
`@kodax-ai/agent/experimental-memory` and the root `/experimental-memory`
|
|
20
|
+
entry with scoped `MemorySession` lifecycle, zero-wait passive recall,
|
|
21
|
+
read-only deliberate `query()`, bounded observations, and episode outcomes.
|
|
22
|
+
- **Deliberate governed recall for the Action LLM.** A session-bound
|
|
23
|
+
`memory_recall` tool exposes only one `need` field, returns prompt-safe
|
|
24
|
+
low-authority evidence from the same F228 plane, and keeps identity, scope,
|
|
25
|
+
revision, and sequence outside model input.
|
|
26
|
+
- **Auditable memory decisions and outcomes.** Trace-only
|
|
27
|
+
`MemoryDecisionReceipt` records candidate/selected/injected refs and policy
|
|
28
|
+
version; accepted Outcome Digests can conservatively link influence without
|
|
29
|
+
storing hidden reasoning or creating a second event store.
|
|
30
|
+
- **Bounded episode review and promotion.** Timed-out review work persists in a
|
|
31
|
+
scoped inbox for bounded next-session drain and revalidation. Promotion now
|
|
32
|
+
consults compatible claims before choosing create, evidence update,
|
|
33
|
+
condition refinement, conflict, no-action, reject, or quarantine.
|
|
34
|
+
|
|
35
|
+
### Changed
|
|
36
|
+
|
|
37
|
+
- **Memory applicability is exact and fail-closed.** Tenant, user, agent,
|
|
38
|
+
workspace, project, and branch identity participate in deterministic scope
|
|
39
|
+
checks; sibling/cross-user/cross-tenant fallback is prohibited.
|
|
40
|
+
- **Memory policy is source-versioned and cache-safe.** `f260-v0.7.68.2`
|
|
41
|
+
binds production reminder rules, evidence rendering, and deliberate-recall
|
|
42
|
+
tool bytes. Passive reminders only affect the dynamic suffix; deliberate
|
|
43
|
+
queries add a normal tool-call/result tail while preserving earlier provider
|
|
44
|
+
cache bytes.
|
|
45
|
+
- **Safety-critical boundaries remain deterministic.** Secret filtering,
|
|
46
|
+
memory-file mutation guards, poisoning/source-evidence checks, and governed
|
|
47
|
+
proposal/preview/fingerprint/apply remain zero-violation code gates rather
|
|
48
|
+
than probabilistic LLM recall thresholds.
|
|
49
|
+
- **Self-knowledge follows the v0.7.68 capability surface.** `kodax_manual`
|
|
50
|
+
now has a dedicated governed-memory topic, names all 43 built-in slash
|
|
51
|
+
commands under a two-way drift guard, and documents the current 10 SDK
|
|
52
|
+
subpaths plus Runtime and `/experimental-memory` ownership boundaries.
|
|
53
|
+
|
|
54
|
+
### Fixed
|
|
55
|
+
|
|
56
|
+
- **Post-review Memory Agent release hardening.** Repository identity now strips
|
|
57
|
+
Git remote userinfo/query credentials before scoped or legacy persistence;
|
|
58
|
+
managed-path guards are Windows-case-safe, protect governance sidecars, and
|
|
59
|
+
fail closed for non-read-only shell access to addressed memory roots. Episode
|
|
60
|
+
reviews use atomic processing claims with stale recovery, while proposal and
|
|
61
|
+
lifecycle stores serialize concurrent read-modify-write updates. Eval manifest
|
|
62
|
+
schema v2 binds untracked file bytes in addition to the tracked patch, corrupt
|
|
63
|
+
raw JSON fails loudly, and summary review state points to the separate
|
|
64
|
+
main-session review artifact instead of remaining permanently pending.
|
|
65
|
+
- **Runtime daemon state replacement is atomic.** Daemon lifecycle updates now
|
|
66
|
+
stage and rename `daemon.json` instead of truncating it in place, preventing
|
|
67
|
+
shutdown polling from mistaking a partial write for completed cleanup and
|
|
68
|
+
leaving an orphaned `stopping` process under full-suite load.
|
|
69
|
+
|
|
70
|
+
### Performance
|
|
71
|
+
|
|
72
|
+
- **The preregistered v2 memory-routing panel passes all release gates.** On
|
|
73
|
+
`ark/v4flash`, general immediate recall passed 59/60 (98.3%), high-value
|
|
74
|
+
recall 40/40, must-silent 200/200 (Wilson lower 98.1%), paired routing lift
|
|
75
|
+
was +73.3 percentage points with zero control regression, and bounded
|
|
76
|
+
two-decision recovery passed 20/20. The 520-cell panel represented 782,721
|
|
77
|
+
tokens and an estimated $0.004447 against the $0.02 cap. Main-session blinded
|
|
78
|
+
review recommends ship for routing value while documenting that the panel is
|
|
79
|
+
not an end-to-end task-completion claim.
|
|
80
|
+
|
|
81
|
+
## [0.7.67] - 2026-07-11
|
|
82
|
+
|
|
83
|
+
> Scope note: a stabilization and agent-efficiency release. **FEATURE_258**
|
|
84
|
+
> adds the protocol-neutral external-agent executor plane, **FEATURE_259**
|
|
85
|
+
> makes workflow/review orchestration more focused and cost-disciplined, and
|
|
86
|
+
> the bounded corrective **FEATURE_261** delivers searchable session resume
|
|
87
|
+
> plus safe ACP-session cleanup. GitHub source/binary release work is included;
|
|
88
|
+
> npm publication remains a separate operator step.
|
|
89
|
+
|
|
90
|
+
### Added
|
|
91
|
+
|
|
92
|
+
- **External Agent Executor Plane and dispatchable catalog.** Host-injected
|
|
93
|
+
executors now share a protocol-neutral registration/catalog/task contract,
|
|
94
|
+
redacted policy-filtered discovery, durable task ledger, recovery, and a
|
|
95
|
+
reference executor. Worker tools, Workflow, Embedded Runtime, and daemon
|
|
96
|
+
clients discover and dispatch the same canonical agent IDs.
|
|
97
|
+
- **External-agent SDK and daemon surfaces.** Runtime sessions expose catalog,
|
|
98
|
+
start/continue/cancel/reconcile, event, and task-result operations with
|
|
99
|
+
versioned schemas, configuration revisions, credential-presence checks, and
|
|
100
|
+
public in-process daemon-factory bootstrap support.
|
|
101
|
+
- **Focused scoped-review workflow.** `/review --workflow` now uses immutable
|
|
102
|
+
review packets, one primary per scope, an additional authoritative primary
|
|
103
|
+
only for risk-flagged packets, batched fresh verification for candidate
|
|
104
|
+
findings, stable finding IDs, capable synthesis, and an audit artifact.
|
|
105
|
+
- **Explicit model-tier intent and route telemetry.** Workflow and substantive
|
|
106
|
+
child briefs carry focused scope/constraints/evidence/output fields plus
|
|
107
|
+
explicit `fast` / `balanced` / `deep` intent. Runtime reports the resolved
|
|
108
|
+
source, fallback, effort, usage, duration, packet-read topology, and token
|
|
109
|
+
coverage without fabricating missing external usage.
|
|
110
|
+
- **Searchable session resume picker.** Running `kodax -r` without an ID now
|
|
111
|
+
opens an interactive TUI with incremental search, keyboard selection, title
|
|
112
|
+
completion, pagination, and the full selected session ID. An explicit value
|
|
113
|
+
resolves a complete ID first, then a unique exact title; duplicate titles
|
|
114
|
+
open a narrowed picker rather than silently selecting one.
|
|
115
|
+
- **Session listing filters and cursors.** SessionManager, Runtime SDK, and
|
|
116
|
+
daemon protocol listings now accept an exact `surface` filter and an opaque
|
|
117
|
+
continuation `cursor`, applied before the requested page limit.
|
|
118
|
+
|
|
119
|
+
### Changed
|
|
120
|
+
|
|
121
|
+
- **Resident workflow context is smaller and discoverable.** The turn-resident
|
|
122
|
+
`run_workflow` hint stays below the deferred-tool budget while the full
|
|
123
|
+
authoring contract remains available through `tool_search`. Recorded
|
|
124
|
+
workflow-shaped plans start directly instead of being expanded into duplicate
|
|
125
|
+
todo/dispatch scaffolding.
|
|
126
|
+
- **Review handoffs are structured and conservative.** Positive observations
|
|
127
|
+
are not findings; missing evidence remains `not-verifiable` rather than being
|
|
128
|
+
promoted into a defect; unreasoned severity overrides retain the original
|
|
129
|
+
severity instead of failing the review.
|
|
130
|
+
- **Eval execution is value-driven and bounded.** Main-session evidence review
|
|
131
|
+
determines whether a candidate has material value over baseline; executor
|
|
132
|
+
aliases are not reused as judge models. Raw reuse, per-call/round/token/cost
|
|
133
|
+
caps, one bounded structured repair, and provider/model concurrency lanes
|
|
134
|
+
prevent runaway panels.
|
|
135
|
+
- **SDK embedder documentation matches the v0.7.67 public surface.** The guide
|
|
136
|
+
now covers external-agent owner/consumer setup and safety boundaries, Runtime
|
|
137
|
+
registration/catalog/task services, exact-surface session pagination,
|
|
138
|
+
run-scoped workflow tiers, live route facts, and durable efficiency reports;
|
|
139
|
+
the English/Chinese subpath tables reflect all 10 published SDK entries.
|
|
140
|
+
|
|
141
|
+
### Fixed
|
|
142
|
+
|
|
143
|
+
- **Restricted Workflow scripts preserve the public Agent routing contract.**
|
|
144
|
+
`phase` and FEATURE_258 `target` values now cross the script host boundary
|
|
145
|
+
with fail-loud validation, so generated/saved workflows can route the same
|
|
146
|
+
canonical external Agent IDs as direct Workflow and Worker dispatch.
|
|
147
|
+
- **Executor-plane shutdown is terminal and waiter-safe.** Closing the plane is
|
|
148
|
+
idempotent, rejects pending task waits, and prevents later registration,
|
|
149
|
+
catalog, or task operations from recreating executors after owner shutdown.
|
|
150
|
+
- **Review/eval trust boundaries fail loudly without replacing real results.**
|
|
151
|
+
Built-in scoped-review outputs are validated against their declared schemas;
|
|
152
|
+
local ledger mirror failures retain the authoritative child result/error;
|
|
153
|
+
Feature 259 baseline reconstruction now requires every exact rewrite and no
|
|
154
|
+
longer leaks candidate-only briefing fields into the baseline.
|
|
155
|
+
- **Runtime tests no longer leave detached Node processes behind.** The config
|
|
156
|
+
suite explicitly shuts down its auto-started daemon owner before deleting
|
|
157
|
+
temporary state, and long-running process fixtures self-exit if an abnormal
|
|
158
|
+
test-runner termination prevents normal managed cleanup.
|
|
159
|
+
- **External tasks keep identity and terminal state across failures.** A remote
|
|
160
|
+
start followed by ledger failure preserves its executor reference as
|
|
161
|
+
`unknown`; in-flight tasks retain immutable executor bindings across catalog
|
|
162
|
+
updates; task-level mutation queues prevent late callbacks from overwriting a
|
|
163
|
+
terminal snapshot; Workflow external waits honor `timeoutMs`.
|
|
164
|
+
- **External task safety and policy boundaries fail closed.** Executor
|
|
165
|
+
availability, health, capability, concurrency, credential presence,
|
|
166
|
+
configuration revision, target side effects, and read-only intent are checked
|
|
167
|
+
before start without exposing secret values.
|
|
168
|
+
- **ACP tests no longer pollute real user sessions.** ACP harnesses now use an
|
|
169
|
+
isolated temporary runtime home and session store, with a guard that rejects
|
|
170
|
+
paths under the real user home. ACP sessions remain provisional until the
|
|
171
|
+
first valid prompt instead of persisting an empty `ACP Session` during
|
|
172
|
+
protocol setup.
|
|
173
|
+
- **Empty ACP pollution can be audited and recovered safely.**
|
|
174
|
+
`kodax -s cleanup-acp` previews only strict empty ACP matches; explicit
|
|
175
|
+
`--apply-session-cleanup` archives them reversibly instead of deleting data.
|
|
176
|
+
|
|
177
|
+
### Performance
|
|
178
|
+
|
|
179
|
+
- **Feature 259 controlled comparison validates the review optimization.** The
|
|
180
|
+
proposed topology passed 8/8 Layer-3 oracle cells versus 6/8 baseline, reduced
|
|
181
|
+
total model tokens 16.9% and output tokens 49.1%, and on standard reviews
|
|
182
|
+
reduced median tokens 57.2%, primary starts 75%, and duplicate packet reads
|
|
183
|
+
83.3%. High-risk multi-area reviews intentionally spend more calls for fresh
|
|
184
|
+
verification and explicit packet coverage.
|
|
185
|
+
|
|
186
|
+
## [0.7.66] - 2026-07-10
|
|
10
187
|
|
|
11
188
|
> Scope note: the runtime migration was developed across the v0.7.64-v0.7.66
|
|
12
189
|
> planning slots and is released as one v0.7.66 cut; v0.7.64 and v0.7.65 were
|
package/README.md
CHANGED
|
@@ -319,8 +319,14 @@ inline/Worker ownership, but only detaches one daemon client. Contradictory
|
|
|
319
319
|
isolation options fail instead of silently selecting a weaker mode. Worker
|
|
320
320
|
isolation is a V8 fault boundary, not a security sandbox.
|
|
321
321
|
|
|
322
|
+
Because a daemon is intentionally persistent, tests that auto-start one must
|
|
323
|
+
also run `kodax daemon stop --home <dir> --profile <name>` (or send authenticated
|
|
324
|
+
`runtime.shutdown`) before deleting their temporary home. A remaining Node
|
|
325
|
+
process is not safe to kill by name alone; verify its command line and owner.
|
|
326
|
+
|
|
322
327
|
```bash
|
|
323
328
|
kodax daemon start
|
|
329
|
+
kodax daemon stop --profile default
|
|
324
330
|
kodax --runtime-mode daemon
|
|
325
331
|
kodax -p "Review this repository" --runtime-mode daemon
|
|
326
332
|
```
|
|
@@ -373,7 +379,7 @@ kodax --repo-intelligence full --repo-intelligence-trace
|
|
|
373
379
|
|
|
374
380
|
## Architecture
|
|
375
381
|
|
|
376
|
-
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
|
|
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):
|
|
377
383
|
|
|
378
384
|
```
|
|
379
385
|
KodaX/
|
|
@@ -399,7 +405,7 @@ KodaX/
|
|
|
399
405
|
│
|
|
400
406
|
├── src/ # CLI entry + SDK subpath entries
|
|
401
407
|
│ ├── kodax_cli.ts # Main CLI entry point (bin: `kodax`)
|
|
402
|
-
│ └── sdk-*.ts # SDK subpath re-exports → @kodax-ai/kodax/{agent,llm,coding,media,repl,skills,mcp,session,runtime}
|
|
408
|
+
│ └── sdk-*.ts # SDK subpath re-exports → @kodax-ai/kodax/{agent,llm,coding,media,repl,skills,mcp,session,runtime,experimental-memory}
|
|
403
409
|
│
|
|
404
410
|
└── package.json # Root workspace config; release.mjs rewrites name + injects subpath exports
|
|
405
411
|
```
|
|
@@ -448,20 +454,22 @@ Source-side workspace package names (`@kodax-ai/*`). npm consumers install the s
|
|
|
448
454
|
KodaX has two layers that consumers should understand separately:
|
|
449
455
|
|
|
450
456
|
- **Source-side**: 4 workspace packages above (what developers see when reading the repo).
|
|
451
|
-
- **npm-published**: a single bundled package `@kodax-ai/kodax` with
|
|
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:
|
|
452
458
|
- **Full-package subpaths** (`/agent`, `/llm`, `/coding`, `/repl`) — each one maps 1:1 to a source workspace and exposes its complete public API.
|
|
453
|
-
- **Narrow-subset subpaths** (`/media`, `/skills`, `/mcp`, `/session`) — each one exposes only a focused capability slice carved out of `/agent` or `/repl`.
|
|
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.
|
|
454
460
|
|
|
455
461
|
| Source package | npm subpath | Type | What you get | Example consumer |
|
|
456
462
|
|---|---|---|---|---|
|
|
457
|
-
| `packages/llm` | `@kodax-ai/kodax/llm` | Full package | 15-alias LLM abstraction (
|
|
458
|
-
| `packages/agent` | `@kodax-ai/kodax/agent` | Full package | Runner / fan-out / session-lineage / capabilities / tracing (
|
|
463
|
+
| `packages/llm` | `@kodax-ai/kodax/llm` | Full package | 15-alias LLM abstraction (108 exports) | Standalone LLM clients |
|
|
464
|
+
| `packages/agent` | `@kodax-ai/kodax/agent` | Full package | Runner / fan-out / external-agent plane / session-lineage / capabilities / tracing (331 exports) | Custom agent frameworks |
|
|
459
465
|
| `packages/agent` | `@kodax-ai/kodax/skills` | **Narrow subset** | Skills system only — `SkillRegistry` / `loadFullSkill` / `expandSkillForLLM` / ... (26 exports = pre-v0.7.43 `@kodax-ai/skills` complete API) | Skill loaders, IDE plugins |
|
|
460
|
-
| `packages/agent` | `@kodax-ai/kodax/mcp` | **Narrow subset** | MCP only — `McpCapabilityProvider` / `createMcpTransport` / `searchMcpCatalog` / ... (
|
|
461
|
-
| `packages/
|
|
462
|
-
| `packages/
|
|
463
|
-
| `packages/
|
|
464
|
-
| `
|
|
466
|
+
| `packages/agent` | `@kodax-ai/kodax/mcp` | **Narrow subset** | MCP only — `McpCapabilityProvider` / `createMcpTransport` / `searchMcpCatalog` / ... (23 exports) | MCP server hosts |
|
|
467
|
+
| `packages/agent` | `@kodax-ai/kodax/media` | **Narrow subset** | Structured image/file/video input-artifact helpers (22 exports) | Desktop hosts and multimodal clients |
|
|
468
|
+
| `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 |
|
|
469
|
+
| `packages/coding` | `@kodax-ai/kodax/coding` | Full package | Coding agent + 50+ tools + repo-intelligence (505 exports) | Build a Claude Code-shape product |
|
|
470
|
+
| `packages/repl` | `@kodax-ai/kodax/repl` | Full package | Ink TUI + permission modes + commands (217 exports) | Terminal-UI consumers |
|
|
471
|
+
| `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
|
+
| `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 |
|
|
465
473
|
|
|
466
474
|
**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.
|
|
467
475
|
|
|
@@ -479,6 +487,14 @@ KodaX has two layers that consumers should understand separately:
|
|
|
479
487
|
|
|
480
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).
|
|
481
489
|
|
|
490
|
+
**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
|
+
|
|
492
|
+
**Cost-Disciplined Workflow SDK (FEATURE_259, v0.7.67)**: SDK callers configure run-scoped `modelTiers` and `workflow.maxConcurrency`, while workflow authors express semantic `fast` / `balanced` / `deep` intent. Terminal workflow events expose resolved tier/source/fallback/usage/duration facts, and each durable `run.json` contains an `efficiencyReport` with token coverage, role/tier starts, packet-read topology, review waves, and quality-gate outcomes. See the [routing and telemetry contract](docs/SDK_EMBEDDER_GUIDE.md#20-cost-disciplined-workflow-routing-and-telemetry-feature_259-v0767).
|
|
493
|
+
|
|
494
|
+
**Paged Session Listing (FEATURE_261, v0.7.67)**: both `/session` `listSessions()` and `runtime.sessions.list()` accept an exact `surface` filter and opaque continuation `cursor`; each returned summary carries the cursor for the next page. Filtering happens before the page limit, so a host does not need to over-fetch mixed surfaces. See the [pagination recipes](docs/SDK_EMBEDDER_GUIDE.md#19-session-surface-filtering-and-cursor-pagination-feature_261-v0767).
|
|
495
|
+
|
|
496
|
+
**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
|
+
|
|
482
498
|
---
|
|
483
499
|
|
|
484
500
|
## Features
|
|
@@ -588,6 +604,7 @@ For smaller surface and tree-shake-friendly imports, the SDK is also exposed via
|
|
|
588
604
|
import { Runner } from '@kodax-ai/kodax/agent'; // agent runtime
|
|
589
605
|
import { getProvider } from '@kodax-ai/kodax/llm'; // LLM abstraction (15 aliases)
|
|
590
606
|
import { runKodaX } from '@kodax-ai/kodax/coding'; // coding tools + prompts
|
|
607
|
+
import { createImageArtifactFromPath } from '@kodax-ai/kodax/media'; // input artifacts
|
|
591
608
|
import { SkillRegistry } from '@kodax-ai/kodax/skills'; // zero-dep skill loader
|
|
592
609
|
import { loadConfig } from '@kodax-ai/kodax/repl'; // REPL config / session helpers
|
|
593
610
|
import { createMcpManager } from '@kodax-ai/kodax/mcp'; // MCP popout manager (v0.7.42)
|
|
@@ -595,7 +612,12 @@ import { listSessions } from '@kodax-ai/kodax/session'; // session histo
|
|
|
595
612
|
import { createKodaXRuntime } from '@kodax-ai/kodax/runtime'; // embedded/daemon runtime API
|
|
596
613
|
```
|
|
597
614
|
|
|
598
|
-
All
|
|
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.
|
|
616
|
+
|
|
617
|
+
For the complete host-facing contract — including embedded/Worker/daemon ownership,
|
|
618
|
+
external-agent registration and task control, session cursor pagination, workflow
|
|
619
|
+
model-tier routing, and efficiency telemetry — see the
|
|
620
|
+
[SDK Embedder Integration Guide](docs/SDK_EMBEDDER_GUIDE.md).
|
|
599
621
|
|
|
600
622
|
> **ESM-only.** The SDK is published as ES Modules. In a CommonJS context (Electron main process, legacy Webpack CJS bundles, `require()`-based code) you must use `await import(...)` instead of `require()`. See [docs/SDK_EMBEDDER_GUIDE.md §5](docs/SDK_EMBEDDER_GUIDE.md#5-consuming-from-a-commonjs-context-electron-main-cjs-bundles) for the canonical recipe + the technical reason most subpaths cannot ship a dual ESM/CJS build.
|
|
601
623
|
|
|
@@ -653,10 +675,21 @@ kodax --session my-project "Summarize it"
|
|
|
653
675
|
kodax --session my-project "How should I fix the first issue?"
|
|
654
676
|
|
|
655
677
|
# Session management
|
|
656
|
-
kodax
|
|
657
|
-
kodax
|
|
678
|
+
kodax -r # Search, page, and select a non-empty session
|
|
679
|
+
kodax -r <session-id> # Resume a known session directly
|
|
680
|
+
kodax -r "Review runtime" # Resume a unique exact title; duplicates open the picker
|
|
681
|
+
kodax --session list # List up to 50 non-empty sessions
|
|
682
|
+
kodax --session cleanup-acp # Preview strictly matched empty ACP-test pollution
|
|
658
683
|
```
|
|
659
684
|
|
|
685
|
+
Bare `-r` opens an interactive picker with incremental search, arrow/PageUp/PageDown
|
|
686
|
+
navigation, Tab completion, full selected-session ID display, and Enter-to-resume.
|
|
687
|
+
An explicit value checks the complete session ID first, then an exact
|
|
688
|
+
case-insensitive title; duplicate titles open a narrowed picker instead of
|
|
689
|
+
silently choosing one. Cleanup is preview-only unless
|
|
690
|
+
`--apply-session-cleanup` is also provided; matching sessions are archived rather
|
|
691
|
+
than permanently deleted.
|
|
692
|
+
|
|
660
693
|
### Session Patterns
|
|
661
694
|
|
|
662
695
|
```bash
|
|
@@ -691,7 +724,7 @@ kodax Start the interactive REPL
|
|
|
691
724
|
-h, --help [topic] Show help or topic help
|
|
692
725
|
-p, --print <text> Run a single task and exit
|
|
693
726
|
-c, --continue Continue the most recent conversation in this directory
|
|
694
|
-
-r, --resume [
|
|
727
|
+
-r, --resume [value] Resume by ID/exact title, or open the searchable picker
|
|
695
728
|
-m, --provider Provider to use
|
|
696
729
|
--model <name> Override the model
|
|
697
730
|
--reasoning <mode> off | auto | quick | balanced | deep
|
|
@@ -882,7 +915,7 @@ await runKodaX({
|
|
|
882
915
|
|
|
883
916
|
## SDK Usage
|
|
884
917
|
|
|
885
|
-
KodaX ships as a single npm package `@kodax-ai/kodax` with
|
|
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:
|
|
886
919
|
|
|
887
920
|
```bash
|
|
888
921
|
npm install @kodax-ai/kodax
|
|
@@ -899,6 +932,7 @@ import { SkillRegistry } from '@kodax-ai/kodax/skills'; // zero-dep sk
|
|
|
899
932
|
import { createMcpManager } from '@kodax-ai/kodax/mcp'; // MCP popout manager (v0.7.42)
|
|
900
933
|
import { listSessions } from '@kodax-ai/kodax/session'; // session history helpers
|
|
901
934
|
import { createKodaXRuntime } from '@kodax-ai/kodax/runtime'; // embedded/daemon runtime API
|
|
935
|
+
import { createMemoryAgent } from '@kodax-ai/kodax/experimental-memory'; // opt-in experimental memory SDK
|
|
902
936
|
```
|
|
903
937
|
|
|
904
938
|
> The SDK is **ESM-only**. CommonJS consumers (Electron main / Webpack CJS / `require()` callers) must use `await import('@kodax-ai/kodax/...')` — see [docs/SDK_EMBEDDER_GUIDE.md §5](docs/SDK_EMBEDDER_GUIDE.md#5-consuming-from-a-commonjs-context-electron-main-cjs-bundles).
|
|
@@ -1048,6 +1082,7 @@ await runInkInteractiveMode({ provider: 'zhipu-coding', effort: 'auto' });
|
|
|
1048
1082
|
| Coding tasks | `@kodax-ai/kodax/coding` | Complete coding agent + tools |
|
|
1049
1083
|
| Terminal app | `@kodax-ai/kodax/repl` | Full interactive experience |
|
|
1050
1084
|
| Runtime host / daemon client | `@kodax-ai/kodax/runtime` | Sessions, runs, events, permissions, catalog, MCP, artifacts, diagnostics |
|
|
1085
|
+
| Experimental governed memory | `@kodax-ai/kodax/experimental-memory` | Scoped `MemoryAgent` / `MemorySession` recall and outcome contracts |
|
|
1051
1086
|
|
|
1052
1087
|
---
|
|
1053
1088
|
|
package/README_CN.md
CHANGED
|
@@ -213,9 +213,13 @@ import { SkillRegistry } from '@kodax-ai/kodax/skills'; // 零依赖 ski
|
|
|
213
213
|
import { loadConfig } from '@kodax-ai/kodax/repl'; // REPL 配置 / session 工具
|
|
214
214
|
import { createMcpManager } from '@kodax-ai/kodax/mcp'; // MCP popout manager(v0.7.42 起)
|
|
215
215
|
import { listSessions } from '@kodax-ai/kodax/session'; // session 历史工具
|
|
216
|
+
import { createKodaXRuntime } from '@kodax-ai/kodax/runtime'; // embedded/Worker/daemon 宿主 API
|
|
217
|
+
import { createMemoryAgent } from '@kodax-ai/kodax/experimental-memory'; // opt-in 实验性记忆 SDK
|
|
216
218
|
```
|
|
217
219
|
|
|
218
|
-
|
|
220
|
+
11 个 SDK 入口(root + 10 subpath)通过 ESM 共享 chunk 复用底层代码 —— 只 import `/agent` 不会把 `/repl` 的 Ink + React 一起拉进来。
|
|
221
|
+
|
|
222
|
+
完整的宿主集成契约——包括 embedded/Worker/daemon 所有权、外部 Agent 注册与任务控制、session cursor 分页、workflow 模型分层和效率遥测——见 [SDK Embedder Integration Guide](docs/SDK_EMBEDDER_GUIDE.md)。
|
|
219
223
|
|
|
220
224
|
> **SDK 是 ESM-only**。在 CommonJS 上下文(Electron main 进程、传统 Webpack CJS bundle、`require()` 调用方)必须用 `await import('@kodax-ai/kodax/...')` 代替 `require()`。详见 [docs/SDK_EMBEDDER_GUIDE.md §5](docs/SDK_EMBEDDER_GUIDE.md#5-consuming-from-a-commonjs-context-electron-main-cjs-bundles),含 Electron main 完整 recipe + 为什么大多数 subpath 物理上无法做 dual ESM/CJS bundle。
|
|
221
225
|
|
|
@@ -366,8 +370,13 @@ daemon 形态使用独立进程并允许多个客户端共享。`runtime.close()
|
|
|
366
370
|
私有 inline/Worker Runtime,但对 daemon 只断开当前客户端。矛盾的隔离参数
|
|
367
371
|
会直接报错,不会静默降级。Worker 是 V8 故障隔离边界,不是安全沙箱。
|
|
368
372
|
|
|
373
|
+
daemon 按设计会持续驻留。测试若自动启动 daemon,删除临时 home 前还必须执行
|
|
374
|
+
`kodax daemon stop --home <目录> --profile <名称>`(或发送已认证的
|
|
375
|
+
`runtime.shutdown`)。不要按进程名批量结束 Node;应先核验命令行和父进程归属。
|
|
376
|
+
|
|
369
377
|
```bash
|
|
370
378
|
kodax daemon start
|
|
379
|
+
kodax daemon stop --profile default
|
|
371
380
|
kodax --runtime-mode daemon
|
|
372
381
|
kodax -p "检查这个仓库" --runtime-mode daemon
|
|
373
382
|
```
|
|
@@ -521,7 +530,7 @@ kodax --repo-intelligence full --repo-intelligence-trace
|
|
|
521
530
|
|
|
522
531
|
## 仓库结构
|
|
523
532
|
|
|
524
|
-
KodaX 是基于 npm workspaces 的 TypeScript monorepo,**源码层 4 个 workspace 包**(FEATURE_194 v0.7.43 包合并 — 9 → 4,ADR-036),npm 上以单 bundle 包 `@kodax-ai/kodax` 发布 +
|
|
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)。核心包:
|
|
525
534
|
|
|
526
535
|
| Workspace 包 | 作用 | 主要依赖 |
|
|
527
536
|
|----|------|---------|
|
|
@@ -530,26 +539,29 @@ KodaX 是基于 npm workspaces 的 TypeScript monorepo,**源码层 4 个 works
|
|
|
530
539
|
| `@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` |
|
|
531
540
|
| `@kodax-ai/repl` | 完整交互式终端 UI(Ink / React、权限模式、命令系统、流式渲染) | `@kodax-ai/coding`, `ink`, `react` |
|
|
532
541
|
|
|
533
|
-
根目录 `src/kodax_cli.ts` 是 CLI 入口;`src/sdk-{agent,llm,coding,media,repl,skills,mcp,session}.ts` 是 SDK subpath 入口;构建产物在 `dist/`,单文件二进制在 `dist/binary/<target>/`。
|
|
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>/`。
|
|
534
543
|
|
|
535
544
|
### 源码层 vs npm 发布层
|
|
536
545
|
|
|
537
546
|
KodaX 有两层结构,SDK 用户需要分开理解:
|
|
538
547
|
|
|
539
548
|
- **源码层**:上面 4 个 workspace 包(开发者读代码时看到的物理结构)。
|
|
540
|
-
- **npm 发布层**:单个 bundled 包 `@kodax-ai/kodax`,对外暴露
|
|
549
|
+
- **npm 发布层**:单个 bundled 包 `@kodax-ai/kodax`,对外暴露 10 个 SDK subpath(SDK 消费者 `import` 时看到的接口)。subpath 分两种角色:
|
|
541
550
|
- **完整包 subpath**(`/agent`、`/llm`、`/coding`、`/repl`)—— 每个 1:1 对应一个源码包,暴露完整公开 API。
|
|
542
|
-
- **窄子集 subpath**(`/media`、`/skills`、`/mcp`、`/session`)—— 从 `/agent` 或 `/repl`
|
|
551
|
+
- **窄子集 subpath**(`/media`、`/skills`、`/mcp`、`/session`、`/experimental-memory`)—— 从 `/agent` 或 `/repl` 切出聚焦能力;`/experimental-memory` 明确为 opt-in 不稳定接口。
|
|
543
552
|
|
|
544
553
|
| 源码包 | npm subpath | 类型 | 内容 | 典型消费者 |
|
|
545
554
|
|---|---|---|---|---|
|
|
546
|
-
| `packages/llm` | `@kodax-ai/kodax/llm` | 完整包 | 15-alias LLM 抽象 (
|
|
547
|
-
| `packages/agent` | `@kodax-ai/kodax/agent` | 完整包 | Runner / fan-out / session-lineage / capabilities / tracing (
|
|
555
|
+
| `packages/llm` | `@kodax-ai/kodax/llm` | 完整包 | 15-alias LLM 抽象 (108 exports) | 独立 LLM 客户端 |
|
|
556
|
+
| `packages/agent` | `@kodax-ai/kodax/agent` | 完整包 | Runner / fan-out / 外部 Agent plane / session-lineage / capabilities / tracing (331 exports) | 自定义 agent 框架 |
|
|
548
557
|
| `packages/agent` | `@kodax-ai/kodax/skills` | **窄子集** | 仅 Skills 系统 —— `SkillRegistry` / `loadFullSkill` / `expandSkillForLLM` 等 (26 exports = v0.7.43 之前 `@kodax-ai/skills` 完整 API) | Skill 加载器、IDE 插件 |
|
|
549
|
-
| `packages/agent` | `@kodax-ai/kodax/mcp` | **窄子集** | 仅 MCP —— `McpCapabilityProvider` / `createMcpTransport` / `searchMcpCatalog` 等 (
|
|
550
|
-
| `packages/
|
|
551
|
-
| `packages/
|
|
552
|
-
| `packages/
|
|
558
|
+
| `packages/agent` | `@kodax-ai/kodax/mcp` | **窄子集** | 仅 MCP —— `McpCapabilityProvider` / `createMcpTransport` / `searchMcpCatalog` 等 (23 exports) | MCP server 宿主 |
|
|
559
|
+
| `packages/agent` | `@kodax-ai/kodax/media` | **窄子集** | 结构化图片/文件/视频输入 artifact helpers (22 exports) | 桌面宿主、多模态客户端 |
|
|
560
|
+
| `packages/agent` | `@kodax-ai/kodax/experimental-memory` | **实验性子集** | F228-backed `MemoryAgent` / `MemorySession` scope、recall、query、observation、outcome 契约 | 显式评估 FEATURE_260 的 SDK 宿主 |
|
|
561
|
+
| `packages/coding` | `@kodax-ai/kodax/coding` | 完整包 | Coding agent + 50+ 工具 + repo-intelligence (505 exports) | 构建 Claude Code 形态产品 |
|
|
562
|
+
| `packages/repl` | `@kodax-ai/kodax/repl` | 完整包 | Ink TUI + 权限模式 + 命令系统 (217 exports) | 终端 UI 消费者 |
|
|
563
|
+
| `packages/repl` | `@kodax-ai/kodax/session` | **窄子集** | 仅会话管理 —— `listSessions` / `loadFullTranscript` / `appendClientNotice` / `forkSession` / `compactSession` / `watchSessions` 等 (17 exports) | 读取 session 历史的 IDE 插件和桌面宿主 |
|
|
564
|
+
| `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 |
|
|
553
565
|
|
|
554
566
|
**经验法则**:需要 Runner / Agent / fan-out 时从 `/agent` 引入;只需要 skills 或 mcp API 时从 `/skills` 或 `/mcp` 引入,bundle 更小。窄子集是完整包的真子集 —— **不会**有额外符号。
|
|
555
567
|
|
|
@@ -557,6 +569,14 @@ KodaX 有两层结构,SDK 用户需要分开理解:
|
|
|
557
569
|
|
|
558
570
|
**宿主读持久化历史(FEATURE_230 + FEATURE_234,v0.7.51;v0.7.63 hardening)**:面向「宿主读持久化状态」的 additive 闭环。**持久化工具记录回放**——resume 的会话现在会回放助手用过的工具卡片,而不是退化成纯文本。`messages` / `lineage` 仍是 canonical;`SessionData.uiHistory` 成为有界、脱敏、仅 terminal 状态的回放缓存。SDK transcript 契约明确化:`loadSession()` = 活动 model context,`loadFullTranscript()` = 带结构化条目的追加序 host scrollback(`message` / `compaction` / `branch_summary` / `rewind_marker` / `client_notice` / `task_result`)并带 clone provenance(`logicalId` / `sourceEntryId`),`uiHistory` = 可选回放缓存,工具卡片始终可从 canonical messages 重建。宿主可用 `appendClientNotice()` 持久化本地 slash 输出且不进入模型上下文;workflow/child 完成结果通过结构化 `taskResults[]` 暴露,不再要求解析 `<task-completed>` 文本。`rewind_marker` 只用于 host scrollback 审计,不进入 model-context messages。**Workflow run 宿主归属**——`WorkflowProcessTrackerOptions` / `WorkflowProcessSnapshot` 新增 host-owned 不透明 `hostMetadata?: Record<string, string>`,SDK 存储、持久化进 `run.json`、回读回显(含进程重启后)但不解释其含义,让宿主零侧表把 run 归回发起它的 session/surface。未 stamp 的旧 run 诚实回显 `hostMetadata === undefined`。详见 [docs/features/v0.7.51.md](docs/features/v0.7.51.md)。
|
|
559
571
|
|
|
572
|
+
**会话恢复与 ACP 污染修复(FEATURE_261,v0.7.67)**:直接运行 `kodax -r` 会进入可搜索、上下选择、Tab 补全和翻页的交互式会话选择器,并显示当前选中项的完整 session ID;`kodax -r <值>` 优先按完整 ID 恢复,ID 不存在时再按忽略大小写的完整标题匹配。标题唯一则直接恢复,同名标题则进入只包含候选项的选择器,绝不静默选第一条。`listSessions()` / Runtime / daemon 会话列表新增 `surface` 精确过滤和不透明 `cursor` 分页。ACP session 改为收到首个有效 prompt 后才持久化,ACP 测试强制使用临时 runtime home,避免测试记录写入真实 `~/.kodax/sessions`。`kodax -s cleanup-acp` 只预览严格匹配的空 ACP 污染记录;仅显式追加 `--apply-session-cleanup` 时才归档,不做永久删除。
|
|
573
|
+
|
|
574
|
+
**实验性 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
|
+
|
|
576
|
+
**外部 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
|
+
|
|
578
|
+
**成本受控 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)。
|
|
579
|
+
|
|
560
580
|
**Inline workflow authoring(FEATURE_246,v0.7.58)**:AMA/AMAW 下 Worker 现在可通过 model-callable 的 `run_workflow` 工具在会话内直接编写并运行工作流——先用自己的工具 scout 代码库,再把具体发现烤进每个 child prompt,然后走**不变的** sandbox + 静态校验 + postcondition 验证流水线。它取代 context-blind 的 `sideQuery` generator 成为主交互路径(generator 仅作为显式 `/workflow create` 命令与无 investigating Worker 的 non-interactive/CI 主机的 fallback 保留);新增结构化 child 输出(`outputSchema`)、无 barrier 的 `wf.pipeline` 分阶段原语、同会话 resume(`resumeFromRunId`)、嵌套 `wf.workflow(...)`,`/workflow create` 重定向到 Worker 的 scout-then-author;`run_workflow` 为 async / idle-yield,不阻塞当前轮。中立的 run-lifecycle manager(`createWorkflowRunManager`)已移入 `@kodax-ai/kodax/agent` 供非 coding SDK 宿主使用。详见 [docs/features/v0.7.58.md](docs/features/v0.7.58.md) 与 [docs/ADR.md](docs/ADR.md) ADR-044/046/047/048/049。
|
|
561
581
|
|
|
562
582
|
**工作流激活分层(FEATURE_248 + FEATURE_249,v0.7.59)**:三种 agent 模式现在有一致的工作流姿态。**AMAW** 携带 mode-level 的 `ORCHESTRATION DEFAULT` 常驻指令(对齐参考实现的 "ultracode" 姿态):实质性工作——多文件调查、设计决策、任何做错代价高的任务——默认编排多个交叉验证的 agent,并有 PLAN-TIME COMMITMENT 流程修正把 orchestrate-vs-solo 决策前置到第 0 轮。**AMA** 同样 host `run_workflow` 工具但没有常驻指令——当你用自然语言请求编排时才激活,绝不因复杂度独自触发。**SA** 保持单独作业。该指令通过 `amawOrchestrationAvailable` 关闭泄漏,因此 AMA 与 SA 的 prompt 保持逐字节一致。详见 [docs/features/v0.7.59.md](docs/features/v0.7.59.md)。
|
|
@@ -580,9 +600,9 @@ KodaX/ # 4 workspace packages(FEATURE_194 v0.7.43)
|
|
|
580
600
|
│ └── repl/ # @kodax-ai/repl —— Ink TUI
|
|
581
601
|
├── src/
|
|
582
602
|
│ ├── kodax_cli.ts # CLI 主入口(bin: `kodax`)
|
|
583
|
-
│ └── sdk-*.ts # SDK subpath 入口 → @kodax-ai/kodax/{agent,llm,coding,media,repl,skills,mcp,session}
|
|
603
|
+
│ └── sdk-*.ts # SDK subpath 入口 → @kodax-ai/kodax/{agent,llm,coding,media,repl,skills,mcp,session,runtime,experimental-memory}
|
|
584
604
|
├── scripts/
|
|
585
|
-
│ ├── build-bundle.mjs # esbuild 单 bundle 多 entry 打包(CLI + root +
|
|
605
|
+
│ ├── build-bundle.mjs # esbuild 单 bundle 多 entry 打包(CLI + root + 10 SDK subpath + chunks)
|
|
586
606
|
│ ├── build-binary.mjs # Bun --compile 单文件二进制打包
|
|
587
607
|
│ └── release.mjs # ADR-024 release-time pkg name/exports 注入
|
|
588
608
|
└── .github/workflows/
|
|
@@ -676,6 +696,7 @@ KodaX 现在会把 Repo Intelligence 的本地缓存分成内置引擎 profile
|
|
|
676
696
|
## 文档
|
|
677
697
|
|
|
678
698
|
- [README.md](README.md) - 英文版 README
|
|
699
|
+
- [docs/SDK_EMBEDDER_GUIDE.md](docs/SDK_EMBEDDER_GUIDE.md) - SDK 宿主集成与 v0.7.68 公共 API 契约
|
|
679
700
|
- [docs/release.md](docs/release.md) - 单文件二进制构建与发布流程
|
|
680
701
|
- [docs/PRD.md](docs/PRD.md) - 产品需求
|
|
681
702
|
- [docs/ADR.md](docs/ADR.md) - 架构决策
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @kodax-ai/kodax — bundled distribution. See docs/ADR.md ADR-022 + ADR-024.
|
|
2
|
+
import{$ as g,I as c,J as d,K as e,L as f,aa as h,ta as i,za as j}from"./chunk-HLBHSA2B.js";import"./chunk-D6QVXQNI.js";import"./chunk-PEGSHZAA.js";import"./chunk-HFM2D5BP.js";import"./chunk-C4SBXBWH.js";import"./chunk-K2NCKRVY.js";import{kb as a,lb as b}from"./chunk-67XJ4YUA.js";import"./chunk-5GL55MOH.js";import"./chunk-PZTG2C33.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-CTHUX5ZH.js";import"./chunk-OIELNE6Z.js";import"./chunk-TOGESFRN.js";import"./chunk-KIQRCGVR.js";import"./chunk-CC4BVVE7.js";import"./chunk-KGAI32VS.js";import"./chunk-HLBHSA2B.js";import"./chunk-D6QVXQNI.js";import"./chunk-PEGSHZAA.js";import"./chunk-HFM2D5BP.js";import"./chunk-C4SBXBWH.js";import"./chunk-K2NCKRVY.js";import"./chunk-67XJ4YUA.js";import"./chunk-5GL55MOH.js";import"./chunk-PZTG2C33.js";import"./chunk-ONUPGMER.js";export{a as ArgumentCompleter,b as createArgumentCompleter};
|