@kodax-ai/kodax 0.7.71 → 0.7.72

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 (86) hide show
  1. package/CHANGELOG.md +602 -487
  2. package/README.md +46 -27
  3. package/README_CN.md +30 -13
  4. package/dist/chunks/agent-YKGU4USA.js +2 -0
  5. package/dist/chunks/argument-completer-QZETLNAB.js +2 -0
  6. package/dist/chunks/{chunk-SX2WFHIS.js → chunk-2RI252RN.js} +1 -1
  7. package/dist/chunks/chunk-CLFP6UGU.js +71 -0
  8. package/dist/chunks/chunk-E27LHEIP.js +37 -0
  9. package/dist/chunks/chunk-EDZ5KJFT.js +5 -0
  10. package/dist/chunks/chunk-GIK4SGAT.js +364 -0
  11. package/dist/chunks/chunk-GVWPHE23.js +310 -0
  12. package/dist/chunks/{chunk-A2TFSV5M.js → chunk-IR5KIK7E.js} +1 -1
  13. package/dist/chunks/chunk-JSDLBXME.js +755 -0
  14. package/dist/chunks/chunk-MVARIMQV.js +22 -0
  15. package/dist/chunks/chunk-PKQOEDHJ.js +628 -0
  16. package/dist/chunks/{chunk-64NQBOSN.js → chunk-SQODXBLX.js} +1 -1
  17. package/dist/chunks/chunk-VDGCGOQH.js +328 -0
  18. package/dist/chunks/chunk-VVE3UM4F.js +410 -0
  19. package/dist/chunks/chunk-WIBLZK4G.js +151 -0
  20. package/dist/chunks/{compaction-config-5KKKXYFT.js → compaction-config-TWCDFLX6.js} +1 -1
  21. package/dist/chunks/{construction-bootstrap-OXDDDW6O.js → construction-bootstrap-ZJPXUPXQ.js} +1 -1
  22. package/dist/chunks/dist-JT4ATXVM.js +2 -0
  23. package/dist/chunks/host-SVEDZUC5.js +2 -0
  24. package/dist/chunks/{run-manager-Z3W6MDO7.js → run-manager-RX42UNEM.js} +1 -1
  25. package/dist/chunks/{utils-CFOXDCB5.js → utils-OTT5CG5J.js} +1 -1
  26. package/dist/index.d.ts +13 -13
  27. package/dist/index.js +4 -4
  28. package/dist/kodax_bootstrap.js +28 -0
  29. package/dist/kodax_cli.js +1325 -1333
  30. package/dist/kodax_resume.js +44 -0
  31. package/dist/provider-capabilities.json +50 -48
  32. package/dist/runtime-worker.js +1322 -1330
  33. package/dist/sdk-a2a.d.ts +10 -9
  34. package/dist/sdk-a2a.js +1 -1
  35. package/dist/sdk-agent.d.ts +382 -206
  36. package/dist/sdk-agent.js +1 -1
  37. package/dist/sdk-coding.d.ts +80 -128
  38. package/dist/sdk-coding.js +1 -1
  39. package/dist/sdk-experimental-memory.js +1 -1
  40. package/dist/sdk-mcp.js +1 -1
  41. package/dist/sdk-media.d.ts +3 -0
  42. package/dist/sdk-media.js +1 -1
  43. package/dist/sdk-repl.d.ts +71 -23
  44. package/dist/sdk-repl.js +2 -2
  45. package/dist/sdk-runtime.d.ts +143 -31
  46. package/dist/sdk-runtime.js +1 -1
  47. package/dist/sdk-session.d.ts +6 -5
  48. package/dist/sdk-session.js +1 -1
  49. package/dist/sdk-skills.d.ts +5 -5
  50. package/dist/sdk-skills.js +1 -1
  51. package/dist/semantic-worker.js +14 -14
  52. package/dist/types-chunks/{bash-prefix-extractor.d-YoiZl5yt.d.ts → bash-prefix-extractor.d-CHJO5y94.d.ts} +107 -248
  53. package/dist/types-chunks/{capsule.d-CK5Pfz1k.d.ts → capsule.d-DxtdE-GD.d.ts} +24 -95
  54. package/dist/types-chunks/center-types.d-BBT122uJ.d.ts +91 -0
  55. package/dist/types-chunks/{commands.d-D6g2jq8V.d.ts → commands.d-DZxHzH5-.d.ts} +6 -4
  56. package/dist/types-chunks/{guardrail.d-DilYC1dh.d.ts → guardrail.d-DlpMnd-Y.d.ts} +1 -1
  57. package/dist/types-chunks/{guardrail.d-DdeDWnVu.d.ts → guardrail.d-auV61_h5.d.ts} +83 -10
  58. package/dist/types-chunks/public-api.d--IDNJsu1.d.ts +1342 -0
  59. package/dist/types-chunks/{run-manager.d-DxU3SSGR.d.ts → run-manager.d-Bh50OdVl.d.ts} +1 -1
  60. package/dist/types-chunks/sdk-session-Cfw6NFu-.d.ts +82 -0
  61. package/dist/types-chunks/{types.d-CEZZSY9s.d.ts → types.d-CNZgY52F.d.ts} +2 -2
  62. package/dist/types-chunks/{types.d-vJExiRje.d.ts → types.d-DCQVBqVn.d.ts} +10 -5
  63. package/dist/types-chunks/{types.d-CRCaLt_s.d.ts → types.d-DH1mvdcl.d.ts} +284 -164
  64. package/dist/types-chunks/{types.d-CzsLFqmf.d.ts → types.d-EqQmHztg.d.ts} +9 -10
  65. package/dist/types-chunks/{utils.d-Cb6vdvFM.d.ts → utils.d-gmn3c5U4.d.ts} +9 -12
  66. package/docs/SDK_EMBEDDER_GUIDE.md +171 -26
  67. package/package.json +4 -4
  68. package/scripts/kodax-bin.cjs +4 -2
  69. package/scripts/production-env.cjs +9 -0
  70. package/dist/chunks/agent-X2EWQADL.js +0 -2
  71. package/dist/chunks/argument-completer-BLNXDO2F.js +0 -2
  72. package/dist/chunks/chunk-4DY756KL.js +0 -70
  73. package/dist/chunks/chunk-52JSZ77P.js +0 -37
  74. package/dist/chunks/chunk-A574DBTV.js +0 -422
  75. package/dist/chunks/chunk-F7KGYHJ3.js +0 -624
  76. package/dist/chunks/chunk-GVTM4Z6O.js +0 -151
  77. package/dist/chunks/chunk-PHH4TRGF.js +0 -22
  78. package/dist/chunks/chunk-PVUXONQB.js +0 -366
  79. package/dist/chunks/chunk-T7LYK53M.js +0 -329
  80. package/dist/chunks/chunk-VRSVNU2Y.js +0 -7
  81. package/dist/chunks/chunk-Y5XKAN7C.js +0 -755
  82. package/dist/chunks/chunk-Z535BARK.js +0 -306
  83. package/dist/chunks/dist-IXJRJ27U.js +0 -2
  84. package/dist/chunks/host-VRKDAN26.js +0 -2
  85. package/dist/types-chunks/public-api.d-BvCp5VkW.d.ts +0 -601
  86. package/dist/types-chunks/sdk-session-wGpa7X_U.d.ts +0 -796
