@kodax-ai/kodax 0.7.69 → 0.7.70

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 (56) hide show
  1. package/CHANGELOG.md +53 -1
  2. package/LICENSE +158 -191
  3. package/README.md +38 -5
  4. package/README_CN.md +31 -7
  5. package/config-templates/integrations/a2a.example.jsonc +1 -1
  6. package/dist/chunks/{agent-DQRXT6M7.js → agent-T72XYPW4.js} +1 -1
  7. package/dist/chunks/argument-completer-QXJC36UP.js +2 -0
  8. package/dist/chunks/chunk-34L74PEG.js +60 -0
  9. package/dist/chunks/{chunk-ZG4DMYBS.js → chunk-4P4L3WEK.js} +1 -1
  10. package/dist/chunks/{chunk-VYKFM3TB.js → chunk-7PV577LP.js} +67 -63
  11. package/dist/chunks/{chunk-PQ3XUSY2.js → chunk-AQGNRBEJ.js} +189 -180
  12. package/dist/chunks/{chunk-URC6ZI6P.js → chunk-F4NOOBRZ.js} +1 -1
  13. package/dist/chunks/{chunk-PA76WUBL.js → chunk-GOQRVDFP.js} +2 -2
  14. package/dist/chunks/{chunk-VAZ25MDX.js → chunk-K7RYV2SE.js} +2 -2
  15. package/dist/chunks/{chunk-M7TCFYTO.js → chunk-P2UKNYYS.js} +3 -3
  16. package/dist/chunks/{chunk-4WIODYOH.js → chunk-RY5OLVQV.js} +1 -1
  17. package/dist/chunks/{chunk-NGJURAY5.js → chunk-XNQ2O7NI.js} +4 -4
  18. package/dist/chunks/{compaction-config-ABLL6UH3.js → compaction-config-TC6C2PJ6.js} +1 -1
  19. package/dist/chunks/{construction-bootstrap-GH6RW6ST.js → construction-bootstrap-BPRXZK4A.js} +1 -1
  20. package/dist/chunks/{dist-RWL2RBO4.js → dist-UENHF5OS.js} +1 -1
  21. package/dist/chunks/{host-7SAB4WEC.js → host-XUVAICP7.js} +1 -1
  22. package/dist/chunks/{run-manager-XMDKTONJ.js → run-manager-T7ALQZNT.js} +1 -1
  23. package/dist/chunks/{utils-QYE5Y73D.js → utils-TMMH6PKT.js} +1 -1
  24. package/dist/index.d.ts +8 -8
  25. package/dist/index.js +6 -6
  26. package/dist/kodax_cli.js +1207 -1192
  27. package/dist/runtime-worker.js +1104 -1090
  28. package/dist/sdk-a2a.d.ts +6 -6
  29. package/dist/sdk-a2a.js +8 -7
  30. package/dist/sdk-agent.d.ts +2 -2
  31. package/dist/sdk-agent.js +1 -1
  32. package/dist/sdk-coding.d.ts +19 -11
  33. package/dist/sdk-coding.js +1 -1
  34. package/dist/sdk-llm.d.ts +1 -1
  35. package/dist/sdk-mcp.d.ts +2 -2
  36. package/dist/sdk-mcp.js +1 -1
  37. package/dist/sdk-repl.d.ts +10 -10
  38. package/dist/sdk-repl.js +1 -1
  39. package/dist/sdk-runtime.d.ts +80 -11
  40. package/dist/sdk-runtime.js +1 -1
  41. package/dist/sdk-session.d.ts +4 -4
  42. package/dist/sdk-session.js +1 -1
  43. package/dist/sdk-skills.js +1 -1
  44. package/dist/semantic-worker.js +10 -10
  45. package/dist/types-chunks/{bash-prefix-extractor.d-BkIA8Wto.d.ts → bash-prefix-extractor.d-h9AwGqmO.d.ts} +12 -2
  46. package/dist/types-chunks/{capability.d-3C62G8Eq.d.ts → capability.d-K664nHOS.d.ts} +21 -6
  47. package/dist/types-chunks/{commands.d-DkPfcQWG.d.ts → commands.d-DxiVanpI.d.ts} +3 -3
  48. package/dist/types-chunks/{manager.d-CoEuPRAo.d.ts → manager.d-B67TmPO1.d.ts} +27 -3
  49. package/dist/types-chunks/{public-api.d-7G4--RZE.d.ts → public-api.d-BqFKI5fK.d.ts} +1 -1
  50. package/dist/types-chunks/{sdk-session-BQccrODn.d.ts → sdk-session-tcoxrMHQ.d.ts} +2 -2
  51. package/dist/types-chunks/{types.d-C9YHEAmA.d.ts → types.d-DZaYznxo.d.ts} +2 -2
  52. package/dist/types-chunks/{utils.d-BbB5jzi1.d.ts → utils.d-B4zc7oot.d.ts} +2 -2
  53. package/docs/SDK_EMBEDDER_GUIDE.md +112 -19
  54. package/package.json +2 -2
  55. package/dist/chunks/argument-completer-RSK6CCGP.js +0 -2
  56. package/dist/chunks/chunk-Z4PPLJF2.js +0 -60
