@kodax-ai/kodax 0.7.70 → 0.7.71

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. package/CHANGELOG.md +134 -0
  2. package/README.md +73 -23
  3. package/README_CN.md +53 -11
  4. package/config-templates/integrations/a2a.example.jsonc +62 -18
  5. package/dist/chunks/{agent-T72XYPW4.js → agent-X2EWQADL.js} +1 -1
  6. package/dist/chunks/argument-completer-BLNXDO2F.js +2 -0
  7. package/dist/chunks/chunk-23X6REO4.js +46 -0
  8. package/dist/chunks/{chunk-Y4WOTWUC.js → chunk-44QXPEEE.js} +1 -1
  9. package/dist/chunks/chunk-4DY756KL.js +70 -0
  10. package/dist/chunks/{chunk-AWMTNUDS.js → chunk-52JSZ77P.js} +1 -1
  11. package/dist/chunks/{chunk-I4TPQEJN.js → chunk-64NQBOSN.js} +1 -1
  12. package/dist/chunks/{chunk-F4NOOBRZ.js → chunk-A2TFSV5M.js} +1 -1
  13. package/dist/chunks/{chunk-4P4L3WEK.js → chunk-A574DBTV.js} +2 -2
  14. package/dist/chunks/{chunk-K7RYV2SE.js → chunk-F7KGYHJ3.js} +2 -2
  15. package/dist/chunks/{chunk-P2UKNYYS.js → chunk-GVTM4Z6O.js} +66 -22
  16. package/dist/chunks/{chunk-GOQRVDFP.js → chunk-PHH4TRGF.js} +2 -2
  17. package/dist/chunks/{chunk-AQGNRBEJ.js → chunk-PVUXONQB.js} +140 -140
  18. package/dist/chunks/{chunk-WW2O2DEP.js → chunk-SX2WFHIS.js} +1 -1
  19. package/dist/chunks/{chunk-RY5OLVQV.js → chunk-T7LYK53M.js} +2 -2
  20. package/dist/chunks/{chunk-F7C7J6IM.js → chunk-VRSVNU2Y.js} +3 -3
  21. package/dist/chunks/chunk-Y5XKAN7C.js +755 -0
  22. package/dist/chunks/{chunk-XNQ2O7NI.js → chunk-Z535BARK.js} +4 -4
  23. package/dist/chunks/chunk-ZJIMT5I3.js +78 -0
  24. package/dist/chunks/compaction-config-5KKKXYFT.js +2 -0
  25. package/dist/chunks/{construction-bootstrap-BPRXZK4A.js → construction-bootstrap-OXDDDW6O.js} +1 -1
  26. package/dist/chunks/{dist-DRBKYVHF.js → dist-GOUP4YVE.js} +1 -1
  27. package/dist/chunks/{dist-UENHF5OS.js → dist-IXJRJ27U.js} +1 -1
  28. package/dist/chunks/host-VRKDAN26.js +2 -0
  29. package/dist/chunks/run-manager-Z3W6MDO7.js +2 -0
  30. package/dist/chunks/{utils-TMMH6PKT.js → utils-CFOXDCB5.js} +1 -1
  31. package/dist/index.d.ts +15 -15
  32. package/dist/index.js +1 -1
  33. package/dist/kodax_cli.js +1168 -1114
  34. package/dist/provider-capabilities.json +101 -57
  35. package/dist/runtime-worker.js +1073 -1019
  36. package/dist/sdk-a2a.d.ts +185 -20
  37. package/dist/sdk-a2a.js +8 -8
  38. package/dist/sdk-agent.d.ts +47 -18
  39. package/dist/sdk-agent.js +1 -1
  40. package/dist/sdk-coding.d.ts +18 -18
  41. package/dist/sdk-coding.js +1 -1
  42. package/dist/sdk-experimental-memory.d.ts +1 -1
  43. package/dist/sdk-experimental-memory.js +1 -1
  44. package/dist/sdk-llm.d.ts +6 -6
  45. package/dist/sdk-llm.js +1 -1
  46. package/dist/sdk-mcp.js +1 -1
  47. package/dist/sdk-media.d.ts +1 -1
  48. package/dist/sdk-media.js +1 -1
  49. package/dist/sdk-repl.d.ts +16 -16
  50. package/dist/sdk-repl.js +1 -1
  51. package/dist/sdk-runtime.d.ts +22 -12
  52. package/dist/sdk-runtime.js +1 -1
  53. package/dist/sdk-session.d.ts +6 -6
  54. package/dist/sdk-session.js +1 -1
  55. package/dist/sdk-skills.js +1 -1
  56. package/dist/semantic-worker.js +9 -9
  57. package/dist/types-chunks/{base.d-CYjtB68X.d.ts → base.d-Cz_rwpOi.d.ts} +2 -1
  58. package/dist/types-chunks/{bash-prefix-extractor.d-h9AwGqmO.d.ts → bash-prefix-extractor.d-YoiZl5yt.d.ts} +3 -3
  59. package/dist/types-chunks/{capability-learning.d-WtsyRv3O.d.ts → capability-learning.d-_lR0J4iR.d.ts} +1 -1
  60. package/dist/types-chunks/{capsule.d-xJvfh4YR.d.ts → capsule.d-CK5Pfz1k.d.ts} +3 -3
  61. package/dist/types-chunks/{commands.d-DxiVanpI.d.ts → commands.d-D6g2jq8V.d.ts} +4 -4
  62. package/dist/types-chunks/{guardrail.d-R7AiGfrI.d.ts → guardrail.d-DdeDWnVu.d.ts} +3 -3
  63. package/dist/types-chunks/{guardrail.d-6ZDbNbHO.d.ts → guardrail.d-DilYC1dh.d.ts} +1 -1
  64. package/dist/types-chunks/{public-api.d-BqFKI5fK.d.ts → public-api.d-BvCp5VkW.d.ts} +3 -3
  65. package/dist/types-chunks/{resolver.d-CIVoGc97.d.ts → resolver.d-ssgNSlrh.d.ts} +2 -2
  66. package/dist/types-chunks/{run-manager.d-BaXtkryp.d.ts → run-manager.d-DxU3SSGR.d.ts} +1 -1
  67. package/dist/types-chunks/{sdk-session-tcoxrMHQ.d.ts → sdk-session-wGpa7X_U.d.ts} +4 -4
  68. package/dist/types-chunks/{types.d-CJR7t6iW.d.ts → types.d-CEZZSY9s.d.ts} +2 -2
  69. package/dist/types-chunks/{types.d-BtC4yLYO.d.ts → types.d-CRCaLt_s.d.ts} +55 -7
  70. package/dist/types-chunks/{types.d-TTvpAGWf.d.ts → types.d-Cqaw71Ax.d.ts} +4 -2
  71. package/dist/types-chunks/{types.d-DZaYznxo.d.ts → types.d-CzsLFqmf.d.ts} +4 -4
  72. package/dist/types-chunks/{utils.d-B4zc7oot.d.ts → utils.d-Cb6vdvFM.d.ts} +5 -5
  73. package/docs/SDK_EMBEDDER_GUIDE.md +250 -41
  74. package/package.json +4 -1
  75. package/dist/chunks/argument-completer-QXJC36UP.js +0 -2
  76. package/dist/chunks/chunk-34L74PEG.js +0 -60
  77. package/dist/chunks/chunk-7PV577LP.js +0 -755
  78. package/dist/chunks/chunk-NGHQIGVW.js +0 -46
  79. package/dist/chunks/chunk-UJEMSPM5.js +0 -78
  80. package/dist/chunks/compaction-config-TC6C2PJ6.js +0 -2
  81. package/dist/chunks/host-XUVAICP7.js +0 -2
  82. package/dist/chunks/run-manager-T7ALQZNT.js +0 -2