@@ -1,9 +1,9 @@
1
1
  import { k as KodaXMessage, F as KodaXReasoningMode, d as KodaXCustomProviderConfig, p as KodaXProviderCapabilityProfile } from './types.d-Cqaw71Ax.js';
2
- import { I as KodaXContextTokenSnapshot, ae as KodaXSkillDynamicContextPolicy, r as KodaXAgentMode, a1 as KodaXRepoIntelligenceMode, Y as KodaXOptions, af as KodaXSkillInvocationContext } from './bash-prefix-extractor.d-YoiZl5yt.js';
3
- import { bm as KodaXSessionUiHistoryItem, bb as KodaXSessionLineage, b2 as KodaXSessionArtifactLedgerEntry, aO as KodaXExtensionSessionState, aN as KodaXExtensionSessionRecord, bi as KodaXSessionRuntimeInfo, dA as WorkflowProcessSource } from './types.d-CRCaLt_s.js';
4
- import { A as AgentsFile, f as AutoModeStats, l as KodaXMcpServersConfig } from './guardrail.d-DdeDWnVu.js';
2
+ import { M as KodaXContextTokenSnapshot, ah as KodaXSkillDynamicContextPolicy, t as KodaXAgentMode, a4 as KodaXRepoIntelligenceMode, $ as KodaXOptions, ai as KodaXSkillInvocationContext } from './bash-prefix-extractor.d-CHJO5y94.js';
3
+ import { bW as KodaXSessionUiHistoryItem, bL as KodaXSessionLineage, bC as KodaXSessionArtifactLedgerEntry, bm as KodaXExtensionSessionState, bl as KodaXExtensionSessionRecord, bS as KodaXSessionRuntimeInfo, ea as WorkflowProcessSource } from './types.d-DH1mvdcl.js';
4
+ import { d as AgentsFile, j as AutoModeStats, p as KodaXMcpServersConfig } from './guardrail.d-auV61_h5.js';
5
5
  import * as readline from 'readline';