@@ -3,7 +3,7 @@ import { a0 as KodaXTokenUsage, k as KodaXMessage, a1 as KodaXToolDefinition, a9
3
3
  import { I as ISkillRegistry, d as SkillDynamicContextExecutor } from './types.d-vJExiRje.js';
4
4
  import { Diagnostic, Position, Location, Hover, DocumentSymbol, SymbolInformation, WorkspaceSymbol, CallHierarchyItem, CallHierarchyIncomingCall, CallHierarchyOutgoingCall } from 'vscode-languageserver-protocol';
5
5
  import { K as KodaXLlmTimeoutConfig, a as CostTracker } from './cost-tracker.d-BeaenODW.js';
6
- import { C as CapabilityKind, b as CapabilityResult } from './capability.d-3C62G8Eq.js';
6
+ import { C as CapabilityKind, f as CapabilitySearchSnapshot, b as CapabilityResult } from './capability.d-K664nHOS.js';
7
7
  import { K as KodaXBaseProvider } from './base.d-CYjtB68X.js';
8
8
 
9
9
  /**
@@ -910,7 +910,7 @@ declare function buildGoalRuntimeBinding(deps: GoalRuntimeBindingDeps): GoalRunt
910
910
  * configure / install / troubleshoot KodaX?" questions. Pure data + a
911
911
  * deterministic resolver — no RAG, no vector store, no network fetch.
912
912
  */
913
- type KodaXManualTopicId = 'overview' | 'install' | 'quickstart' | 'providers' | 'custom-providers' | 'config' | 'permissions' | 'commands' | 'tools' | 'agents' | 'skills' | 'extensions' | 'mcp' | 'repo-intelligence' | 'sessions' | 'memory' | 'doctor' | 'sdk' | 'troubleshooting';
913
+ type KodaXManualTopicId = 'overview' | 'license' | 'install' | 'quickstart' | 'providers' | 'custom-providers' | 'config' | 'permissions' | 'commands' | 'tools' | 'agents' | 'skills' | 'extensions' | 'mcp' | 'a2a' | 'repo-intelligence' | 'sessions' | 'memory' | 'doctor' | 'sdk' | 'troubleshooting';
914
914
  /** A pointer to the code/doc the topic is derived from (for traceability). */
915
915
  interface KodaXManualSource {
916
916
  readonly label: string;
@@ -1312,6 +1312,10 @@ interface CapabilityRuntimeContract {
1312
1312
  limit?: number;
1313
1313
  server?: string;
1314
1314
  }): Promise<unknown[]>;
1315
+ searchCapabilitySnapshot?(providerId: string, query: string, options?: {
1316
+ kind?: CapabilityKind;
1317
+ server?: string;
1318
+ }): Promise<CapabilitySearchSnapshot>;
1315
1319
  describeCapability(providerId: string, capabilityId: string): Promise<unknown>;
1316
1320
  executeCapability(providerId: string, capabilityId: string, input: Record<string, unknown>): Promise<CapabilityResult>;
1317
1321
  readCapability(providerId: string, capabilityId: string, options?: Record<string, unknown>): Promise<CapabilityResult>;
@@ -2593,6 +2597,8 @@ interface KodaXContextOptions {
2593
2597
  * and shell execution. Defaults to `gitRoot`, then `process.cwd()`.
2594
2598
  */
2595
2599
  executionCwd?: string;
2600
+ /** Fail-closed host policy applied to every concrete file a read tool opens. */
2601
+ assertReadablePath?: (candidate: string) => void;
2596
2602
  /**
2597
2603
  * Best-known token snapshot for the current conversation history.
2598
2604
  * When present, the core will prefer it over local estimation and rebase it as
@@ -3218,6 +3224,10 @@ interface KodaXToolExecutionContext {
3218
3224
  skillScriptRunner?: KodaXSkillScriptRunner;
3219
3225
  /** Working directory used to resolve relative paths and execute shell commands. */
3220
3226
  executionCwd?: string;
3227
+ /** Fail-closed host policy applied to every concrete file a read tool opens. */
3228
+ assertReadablePath?: (candidate: string) => void;
3229
+ /** Host tool visibility ceiling inherited by child agents. */
3230
+ toolVisibilityPolicy?: KodaXToolVisibilityPolicy;
3221
3231
  /** Maximum physical input capacity of the active model request. */
3222
3232
  maximumInputTokens?: number;
3223
3233
  /** Remaining capacity for the complete tool-result batch in this request. */
@@ -10,6 +10,24 @@
10
10
  * because it is coupled to the coding CLI surface.
11
11
  */
12
12
  type CapabilityKind = 'tool' | 'resource' | 'prompt';
13
+ interface CapabilitySearchOptions {
14
+ kind?: CapabilityKind;
15
+ limit?: number;
16
+ server?: string;
17
+ }
18
+ type CapabilitySearchFreshness = 'live' | 'cached' | 'stale' | 'mixed' | 'unknown';
19
+ interface CapabilitySearchFailure {
20
+ source: string;
21
+ message: string;
22
+ }
23
+ /** Complete internal search view. Model-facing tools page this snapshot. */
24
+ interface CapabilitySearchSnapshot {
25
+ items: unknown[];
26
+ revision?: string;
27
+ complete: boolean;
28
+ freshness: CapabilitySearchFreshness;
29
+ failures?: CapabilitySearchFailure[];
30
+ }
13
31
  interface CapabilityResult {
14
32
  kind: CapabilityKind;
15
33
  content?: string;
@@ -21,11 +39,8 @@ interface CapabilityResult {
21
39
  interface CapabilityProvider {
22
40
  id: string;
23
41
  kinds: CapabilityKind[];
24
- search?: (query: string, options?: {
25
- kind?: CapabilityKind;
26
- limit?: number;
27
- server?: string;
28
- }) => Promise<unknown[]>;
42
+ search?: (query: string, options?: CapabilitySearchOptions) => Promise<unknown[]>;
43
+ searchSnapshot?: (query: string, options?: Omit<CapabilitySearchOptions, 'limit'>) => Promise<CapabilitySearchSnapshot>;
29
44
  describe?: (id: string) => Promise<unknown>;
30
45
  execute?: (id: string, input: Record<string, unknown>) => Promise<CapabilityResult>;
31
46
  read?: (id: string, options?: Record<string, unknown>) => Promise<CapabilityResult>;
@@ -36,4 +51,4 @@ interface CapabilityProvider {
36
51
  dispose?: () => Promise<void>;
37
52
  }
38
53
 
39
- export type { CapabilityKind as C, CapabilityProvider as a, CapabilityResult as b };
54
+ export type { CapabilityKind as C, CapabilityProvider as a, CapabilityResult as b, CapabilitySearchFailure as c, CapabilitySearchFreshness as d, CapabilitySearchOptions as e, CapabilitySearchSnapshot as f };
@@ -1,6 +1,6 @@
1
- import { h as SessionStorage$1, f as PermissionMode } from './public-api.d-7G4--RZE.js';
2
- import { Y as KodaXOptions, a6 as KodaXResult } from './bash-prefix-extractor.d-BkIA8Wto.js';
3
- import { n as RuntimeSurfaceStatus, b as CommandDefinition, e as CommandSource, c as CommandInfo, C as Command$1, I as InteractiveContext, a as CommandCallbacks, g as CurrentConfig, d as CommandInvocationRequest, f as CommandWorkflowInvocationRequest } from './utils.d-BbB5jzi1.js';
1
+ import { h as SessionStorage$1, f as PermissionMode } from './public-api.d-BqFKI5fK.js';
2
+ import { Y as KodaXOptions, a6 as KodaXResult } from './bash-prefix-extractor.d-h9AwGqmO.js';
3
+ import { n as RuntimeSurfaceStatus, b as CommandDefinition, e as CommandSource, c as CommandInfo, C as Command$1, I as InteractiveContext, a as CommandCallbacks, g as CurrentConfig, d as CommandInvocationRequest, f as CommandWorkflowInvocationRequest } from './utils.d-B4zc7oot.js';
4
4
  import { be as KodaXSessionStorage, b0 as KodaXSessionData } from './types.d-BtC4yLYO.js';
5
5
 
6
6
  /**
@@ -1,4 +1,4 @@
1
- import { a as CapabilityProvider, C as CapabilityKind, b as CapabilityResult } from './capability.d-3C62G8Eq.js';
1
+ import { a as CapabilityProvider, C as CapabilityKind, f as CapabilitySearchSnapshot, b as CapabilityResult } from './capability.d-K664nHOS.js';
2
2
  import { a as McpServerConfig, b as McpServersConfig, M as McpConnectMode } from './config.d-CJy1WENT.js';
3
3
 
4
4
  type McpCapabilityKind = 'tool' | 'resource' | 'prompt';
@@ -180,6 +180,12 @@ interface McpServerRuntimeDiagnostics {
180
180
  resources: number;
181
181
  prompts: number;
182
182
  }
183
+ interface McpDiscoveryCatalog {
184
+ snapshot: McpServerCatalogSnapshot;
185
+ freshness: 'live' | 'stale';
186
+ complete: boolean;
187
+ error?: string;
188
+ }
183
189
  declare class McpServerRuntime {
184
190
  private readonly serverId;
185
191
  private readonly config;
@@ -195,7 +201,10 @@ declare class McpServerRuntime {
195
201
  private readonly completedElicitations;
196
202
  private nextRequestId;
197
203
  private initialized;
204
+ private liveCatalogValidated;
205
+ private catalogInvalidationVersion;
198
206
  private connectPromise?;
207
+ private discoveryPromise?;
199
208
  private catalog?;
200
209
  private serverCapabilities?;
201
210
  private cachedHttpTransport?;
@@ -208,6 +217,9 @@ declare class McpServerRuntime {
208
217
  /** Load catalog from memory or disk only — never triggers a lazy connection. */
209
218
  getCachedCatalog(): Promise<McpServerCatalogSnapshot | undefined>;
210
219
  getCatalog(forceRefresh?: boolean): Promise<McpServerCatalogSnapshot>;
220
+ /** Validate cached capability truth on first model-facing discovery use. */
221
+ getDiscoveryCatalog(): Promise<McpDiscoveryCatalog>;
222
+ private resolveDiscoveryCatalog;
211
223
  describeCapability(capabilityId: string): Promise<McpCapabilityDescriptor | undefined>;
212
224
  callTool(name: string, args: Record<string, unknown>): Promise<{
213
225
  content?: string;
@@ -272,6 +284,7 @@ declare class McpServerRuntime {
272
284
  private dispatchServerRequest;
273
285
  private failPending;
274
286
  private applyCatalogSnapshot;
287
+ private emptyCatalog;
275
288
  }
276
289
 
277
290
  /**
@@ -338,15 +351,26 @@ declare class McpCapabilityProvider implements CapabilityProvider {
338
351
  limit?: number;
339
352
  server?: string;
340
353
  }): Promise<unknown[]>;
354
+ searchSnapshot(query: string, options?: {
355
+ kind?: CapabilityKind;
356
+ server?: string;
357
+ }): Promise<CapabilitySearchSnapshot>;
341
358
  describe(id: string): Promise<unknown>;
342
359
  execute(id: string, input: Record<string, unknown>): Promise<CapabilityResult>;
343
360
  read(id: string, options?: Record<string, unknown>): Promise<CapabilityResult>;
344
361
  getPrompt(id: string, args?: Record<string, unknown>): Promise<unknown>;
345
362
  getPromptContext(): Promise<string | undefined>;
363
+ private formatPromptContext;
364
+ private formatExactIdPrompt;
365
+ private formatCompleteNamePrompt;
346
366
  getDiagnostics(): Record<string, unknown> | undefined;
347
367
  refresh(): Promise<void>;
348
368
  dispose(): Promise<void>;
349
369
  private collectCatalogItems;
370
+ private collectDiscoveryCatalog;
371
+ private formatPromptServerLine;
372
+ private formatPromptNameLines;
373
+ private formatFleetSummary;
350
374
  private listServerDiagnostics;
351
375
  private requireRuntime;
352
376
  }
@@ -530,5 +554,5 @@ declare class McpManager {
530
554
  */
531
555
  declare function createMcpManager(servers: McpServersConfig | undefined, options?: McpProviderOptions): McpManager;
532
556
 
533
- export { normalizeMcpCapabilityId as A, parseMcpCapabilityId as B, searchMcpCatalog as C, McpCapabilityProvider as b, McpManager as h, McpServerRuntime as q, buildInitializeCapabilities as v, createMcpCapabilityId as w, createMcpManager as x, defaultMcpCacheDir as y, getMcpCachePaths as z };
534
- export type { McpCapabilityDescriptor as M, McpCapabilityKind as a, McpCapabilityRisk as c, McpCatalogItem as d, McpElicitRequest as e, McpElicitResult as f, McpIcon as g, McpProviderOptions as i, McpReverseCapabilities as j, McpRoot as k, McpSamplingRequest as l, McpSamplingResult as m, McpServerCatalog as n, McpServerCatalogSnapshot as o, McpServerLogs as p, McpServerRuntimeDiagnostics as r, McpServerStatus as s, McpServerToolList as t, McpToolTaskSupport as u };
557
+ export { getMcpCachePaths as A, normalizeMcpCapabilityId as B, parseMcpCapabilityId as C, searchMcpCatalog as D, McpCapabilityProvider as b, McpManager as i, McpServerRuntime as r, buildInitializeCapabilities as w, createMcpCapabilityId as x, createMcpManager as y, defaultMcpCacheDir as z };
558
+ export type { McpCapabilityDescriptor as M, McpCapabilityKind as a, McpCapabilityRisk as c, McpCatalogItem as d, McpDiscoveryCatalog as e, McpElicitRequest as f, McpElicitResult as g, McpIcon as h, McpProviderOptions as j, McpReverseCapabilities as k, McpRoot as l, McpSamplingRequest as m, McpSamplingResult as n, McpServerCatalog as o, McpServerCatalogSnapshot as p, McpServerLogs as q, McpServerRuntimeDiagnostics as s, McpServerStatus as t, McpServerToolList as u, McpToolTaskSupport as v };
@@ -1,4 +1,4 @@
1
- import { a as BashPrefixExtractor } from './bash-prefix-extractor.d-BkIA8Wto.js';
1
+ import { a as BashPrefixExtractor } from './bash-prefix-extractor.d-h9AwGqmO.js';
2
2
  import { b0 as KodaXSessionData, b5 as KodaXSessionLineage, ba as KodaXSessionNavigationOptions, bc as KodaXSessionRuntimeInfo, be as KodaXSessionStorage, aT as KodaXJsonValue } from './types.d-BtC4yLYO.js';
3
3
  import { k as KodaXMessage, S as KodaXTaskResultMetadata } from './types.d-TTvpAGWf.js';
4
4
 
@@ -1,6 +1,6 @@
1
- import { f as PermissionMode } from './public-api.d-7G4--RZE.js';
1
+ import { f as PermissionMode } from './public-api.d-BqFKI5fK.js';
2
2
  import { F as KodaXReasoningMode, k as KodaXMessage, c as KodaXContentBlock } from './types.d-TTvpAGWf.js';
3
- import { r as KodaXAgentMode } from './bash-prefix-extractor.d-BkIA8Wto.js';
3
+ import { r as KodaXAgentMode } from './bash-prefix-extractor.d-h9AwGqmO.js';
4
4
  import { bg as KodaXSessionUiHistoryItem, bk as KodaXSessionUiToolCall } from './types.d-BtC4yLYO.js';
5
5
 
6
6
  /**
@@ -1,8 +1,8 @@
1
1
  import { a9 as KodaXWireReasoningEffort, a1 as KodaXToolDefinition, a3 as KodaXToolResultContentItem, k as KodaXMessage } from './types.d-TTvpAGWf.js';
2
2
  import { K as KodaXBaseProvider } from './base.d-CYjtB68X.js';
3
- import { C as CapabilityKind, a as CapabilityProvider } from './capability.d-3C62G8Eq.js';
3
+ import { C as CapabilityKind, a as CapabilityProvider } from './capability.d-K664nHOS.js';
4
4
  import { aT as KodaXJsonValue, aH as KodaXExtensionSessionRecord, aJ as KodaXExtensionStore } from './types.d-BtC4yLYO.js';
5
- import { aB as KodaXToolExecutionContext, bi as ToolSideEffect } from './bash-prefix-extractor.d-BkIA8Wto.js';
5
+ import { aB as KodaXToolExecutionContext, bi as ToolSideEffect } from './bash-prefix-extractor.d-h9AwGqmO.js';
6
6
 
7
7
  /**
8
8
  * KodaX Constructed-World types (FEATURE_087, v0.7.28).
@@ -1,9 +1,9 @@
1
1
  import { k as KodaXMessage, F as KodaXReasoningMode, d as KodaXCustomProviderConfig, p as KodaXProviderCapabilityProfile } from './types.d-TTvpAGWf.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-BkIA8Wto.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-h9AwGqmO.js';
3
3
  import { bg as KodaXSessionUiHistoryItem, b5 as KodaXSessionLineage, aY as KodaXSessionArtifactLedgerEntry, aI as KodaXExtensionSessionState, aH as KodaXExtensionSessionRecord, bc as KodaXSessionRuntimeInfo, du as WorkflowProcessSource } from './types.d-BtC4yLYO.js';
4
4
  import { A as AgentsFile, f as AutoModeStats, l as KodaXMcpServersConfig } from './guardrail.d-R7AiGfrI.js';
5
5
  import * as readline from 'readline';
6
- import { f as PermissionMode } from './public-api.d-7G4--RZE.js';
6
+ import { f as PermissionMode } from './public-api.d-BqFKI5fK.js';
7
7
  import { SpawnSyncReturns } from 'child_process';
8
8
 
9
9
  /**
@@ -3208,6 +3208,12 @@ time/body/redirects, and strips authorization on a cross-origin redirect. A
3208
3208
  custom `fetch` option is a trusted transport override: the embedder then owns
3209
3209
  equivalent DNS-to-connection binding in that transport or proxy.
3210
3210
 
3211
+ Starting in v0.7.70, the interface selected from the Agent Card must remain on
3212
+ the Card's trusted origin. A configured `credentialRef` is used only when the
3213
+ Card advertises the A2A 1.0 Bearer security scheme; discovery fails closed
3214
+ rather than sending a secret to an unadvertised or differently secured
3215
+ endpoint.
3216
+
3211
3217
  ```ts
3212
3218
  import {
3213
3219
  createA2AAgentExecutorFactory,
@@ -3264,6 +3270,12 @@ The executor supports durable task start/get, input continuation, cancel,
3264
3270
  reconcile, SSE events, and polling fallback. An ambiguous start is not retried
3265
3271
  automatically. A `credentialRef` is resolved just in time by the F258 broker;
3266
3272
  the registration, task store, and diagnostics never contain the credential.
3273
+ Authenticated SSE uses that same broker. JSON-RPC ID/version and task/context
3274
+ correlation are validated before an event is accepted; if a stream ends
3275
+ normally before a terminal snapshot, the executor resumes bounded polling.
3276
+ Streamed `artifactUpdate` chunks are accumulated by artifact ID according to
3277
+ `append`, and direct Message file Parts are preserved as authorized artifact
3278
+ references.
3267
3279
 
3268
3280
  ### Built-in configured path (no host code)
3269
3281
 
@@ -3293,6 +3305,12 @@ kodax a2a expose document-agent # ~/.kodax/agents/document-agent.md
3293
3305
  kodax a2a serve --port 8765
3294
3306
  ```
3295
3307
 
3308
+ `a2a serve` resolves its Runtime provider in this order: explicit CLI option,
3309
+ environment, core configuration, then the built-in default. Provider-compatible
3310
+ model selection follows the normal hosted Runtime rule. A selected Markdown
3311
+ Agent may declare its own validated `provider`; remote A2A input cannot choose
3312
+ or override provider, model, reasoning, profile, workspace, or tools.
3313
+
3296
3314
  `expose` validates a named user Markdown Agent before writing its reference.
3297
3315
  `serve` loads configured MCP and Extensions before it resolves the execution
3298
3316
  binding or opens a socket. Native workspace read tools are admitted by
@@ -3309,6 +3327,10 @@ require an explicit restart. Managed contexts live below
3309
3327
  `process: isolated`, an admitted `scripts/...` path, and a passing
3310
3328
  `kodax sandbox doctor`; KodaX never falls back to an unsandboxed shell.
3311
3329
 
3330
+ Every concrete file reached by `read`, `grep`, or `glob` is checked against the
3331
+ bound workspace. Child runs inherit ceilings for native reads, tools, Skills,
3332
+ and Skill scripts; they cannot expand the parent's admitted authority.
3333
+
3312
3334
  ### Publish one KodaX Agent
3313
3335
 
3314
3336
  Publication is host-owned and opt-in. The public card describes only the
@@ -3375,12 +3397,28 @@ default). When that bound is reached the response contains the current working
3375
3397
  task; it does not cancel the Runtime run, and clients can continue with
3376
3398
  `GetTask` or `SubscribeToTask`.
3377
3399
 
3400
+ When a task enters `INPUT_REQUIRED`, the next accepted input answers the pending
3401
+ interaction on the original Runtime run; it does not start a replacement run.
3402
+ History length and list filters are validated and bounded. Task listing uses a
3403
+ stable opaque cursor, while per-principal retention prunes only the oldest
3404
+ terminal records. Terminal subscriptions and failed-start resources are closed
3405
+ by their owning lifecycle.
3406
+
3378
3407
  Remote messages are ordinary user inputs. They cannot select provider, model,
3379
3408
  profile, tools, working directory, permission mode, or Runtime configuration.
3380
3409
  URL parts are rejected; inline raw/data parts are bounded and materialized under
3381
3410
  the server-owned data directory. Responses expose final approved output only,
3382
3411
  not system prompts, reasoning deltas, tool payloads, credentials, or local paths.
3383
3412
 
3413
+ Generated files are published only through the trusted output broker: a normal
3414
+ tool or Extension stages a file in the context's `.kodax-a2a-staging` area, or
3415
+ a successfully admitted `run_skill_script` promotes one of its declared
3416
+ outputs. The server rechecks that the result is a regular non-symlink file in
3417
+ the real bound workspace and applies part-size/output-mode limits before
3418
+ inlining it. A declaration from a failed Skill run, an ordinary `write`/`edit`
3419
+ elsewhere in the workspace, and a local path in model text never become A2A
3420
+ artifacts implicitly.
3421
+
3384
3422
  The normative baseline is A2A repository commit
3385
3423
  `2183794bfb9b67af4aee1be0a0ef726050642873`, protocol `1.0`, with
3386
3424
  `specification/a2a.proto` SHA-256
@@ -3445,6 +3483,7 @@ const runtime = await connectKodaXRuntime({
3445
3483
  daemonSafeRunInput: 1,
3446
3484
  sharedSessionSettings: 1,
3447
3485
  durableRecoveryQueries: 1,
3486
+ daemonManagement: 1,
3448
3487
  },
3449
3488
  });
3450
3489
  ```
@@ -3532,10 +3571,13 @@ reset boundary.
3532
3571
 
3533
3572
  ### Durable mutations, stable ordering, and settings CAS
3534
3573
 
3535
- Every public control mutation uses a durable operation envelope. Credential
3536
- supply and Host Tool completion are connection-local reverse-result frames and
3537
- are deliberately excluded from the control journal so secrets/results are not
3538
- persisted. The SDK creates an operation ID for ordinary one-shot calls. A
3574
+ Every durable public control mutation uses an operation envelope. Credential
3575
+ and Host Tool register/revoke/supply/complete requests are reverse-bridge
3576
+ control frames and are deliberately excluded from the control journal so
3577
+ secrets/results are not persisted. They still enter the daemon management
3578
+ draining fence: once an atomic stop begins, they fail with typed `conflict` and
3579
+ cannot change reverse-bridge state. The SDK creates an operation ID for
3580
+ ordinary one-shot calls. A
3539
3581
  product-level retry after a lost response must reuse its own stable operation
3540
3582
  ID; changing its method, payload, resource, or authenticated principal is
3541
3583
  rejected.
@@ -3743,10 +3785,24 @@ remain valid only for embedded Runtime calls.
3743
3785
 
3744
3786
  ### Recovery queries and stop preflight
3745
3787
 
3746
- `runtime.status.preflight()` returns connected-client count, active and queued
3747
- runs, pending AskUser/permission records, blockers, and `canStop`. Treat this as
3748
- a required check before stop or inline rollback; the query does not stop the
3749
- daemon by itself. `runtime.operations.get()` reconciles durable mutations,
3788
+ `runtime.status.preflight()` returns the initialized logical-client count,
3789
+ active and queued runs, running/paused Workflows, every non-terminal External
3790
+ Agent task (including `unknown`), pending AskUser/permission records, blockers,
3791
+ and `canStop`. The background-work blockers are `active_workflows` and
3792
+ `active_agent_tasks`. The current facade counts as one; daemon self-connections
3793
+ and bounded health probes do not count. A second process changes the count to
3794
+ two, and its awaited `close()` makes the count converge back to one.
3795
+
3796
+ Preflight is useful for UI, but it is not a stop authorization token. Use
3797
+ `runtime.daemon.inspect()` to obtain one consistent management revision,
3798
+ verified owner fence, owner-policy revision, and preflight projection. Only
3799
+ `runtime.daemon.stopForInline()` atomically rechecks and commits a rollback.
3800
+ The management revision also advances when the preflight projection changes,
3801
+ so a Workflow or AgentTask lifecycle transition between inspect and commit
3802
+ invalidates the stale stop. Capability details
3803
+ `daemonManagement.backgroundWorkPreflight` and
3804
+ `daemonManagement.reverseBridgeDrainingFence` identify this complete contract.
3805
+ `runtime.operations.get()` reconciles durable mutations,
3750
3806
  `hostTools.getInvocation()` reconciles Host Tool metadata, and
3751
3807
  `permissions.listGrants()` returns the daemon-owned persistent grant set.
3752
3808
 
@@ -3758,27 +3814,64 @@ truth.
3758
3814
 
3759
3815
  ### Owner policy, rollback, and Electron boundary
3760
3816
 
3761
- Daemon and inline Coder use one profile fence. For an emergency rollback, stop
3762
- the daemon, switch the policy with revision CAS, then acquire the inline owner:
3817
+ Daemon and inline Coder use one profile fence. Do not compose
3818
+ `status.preflight()` with a low-level unconditional stop: another client or run
3819
+ can appear between those calls. The public rollback transaction gates new
3820
+ clients and mutations, rechecks the same Runtime and management/policy
3821
+ revisions, verifies there is no other client or active/queued/pending work,
3822
+ commits sticky inline policy while that daemon still owns the fence, and then
3823
+ requests shutdown.
3763
3824
 
3764
3825
  ```ts
3765
3826
  import {
3766
3827
  acquireKodaXInlineOwner,
3767
- setKodaXRuntimeOwnerMode,
3828
+ enableKodaXDaemonOwner,
3829
+ getKodaXRuntimeOwnerState,
3768
3830
  } from '@kodax-ai/kodax/runtime';
3769
3831
 
3770
- const policy = setKodaXRuntimeOwnerMode({
3771
- homeDir: kodaxHome,
3772
- profile: 'coder',
3773
- mode: 'inline',
3774
- expectedRevision: currentPolicyRevision,
3832
+ const management = await runtime.daemon.inspect();
3833
+ if (!management.preflight.canStop) {
3834
+ showRollbackBlockers(management.preflight.blockers);
3835
+ return;
3836
+ }
3837
+
3838
+ const rollback = await runtime.daemon.stopForInline({
3839
+ expectedRuntimeId: management.runtimeId,
3840
+ expectedRevision: management.revision,
3841
+ expectedOwnerPolicyRevision: management.ownerPolicy.revision,
3842
+ operation: { operationId: loadOrCreatePendingOperationId('coder-inline-rollback') },
3775
3843
  });
3844
+
3845
+ // `accepted` means inline policy is committed and shutdown is in progress.
3846
+ // Wait through the public owner-state query; never infer release from a PID.
3847
+ const shutdownDeadline = Date.now() + 30_000;
3848
+ while (getKodaXRuntimeOwnerState({ homeDir: kodaxHome, profile: 'coder' }).owner?.runtimeId
3849
+ === rollback.runtimeId) {
3850
+ if (Date.now() >= shutdownDeadline) throw new Error('Timed out waiting for daemon owner release.');
3851
+ await delay(25);
3852
+ }
3853
+ const releasedOwner = getKodaXRuntimeOwnerState({ homeDir: kodaxHome, profile: 'coder' });
3854
+ if (releasedOwner.ownerStatus !== 'unowned') {
3855
+ throw new Error('Coder profile acquired a different owner during rollback.');
3856
+ }
3857
+ await runtime.close(); // Detach only; it does not perform a second stop.
3776
3858
  const inlineOwner = acquireKodaXInlineOwner({ homeDir: kodaxHome, profile: 'coder' });
3859
+
3860
+ // Later, after the inline owner has released its fence:
3861
+ inlineOwner.close();
3862
+ const daemonPolicy = enableKodaXDaemonOwner({ homeDir: kodaxHome, profile: 'coder' });
3863
+ // daemonPolicy.revision is authoritative; no expectedRevision guess is needed.
3777
3864
  ```
3778
3865
 
3779
- The inline policy is sticky: later CLI auto-start is rejected until an explicit
3780
- CAS changes the policy back to `daemon`. Stale-owner handling validates the
3781
- owned lock/state and never kills a process merely because a PID was reused.
3866
+ Any management revision change, another logical client, active or queued run,
3867
+ running/paused Workflow, non-terminal/unknown AgentTask, pending
3868
+ AskUser/permission, or in-flight mutation returns structured `conflict`; the
3869
+ daemon remains running and policy remains unchanged. Draining also rejects
3870
+ credential and Host Tool state changes without journaling their secrets or
3871
+ results. The inline policy is sticky: later CLI auto-start is rejected until
3872
+ `enableKodaXDaemonOwner()` changes it back to `daemon`. `runtime.close()` still
3873
+ only detaches. Stale-owner handling validates the owned lock/state and never
3874
+ kills a process merely because a PID was reused.
3782
3875
 
3783
3876
  Keep all trusted objects in Electron Main: daemon token/endpoint, stable client
3784
3877
  identity, operation IDs, owner policy, keychain broker, Host Tool handlers, and
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kodax-ai/kodax",
3
- "version": "0.7.69",
3
+ "version": "0.7.70",
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,
@@ -100,7 +100,7 @@
100
100
  "cli"
101
101
  ],
102
102
  "author": "",
103
- "license": "Apache-2.0",
103
+ "license": "SEE LICENSE IN LICENSE",
104
104
  "dependencies": {
105
105
  "@agentclientprotocol/sdk": "^0.15.0",
106
106
  "@alcalzone/ansi-tokenize": "^0.2.5",
@@ -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-VAZ25MDX.js";import"./chunk-M7TCFYTO.js";import"./chunk-WW2O2DEP.js";import"./chunk-ZG4DMYBS.js";import"./chunk-URC6ZI6P.js";import"./chunk-PA76WUBL.js";import"./chunk-4WIODYOH.js";import"./chunk-I4TPQEJN.js";import"./chunk-Y4WOTWUC.js";import"./chunk-PQ3XUSY2.js";import"./chunk-UJEMSPM5.js";import"./chunk-VYKFM3TB.js";import"./chunk-AWMTNUDS.js";import"./chunk-F7C7J6IM.js";import"./chunk-NGHQIGVW.js";import"./chunk-ONUPGMER.js";export{a as ArgumentCompleter,b as createArgumentCompleter};