package/CHANGELOG.md CHANGED
@@ -6,6 +6,140 @@ All notable changes to this project will be documented in this file.
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.7.71] - 2026-07-17
10
+
11
+ ### Added
12
+
13
+ - **Kimi Code K3 support.** The `kimi-code` subscription provider now exposes
14
+ `k3-256k` (Moderato) and `k3` (1,048,576 context tokens, Allegretto+) as
15
+ explicit catalog choices, alongside `kimi-for-coding-highspeed` and the
16
+ stable `kimi-for-coding` default. Both K3 choices send the upstream model id
17
+ `k3`, so users do not need to override compaction settings for their plan.
18
+ K3 sends its effort inside `thinking.effort` on both Anthropic- and
19
+ OpenAI-compatible transports, defaults omitted reasoning to `max`, and
20
+ preserves both legacy `reasoning=false` and explicit `effort=none` as disabled
21
+ thinking. Static capability, reasoning, media, cost-tracking, and opt-in
22
+ real-wire regressions cover the subscription routes and local context-tier
23
+ mapping.
24
+ - **Standards-based A2A authentication and Agent activation (FEATURE_267/268
25
+ closure).** Outbound A2A entries can use OAuth 2.0 Client Credentials with an
26
+ external Authorization Server, while inbound KodaX Agents can validate RFC
27
+ 9068 JWT access tokens against an external issuer/JWKS as an OAuth Resource
28
+ Server. The fixed environment Bearer profile remains available for
29
+ compatibility. A hot `agents.<name>.enabled` switch plus `kodax a2a
30
+ enable|disable` lets operators keep many configured third-party Agents while
31
+ controlling which ones admit new orchestration; in-flight tasks are not
32
+ cancelled.
33
+
34
+ ### Changed
35
+
36
+ - **External Agent SDK migration notes.** `AgentRegistrationService` now
37
+ requires `setEnabled`; custom implementations must add the same
38
+ revision/owner-conditional enablement operation. `executorConfig` and
39
+ executor-reference `metadata` are `AgentJsonObject` values and reject class
40
+ instances, accessors, circular references, and other non-JSON-safe data at
41
+ runtime. SDK daemon auto-start without an explicit `homeDir` now follows the
42
+ resolved `KODAX_HOME`; embedders that intentionally need the OS-home endpoint
43
+ must pass `homeDir`, while custom endpoints remain attach-only.
44
+
45
+ ### Fixed
46
+
47
+ - **A2A durable-owner upgrade and admission concurrency.** New inbound tasks
48
+ persist a non-secret principal-key scheme marker. Pre-realm tasks remain
49
+ inaccessible during normal serving, but stopped operators can use
50
+ `kodax a2a migrate-tasks` to dry-run and explicitly apply the configured
51
+ owner mapping; custom hosts can use the public
52
+ `migrateA2ALegacyTaskOwners()` SDK with exact mappings. Ambiguous or live-
53
+ store migration fails closed. Global task capacity now uses a synchronous
54
+ pending reservation, keeping slow workspace/session/run preparation outside
55
+ any global lock while preserving exact limits and per-principal ordering.
56
+ - **Bounded External Agent and daemon shutdown/startup.** Executor-plane close
57
+ now has a 30-second default upper bound (overrideable with `closeTimeoutMs`),
58
+ obsolete-executor cleanup runs outside the serialized registration mutation
59
+ lane, and revision tombstones are SHA-256 fingerprints capped at 4,096
60
+ entries. Current registrations and task snapshots continue to enforce exact
61
+ revision immutability after older, unreferenced tombstones age out. Daemon
62
+ auto-start now races health checks against the spawned child's exit, keeps
63
+ the child referenced until readiness, and terminates it on early exit,
64
+ timeout, identity mismatch, or when another daemon wins ownership. A startup
65
+ candidate that exits after losing the owner race now lets its SDK caller wait
66
+ for and attach to the competing owner instead of failing that caller.
67
+ - **Faster packaged-Electron gates.** Release jobs build once and reuse that
68
+ output for both the Windows Electron smoke and binary packaging. CI and
69
+ release jobs cache the version-pinned Electron smoke toolchain, whose local
70
+ directory is now explicitly ignored. Both paths explicitly materialize the
71
+ Electron binary after cache restore or dependency installation, preventing a
72
+ successful npm package install with a missing `electron/dist` from bypassing
73
+ the real packaged-daemon gate.
74
+ - **A2A authentication and reconciliation hardening.** Card-level and
75
+ Skill-level security requirements now fail closed unless one complete
76
+ alternative is satisfiable. Card, RPC, and token origins remain separate;
77
+ exact credentials used by active RPC/SSE requests remain retained through
78
+ response parsing and are redacted from errors and successful results;
79
+ concurrent rejected-token invalidation cannot discard a newer token and each
80
+ RPC retries at most once. Direct SDK and file configuration now share strict
81
+ issuer, endpoint, resource, and RFC 6749 scope validation. Task ownership
82
+ also requires a stable `securityRealm` and hashes the
83
+ `(realm, subject, tenant)` tuple: built-in Bearer/OAuth derive realms from the
84
+ token-env name/exact issuer, custom authentication must provide one, authority
85
+ switches and legacy pre-realm tasks fail closed, and same-realm restart
86
+ preserves new-format tasks. Authentication/effect changes participate in
87
+ executor revisions; registration persistence
88
+ precedes catalog mutation; first-class management ownership plus revision-
89
+ conditional mutations protects unrelated or concurrently replaced SDK
90
+ registrations, including same-revision owner takeovers; changed authority is
91
+ fenced before parallel discovery; live drift is repaired; and a final
92
+ post-preflight admission check closes disable/removal races without
93
+ rediscovering unchanged peers. Internal immutable route snapshots preserve
94
+ admitted task input/cancel/reconcile routing across registration update or
95
+ removal and Runtime restart without exposing secret material or expanding the
96
+ public task DTO. Admission now rechecks globally unique task IDs, task writes
97
+ publish to memory only after durable persistence, and terminal event-write
98
+ failures cannot strand waiters or route snapshots. Returned registration
99
+ summaries are detached, executor cache keys are unambiguous tuples, and one
100
+ ownership conflict or observer failure cannot abort unrelated Agent
101
+ reconciliation or leave unawaited activation work. Daemon A2A ownership is
102
+ now bound to the exact resolved config home—`<homeDir>/.kodax` when explicitly
103
+ selected, otherwise the possibly arbitrary `KODAX_HOME`—recorded in daemon
104
+ state, and checked across every local profile before mutation. Legacy
105
+ non-empty version-1 A2A files require an explicit stopped-owner migration,
106
+ while version-2 migration is a read-only idempotent no-op. Failed initial A2A
107
+ reconciliation also closes the newly created Runtime before releasing daemon
108
+ ownership.
109
+ - **A2A post-closure lifecycle and resource correctness.** Executor operations
110
+ and close now drain without disposal races; configured artifact references
111
+ and direct `a2a call` use a bounded reference-only/no-fetch policy. CLI task
112
+ RPC/SSE permits 32 MiB while Card/interface/OAuth/security metadata remains
113
+ capped at 2 MiB, and unsupported required Card extensions fail discovery.
114
+ Daemon mutation now requires independently owner-derived
115
+ `externalAgentAdmin: 1` and `a2aConfigReconciler: 1`; capability overrides
116
+ cannot forge them. Public `/a2a` config exports are read-only, with raw writers
117
+ retained inside the fenced CLI owner. Inbound serving now has a global
118
+ admission reservation, subscribe-first replay, authentication-before-body,
119
+ exact JSON/SSE media matching, an admitted-handler close barrier, and fixed
120
+ four-per-task/eight-per-server/24 MiB-per-stream SSE ceilings without
121
+ terminating the underlying task for one slow subscriber.
122
+ - **Public Kimi Open Platform parity and live coverage.** `kimi` now defaults to
123
+ `kimi-k2.7-code`, exposes the HighSpeed route and wire-legal K2.5 id, uses the
124
+ exact 262,144-token limits and current prices, and has gated real-key coverage
125
+ for credential verification, K2.7 thinking, forced-tool fallback, and K2.6
126
+ thinking disablement. K2.7 disable requests now fail locally instead of being
127
+ silently ignored, while K2.6 disable requests emit the required wire toggle.
128
+
129
+ - **Packaged Electron shared-daemon auto-start.** Runtime SDK embedders running
130
+ from packaged/asar Electron applications now launch the detached daemon child
131
+ through a bootstrap-only Node execution boundary without changing the host or
132
+ long-lived daemon environment, leaking `ELECTRON_RUN_AS_NODE` to user child
133
+ processes, or opening a second GUI instance. Trusted internal JavaScript
134
+ children retain a bounded Electron-to-Node launch path. Missing packaged CLI
135
+ sidecars fail immediately, disabled `RunAsNode` fuses receive an actionable
136
+ timeout diagnostic, and a real Windows Electron 42.5.0 + asar smoke now gates
137
+ CI and releases. Public docs also distinguish CLI-style `homeDir` from the
138
+ lower-level `.kodax` path used by `KODAX_HOME`.
139
+ - **Cross-platform release template checks.** Generated configuration templates
140
+ now compare normalized line endings, so Windows CRLF checkouts no longer report
141
+ false drift during binary builds.
142
+
9
143
  ## [0.7.70] - 2026-07-15
10
144
 
11
145
  ### Added
package/README.md CHANGED
@@ -347,14 +347,21 @@ temporary environment override. The same rule applies to other paired settings,
347
347
  for example `provider` ↔ `KODAX_PROVIDER` and `effort` ↔ `KODAX_EFFORT`.
348
348
  JSON names stay camelCase while environment names use `KODAX_UPPER_SNAKE_CASE`.
349
349
 
350
- By default, daemon state, config, and runtime session storage are scoped under
351
- the OS user home directory, so `kodax --runtime-mode daemon` and SDK clients
352
- using `createKodaXRuntime({ mode: 'daemon' })` converge on the same local daemon
353
- profile. The high-level `createKodaXRuntime({ mode: 'daemon' })` API starts or
350
+ By default, daemon state, config, and runtime session storage use the exact
351
+ resolved `KODAX_HOME` (normally `<OS user home>/.kodax`), so CLI and SDK clients
352
+ converge on the same local daemon even when `KODAX_HOME` is an arbitrary custom
353
+ directory. The high-level `createKodaXRuntime({ mode: 'daemon' })` API starts or
354
354
  reuses that daemon unless you pass an explicit endpoint/transport or
355
- `autoStartDaemon: false`. Pass `--home <dir>` or `homeDir` only when you
356
- intentionally want an isolated daemon namespace for tests, CI, or project-local
357
- experiments.
355
+ `autoStartDaemon: false`. An explicit `--home <dir>` or `homeDir` selects the
356
+ isolated `<dir>/.kodax` namespace for tests, CI, or project-local experiments.
357
+
358
+ **v0.7.71 packaged Electron patch:** packaged/asar Electron hosts can use daemon
359
+ auto-start without relaunching the GUI. `ELECTRON_RUN_AS_NODE` is limited to a
360
+ bootstrap-only child exec boundary and removed before daemon or ordinary user
361
+ child code loads. The default-enabled Electron `RunAsNode` fuse is required;
362
+ hosts that disable it must start the daemon through ordinary Node/KodaX CLI and
363
+ connect in attach-only mode. For SDK calls, `homeDir` is the CLI-style base
364
+ directory that owns `.kodax`, not the `.kodax` path itself.
358
365
 
359
366
  One daemon owns many sessions. Different sessions may run concurrently; starts