6
- import { f as PermissionMode } from './public-api.d-BvCp5VkW.js';
6
+ import { R as PermissionMode, L as LearningBinding, E as LearningSurfaceSnapshot } from './public-api.d--IDNJsu1.js';
7
7
  import { SpawnSyncReturns } from 'child_process';
8
8
 
9
9
  /**
@@ -227,6 +227,9 @@ interface CommandCallbacks {
227
227
  rewindSession?: (selector?: string) => Promise<SessionRewindStatus>;
228
228
  getCostReport?: () => string | null;
229
229
  getRuntimeStatus?: () => Promise<RuntimeSurfaceStatus | undefined>;
230
+ learning?: LearningBinding;
231
+ getLearningSummary?: () => Promise<LearningSurfaceSnapshot>;
232
+ openLearningCenter?: (nameOrSlug?: string) => Promise<void>;
230
233
  /**
231
234
  * FEATURE_092 phase 2b.8: read-only stats accessor for the auto-mode
232
235
  * classifier guardrail. Returns undefined when the guardrail hasn't been
@@ -258,14 +261,8 @@ interface CommandInvocationRequest extends CommandExecutionMetadata {
258
261
  displayName: string;
259
262
  path?: string;
260
263
  skillInvocation?: KodaXSkillInvocationContext;
261
- /**
262
- * FEATURE_246: per-turn agent-mode elevation for this invocation only.
263
- * The `/workflow` command in AMA sets this to `'amaw'` so its authoring turn
264
- * gets `run_workflow` (scout-then-author) — matching AMAW's capability without
265
- * making plain AMA self-activate workflows from natural language. The session
266
- * mode is unchanged; only this one turn runs elevated.
267
- */
268
- agentModeOverride?: KodaXAgentMode;
264
+ /** Trusted host marker set only by an explicit Workflow command. */
265
+ workflowIntent?: 'explicit';
269
266
  }
270
267
  interface CommandWorkflowInvocationRequest {
271
268
  request: string;
@@ -2169,17 +2169,30 @@ For streaming follow-ups, use `enqueueWithArtifacts()` instead of the raw
2169
2169
  message queue:
2170
2170
 
2171
2171
  ```ts
2172
- enqueueWithArtifacts({
2173
- provider: selectedProvider,
2174
- model: selectedModel,
2175
- content: followupText,
2176
- inputArtifacts: [artifact],
2177
- });
2178
- ```
2179
-
2180
- The helper validates first and then stores `inputArtifacts` on the queued prompt.
2181
- Queued image follow-ups are rebuilt as multimodal content blocks on the next
2182
- runner turn. Unsupported file/video attachments are rejected before enqueueing.
2172
+ enqueueWithArtifacts({
2173
+ provider: selectedProvider,
2174
+ model: selectedModel,
2175
+ sessionId: activeSessionId,
2176
+ content: followupText,
2177
+ inputArtifacts: [artifact],
2178
+ });
2179
+ ```
2180
+
2181
+ The helper validates first and then stores `inputArtifacts` on the queued prompt.
2182
+ Queued image follow-ups are rebuilt as multimodal content blocks on the next
2183
+ runner turn. Unsupported file/video attachments are rejected before enqueueing.
2184
+ Pass `sessionId` whenever the host can run more than one session concurrently;
2185
+ it targets that Actor session's root queue without exposing Actor paths. For
2186
+ backward compatibility, omitting both `sessionId` and `agentId` still binds to
2187
+ the sole active Actor root, or uses the legacy unscoped SA queue when no Actor
2188
+ run is active. If multiple Actor roots are active, the helper rejects the
2189
+ ambiguous call instead of risking cross-session delivery. Low-level child-Actor
2190
+ producers may continue to pass an explicit `agentId`.
2191
+
2192
+ `enqueueWithArtifacts()` is an in-process queue helper for direct/inline runs.
2193
+ Runtime Worker and daemon clients must use `runtime.runs.submitInput(...)` (with
2194
+ the same `sessionId`, `afterRunId`, and `delivery:'after_turn'`) because a
2195
+ process-local MessageQueue cannot cross those transport boundaries.
2183
2196
 
2184
2197
  ### Boundaries
2185
2198
 
@@ -2521,10 +2534,16 @@ For a given profile, one owner wins an atomic lock. Concurrent starters wait for
2521
2534
  the winner and connect once it is ready. Stale state is cleaned only after pid,
2522
2535
  endpoint, token, and runtime identity checks. If ownership cannot be verified,
2523
2536
  KodaX reports the daemon as unhealthy instead of killing an arbitrary process.
2524
- SDK auto-start launches a detached `kodax daemon serve` process; it never treats
2525
- an in-process socket listener as daemon mode. Closing the SDK client detaches
2526
- without stopping that shared process. Use `kodax daemon stop` or the explicit
2527
- runtime shutdown protocol to stop the owner.
2537
+ SDK auto-start launches a detached `kodax daemon serve` process; it never treats
2538
+ an in-process socket listener as daemon mode. Closing the SDK client detaches
2539
+ without stopping that shared process. Use `kodax daemon stop` or the explicit
2540
+ runtime shutdown protocol to stop the owner.
2541
+
2542
+ CLI and SDK startup retain the exact spawned candidate until health confirms
2543
+ that candidate PID. Early exit, timeout, identity mismatch, cancellation, or a
2544
+ different owner winning the race reclaims only the unsuccessful candidate
2545
+ process tree. Once healthy, the owner detaches normally and is not tied to the
2546
+ creating client process.
2528
2547
 
2529
2548
  ### Daemon startup, conflict, and recovery behavior
2530
2549
 
@@ -2548,6 +2567,9 @@ Operational guidance:
2548
2567
  - test harnesses that auto-start a process daemon must send authenticated
2549
2568
  `runtime.shutdown` (or run `kodax daemon stop --home <dir> --profile <name>`)
2550
2569
  before deleting their temporary home; `runtime.close()` only detaches;
2570
+ - KodaX's own Vitest harness also supplies an internal worker-PID marker so a
2571
+ forcibly terminated worker cannot strand its test daemon; this is a test-only
2572
+ fallback, not a public SDK option or a production idle-shutdown policy;
2551
2573
  - query `kodax daemon status --json` before deciding to restart;
2552
2574
  - inspect `kodax daemon logs --lines 100` when startup times out;
2553
2575
  - custom endpoints and injected transports are attach-only unless the caller
@@ -2599,11 +2621,14 @@ runtime close.
2599
2621
  ```ts
2600
2622
  const session = await runtime.sessions.create({ title: 'Shared session' });
2601
2623
 
2602
- const sub = runtime.events.subscribe({ sessionId: session.id }, (event) => {
2603
- if (event.type === 'assistant.delta') {
2604
- // Render streaming text in the host UI.
2605
- }
2606
- });
2624
+ const sub = runtime.events.subscribe({ sessionId: session.id }, (event) => {
2625
+ if (event.type === 'assistant.delta') {
2626
+ // Render streaming text in the host UI.
2627
+ }
2628
+ });
2629
+ // Daemon subscriptions establish a remote handshake. Await this before
2630
+ // starting work whose first event must not be missed; local subscriptions omit it.
2631
+ await sub.ready;
2607
2632
 
2608
2633
  const artifact = await runtime.artifacts.create({
2609
2634
  kind: 'image',
@@ -2661,7 +2686,7 @@ Space-style client can subscribe to permission events and answer a request
2661
2686
  created by a REPL-style client.
2662
2687
 
2663
2688
  ```ts
2664
- const sub = runtime.events.subscribe({ type: 'permission.requested' }, (event) => {
2689
+ const sub = runtime.events.subscribe({ type: 'permission.requested' }, (event) => {
2665
2690
  const payload = event.payload;
2666
2691
  if (!payload || typeof payload !== 'object' || typeof payload.id !== 'string') {
2667
2692
  return;
@@ -2670,11 +2695,14 @@ const sub = runtime.events.subscribe({ type: 'permission.requested' }, (event) =
2670
2695
  payload.id,
2671
2696
  { type: 'allow_once' },
2672
2697
  { runId: payload.runId },
2673
- );
2674
- });
2675
- ```
2676
-
2677
- Only the first valid response wins. Wrong-run or stale responses are rejected.
2698
+ );
2699
+ });
2700
+ await sub.ready;
2701
+ ```
2702
+
2703
+ Await `ready` before another client starts work that may request permission;
2704
+ this creates an explicit cross-connection ordering boundary. Only the first
2705
+ valid response wins. Wrong-run or stale responses are rejected.
2678
2706
  Abort, runtime close, daemon stop, and timeout reject unresolved permission
2679
2707
  requests so tool approval promises do not hang forever.
2680
2708
 
@@ -3693,6 +3721,7 @@ const runtime = await connectKodaXRuntime({
3693
3721
  sharedSessionSettings: 1,
3694
3722
  durableRecoveryQueries: 1,
3695
3723
  daemonManagement: 1,
3724
+ runtimeAutoModeGuardrail: 1,
3696
3725
  },
3697
3726
  });
3698
3727
  ```