360
367
  within the same session are queued so that only one run is active for that
@@ -509,18 +516,28 @@ KodaX has two layers that consumers should understand separately:
509
516
 
510
517
  **Experimental Memory Agent SDK (FEATURE_260, v0.7.68)**: `/experimental-memory` exposes the thin agent-layer `MemoryAgent` and scoped `MemorySession` lifecycle over the existing governed F228 plane. Passive recall is zero-wait; `query()` is read-only and deliberate; durable changes still require the proposal/preview/fingerprint/apply path. The Action LLM remains the final decision maker, recalled content stays low-authority, and safety/scope gates remain deterministic. See the [direct session and boundary guide](docs/SDK_EMBEDDER_GUIDE.md#21-experimental-governed-memory--experimental-memory-feature_260-v0768).
511
518
 
512
- **Bidirectional A2A 1.0 (FEATURE_267, v0.7.69)**: `/a2a` discovers allowed Agent Cards and installs a JSON-RPC/SSE executor through the existing F258 plane. Configured outbound Agents are also registered automatically as `external:<name>` in embedded CLI and user-daemon Runtimes, so the main Agent can orchestrate them without host code. The same module can publish the Runtime default or one validated `~/.kodax/agents/*.md` Agent behind an authenticated Runtime facade. The built-in listener is loopback-only; public deployment uses `handle()` behind host-owned TLS and authorization. A2A 0.3, gRPC, HTTP+JSON, push notifications, and automatic public exposure are not advertised. See the [client/server recipes and security boundaries](docs/SDK_EMBEDDER_GUIDE.md#22-bidirectional-a2a-10--a2a-feature_267-v0769).
513
-
514
- **v0.7.70 interoperability hardening** keeps a discovered A2A interface on the
515
- trusted Agent Card origin and sends a credential only when the Card advertises
516
- Bearer authentication. `a2a serve` now resolves its provider from CLI, then
517
- environment, config, and the built-in default; a Markdown Agent can pin its own
518
- provider. Input continuation resumes the original Runtime run, task history and
519
- retention are bounded with stable cursor pagination, and authenticated SSE is
520
- correlated before falling back to polling after an early normal EOF. Only
521
- direct remote artifacts, broker-staged outputs, and outputs from a successfully
522
- admitted Skill script can be published; ordinary workspace writes and local
523
- paths stay private.
519
+ **Bidirectional A2A 1.0 (FEATURE_267, v0.7.69)**: `/a2a` discovers allowed Agent Cards and installs a JSON-RPC/SSE executor through the existing F258 plane. Configured outbound Agents are also registered automatically as `external:<name>` in embedded CLI and user-daemon Runtimes, so the main Agent can orchestrate them without host code. One `a2a.json` may hold many outbound registrations and at most one inbound server, which publishes either the Runtime default or one validated `~/.kodax/agents/*.md` Agent behind an authenticated Runtime facade. The built-in listener is loopback-only; public deployment uses `handle()` behind host-owned TLS and authorization. A2A 0.3, gRPC, HTTP+JSON, push notifications, and automatic public exposure are not advertised. See the [client/server recipes and security boundaries](docs/SDK_EMBEDDER_GUIDE.md#22-bidirectional-a2a-10--a2a-feature_267-v0769).
520
+
521
+ **A2A interoperability and authentication hardening** keeps a discovered
522
+ interface on the trusted Agent Card origin and sends credentials only when one
523
+ complete Card/Skill security requirement is satisfiable. The no-code client
524
+ supports HTTP Bearer compatibility and OAuth 2.0 Client Credentials; for OAuth,
525
+ an external Authorization Server issues short-lived access tokens and KodaX
526
+ caches them only in memory. Inbound `a2a serve` can validate RFC 9068 JWT access
527
+ tokens from an external issuer/JWKS, but never signs or issues production
528
+ tokens itself. It resolves its provider from CLI, then environment, config, and
529
+ the built-in default; a Markdown Agent can pin its own provider. Input
530
+ continuation resumes the original Runtime run, task history and retention are
531
+ bounded with stable cursor pagination, and authenticated SSE is correlated
532
+ before falling back to polling after an early normal EOF. Only direct remote
533
+ artifacts, broker-staged outputs, and outputs from a successfully admitted
534
+ Skill script can be published; ordinary workspace writes and local paths stay
535
+ private.
536
+
537
+ This authentication and per-Agent activation hardening is a post-release
538
+ closure of the v0.7.69 F267/F268 design and ships in the v0.7.71 patch; it is
539
+ not a claim that older v0.7.69 binaries contained the
540
+ later OAuth profiles.
524
541
 
525
542
  **v0.7.70 MCP discovery hardening** uses exact capability IDs and revisioned
526
543
  cursors while admitting results against real physical capacity. Compact CJK
@@ -537,8 +554,23 @@ kodax a2a add research https://agent.example/.well-known/agent-card.json --effec
537
554
  kodax a2a test research
538
555
  kodax a2a call research "Summarize this topic"
539
556
 
557
+ # Stage an OAuth-protected Agent, then hot-activate/deactivate it
558
+ export RESEARCH_A2A_CLIENT_SECRET='provisioned-by-your-authorization-server'
559
+ # PowerShell: $env:RESEARCH_A2A_CLIENT_SECRET='provisioned-by-your-authorization-server'
560
+ # PowerShell: run the command on one line or replace each trailing \ with a backtick.
561
+ kodax a2a add reviewer https://reviewer.example/.well-known/agent-card.json \
562
+ --disabled --effect read --oauth-scheme enterprise-oauth \
563
+ --oauth-issuer https://identity.example/ \
564
+ --oauth-token-url https://identity.example/oauth/token \
565
+ --oauth-client-id kodax-reviewer \
566
+ --oauth-client-secret-env RESEARCH_A2A_CLIENT_SECRET \
567
+ --oauth-scope a2a.invoke --oauth-resource https://reviewer.example/
568
+ kodax a2a enable reviewer
569
+ kodax a2a disable reviewer # blocks new dispatch; does not cancel in-flight tasks
570
+
540
571
  # Expose the Runtime default Agent, or pass a name from ~/.kodax/agents/*.md
541
572
  export KODAX_A2A_TOKEN='replace-with-a-long-random-token'
573
+ # PowerShell: $env:KODAX_A2A_TOKEN='replace-with-a-long-random-token'
542
574
  kodax a2a expose # or: kodax a2a expose document-agent
543
575
  kodax a2a serve # loopback http://127.0.0.1:8765
544
576
  ```
@@ -554,12 +586,30 @@ can stage legacy entries. Remove legacy keys only with
554
586
  literal-secret warnings. Running
555
587
  CLI/daemon hosts retain the
556
588
  last valid revision, atomically replace the complete MCP provider, reconcile
557
- Extensions per entry, and hot-register outbound A2A Agents. `a2a serve` loads
589
+ Extensions per entry, and hot-register outbound A2A Agents. Each A2A entry has
590
+ a desired `enabled` switch; `kodax a2a list` shows configuration, while the
591
+ owning Runtime is authoritative for live applied registrations. Disabled
592
+ entries are not fetched during automatic reconciliation and, after the owning
593
+ Runtime applies the revision, cannot accept new dispatch. The mutation command
594
+ itself is not cross-process acknowledgement. `a2a add --disabled` still checks
595
+ the Card by default unless `--no-test` is supplied, while `a2a test` performs
596
+ discovery/security planning without requesting an OAuth token. The fixed
597
+ `KODAX_A2A_TOKEN` example is an operator-provisioned compatibility credential;
598
+ KodaX does not generate or issue it. Disabled entries remain available for
599
+ later re-enable. `a2a serve` loads
558
600
  its configured MCP/Extension capability surface before listening and pins that
559
601
  execution authority; it hot-reloads publication, authentication, and limits.
602
+
603
+ A2A configuration migration and retained task ownership are separate. If a
604
+ v0.7.70 task store must remain addressable after the realm-aware upgrade, stop
605
+ the A2A server, run `kodax a2a migrate-tasks` to inspect the exact-owner plan,
606
+ then apply it with `--apply --confirm-server-stopped`. OAuth migration also
607
+ requires the known historical `--subject`; normal serving never guesses or
608
+ dual-reads a legacy owner key.
609
+
560
610
  Agent, Skill, Extension-tool authority, workspace, tool-policy, or task-store
561
611
  changes require an explicit server restart. Managed
562
- A2A contexts default to `~/kodax_a2a_server_workspace/<profile>/contexts/`.
612
+ A2A contexts default to `~/kodax_a2a_server_workspace/<runtime-profile>/contexts/`.
563
613
  Exact Skill scripts require the opt-in isolated policy and a passing
564
614
  `kodax sandbox doctor` (`kodax sandbox setup` performs the explicit Windows
565
615
  one-time provisioning).
@@ -1161,8 +1211,8 @@ await runInkInteractiveMode({ provider: 'zhipu-coding', effort: 'auto' });
1161
1211
  |----------|----------------------|-------------------|---------------|
1162
1212
  | anthropic | `ANTHROPIC_API_KEY` | Native | claude-sonnet-4-6 (`claude-opus-4-6` / `claude-haiku-4-5` via `/model`) |
1163
1213
  | openai | `OPENAI_API_KEY` | Native | gpt-5.3-codex (`gpt-5.4` / `gpt-5.3-codex-spark` via `/model`) |
1164
- | kimi | `KIMI_API_KEY` | Native | kimi-k2.6 (`kimi-k2.7-code` 256K / `k2.5` via `/model`) |
1165
- | kimi-code | `KIMI_CODE_API_KEY` | Native | kimi-for-coding |
1214
+ | kimi | `KIMI_API_KEY` | Native | kimi-k2.7-code (262,144-token context; `kimi-k2.7-code-highspeed` / `kimi-k2.6` / `kimi-k2.5` via `/model`) |
1215
+ | kimi-code | `KIMI_CODE_API_KEY` | Native | kimi-for-coding (`k3-256k` for Moderato / `k3` 1M for Allegretto+ / `kimi-for-coding-highspeed` via `/model`; both K3 choices use upstream `k3`) |
1166
1216
  | qwen | `QWEN_API_KEY` | Native | qwen3.5-plus |
1167
1217
  | zhipu | `ZHIPU_API_KEY` | Native | glm-5 (`glm-5.2` 1M ctx / `glm-5.1` / `glm-5-turbo` via `/model`) |
1168
1218
  | zhipu-coding | `ZHIPU_CODING_API_KEY` | Native | glm-5 (`glm-5.2` 1M ctx / `glm-5.1` / `glm-5-turbo` via `/model`) |
package/README_CN.md CHANGED
@@ -81,6 +81,13 @@ data/session root 下的 inline Runtime,不参与 Coder owner fence。capabili
81
81
  fail closed,不能静默退回 inline Coder。完整接入说明见
82
82
  [SDK Embedder Guide §23](docs/SDK_EMBEDDER_GUIDE.md#23-shared-coder-daemon-for-space-and-ide-hosts-feature_269-v0769)。
83
83
 
84
+ **v0.7.71 Electron 打包修复**:packaged/asar Electron 宿主可以直接自动启动
85
+ daemon,不会再次打开 GUI。`ELECTRON_RUN_AS_NODE` 只存在于子进程启动边界,
86
+ 在 daemon 与普通用户子进程代码加载前即被移除。该路径要求 Electron 默认开启的
87
+ `RunAsNode` fuse;主动关闭该 fuse 的宿主必须通过普通 Node/KodaX CLI 启动 daemon,
88
+ 再使用 attach-only 模式连接。SDK 的 `homeDir` 是拥有 `.kodax` 的 CLI 风格基础目录,
89
+ 不是 `.kodax` 目录本身。
90
+
84
91
  ## 为什么用 KodaX
85
92
 
86
93
  <table>
@@ -455,8 +462,8 @@ dist/binary/linux-x64/
455
462
  |----------|----------|-----------|-----------|
456
463
  | anthropic | `ANTHROPIC_API_KEY` | Native | claude-sonnet-4-6(可 `/model` 切换 `claude-opus-4-6` / `claude-haiku-4-5`) |
457
464
  | openai | `OPENAI_API_KEY` | Native | gpt-5.3-codex(可 `/model` 切换 `gpt-5.4` / `gpt-5.3-codex-spark`) |
458
- | kimi | `KIMI_API_KEY` | Native | kimi-k2.6(可 `/model` 切换 `kimi-k2.7-code` 256K / `k2.5`) |
459
- | kimi-code | `KIMI_CODE_API_KEY` | Native | kimi-for-coding |
465
+ | kimi | `KIMI_API_KEY` | Native | kimi-k2.7-code(262,144 token;可 `/model` 切换 `kimi-k2.7-code-highspeed` / `kimi-k2.6` / `kimi-k2.5`) |
466
+ | kimi-code | `KIMI_CODE_API_KEY` | Native | kimi-for-coding(可 `/model` 切换 `k3-256k`〔Moderato,256K〕/ `k3`〔Allegretto+,1M〕/ `kimi-for-coding-highspeed`;两个 K3 选项均请求上游 `k3`) |
460
467
  | qwen | `QWEN_API_KEY` | Native | qwen3.5-plus |
461
468
  | zhipu | `ZHIPU_API_KEY` | Native | glm-5(可 `/model` 切换 `glm-5.2` 1M ctx / `glm-5.1` / `glm-5-turbo`) |
462
469
  | zhipu-coding | `ZHIPU_CODING_API_KEY` | Native | glm-5(GLM Coding Plan;可 `/model` 切换 `glm-5.2` 1M ctx / `glm-5.1` / `glm-5-turbo`) |
@@ -590,15 +597,21 @@ KodaX 有两层结构,SDK 用户需要分开理解:
590
597
 
591
598
  **实验性 Memory Agent SDK(FEATURE_260,v0.7.68)**:`/experimental-memory` 暴露基于既有 F228 治理平面的薄 `MemoryAgent` 与 scoped `MemorySession`。被动 recall 零等待,`query()` 只读且由主 Action LLM 主动选择;持久化仍必须经过 proposal/preview/fingerprint/apply。召回内容保持低权限,安全与 scope 边界仍由确定性代码门禁承担。直接 session 示例与宿主边界见 [SDK Embedder Guide §21](docs/SDK_EMBEDDER_GUIDE.md#21-experimental-governed-memory--experimental-memory-feature_260-v0768)。
592
599
 
593
- **双向 A2A 1.0(FEATURE_267,v0.7.69)**:`/a2a` 可发现 allowlist 内的 Agent Card,并通过既有 F258 plane 安装 JSON-RPC/SSE executor。配置中的出站 Agent 还会作为 `external:<name>` 自动注册到 embedded CLI 与用户 daemon Runtime,因此主 Agent 无需宿主代码即可编排。入站方向可以发布 Runtime 默认 Agent,或发布一个经过验证的 `~/.kodax/agents/*.md` Agent。内置 listener 仅允许 loopback;公网部署必须由宿主用 TLS、鉴权和授权包住 `handle()`。不宣称支持 A2A 0.3、gRPC、HTTP+JSON、push notification,也不会自动把本地 Agent 暴露到网络。详见 [SDK Embedder Guide §22](docs/SDK_EMBEDDER_GUIDE.md#22-bidirectional-a2a-10--a2a-feature_267-v0769)。
600
+ **双向 A2A 1.0(FEATURE_267,v0.7.69)**:`/a2a` 可发现 allowlist 内的 Agent Card,并通过既有 F258 plane 安装 JSON-RPC/SSE executor。配置中的出站 Agent 还会作为 `external:<name>` 自动注册到 embedded CLI 与用户 daemon Runtime,因此主 Agent 无需宿主代码即可编排。一个 `a2a.json` 可保存多个出站注册,但最多只有一个入站 server;入站可发布 Runtime 默认 Agent,或发布一个经过验证的 `~/.kodax/agents/*.md` Agent。内置 listener 仅允许 loopback;公网部署必须由宿主用 TLS、鉴权和授权包住 `handle()`。不宣称支持 A2A 0.3、gRPC、HTTP+JSON、push notification,也不会自动把本地 Agent 暴露到网络。详见 [SDK Embedder Guide §22](docs/SDK_EMBEDDER_GUIDE.md#22-bidirectional-a2a-10--a2a-feature_267-v0769)。
601
+
602
+ **A2A 互操作与认证加固**:发现得到的 interface 必须与受信 Agent Card 同源,且只有
603
+ 完整满足 Card/Skill 的一个 security requirement 时才会携带凭据。无代码 client
604
+ 支持 HTTP Bearer 兼容模式与 OAuth 2.0 Client Credentials;OAuth 的短期 access
605
+ token 由外部 Authorization Server 签发,KodaX 只在进程内缓存。入站 `a2a serve`
606
+ 可以按外部 issuer/JWKS 校验 RFC 9068 JWT access token,但不会自行签发生产 token。
607
+ 服务按 CLI、环境变量、配置、内置默认值的顺序解析 provider,Markdown Agent 也可
608
+ 固定自己的 provider。补充输入会继续原 Runtime run;任务历史、保留策略与稳定
609
+ cursor 分页均有边界;带鉴权的 SSE 会先校验关联信息,流在正常终止但未给出终态时
610
+ 回退 polling。仅远端直接 artifact、输出 broker 暂存结果,以及成功授权执行的 Skill
611
+ 脚本输出可以发布;普通工作区写入与本地路径不会暴露。
594
612
 
595
- **v0.7.70 互操作加固**:发现得到的 A2A interface 必须与受信 Agent Card
596
- 同源,且只有 Card 宣告 Bearer 鉴权时才会携带凭据。`a2a serve` 按 CLI、环境变量、
597
- 配置、内置默认值的顺序解析 provider,Markdown Agent 也可固定自己的 provider。
598
- 补充输入会继续原 Runtime run;任务历史、保留策略与稳定 cursor 分页均有边界;
599
- 带鉴权的 SSE 会先校验关联信息,流在正常终止但未给出终态时回退 polling。
600
- 仅远端直接 artifact、输出 broker 暂存结果,以及成功授权执行的 Skill 脚本输出
601
- 可以发布;普通工作区写入与本地路径不会暴露。
613
+ 这里的认证与逐 Agent 激活加固,是对 v0.7.69 F267/F268 设计的发布后补全,
614
+ v0.7.71 补丁交付;并不表示早期 v0.7.69 二进制已经包含后续 OAuth profile。
602
615
 
603
616
  **v0.7.70 MCP 发现加固**:能力使用精确 ID 和带 revision 的 cursor,结果按真实物理
604
617
  容量准入。紧凑 CJK 查询会分词;跨语言 lexical 零匹配只会返回容量内的无损分组
@@ -613,8 +626,23 @@ kodax a2a add research https://agent.example/.well-known/agent-card.json --effec
613
626
  kodax a2a test research
614
627
  kodax a2a call research "总结这个主题"
615
628
 
629
+ # 先保存受 OAuth 保护的 Agent,再热启用/停用
630
+ export RESEARCH_A2A_CLIENT_SECRET='由你的授权服务器分配'
631
+ # PowerShell:$env:RESEARCH_A2A_CLIENT_SECRET='由你的授权服务器分配'
632
+ # PowerShell:将命令写成一行,或把每个行尾反斜杠替换为反引号。
633
+ kodax a2a add reviewer https://reviewer.example/.well-known/agent-card.json \
634
+ --disabled --effect read --oauth-scheme enterprise-oauth \
635
+ --oauth-issuer https://identity.example/ \
636
+ --oauth-token-url https://identity.example/oauth/token \
637
+ --oauth-client-id kodax-reviewer \
638
+ --oauth-client-secret-env RESEARCH_A2A_CLIENT_SECRET \
639
+ --oauth-scope a2a.invoke --oauth-resource https://reviewer.example/
640
+ kodax a2a enable reviewer
641
+ kodax a2a disable reviewer # 只阻止新调度,不取消已运行任务
642
+
616
643
  # 暴露 Runtime 默认 Agent,或指定 ~/.kodax/agents/*.md 中的 Agent 名称
617
644
  export KODAX_A2A_TOKEN='请替换为足够长的随机令牌'
645
+ # PowerShell:$env:KODAX_A2A_TOKEN='请替换为足够长的随机令牌'
618
646
  kodax a2a expose # 或:kodax a2a expose document-agent
619
647
  kodax a2a serve # 仅监听 http://127.0.0.1:8765
620
648
  ```
@@ -628,10 +656,24 @@ MCP、A2A、Extension 分别使用 `~/.kodax/integrations/` 下的一个用户
628
656
  和明文 secret 警告后,才应同时使用 `--apply --cleanup-legacy` 清理旧 key。
629
657
  运行中的 CLI/daemon 保留最后一个
630
658
  有效版本,完整替换 MCP provider、逐条协调 Extension,并热注册出站 A2A Agent。
659
+ 每个 A2A 条目都有期望态 `enabled`;`kodax a2a list` 显示配置,实际已应用注册以
660
+ 拥有该 Runtime 的进程为准。自动协调不会获取已停用条目的 Card 或 token;拥有者
661
+ 观察并应用该 revision 后,停用条目才会阻止新调度,CLI 写入返回本身不是跨进程生效
662
+ 确认。`a2a add --disabled` 默认仍会校验 Card,除非显式使用 `--no-test`;`a2a test`
663
+ 只做 discovery/security planning,不会申请 OAuth token。示例中的固定
664
+ `KODAX_A2A_TOKEN` 是运维侧预先提供的兼容凭据,并非 KodaX 自行生成或签发。
665
+ 停用条目可随时重新启用。
631
666
  `a2a serve` 会在监听前装载已配置的 MCP/Extension 能力并固定执行权威,同时热加载
632
667
  公开信息、鉴权和限额。Agent、Skill、Extension 工具权威、工作区、tool policy
633
668
  或任务存储变更必须显式重启服务。
634
- 托管 A2A 上下文默认位于 `~/kodax_a2a_server_workspace/<profile>/contexts/`。
669
+
670
+ A2A 配置迁移与历史任务 owner 迁移是两件事。如果升级 realm-aware owner key
671
+ 后仍需访问 v0.7.70 的任务库,应先停止 A2A server,执行
672
+ `kodax a2a migrate-tasks` 查看精确 owner 计划,再用
673
+ `--apply --confirm-server-stopped` 应用。OAuth 还必须提供已知历史
674
+ `--subject`;正常服务不会猜测或双读 legacy owner key。
675
+
676
+ 托管 A2A 上下文默认位于 `~/kodax_a2a_server_workspace/<runtime-profile>/contexts/`。
635
677
  精确授权的 Skill 脚本必须使用隔离策略,并通过 `kodax sandbox doctor`;
636
678
  Windows 的一次性显式初始化由 `kodax sandbox setup` 完成。
637
679
 
@@ -1,23 +1,17 @@
1
1
  // Bidirectional A2A configuration: ~/.kodax/integrations/a2a.json.
2
- // `agents` calls third-party Agents. The optional singleton `server` exposes
3
- // one KodaX general task Agent; ACP remains the coding/editor protocol.
2
+ // `agents` calls many third-party Agents. The optional singleton `server`
3
+ // exposes exactly one KodaX general task Agent; ACP remains the coding/editor
4
+ // protocol. Uncomment only the entries you need; no token value belongs here.
5
+ // Legacy version 1 files remain readable. Non-empty files require an explicit
6
+ // stopped-daemon migration; new/empty files and every later write use version 2.
4
7
  {
5
- "version": 1,
6
- "agents": {}
8
+ "version": 2,
7
9
 
8
- // Outbound example (keep tokens in the named environment variable):
9
- // "agents": {
10
- // "reporting": {
11
- // "cardUrl": "https://agents.example.com/.well-known/agent-card.json",
12
- // "credentialEnv": "REPORTING_A2A_TOKEN",
13
- // "effect": "read"
14
- // }
15
- // },
16
-
17
- // Create the inbound block with `kodax a2a expose`; do not copy private
18
- // Agent instructions, Runtime Skills, model names, or local paths into the
19
- // public `published.skills` list. Managed workspaces default below
20
- // ~/kodax_a2a_server_workspace/<server>/contexts/<caller-context>/.
10
+ // Create this inbound block with `kodax a2a expose`; config never starts a
11
+ // listener by itself. Do not copy private Agent instructions, Runtime Skills,
12
+ // model names, or local paths into the public `published.skills` list.
13
+ // Managed workspaces default below
14
+ // ~/kodax_a2a_server_workspace/<runtime-profile>/contexts/<context-key>/.
21
15
  // Native read/grep/glob remains available according to workspace access.
22
16
  // Arbitrary shell is never exposed. Skill instructions/assets need no
23
17
  // process authority. An exact checked-in scripts/... entry requires
@@ -43,12 +37,62 @@
43
37
  // "published": {
44
38
  // "name": "KodaX Agent",
45
39
  // "description": "Completes approved general tasks.",
46
- // "version": "0.7.70",
40
+ // "version": "0.7.71",
47
41
  // "skills": [{ "id": "general", "name": "General", "description": "Complete general tasks.", "tags": [] }],
48
42
  // "inputModes": ["text/plain"],
49
43
  // "outputModes": ["text/plain"]
50
44
  // },
51
45
  // "authentication": { "type": "bearer-env", "tokenEnv": "KODAX_A2A_TOKEN", "principalId": "configured-client" },
52
46
  // "dataDir": "~/.kodax/a2a/tasks"
47
+ // },
48
+
49
+ // Production OAuth2 resource-server alternative for the server above. The
50
+ // external Authorization Server issues access tokens and, for JWT tokens,
51
+ // signs them. KodaX holds no issuer signing key; it validates RFC 9068 tokens
52
+ // against the issuer's rotating JWKS, audience, expiry, subject, and scopes.
53
+ // Replace the server.authentication value above with:
54
+ // {
55
+ // "type": "oauth2-jwt",
56
+ // "scheme": "enterprise-oauth",
57
+ // "issuer": "https://identity.example.com",
58
+ // "audience": "https://agent.example.com/a2a",
59
+ // "jwksUrl": "https://identity.example.com/.well-known/jwks.json",
60
+ // "tokenUrl": "https://identity.example.com/oauth/token",
61
+ // "metadataUrl": "https://identity.example.com/.well-known/oauth-authorization-server",
62
+ // "requiredScopes": ["a2a.invoke"]
53
63
  // }
64
+
65
+ "agents": {
66
+ // Fixed Bearer compatibility example. `enabled` is hot desired state:
67
+ // disabled Agents remain configured but are not candidates for new
68
+ // orchestration, while already admitted remote tasks may finish.
69
+ // "reporting": {
70
+ // "cardUrl": "https://agents.example.com/.well-known/agent-card.json",
71
+ // "enabled": true,
72
+ // "credentialEnv": "REPORTING_A2A_TOKEN",
73
+ // "effect": "read"
74
+ // },
75
+
76
+ // Standards-based machine-to-machine OAuth2 example. The external
77
+ // Authorization Server issues access tokens; KodaX obtains and caches them
78
+ // only in process memory. `tokenUrl` must exactly match the selected Card
79
+ // OAuth2 clientCredentials flow. Use `kodax a2a enable|disable <name>` to
80
+ // mutate `enabled` atomically; the owning Runtime applies it asynchronously.
81
+ // "reviewer": {
82
+ // "cardUrl": "https://reviewer.example.com/.well-known/agent-card.json",
83
+ // "enabled": false,
84
+ // "effect": "read",
85
+ // "authentication": {
86
+ // "type": "oauth2-client-credentials",
87
+ // "scheme": "enterprise-oauth",
88
+ // "issuer": "https://identity.example.com",
89
+ // "tokenUrl": "https://identity.example.com/oauth/token",
90
+ // "clientId": "kodax-reviewer",
91
+ // "clientSecretEnv": "REVIEWER_CLIENT_SECRET",
92
+ // "scopes": ["a2a.invoke"],
93
+ // "resource": "https://reviewer.example.com/",
94
+ // "clientAuthentication": "client-secret-basic"
95
+ // }
96
+ // }
97
+ }
54
98
  }
@@ -1,2 +1,2 @@
1
1
  // @kodax-ai/kodax — bundled distribution. See docs/ADR.md ADR-022 + ADR-024.
2
- import{Ga as i,K as c,L as d,M as e,Ma as j,N as f,ma as g,na as h}from"./chunk-RY5OLVQV.js";import"./chunk-I4TPQEJN.js";import"./chunk-Y4WOTWUC.js";import"./chunk-AQGNRBEJ.js";import"./chunk-UJEMSPM5.js";import{sb as a,tb as b}from"./chunk-7PV577LP.js";import"./chunk-AWMTNUDS.js";import"./chunk-F7C7J6IM.js";import"./chunk-NGHQIGVW.js";import"./chunk-ONUPGMER.js";export{d as bucketProviderPayloadSize,g as buildAutoRepoIntelligenceContext,e as checkPromiseSignal,b as cleanupIncompleteToolCalls,h as describeTransientProviderRetry,f as emitResilienceDebug,c as estimateProviderPayloadBytes,j as runKodaX,i as saveSessionSnapshot,a as validateAndFixToolHistory};
2
+ import{Ga as i,K as c,L as d,M as e,Ma as j,N as f,ma as g,na as h}from"./chunk-T7LYK53M.js";import"./chunk-64NQBOSN.js";import"./chunk-44QXPEEE.js";import"./chunk-PVUXONQB.js";import"./chunk-ZJIMT5I3.js";import{vb as a,wb as b}from"./chunk-Y5XKAN7C.js";import"./chunk-52JSZ77P.js";import"./chunk-VRSVNU2Y.js";import"./chunk-23X6REO4.js";import"./chunk-ONUPGMER.js";export{d as bucketProviderPayloadSize,g as buildAutoRepoIntelligenceContext,e as checkPromiseSignal,b as cleanupIncompleteToolCalls,h as describeTransientProviderRetry,f as emitResilienceDebug,c as estimateProviderPayloadBytes,j as runKodaX,i as saveSessionSnapshot,a as validateAndFixToolHistory};
@@ -0,0 +1,2 @@
1
+ // @kodax-ai/kodax — bundled distribution. See docs/ADR.md ADR-022 + ADR-024.
2
+ import{Ba as a,Ca as b}from"./chunk-F7KGYHJ3.js";import"./chunk-GVTM4Z6O.js";import"./chunk-SX2WFHIS.js";import"./chunk-A574DBTV.js";import"./chunk-A2TFSV5M.js";import"./chunk-PHH4TRGF.js";import"./chunk-T7LYK53M.js";import"./chunk-64NQBOSN.js";import"./chunk-44QXPEEE.js";import"./chunk-PVUXONQB.js";import"./chunk-ZJIMT5I3.js";import"./chunk-Y5XKAN7C.js";import"./chunk-52JSZ77P.js";import"./chunk-VRSVNU2Y.js";import"./chunk-23X6REO4.js";import"./chunk-ONUPGMER.js";export{a as ArgumentCompleter,b as createArgumentCompleter};
@@ -0,0 +1,46 @@
1
+ // @kodax-ai/kodax — bundled distribution. See docs/ADR.md ADR-022 + ADR-024.
2
+ import{a as o}from"./chunk-ONUPGMER.js";import{AsyncLocalStorage as Be}from"node:async_hooks";var Ne=new Be;function Le(e){let t=Ne.getStore()?.credential;return t?M(e,t,new WeakMap):e}o(Le,"redactScopedProviderCredential");function M(e,t,n){if(typeof e=="string")return e.split(t).join("[REDACTED_CREDENTIAL]");if(e===null||typeof e!="object")return e;let r=n.get(e);if(r!==void 0)return r;if(e instanceof Error){let s=new Error(M(e.message,t,n));return n.set(e,s),s.name=e.name,e.stack!==void 0&&(s.stack=M(e.stack,t,n)),s}if(Array.isArray(e)){let s=[];n.set(e,s);for(let l of e)s.push(M(l,t,n));return s}let i={};n.set(e,i);for(let[s,l]of Object.entries(Object.getOwnPropertyDescriptors(e))){if(!l.enumerable||!("value"in l))continue;let u=s.split(t).join("[REDACTED_CREDENTIAL]");i[u]=M(l.value,t,n)}return i}o(M,"redactCredentialValue");function A(e,t){return`${e}/${t??""}`}o(A,"capabilityCacheKey");function je(e,t,n){return e[A(t,n)]?.rejected??[]}o(je,"getRejectedEfforts");function $e(e,t,n,r,i,s){let l=A(t,n),u=e[l],g=u?.rejected.includes(r)?u.rejected:[...u?.rejected??[],r];return{...e,[l]:{rejected:g,source:i,updatedAt:s}}}o($e,"addRejectedEffort");function Fe(e,t,n){if(!t)return{};let r={...e};return delete r[A(t,n)],r}o(Fe,"removeCacheEntry");function Ue(e){if(!e||typeof e!="object")return{};let t={};for(let[n,r]of Object.entries(e)){if(!r||typeof r!="object")continue;let i=r,s=Array.isArray(i.rejected)?i.rejected.filter(g=>typeof g=="string"):[],l=i.source==="probed"?"probed":"observed",u=typeof i.updatedAt=="string"?i.updatedAt:"";t[n]={rejected:s,source:l,updatedAt:u}}return t}o(Ue,"sanitizeCapabilityCache");import{AsyncLocalStorage as We}from"node:async_hooks";var Ve=new We,J=8,Y=32;function ze(e){if(e===void 0)return;let t=Number.parseInt(e,10);return Number.isInteger(t)&&t>0?t:void 0}o(ze,"parsePositiveInt");function qe(){let e=I()?.workflow?.maxConcurrency,t=typeof e=="number"&&Number.isInteger(e)&&e>0?e:ze(process.env.KODAX_WORKFLOW_MAX_CONCURRENCY)??J;return Math.max(1,Math.min(Y,t))}o(qe,"resolveWorkflowMaxConcurrency");function I(){return Ve.getStore()}o(I,"getRunScopedConfig");var K={transport:"native-api",conversationSemantics:"full-history",mcpSupport:"none",contextFidelity:"full",toolCallingFidelity:"full",sessionSupport:"full",longRunningSupport:"full",multimodalSupport:"none",evidenceSupport:"full"},Q={...K,multimodalSupport:"image-input"},O={transport:"cli-bridge",conversationSemantics:"last-user-message",mcpSupport:"none",contextFidelity:"lossy",toolCallingFidelity:"limited",sessionSupport:"stateless",longRunningSupport:"limited",multimodalSupport:"none",evidenceSupport:"limited"},Z={...O,multimodalSupport:"image-input"};function j(e){return{transport:e.transport,conversationSemantics:e.conversationSemantics,mcpSupport:e.mcpSupport,contextFidelity:e.contextFidelity??"full",toolCallingFidelity:e.toolCallingFidelity??"full",sessionSupport:e.sessionSupport??"full",longRunningSupport:e.longRunningSupport??"full",multimodalSupport:e.multimodalSupport??"none",evidenceSupport:e.evidenceSupport??"full"}}o(j,"normalizeCapabilityProfile");import tn from"@anthropic-ai/sdk";import{parse as $o}from"partial-json";import hn from"openai";import{ClientSideConnection as _n,PROTOCOL_VERSION as Xn,ndJsonStream as An}from"@agentclientprotocol/sdk";var Sn=String.raw`
3
+ using System;
4
+ using System.Runtime.InteropServices;
5
+ using System.Text;
6
+ public static class KodaXNativeProcessSnapshot {
7
+ [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
8
+ private struct ProcessEntry32 {
9
+ public uint dwSize;
10
+ public uint cntUsage;
11
+ public uint th32ProcessID;
12
+ public IntPtr th32DefaultHeapID;
13
+ public uint th32ModuleID;
14
+ public uint cntThreads;
15
+ public uint th32ParentProcessID;
16
+ public int pcPriClassBase;
17
+ public uint dwFlags;
18
+ [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 260)]
19
+ public string szExeFile;
20
+ }
21
+ [DllImport("kernel32.dll", SetLastError = true)]
22
+ private static extern IntPtr CreateToolhelp32Snapshot(uint flags, uint processId);
23
+ [DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)]
24
+ private static extern bool Process32First(IntPtr snapshot, ref ProcessEntry32 entry);
25
+ [DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)]
26
+ private static extern bool Process32Next(IntPtr snapshot, ref ProcessEntry32 entry);
27
+ [DllImport("kernel32.dll")]
28
+ private static extern bool CloseHandle(IntPtr handle);
29
+ public static string ReadRows() {
30
+ var snapshot = CreateToolhelp32Snapshot(2, 0);
31
+ if (snapshot == new IntPtr(-1)) return string.Empty;
32
+ var rows = new StringBuilder();
33
+ var entry = new ProcessEntry32();
34
+ entry.dwSize = (uint)Marshal.SizeOf(entry);
35
+ try {
36
+ if (!Process32First(snapshot, ref entry)) return string.Empty;
37
+ do {
38
+ rows.Append(entry.th32ProcessID).Append(',').Append(entry.th32ParentProcessID).Append('\n');
39
+ entry.dwSize = (uint)Marshal.SizeOf(entry);
40
+ } while (Process32Next(snapshot, ref entry));
41
+ return rows.ToString();
42
+ } finally {
43
+ CloseHandle(snapshot);
44
+ }
45
+ }
46
+ }`;import ie from"node:fs";import se from"node:os";import ae from"node:path";var pt="gpt-5.4",gt="auto-gemini-3",mt=["gpt-5.4","gpt-5.3-codex","gpt-5.3-codex-spark"],ht=["auto-gemini-3","gemini-3.1-pro-preview","gemini-3-flash-preview","gemini-2.5-pro","gemini-2.5-flash"];function de(e){let t=new Set,n=[];for(let r of e){let i=r.trim();if(!i)continue;let s=i.toLowerCase();t.has(s)||(t.add(s),n.push(i))}return n}o(de,"dedupePreserveOrder");function yt(){let e=ae.join(se.homedir(),".codex","config.toml");try{return ie.readFileSync(e,"utf8").match(/^\s*model\s*=\s*"([^"]+)"/m)?.[1]?.trim()||null}catch{return null}}o(yt,"readCodexConfiguredModel");function bt(){let e=ae.join(se.homedir(),".gemini","settings.json");try{let t=JSON.parse(ie.readFileSync(e,"utf8")),n=typeof t.model=="string"?t.model.trim():"";return n||(typeof t.general?.model=="string"?t.general.model.trim():"")||null}catch{return null}}o(bt,"readGeminiConfiguredModel");function E(){return yt()||pt}o(E,"getCodexCliDefaultModel");function T(){return bt()||gt}o(T,"getGeminiCliDefaultModel");function w(){return de([E(),...mt])}o(w,"getCodexCliKnownModels");function _(){return de([T(),...ht])}o(_,"getGeminiCliKnownModels");var pr=T(),gr=_();var xr=E(),Sr=w();import{existsSync as wt,readFileSync as _t}from"node:fs";import S from"node:path";import{fileURLToPath as Xt}from"node:url";var le=["none","prompt-only","native-effort","native-budget","native-toggle","native-adaptive","unknown"],ue=["openai-responses-effort","openai-chat-effort","codex-cli-config","anthropic-output-effort","provider-budget","provider-toggle","prompt-only","none"],ce=["anthropic-adaptive","anthropic-budget","provider-budget","provider-toggle","none"],fe=["zai-glm-5.2","zai-glm-toggle","deepseek-v4-openai","deepseek-v4-anthropic","deepseek-toggle","kimi-k3","kimi-k2.7-code","kimi-hybrid-toggle","minimax-m3","minimax-m2-always","mimo-v2.5-toggle","qwen-hybrid-thinking","openai-chat-reasoning","openai-responses-reasoning","codex-cli-effort","claude-adaptive-xhigh","claude-adaptive-max","anthropic-budget","generic-thinking-toggle","none"],pe=["native","image-input-native","cli-bridge","image-input-cli-bridge"],ge=["count-tokens","models-list","minimal-message","unsupported"];function h(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}o(h,"isPlainObject");function R(e,t){if(typeof e!="string"||e.length===0)throw new Error(`provider-capabilities.json: ${t} must be a non-empty string`);return e}o(R,"requireString");function x(e,t){if(e!==void 0)return R(e,t)}o(x,"optionalString");function P(e,t){if(e!==void 0){if(typeof e!="number"||!Number.isFinite(e)||e<0)throw new Error(`provider-capabilities.json: ${t} must be a non-negative finite number`);return e}}o(P,"optionalNumber");function f(e,t){if(e!==void 0){if(typeof e!="boolean")throw new Error(`provider-capabilities.json: ${t} must be a boolean`);return e}}o(f,"optionalBoolean");function me(e,t){if(e!==void 0){if(!Array.isArray(e))throw new Error(`provider-capabilities.json: ${t} must be an array`);return e.map((n,r)=>R(n,`${t}[${r}]`))}}o(me,"optionalStringArray");function Ct(e,t){if(e===void 0)return;if(!h(e))throw new Error(`provider-capabilities.json: ${t} must be an object`);let n={};for(let[r,i]of Object.entries(e))n[r]=R(i,`${t}.${r}`);return n}o(Ct,"optionalStringMap");function Pt(e,t){if(e!==void 0){if(typeof e!="string"||!fe.includes(e))throw new Error(`provider-capabilities.json: ${t} must be one of ${fe.join(", ")}, got ${JSON.stringify(e)}`);return e}}o(Pt,"optionalReasoningPreset");function F(e,t){if(typeof e!="string"||!le.includes(e))throw new Error(`provider-capabilities.json: ${t} must be one of ${le.join(", ")}, got ${JSON.stringify(e)}`);return e}o(F,"requireReasoningCapability");function Rt(e,t){if(typeof e!="string"||!ue.includes(e))throw new Error(`provider-capabilities.json: ${t} must be one of ${ue.join(", ")}, got ${JSON.stringify(e)}`);return e}o(Rt,"requireEffortStrategy");function Et(e,t){if(e!==void 0){if(typeof e!="string"||!ce.includes(e))throw new Error(`provider-capabilities.json: ${t} must be one of ${ce.join(", ")}, got ${JSON.stringify(e)}`);return e}}o(Et,"optionalThinkingStrategy");function he(e,t){if(e===void 0)return;if(!h(e))throw new Error(`provider-capabilities.json: ${t} must be an object`);let n=Rt(e.effortStrategy,`${t}.effortStrategy`),r=Pt(e.reasoningPreset,`${t}.reasoningPreset`),i=Et(e.thinkingStrategy,`${t}.thinkingStrategy`),s=x(e.defaultEffort,`${t}.defaultEffort`),l=Ct(e.effortAliases,`${t}.effortAliases`),u=me(e.disabledEfforts,`${t}.disabledEfforts`),g=me(e.localRejectEfforts,`${t}.localRejectEfforts`),y=f(e.allowCustomEffort,`${t}.allowCustomEffort`),b=f(e.supportsReasoningEffort,`${t}.supportsReasoningEffort`),v=f(e.supportsReasoningSummary,`${t}.supportsReasoningSummary`),k=f(e.supportsEncryptedReasoningReplay,`${t}.supportsEncryptedReasoningReplay`),d=f(e.supportsAdaptiveThinking,`${t}.supportsAdaptiveThinking`),C=f(e.supportsManualThinkingBudget,`${t}.supportsManualThinkingBudget`),p=f(e.supportsDisabledThinking,`${t}.supportsDisabledThinking`),X=f(e.requiresEffortBetaHeader,`${t}.requiresEffortBetaHeader`),a={effortStrategy:n};if(r!==void 0&&(a.reasoningPreset=r),i!==void 0&&(a.thinkingStrategy=i),s!==void 0&&(a.defaultEffort=s),l!==void 0&&(a.effortAliases=l),u!==void 0&&(a.disabledEfforts=u),g!==void 0&&(a.localRejectEfforts=g),e.supportedEfforts!==void 0){if(!Array.isArray(e.supportedEfforts))throw new Error(`provider-capabilities.json: ${t}.supportedEfforts must be an array`);a.supportedEfforts=e.supportedEfforts.map((c,m)=>{if(!h(c))throw new Error(`provider-capabilities.json: ${t}.supportedEfforts[${m}] must be an object`);return{value:R(c.value,`${t}.supportedEfforts[${m}].value`),...x(c.description,`${t}.supportedEfforts[${m}].description`)!==void 0?{description:x(c.description,`${t}.supportedEfforts[${m}].description`)}:{},...f(c.isDefault,`${t}.supportedEfforts[${m}].isDefault`)!==void 0?{isDefault:f(c.isDefault,`${t}.supportedEfforts[${m}].isDefault`)}:{},...f(c.isUserVisible,`${t}.supportedEfforts[${m}].isUserVisible`)!==void 0?{isUserVisible:f(c.isUserVisible,`${t}.supportedEfforts[${m}].isUserVisible`)}:{}}})}if(e.budgetByEffort!==void 0){if(!h(e.budgetByEffort))throw new Error(`provider-capabilities.json: ${t}.budgetByEffort must be an object`);let c={};for(let[m,G]of Object.entries(e.budgetByEffort))c[m]=P(G,`${t}.budgetByEffort.${m}`)??0;a.budgetByEffort=c}return y!==void 0&&(a.allowCustomEffort=y),b!==void 0&&(a.supportsReasoningEffort=b),v!==void 0&&(a.supportsReasoningSummary=v),k!==void 0&&(a.supportsEncryptedReasoningReplay=k),d!==void 0&&(a.supportsAdaptiveThinking=d),C!==void 0&&(a.supportsManualThinkingBudget=C),p!==void 0&&(a.supportsDisabledThinking=p),X!==void 0&&(a.requiresEffortBetaHeader=X),a}o(he,"validateReasoningProfile");function ye(e,t){let n=e.reasoningProfile,r=e.reasoningCapabilityV2;if(n!==void 0&&r!==void 0)throw new Error(`provider-capabilities.json: ${t} must not define both reasoningProfile and deprecated reasoningCapabilityV2`);return n!==void 0?he(n,`${t}.reasoningProfile`):he(r,`${t}.reasoningCapabilityV2`)}o(ye,"validateReasoningProfileField");function Tt(e,t){if(typeof e!="string"||!pe.includes(e))throw new Error(`provider-capabilities.json: ${t} must be one of ${pe.join(", ")}, got ${JSON.stringify(e)}`);return e}o(Tt,"requireProfileName");function xt(e,t){if(typeof e!="string"||!ge.includes(e))throw new Error(`provider-capabilities.json: ${t} must be one of ${ge.join(", ")}, got ${JSON.stringify(e)}`);return e}o(xt,"requireVerifyStrategy");function St(e,t){if(!h(e))throw new Error(`provider-capabilities.json: ${t} must be an object`);let n=R(e.id,`${t}.id`),r=x(e.wireModel,`${t}.wireModel`),i=x(e.displayName,`${t}.displayName`),s=P(e.contextWindow,`${t}.contextWindow`),l=P(e.maxOutputTokens,`${t}.maxOutputTokens`),u=P(e.thinkingBudgetCap,`${t}.thinkingBudgetCap`),g=f(e.replayReasoningContent,`${t}.replayReasoningContent`),y=f(e.strictThinkingSignature,`${t}.strictThinkingSignature`),b=P(e.streamMaxDurationMs,`${t}.streamMaxDurationMs`),v=e.reasoningCapability===void 0?void 0:F(e.reasoningCapability,`${t}.reasoningCapability`),k=ye(e,t),d={id:n};return r!==void 0&&(d.wireModel=r),i!==void 0&&(d.displayName=i),s!==void 0&&(d.contextWindow=s),l!==void 0&&(d.maxOutputTokens=l),u!==void 0&&(d.thinkingBudgetCap=u),v!==void 0&&(d.reasoningCapability=v),k!==void 0&&(d.reasoningProfile=k),g!==void 0&&(d.replayReasoningContent=g),y!==void 0&&(d.strictThinkingSignature=y),b!==void 0&&(d.streamMaxDurationMs=b),d}o(St,"validateModelDescriptor");function Mt(e,t){if(e===void 0)return;if(!h(e))throw new Error(`provider-capabilities.json: ${t} must be an object`);let n={};for(let[r,i]of Object.entries(e))n[r]=F(i,`${t}.${r}`);return n}o(Mt,"validateModelReasoningCapabilities");function Kt(e,t){if(!h(e))throw new Error(`provider-capabilities.json: providers.${t} must be an object`);let n=f(e.cliBridge,`providers.${t}.cliBridge`),r=R(e.apiKeyEnv,`providers.${t}.apiKeyEnv`),i=F(e.reasoningCapability,`providers.${t}.reasoningCapability`),s=ye(e,`providers.${t}`),l=Tt(e.capabilityProfile,`providers.${t}.capabilityProfile`),u=xt(e.verifyStrategy,`providers.${t}.verifyStrategy`);if(n&&u!=="unsupported")throw new Error(`provider-capabilities.json: providers.${t} is a cliBridge entry but verifyStrategy="${u}" \u2014 must be "unsupported" (CLI binary owns credentials)`);let g=P(e.contextWindow,`providers.${t}.contextWindow`),y=P(e.maxOutputTokens,`providers.${t}.maxOutputTokens`),b=P(e.thinkingBudgetCap,`providers.${t}.thinkingBudgetCap`),v=f(e.supportsThinking,`providers.${t}.supportsThinking`),k=Mt(e.modelReasoningCapabilities,`providers.${t}.modelReasoningCapabilities`),d=x(e.model,`providers.${t}.model`);if(n&&(d!==void 0||e.models!==void 0))throw new Error(`provider-capabilities.json: providers.${t} is a cliBridge entry but defines model/models \u2014 must be omitted (filled at load time)`);if(!n&&d===void 0)throw new Error(`provider-capabilities.json: providers.${t}.model is required (only cliBridge entries may omit)`);let C;if(e.models!==void 0){if(!Array.isArray(e.models))throw new Error(`provider-capabilities.json: providers.${t}.models must be an array`);C=e.models.map((a,c)=>St(a,`providers.${t}.models[${c}]`));let X=new Set([...d===void 0?[]:[d],...C.map(a=>a.id)]);for(let[a,c]of C.entries())if(c.wireModel!==void 0&&!X.has(c.wireModel))throw new Error(`provider-capabilities.json: providers.${t}.models[${a}].wireModel must reference a declared model, got ${JSON.stringify(c.wireModel)}`)}let p={apiKeyEnv:r,reasoningCapability:i,capabilityProfile:l,verifyStrategy:u};return s!==void 0&&(p.reasoningProfile=s),d!==void 0&&(p.model=d),C!==void 0&&(p.models=C),g!==void 0&&(p.contextWindow=g),y!==void 0&&(p.maxOutputTokens=y),b!==void 0&&(p.thinkingBudgetCap=b),v!==void 0&&(p.supportsThinking=v),k!==void 0&&(p.modelReasoningCapabilities=k),n&&(p.cliBridge=!0),p}o(Kt,"validateProviderEntry");function be(e){if(!h(e))throw new Error("provider-capabilities.json: root must be an object");if(e.version!==1)throw new Error(`provider-capabilities.json: version must be 1, got ${JSON.stringify(e.version)}`);let t=R(e.updatedAt,"updatedAt");if(!h(e.providers))throw new Error("provider-capabilities.json: providers must be an object");let n={};for(let[r,i]of Object.entries(e.providers))n[r]=Kt(i,r);return{version:1,updatedAt:t,providers:n}}o(be,"validateProviderCapabilitiesJson");var At=Object.freeze({native:K,"image-input-native":Q,"cli-bridge":O,"image-input-cli-bridge":Z}),L=null;function It(){if(process.env.KODAX_BUNDLED==="true")return S.join(S.dirname(process.execPath),"provider-capabilities.json");let e=S.dirname(Xt(import.meta.url)),t=[S.join(e,"provider-capabilities.json"),S.join(S.dirname(e),"provider-capabilities.json")];for(let n of t)if(wt(n))return n;return t[0]}o(It,"resolveJsonPath");function Ot(e){if(e.models){for(let t of e.models)t.reasoningProfile&&ve(t.reasoningProfile);for(let t of e.models)Object.freeze(t);Object.freeze(e.models)}return e.reasoningProfile&&ve(e.reasoningProfile),e.modelReasoningCapabilities&&Object.freeze(e.modelReasoningCapabilities),Object.freeze(e)}o(Ot,"deepFreezeSnapshot");function ve(e){if(e.supportedEfforts){for(let t of e.supportedEfforts)Object.freeze(t);Object.freeze(e.supportedEfforts)}e.budgetByEffort&&Object.freeze(e.budgetByEffort),e.effortAliases&&Object.freeze(e.effortAliases),e.disabledEfforts&&Object.freeze(e.disabledEfforts),e.localRejectEfforts&&Object.freeze(e.localRejectEfforts),Object.freeze(e)}o(ve,"freezeReasoningProfile");function Dt(e){if(e==="gemini-cli"){let t=T();return{model:t,models:_().filter(n=>n!==t).map(n=>({id:n}))}}if(e==="codex-cli"){let t=E();return{model:t,models:w().filter(n=>n!==t).map(n=>({id:n}))}}throw new Error(`provider-capabilities loader: unknown cliBridge provider '${e}'`)}o(Dt,"resolveCliBridgeModels");function Bt(e,t){let n=At[t.capabilityProfile];if(!n)throw new Error(`provider-capabilities loader: unknown capabilityProfile '${t.capabilityProfile}' for provider '${e}'`);if(t.cliBridge){let i=Dt(e),s={model:i.model,models:i.models,apiKeyEnv:t.apiKeyEnv,reasoningCapability:t.reasoningCapability,capabilityProfile:n,verifyStrategy:t.verifyStrategy};return t.reasoningProfile!==void 0&&(s.reasoningProfile=t.reasoningProfile),t.supportsThinking!==void 0&&(s.supportsThinking=t.supportsThinking),s}let r={model:t.model,apiKeyEnv:t.apiKeyEnv,reasoningCapability:t.reasoningCapability,capabilityProfile:n,verifyStrategy:t.verifyStrategy};return t.reasoningProfile!==void 0&&(r.reasoningProfile=t.reasoningProfile),t.models!==void 0&&(r.models=t.models),t.modelReasoningCapabilities!==void 0&&(r.modelReasoningCapabilities=t.modelReasoningCapabilities),t.contextWindow!==void 0&&(r.contextWindow=t.contextWindow),t.maxOutputTokens!==void 0&&(r.maxOutputTokens=t.maxOutputTokens),t.thinkingBudgetCap!==void 0&&(r.thinkingBudgetCap=t.thinkingBudgetCap),t.supportsThinking!==void 0&&(r.supportsThinking=t.supportsThinking),r}o(Bt,"buildSnapshot");function ke(){if(L)return L;let e=It(),t;try{let i=_t(e,"utf8");t=JSON.parse(i)}catch(i){let s=i instanceof Error?i.message:String(i);throw new Error(`provider-capabilities loader: failed to read ${e}: ${s}`)}let n=be(t),r={};for(let[i,s]of Object.entries(n.providers))r[i]=Ot(Bt(i,s));return L=Object.freeze(r),L}o(ke,"getProviderSnapshots");import Yr from"@anthropic-ai/sdk";var V=ke();var Ce=process.env.KODAX_PROVIDER??"zhipu-coding";export{Le as a,je as b,$e as c,Fe as d,Ue as e,qe as f,j as g,V as h};
@@ -1,2 +1,2 @@
1
1
  // @kodax-ai/kodax — bundled distribution. See docs/ADR.md ADR-022 + ADR-024.
2
- import{o}from"./chunk-UJEMSPM5.js";import{a as i}from"./chunk-ONUPGMER.js";function r(u){let e=o(u?.llm);if(!e)return;let t={};return e.requestTimeoutMs!==void 0&&(t.requestTimeoutMs=e.requestTimeoutMs),e.streamIdleTimeoutMs!==void 0&&(t.streamIdleTimeoutMs=e.streamIdleTimeoutMs),e.chunkTimeoutMs!==void 0&&(t.chunkTimeoutMs=e.chunkTimeoutMs),e.maxRetryDelayMs!==void 0&&(t.maxRetryDelayMs=e.maxRetryDelayMs),Object.keys(t).length>0?t:void 0}i(r,"providerResilienceConfigFromTimeouts");export{r as a};
2
+ import{o}from"./chunk-ZJIMT5I3.js";import{a as i}from"./chunk-ONUPGMER.js";function r(u){let e=o(u?.llm);if(!e)return;let t={};return e.requestTimeoutMs!==void 0&&(t.requestTimeoutMs=e.requestTimeoutMs),e.streamIdleTimeoutMs!==void 0&&(t.streamIdleTimeoutMs=e.streamIdleTimeoutMs),e.chunkTimeoutMs!==void 0&&(t.chunkTimeoutMs=e.chunkTimeoutMs),e.maxRetryDelayMs!==void 0&&(t.maxRetryDelayMs=e.maxRetryDelayMs),Object.keys(t).length>0?t:void 0}i(r,"providerResilienceConfigFromTimeouts");export{r as a};