@@ -3704,6 +3733,18 @@ Coder. FEATURE_269 does not advertise `interruptInput`, so an interrupt-only
3704
3733
  product must require `{ interruptInput: 1 }` and fail connection. The supported
3705
3734
  fallback is `delivery: 'after_turn'` only when that is the user's intent.
3706
3735
 
3736
+ The final v0.7.72 SDK requires `runtimeAutoModeGuardrail:1` automatically for
3737
+ `autoStart: true`, even when the caller omits it from `requirements`. If the healthy
3738
+ profile daemon is older, the SDK first requires `daemonManagement:1`, takes a
3739
+ revision/owner-policy fenced preflight, and replaces it only when no active or
3740
+ queued run, Workflow, Agent turn, pending permission/user input, or other
3741
+ logical client exists. A busy or still-older daemon is never stopped: the
3742
+ connection rejects with `RuntimeDaemonCapabilityUpgradeError`, whose
3743
+ `recoverable` and `restartRequired` fields are `true` and whose optional
3744
+ `preflight` explains the blockers. Attach-only connections never mutate daemon
3745
+ ownership and must request `runtimeAutoModeGuardrail:1` explicitly when they
3746
+ depend on this contract.
3747
+
3707
3748
  The `coderFeatureMatrix` capability reports daemon availability for managed
3708
3749
  runs, transcript/session operations, Todo projection, managed tasks, Workflow,
3709
3750
  MCP, Reference External Agent, Memory, and Runtime artifacts. Reference
@@ -4091,6 +4132,110 @@ tool arguments.
4091
4132
 
4092
4133
  ---
4093
4134
 
4135
+ ## 24. Runtime-owned Auto Mode and plan-approval bridges (v0.7.72)
4136
+
4137
+ Auto Mode is a Runtime session contract, including in shared-daemon mode. Do
4138
+ not implement a second classifier or decide permissions from a client-side
4139
+ `beforeToolExecute` hook before the Runtime has classified the call.
4140
+
4141
+ ### Configure the session, not an individual UI callback
4142
+
4143
+ ```ts
4144
+ await runtime.sessions.updateSettings(session.id, {
4145
+ permissionMode: 'auto',
4146
+ autoModeEngine: 'llm',
4147
+ autoModeClassifierModel: 'zhipu:glm-5.2', // optional; otherwise follow the run model
4148
+ autoModeTimeoutMs: 20_000, // positive safe integer, optional
4149
+ executionCwd: projectDirectory,
4150
+ });
4151
+ ```
4152
+
4153
+ `autoModeClassifierModel` and `autoModeTimeoutMs` are durable session settings
4154
+ in inline, Worker, and daemon forms. A `null` patch removes either optional
4155
+ override; a zero, negative, fractional, or unsafe timeout is rejected. Daemon
4156
+ capability discovery advertises both fields in `sharedSessionSettings.keys`.
4157
+
4158
+ The Runtime owns one serialized permission-settings stream and one shared
4159
+ engine/denial/breaker state per Session. It reuses bounded context-specific
4160
+ guardrails across turns while provider/model, repository boundary, execution
4161
+ directory, classifier model, and timeout remain the same. Updating one of
4162
+ those inputs selects a new context guardrail by design without copying stale
4163
+ state from a queued turn. Active runs, queued runs, explicit settings updates,
4164
+ and automatic LLM-to-rules fallback merge through the same Session mutation
4165
+ queue; fallback is persisted before a later classification reads the engine.
4166
+
4167
+ ### What an embedder should expect
4168
+
4169
+ The Runtime's execution order is fixed:
4170
+
4171
+ ```text
4172
+ Runtime Auto Mode guardrail -> host permission bridge only for escalate -> tool execution
4173
+ ```
4174
+
4175
+ Consequently, an LLM/rules `allow` does not create a pending permission request
4176
+ just because a host installed a static approval hook. `block` does not become a
4177
+ spurious approval prompt. A real `escalate` uses the existing shared
4178
+ `runtime.permissions` flow, so another authorized client may render and answer
4179
+ it. Hosts should subscribe to permission events to display such a request, but
4180
+ must not treat a missing request as an error for a safe tool call.
4181
+
4182
+ The permission event's `inputPreview` is a display-safe diagnostic projection:
4183
+ it is bounded, credential-redacted, valid JSON, and includes the effective
4184
+ execution directory. Use the Runtime owner’s typed tool input for execution;
4185
+ do not reconstruct or authorize a tool from the preview. `gitRoot` remains the
4186
+ session repository safety boundary, whereas relative operands resolve from the
4187
+ validated `executionCwd`. In particular, quoted Python/JavaScript/regexp source
4188
+ inside a shell command is not a path operand.
4189
+
4190
+ The user-level `.kodax` directory is a credential/configuration boundary, not
4191
+ an ordinary project path. Direct shell mutations, output redirects, and
4192
+ recognized nested-shell payloads whose target is provably beneath that
4193
+ directory are rejected before LLM classification. The check is segment-safe
4194
+ and Windows case-insensitive. KodaX deliberately does not scan arbitrary
4195
+ quoted language source for path-looking substrings: doing so would turn Python,
4196
+ JavaScript, YAML, and regular expressions into false Tier-0 matches. Trusted
4197
+ configuration changes should use the KodaX config CLI or SDK configuration API.
4198
+
4199
+ ### 0.7.x source compatibility
4200
+
4201
+ The v0.7.72 public declarations retain the following migration aliases:
4202
+
4203
+ | Legacy source | Current source | Contract |
4204
+ |---|---|---|
4205
+ | `agentMode: 'amaw'` | `'ama'` | accepted as deprecated input and normalized to AMA; no separate AMAW runtime is restored |
4206
+ | `SkillSource` | `ResolvedSkillSource` | formal source union remains `project \| user \| plugin \| builtin`; only resolved discovery output adds `learned` |
4207
+ | `RuntimeDaemonPreflight.activeAgentTasks` | `activeAgentTurns` | both required fields are returned and reference the same array throughout the 0.7.x line |
4208
+
4209
+ ### Plan capability is opt-in
4210
+
4211
+ `exit_plan_mode` is exposed to a Runtime run only when that run supplies an
4212
+ approval bridge. A daemon or headless host that cannot approve a plan should
4213
+ leave the bridge absent; KodaX removes the tool from that run's scope.
4214
+
4215
+ ```ts
4216
+ const planned = await runtime.runs.start({
4217
+ sessionId: session.id,
4218
+ prompt: 'Draft a migration plan, then ask for approval.',
4219
+ options: {
4220
+ events: {
4221
+ exitPlanMode: async () => showPlanAndAskUser(),
4222
+ },
4223
+ },
4224
+ });
4225
+ await planned.result;
4226
+ ```
4227
+
4228
+ The callback belongs in a trusted host process (for Electron, Main rather than
4229
+ renderer). It is intentionally not inferred from the presence of a permission
4230
+ UI: tool permission and plan approval are different user decisions.
4231
+
4232
+ See [ADR-056](ADR.md#adr-056-runtime-owns-auto-mode-permission-decisions-and-host-capability-exposure)
4233
+ for the ownership decision, [the v0.7.72 design](features/v0.7.72.md#2026-07-18-runtime-permission-queue-and-resume-closure)
4234
+ for the release boundary, and [Known Issue 187](KNOWN_ISSUES.md#187-shared-daemon-auto-permission-ownership-upgrade-fencing-preview-bounds-and-sdk-compatibility-were-incomplete)
4235
+ for the final capability-upgrade and compatibility closure.
4236
+
4237
+ ---
4238
+
4094
4239
  ## See also
4095
4240
 
4096
4241
  - [README.md](../README.md) — end-user CLI quick start
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kodax-ai/kodax",
3
- "version": "0.7.71",
3
+ "version": "0.7.72",
4
4
  "description": "KodaX lightweight coding agent - TypeScript implementation with 15 built-in LLM provider aliases, published as a Node-free single-file CLI and SDK",
5
5
  "type": "module",
6
6
  "private": false,
@@ -73,13 +73,13 @@
73
73
  "build:dts": "node scripts/build-dts.mjs",
74
74
  "build:packages": "tsc -b tsconfig.build.json && npm run copy:builtin -w @kodax-ai/agent && npm run copy:provider-caps -w @kodax-ai/llm",
75
75
  "build:bundle": "node scripts/build-bundle.mjs",
76
- "dev": "node --max-old-space-size=4096 --require ./scripts/production-env.cjs --import tsx src/kodax_cli.ts",
77
- "dev:cli": "node --max-old-space-size=4096 --require ./scripts/production-env.cjs --import tsx src/kodax_cli.ts",
76
+ "dev": "node --max-old-space-size=4096 --require ./scripts/production-env.cjs --import tsx src/kodax_bootstrap.ts",
77
+ "dev:cli": "node --max-old-space-size=4096 --require ./scripts/production-env.cjs --import tsx src/kodax_bootstrap.ts",
78
78
  "dev:mem-diag": "node scripts/mem-diag-launch.cjs",
79
79
  "dev:mem-snapshot": "node scripts/mem-diag-launch.cjs 2",
80
80
  "probe:reasoning": "tsx scripts/probe-reasoning.ts",
81
81
  "probe:max-tokens": "node scripts/probe-max-tokens.mjs",
82
- "start": "node --max-old-space-size=4096 --require ./scripts/production-env.cjs dist/kodax_cli.js",
82
+ "start": "node --max-old-space-size=4096 --require ./scripts/production-env.cjs dist/kodax_bootstrap.js",
83
83
  "build:binary": "node scripts/build-binary.mjs",
84
84
  "build:binary:all": "node scripts/build-binary.mjs --all",
85
85
  "test": "vitest run",
@@ -11,7 +11,7 @@
11
11
  * development reconciler, leaking ~100 MB/turn of profiling objects.
12
12
  *
13
13
  * This CJS file runs synchronously first, requires the env preload,
14
- * then dynamic-imports the compiled ESM entry.
14
+ * then dynamic-imports the lightweight compiled bootstrap.
15
15
  *
16
16
  * Opt back into development by setting KODAX_DEV=1.
17
17
  */
@@ -19,7 +19,9 @@
19
19
 
20
20
  require('./production-env.cjs');
21
21
 
22
- import('../dist/kodax_cli.js').catch((err) => {
22
+ import('../dist/kodax_bootstrap.js').then(
23
+ ({ runKodaXBootstrapAsEntry }) => runKodaXBootstrapAsEntry(),
24
+ ).catch((err) => {
23
25
  // Surface unexpected errors with a full stack — this path should be rare.
24
26
  // eslint-disable-next-line no-console
25
27
  console.error(err);
@@ -14,3 +14,12 @@
14
14
  if (!process.env.NODE_ENV) {
15
15
  process.env.NODE_ENV = process.env.KODAX_DEV === '1' ? 'development' : 'production';
16
16
  }
17
+
18
+ // Bootstrap hardening must run before the first application ESM import.
19
+ // ELECTRON_RUN_AS_NODE is a one-shot exec-boundary switch and is never kept.
20
+ delete process.env.ELECTRON_RUN_AS_NODE;
21
+ if (process.env.KODAX_DISABLE_HARDENING !== '1') {
22
+ delete process.env.LD_PRELOAD;
23
+ delete process.env.DYLD_INSERT_LIBRARIES;
24
+ delete process.env.DYLD_LIBRARY_PATH;
25
+ }
@@ -1,2 +0,0 @@
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-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};
@@ -1,2 +0,0 @@
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};