@kodax-ai/kodax 0.7.77 → 0.7.79

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 (133) hide show
  1. package/CHANGELOG.md +3651 -3201
  2. package/README.md +317 -110
  3. package/README_CN.md +255 -91
  4. package/config-templates/config.example.jsonc +124 -32
  5. package/config-templates/integrations/a2a.example.jsonc +23 -7
  6. package/dist/builtin/skill-creator/scripts/aggregate-benchmark.js +2 -1
  7. package/dist/builtin/skill-creator/scripts/analyze-benchmark.d.ts +1 -0
  8. package/dist/builtin/skill-creator/scripts/analyze-benchmark.js +4 -3
  9. package/dist/builtin/skill-creator/scripts/compare-runs.d.ts +1 -0
  10. package/dist/builtin/skill-creator/scripts/compare-runs.js +4 -3
  11. package/dist/builtin/skill-creator/scripts/generate-review.js +2 -1
  12. package/dist/builtin/skill-creator/scripts/grade-evals.d.ts +1 -0
  13. package/dist/builtin/skill-creator/scripts/grade-evals.js +4 -3
  14. package/dist/builtin/skill-creator/scripts/improve-description.js +2 -1
  15. package/dist/builtin/skill-creator/scripts/init-skill.d.ts +1 -0
  16. package/dist/builtin/skill-creator/scripts/init-skill.js +4 -3
  17. package/dist/builtin/skill-creator/scripts/install-skill.d.ts +1 -0
  18. package/dist/builtin/skill-creator/scripts/install-skill.js +4 -3
  19. package/dist/builtin/skill-creator/scripts/package-skill.d.ts +1 -0
  20. package/dist/builtin/skill-creator/scripts/package-skill.js +4 -3
  21. package/dist/builtin/skill-creator/scripts/quick-validate.d.ts +1 -0
  22. package/dist/builtin/skill-creator/scripts/quick-validate.js +4 -3
  23. package/dist/builtin/skill-creator/scripts/run-eval.d.ts +1 -0
  24. package/dist/builtin/skill-creator/scripts/run-eval.js +4 -3
  25. package/dist/builtin/skill-creator/scripts/run-loop.js +2 -1
  26. package/dist/builtin/skill-creator/scripts/run-trigger-eval.js +2 -1
  27. package/dist/builtin/skill-creator/scripts/utils.d.ts +3 -0
  28. package/dist/builtin/skill-creator/scripts/utils.js +5 -1
  29. package/dist/chunks/agent-V4AC5JZD.js +2 -0
  30. package/dist/chunks/argument-completer-ZPC2MLES.js +2 -0
  31. package/dist/chunks/chunk-5BNQXXGY.js +1 -0
  32. package/dist/chunks/{chunk-EH7AOMJ7.js → chunk-67THZRM6.js} +1 -1
  33. package/dist/chunks/chunk-6GVQDQTQ.js +292 -0
  34. package/dist/chunks/chunk-B6UY3VHV.js +348 -0
  35. package/dist/chunks/{chunk-HORNWBYR.js → chunk-BBOVVDQJ.js} +1 -1
  36. package/dist/chunks/chunk-CR2IF7VF.js +30 -0
  37. package/dist/chunks/{chunk-FNW2XUL5.js → chunk-CXHEZY5G.js} +1 -1
  38. package/dist/chunks/chunk-EDZ4QILG.js +266 -0
  39. package/dist/chunks/chunk-GEECPO2H.js +218 -0
  40. package/dist/chunks/chunk-H5LLM7DB.js +89 -0
  41. package/dist/chunks/chunk-KLWP7POA.js +467 -0
  42. package/dist/chunks/{chunk-XSA37BVM.js → chunk-M4N2JZTZ.js} +2 -2
  43. package/dist/chunks/chunk-OWQT3FTE.js +5 -0
  44. package/dist/chunks/chunk-Q4M7DJOD.js +319 -0
  45. package/dist/chunks/{chunk-3DD4QEBH.js → chunk-QCZLCLFL.js} +10 -10
  46. package/dist/chunks/chunk-RQPMGRTR.js +810 -0
  47. package/dist/chunks/chunk-SG6P4SZS.js +123 -0
  48. package/dist/chunks/chunk-TSTVAU5E.js +386 -0
  49. package/dist/chunks/chunk-ZCZZUE5E.js +662 -0
  50. package/dist/chunks/compaction-config-AEUGVROL.js +2 -0
  51. package/dist/chunks/{construction-bootstrap-RPRL3L7R.js → construction-bootstrap-K3ZGEN5N.js} +1 -1
  52. package/dist/chunks/dist-GFJFRPAV.js +2 -0
  53. package/dist/chunks/{dist-FDSOIR35.js → dist-JMO47GJV.js} +1 -1
  54. package/dist/chunks/host-23K2Q6RZ.js +2 -0
  55. package/dist/chunks/run-manager-PGIR6ITA.js +2 -0
  56. package/dist/chunks/utils-6LEKJPQN.js +2 -0
  57. package/dist/index.d.ts +22 -21
  58. package/dist/index.js +6 -6
  59. package/dist/kodax_bootstrap.js +2 -1
  60. package/dist/kodax_cli.js +2225 -1468
  61. package/dist/kodax_resume.js +570 -34
  62. package/dist/provider-capabilities.json +85 -50
  63. package/dist/runtime-worker.js +2076 -1343
  64. package/dist/sandbox-workspace-session.js +829 -0
  65. package/dist/sdk-a2a.d.ts +24 -18
  66. package/dist/sdk-a2a.js +8 -8
  67. package/dist/sdk-agent.d.ts +315 -168
  68. package/dist/sdk-agent.js +1 -1
  69. package/dist/sdk-coding.d.ts +42 -205
  70. package/dist/sdk-coding.js +1 -1
  71. package/dist/sdk-experimental-memory.d.ts +3 -3
  72. package/dist/sdk-experimental-memory.js +1 -1
  73. package/dist/sdk-llm.d.ts +7 -6
  74. package/dist/sdk-llm.js +1 -1
  75. package/dist/sdk-mcp.d.ts +1 -1
  76. package/dist/sdk-mcp.js +1 -1
  77. package/dist/sdk-media.d.ts +1 -1
  78. package/dist/sdk-media.js +1 -1
  79. package/dist/sdk-repl.d.ts +77 -36
  80. package/dist/sdk-repl.js +2 -2
  81. package/dist/sdk-runtime.d.ts +406 -163
  82. package/dist/sdk-runtime.js +1 -1
  83. package/dist/sdk-sandbox.d.ts +93 -0
  84. package/dist/sdk-sandbox.js +2 -0
  85. package/dist/sdk-session.d.ts +8 -9
  86. package/dist/sdk-session.js +1 -1
  87. package/dist/sdk-skills.d.ts +2 -2
  88. package/dist/sdk-skills.js +1 -1
  89. package/dist/semantic-worker.js +283 -18
  90. package/dist/types-chunks/{base.d-4e74xDdy.d.ts → base.d-DxG0m09Z.d.ts} +1 -1
  91. package/dist/types-chunks/{bash-prefix-extractor.d-pZdu6qt7.d.ts → bash-prefix-extractor.d-CNSidpmv.d.ts} +149 -10
  92. package/dist/types-chunks/{capability-learning.d-CVsdHw4j.d.ts → capability-learning.d-iPSiAmc_.d.ts} +1 -1
  93. package/dist/types-chunks/{capsule.d-CxCm1KZz.d.ts → capsule.d-B3q98pLQ.d.ts} +9 -7
  94. package/dist/types-chunks/{types.d-RdWRfUEs.d.ts → controller.d-RGV7Pjv9.d.ts} +785 -8
  95. package/dist/types-chunks/{guardrail.d-B0PwAZVR.d.ts → guardrail.d-1NLSFTyN.d.ts} +310 -70
  96. package/dist/types-chunks/{history-retrieval.d-B__aEN62.d.ts → history-retrieval.d-BAegI14A.d.ts} +16 -3
  97. package/dist/types-chunks/{integration-config.d-ojG4swOP.d.ts → integration-config.d-BNowXE8k.d.ts} +23 -8
  98. package/dist/types-chunks/{oauth-login.d-Bgb4rdLN.d.ts → oauth-login.d-6i-vidxv.d.ts} +6 -2
  99. package/dist/types-chunks/{public-api.d--fF88JrC.d.ts → public-api.d-BpJhHoa7.d.ts} +366 -28
  100. package/dist/types-chunks/{commands.d-BccESAMV.d.ts → repl.d-CZ12Ow3X.d.ts} +89 -78
  101. package/dist/types-chunks/{side-query.d-5JvXhuOZ.d.ts → resolver.d-C9IW4fmU.d.ts} +7 -67
  102. package/dist/types-chunks/{run-manager.d-B47hIqnI.d.ts → run-manager.d-CX3AUocA.d.ts} +1 -1
  103. package/dist/types-chunks/{sdk-session-CLWf8Adb.d.ts → sdk-session-B3cfJKqF.d.ts} +3 -3
  104. package/dist/types-chunks/side-query.d-CP1LiRiH.d.ts +83 -0
  105. package/dist/types-chunks/{types-LanCEDj8.d.ts → types-Bf3Y3mW-.d.ts} +42 -3
  106. package/dist/types-chunks/{types.d-CODuyyqy.d.ts → types.d-BZ9oXvTV.d.ts} +2 -2
  107. package/dist/types-chunks/{types.d-DCQVBqVn.d.ts → types.d-BbtGlKZu.d.ts} +25 -3
  108. package/dist/types-chunks/{types.d-DCsKM8aT.d.ts → types.d-C0_rn--1.d.ts} +4 -4
  109. package/dist/types-chunks/{types.d-DIpZJKUl.d.ts → types.d-CgrXrFrq.d.ts} +16 -2
  110. package/dist/types-chunks/{utils.d-CDduqbFw.d.ts → utils.d-CGpHavsU.d.ts} +32 -8
  111. package/docs/SDK_EMBEDDER_GUIDE.md +1117 -227
  112. package/package.json +11 -1
  113. package/dist/chunks/agent-NGSWFE73.js +0 -2
  114. package/dist/chunks/argument-completer-WGGZPEEO.js +0 -2
  115. package/dist/chunks/chunk-27QLRH3D.js +0 -5
  116. package/dist/chunks/chunk-2MQPVY6P.js +0 -770
  117. package/dist/chunks/chunk-6WAPVAGQ.js +0 -74
  118. package/dist/chunks/chunk-AOENDSVN.js +0 -448
  119. package/dist/chunks/chunk-FSXI4MAV.js +0 -78
  120. package/dist/chunks/chunk-HV2GMZUZ.js +0 -343
  121. package/dist/chunks/chunk-IQT4RPCE.js +0 -46
  122. package/dist/chunks/chunk-JS2BHGJP.js +0 -158
  123. package/dist/chunks/chunk-OAMKECRG.js +0 -381
  124. package/dist/chunks/chunk-ON2WG2LG.js +0 -622
  125. package/dist/chunks/chunk-RUGAAHTF.js +0 -321
  126. package/dist/chunks/chunk-TGCG7U2W.js +0 -37
  127. package/dist/chunks/compaction-config-BE7VYWH6.js +0 -2
  128. package/dist/chunks/dist-ZZBNVTKU.js +0 -2
  129. package/dist/chunks/host-QAKQVC4A.js +0 -2
  130. package/dist/chunks/run-manager-N4UFWA2D.js +0 -2
  131. package/dist/chunks/utils-AUHCI4D5.js +0 -2
  132. package/dist/types-chunks/center-types.d-BBT122uJ.d.ts +0 -91
  133. package/dist/types-chunks/guardrail.d-CJx9RRd3.d.ts +0 -156
@@ -1,23 +1,22 @@
1
- import { F as KodaXReasoningMode, d as KodaXCustomProviderConfig } from './types-chunks/types.d-DIpZJKUl.js';
2
- export { k as KodaXMessage } from './types-chunks/types.d-DIpZJKUl.js';
3
- import { a1 as KodaXOptions, aj as KodaXShellExecutionContract, W as KodaXManagedTaskStatusEvent, Q as KodaXEvents, ac as KodaXResult, be as RuntimeContextBudgetSnapshot, bl as RuntimeToolExposurePlan, a4 as KodaXPromptCacheDiagnosticEvent, N as KodaXContextOptions, K as KodaXActivityEventMeta, aJ as KodaXToolEventMeta, aQ as KodaXTurnStartedEvent, aN as KodaXTurnCompletedEvent, aP as KodaXTurnFailedEvent, L as KodaXContextCompactionFinishedEvent, M as KodaXContextIdentity } from './types-chunks/bash-prefix-extractor.d-pZdu6qt7.js';
4
- import { C as AgentDispatchContext, Q as AgentExecutorFactory, D as AgentDispatchPolicy, y as AgentCredentialBroker, m as AgentArtifactPolicy, bu as KodaXImageInputArtifact, bx as KodaXInputArtifactSource, c3 as KodaXVideoInputArtifact, ea as WorkflowProcessSnapshot, e4 as WorkflowProcessEvent, M as AgentExecutionKind, al as AgentRegistrationService, b1 as DispatchableAgentQuery, a$ as DispatchableAgentListing, ad as AgentPreflightInput, ae as AgentPreflightResult, aA as AgentTreeSnapshot, B as AgentDetail, an as AgentSpawnInput, aD as AgentTurnRef, z as AgentDataClassification, $ as AgentFollowupResult, ac as AgentOutput, J as AgentEvent } from './types-chunks/types.d-RdWRfUEs.js';
5
- import { i as SkillMetadata } from './types-chunks/types.d-DCQVBqVn.js';
1
+ import { G as KodaXReasoningMode, d as KodaXCustomProviderConfig } from './types-chunks/types.d-CgrXrFrq.js';
2
+ export { k as KodaXMessage } from './types-chunks/types.d-CgrXrFrq.js';
3
+ import { I as AgentDispatchContext, cT as LearningQuery, cS as LearningPage, cv as LearnedCapabilityRecord, cY as LearningSurfaceSnapshot, cO as LearningEvent, cX as LearningSubscribeOptions, W as AgentExecutorFactory, J as AgentDispatchPolicy, F as AgentCredentialBroker, q as AgentArtifactPolicy, bK as KodaXImageInputArtifact, bN as KodaXInputArtifactSource, ck as KodaXVideoInputArtifact, fa as WorkflowProcessSnapshot, f4 as WorkflowProcessEvent, S as AgentExecutionKind, ar as AgentRegistrationService, ba as DispatchableAgentQuery, b8 as DispatchableAgentListing, aj as AgentPreflightInput, ak as AgentPreflightResult, aG as AgentTreeSnapshot, H as AgentDetail, at as AgentSpawnInput, aJ as AgentTurnRef, G as AgentDataClassification, a5 as AgentFollowupResult, ai as AgentOutput, P as AgentEvent } from './types-chunks/controller.d-RGV7Pjv9.js';
4
+ import { i as SkillMetadata } from './types-chunks/types.d-BbtGlKZu.js';
6
5
  import { a as McpServerConfig } from './types-chunks/config.d-CJy1WENT.js';
7
6
  import { t as McpServerStatus, u as McpServerToolList } from './types-chunks/manager.d-B67TmPO1.js';
8
- import { K as KodaXSessionHistoryHit } from './types-chunks/history-retrieval.d-B__aEN62.js';
9
- import { c as ManagedWorkflowSnapshot } from './types-chunks/run-manager.d-B47hIqnI.js';
10
- import { L as LoadedExtensionDiagnostic, u as ExtensionRuntimeDiagnostics } from './types-chunks/types.d-DCsKM8aT.js';
11
- import { r as AutoModeStats } from './types-chunks/guardrail.d-B0PwAZVR.js';
12
- import { M as saveConfig, c as CommandInfo } from './types-chunks/utils.d-CDduqbFw.js';
13
- import { k as FullTranscriptSessionData, Z as SessionTranscriptEntry, c as CompactSessionResult } from './types-chunks/public-api.d--fF88JrC.js';
14
- import { n as LearningQuery, m as LearningPage, b as LearnedCapabilityRecord, p as LearningSurfaceSnapshot, j as LearningEvent, o as LearningSubscribeOptions } from './types-chunks/center-types.d-BBT122uJ.js';
7
+ import { K as KodaXSessionHistoryHit } from './types-chunks/history-retrieval.d-BAegI14A.js';
8
+ import { c as ManagedWorkflowSnapshot } from './types-chunks/run-manager.d-CX3AUocA.js';
9
+ import { a1 as KodaXOptions, al as KodaXShellExecutionContract, aR as KodaXToolSandboxObservationUpdate, aP as KodaXToolEventMeta, W as KodaXManagedTaskStatusEvent, Q as KodaXEvents, ad as KodaXResult, bl as RuntimeContextBudgetSnapshot, bs as RuntimeToolExposurePlan, a5 as KodaXPromptCacheDiagnosticEvent, N as KodaXContextOptions, K as KodaXActivityEventMeta, aX as KodaXTurnStartedEvent, aU as KodaXTurnCompletedEvent, aW as KodaXTurnFailedEvent, L as KodaXContextCompactionFinishedEvent, M as KodaXContextIdentity } from './types-chunks/bash-prefix-extractor.d-CNSidpmv.js';
10
+ import { L as LoadedExtensionDiagnostic, u as ExtensionRuntimeDiagnostics } from './types-chunks/types.d-C0_rn--1.js';
11
+ import { h as AutoModeDecisionDiagnostics, s as AutoModeStats } from './types-chunks/guardrail.d-1NLSFTyN.js';
12
+ import { M as saveConfig, c as CommandInfo } from './types-chunks/utils.d-CGpHavsU.js';
13
+ import { m as FullTranscriptSessionData, ah as SessionTranscriptEntry, a3 as SessionConversationHistoryData, a7 as SessionConversationHistoryStatus, a5 as SessionConversationHistoryIssue, a4 as SessionConversationHistoryEntry, c as CompactSessionResult } from './types-chunks/public-api.d-BpJhHoa7.js';
14
+ import './types-chunks/capability.d-K664nHOS.js';
15
15
  import 'vscode-languageserver-protocol';
16
16
  import './types-chunks/cost-tracker.d-BeaenODW.js';
17
- import './types-chunks/types-LanCEDj8.js';
18
- import './types-chunks/capability.d-K664nHOS.js';
19
- import './types-chunks/base.d-4e74xDdy.js';
20
- import './types-chunks/guardrail.d-CJx9RRd3.js';
17
+ import './types-chunks/types-Bf3Y3mW-.js';
18
+ import './types-chunks/base.d-DxG0m09Z.js';
19
+ import './types-chunks/side-query.d-CP1LiRiH.js';
21
20
  import 'readline';
22
21
  import 'child_process';
23
22
 
@@ -163,32 +162,32 @@ interface RuntimeAgentBindingService {
163
162
 
164
163
  interface RuntimeLearningService {
165
164
  list(query?: LearningQuery): Promise<LearningPage>;
166
- get(nameOrSlug: string): Promise<LearnedCapabilityRecord>;
165
+ get(nameOrSlugOrId: string): Promise<LearnedCapabilityRecord>;
167
166
  getSnapshot(): Promise<LearningSurfaceSnapshot>;
168
167
  events(afterRevision?: number): Promise<readonly LearningEvent[]>;
169
168
  subscribe(options?: LearningSubscribeOptions): AsyncIterable<LearningEvent>;
170
- acknowledge(nameOrSlug: string): Promise<void>;
171
- snooze(nameOrSlug: string, until: string): Promise<void>;
172
- reject(nameOrSlug: string): Promise<void>;
173
- disable(nameOrSlug: string): Promise<void>;
174
- rollback(nameOrSlug: string): Promise<void>;
175
- promote(nameOrSlug: string, scope: 'user'): Promise<void>;
176
- review(nameOrSlug: string): Promise<void>;
177
- trust(nameOrSlug: string): Promise<void>;
169
+ acknowledge(nameOrSlugOrId: string): Promise<void>;
170
+ snooze(nameOrSlugOrId: string, until: string): Promise<void>;
171
+ reject(nameOrSlugOrId: string): Promise<void>;
172
+ disable(nameOrSlugOrId: string): Promise<void>;
173
+ rollback(nameOrSlugOrId: string): Promise<void>;
174
+ promote(nameOrSlugOrId: string, scope: 'user'): Promise<void>;
175
+ review(nameOrSlugOrId: string): Promise<void>;
176
+ trust(nameOrSlugOrId: string): Promise<void>;
178
177
  }
179
178
 
180
179
  declare const KODAX_DAEMON_PROTOCOL = "kodax-runtime-daemon";
181
180
  declare const KODAX_DAEMON_PROTOCOL_VERSION = 1;
182
- type RuntimeDaemonMethod = 'initialize' | 'runtime.initialize' | 'ping' | 'runtime.identity' | 'runtime.status' | 'runtime.shutdown' | 'runtime.capabilities' | 'daemon.status' | 'daemon.stop' | 'daemon.logs' | 'daemon.preflight' | 'daemon.management.get' | 'daemon.rollbackToInline' | 'operation.get' | 'session.create' | 'session.load' | 'session.list' | 'session.transcript' | 'session.transcript.page' | 'session.transcript.entryChunk' | 'session.transcript.search' | 'session.observe' | 'session.fork' | 'session.notice.append' | 'session.rewind' | 'session.active_entry.set' | 'session.activeEntry.set' | 'session.compact' | 'session.archive' | 'session.unarchive' | 'session.delete' | 'session.settings.get' | 'session.settings.getVersioned' | 'session.autoMode.getStats' | 'session.settings.update' | 'session.settings.updateVersioned' | 'run.start' | 'run.input.submit' | 'run.get' | 'run.list' | 'run.await' | 'run.abort' | 'run.model.set' | 'run.provider.set' | 'run.reasoning.set' | 'run.setModel' | 'run.setProvider' | 'run.setReasoning' | 'event.subscribe' | 'event.unsubscribe' | 'event.replay' | 'permission.list' | 'permission.listPending' | 'permission.request' | 'permission.respond' | 'permission.grants.list' | 'permission.grants.revoke' | 'user_input.listPending' | 'user_input.respond' | 'user_input.dismiss' | 'credential.register' | 'credential.get' | 'credential.revoke' | 'credential.supply' | 'host_tool.register' | 'host_tool.get' | 'host_tool.invocation.get' | 'host_tool.revoke' | 'host_tool.complete' | 'workflow.list' | 'workflow.get' | 'workflow.subscribe' | 'workflow.unsubscribe' | 'workflow.pause' | 'workflow.resume' | 'workflow.stop' | 'learning.list' | 'learning.get' | 'learning.snapshot' | 'learning.events' | 'learning.acknowledge' | 'learning.snooze' | 'learning.reject' | 'learning.disable' | 'learning.rollback' | 'learning.promote' | 'learning.review' | 'learning.trust' | 'config.read' | 'config.patch' | 'config.reload' | 'model.list' | 'provider.list' | 'provider.custom.list' | 'provider.custom.upsert' | 'provider.custom.remove' | 'mcp.server.list' | 'mcp.server.get' | 'mcp.server.validate' | 'mcp.server.upsert' | 'mcp.server.delete' | 'mcp.server.remove' | 'mcp.server.reload' | 'mcp.tool.list' | 'extension.list' | 'extension.reload' | 'command.list' | 'command.resolve' | 'skill.list' | 'skill.describe' | 'skill.read' | 'artifact.create' | 'artifact.get' | 'artifact.delete' | 'agentRegistrations.list' | 'agentRegistrations.upsert' | 'agentRegistrations.setEnabled' | 'agentRegistrations.remove' | 'agents.listDispatchable' | 'agents.describe' | 'agents.preflight' | 'agents.tree' | 'agents.detail' | 'agents.spawn' | 'agents.send' | 'agents.followup' | 'agents.interrupt' | 'agents.output' | 'agents.events' | 'agents.wait' | 'context.budget.get' | 'tool.exposure.preview' | 'provider.cache.diagnostics.get';
181
+ type RuntimeDaemonMethod = 'initialize' | 'runtime.initialize' | 'ping' | 'runtime.identity' | 'runtime.status' | 'runtime.shutdown' | 'runtime.capabilities' | 'daemon.status' | 'daemon.stop' | 'daemon.logs' | 'daemon.preflight' | 'daemon.management.get' | 'daemon.rollbackToInline' | 'operation.get' | 'session.create' | 'session.load' | 'session.list' | 'session.status' | 'session.transcript' | 'session.transcript.page' | 'session.transcript.entryChunk' | 'session.transcript.search' | 'session.conversation' | 'session.conversation.page' | 'session.conversation.entryChunk' | 'session.observe' | 'session.diagnostics' | 'session.fork' | 'session.notice.append' | 'session.rewind' | 'session.active_entry.set' | 'session.activeEntry.set' | 'session.compact' | 'session.archive' | 'session.unarchive' | 'session.delete' | 'session.settings.get' | 'session.settings.getVersioned' | 'session.autoMode.getStats' | 'session.settings.update' | 'session.settings.updateVersioned' | 'run.start' | 'run.input.submit' | 'run.get' | 'run.list' | 'run.await' | 'run.abort' | 'run.model.set' | 'run.provider.set' | 'run.reasoning.set' | 'run.setModel' | 'run.setProvider' | 'run.setReasoning' | 'request.cancel' | 'request.ack' | 'event.subscribe' | 'event.unsubscribe' | 'event.replay' | 'permission.list' | 'permission.listPending' | 'permission.request' | 'permission.respond' | 'permission.grants.list' | 'permission.grants.revoke' | 'user_input.listPending' | 'user_input.respond' | 'user_input.dismiss' | 'credential.register' | 'credential.get' | 'credential.revoke' | 'credential.supply' | 'host_tool.register' | 'host_tool.get' | 'host_tool.invocation.get' | 'host_tool.revoke' | 'host_tool.complete' | 'workflow.list' | 'workflow.get' | 'workflow.subscribe' | 'workflow.unsubscribe' | 'workflow.pause' | 'workflow.resume' | 'workflow.stop' | 'learning.list' | 'learning.get' | 'learning.snapshot' | 'learning.events' | 'learning.acknowledge' | 'learning.snooze' | 'learning.reject' | 'learning.disable' | 'learning.rollback' | 'learning.promote' | 'learning.review' | 'learning.trust' | 'config.read' | 'config.patch' | 'config.reload' | 'model.list' | 'provider.list' | 'provider.custom.list' | 'provider.custom.upsert' | 'provider.custom.remove' | 'mcp.server.list' | 'mcp.server.get' | 'mcp.server.validate' | 'mcp.server.upsert' | 'mcp.server.delete' | 'mcp.server.remove' | 'mcp.server.reload' | 'mcp.tool.list' | 'extension.list' | 'extension.reload' | 'command.list' | 'command.resolve' | 'skill.list' | 'skill.describe' | 'skill.read' | 'artifact.create' | 'artifact.get' | 'artifact.delete' | 'agentRegistrations.list' | 'agentRegistrations.upsert' | 'agentRegistrations.setEnabled' | 'agentRegistrations.remove' | 'agents.listDispatchable' | 'agents.describe' | 'agents.preflight' | 'agents.tree' | 'agents.detail' | 'agents.spawn' | 'agents.send' | 'agents.followup' | 'agents.interrupt' | 'agents.output' | 'agents.events' | 'agents.wait' | 'context.budget.get' | 'tool.exposure.preview' | 'provider.cache.diagnostics.get';
183
182
  type RuntimeDaemonRetiredMethod = 'agentTasks.list' | 'agentTasks.start' | 'agentTasks.get' | 'agentTasks.events' | 'agentTasks.wait' | 'agentTasks.sendInput' | 'agentTasks.cancel' | 'agentTasks.reconcile';
184
183
  type RuntimeDaemonWireMethod = RuntimeDaemonMethod | RuntimeDaemonRetiredMethod;
185
- type RuntimeDaemonNotificationMethod = 'event' | 'credential.request' | 'host_tool.invoke' | 'runtime.warning';
184
+ type RuntimeDaemonNotificationMethod = 'event' | 'observation.invalidated' | 'credential.request' | 'host_tool.invoke' | 'runtime.warning';
186
185
  interface RuntimeDaemonError {
187
186
  readonly code: RuntimeDaemonErrorCode;
188
187
  readonly message: string;
189
188
  readonly data?: unknown;
190
189
  }
191
- type RuntimeDaemonErrorCode = 'invalid_frame' | 'invalid_request' | 'invalid_params' | 'not_initialized' | 'method_not_found' | 'unauthorized' | 'permission_denied' | 'conflict' | 'not_found' | 'session_not_admitted' | 'cancelled' | 'overloaded' | 'client_upgrade_required' | 'operation_required' | 'operation_epoch_mismatch' | 'operation_id_reuse' | 'operation_interrupted' | 'operation_unknown' | 'control_history_untrusted' | 'credential_unavailable' | 'host_tool_unavailable' | 'host_tool_unknown' | 'internal_error';
190
+ type RuntimeDaemonErrorCode = 'invalid_frame' | 'invalid_request' | 'invalid_params' | 'not_initialized' | 'method_not_found' | 'unauthorized' | 'permission_denied' | 'conflict' | 'not_found' | 'session_not_admitted' | 'cancelled' | 'overloaded' | 'client_upgrade_required' | 'operation_required' | 'operation_epoch_mismatch' | 'operation_id_reuse' | 'operation_interrupted' | 'operation_unknown' | 'control_history_untrusted' | 'resync_required' | 'read_timeout' | 'read_cancelled' | 'data_changed' | 'observation_invalidated' | 'runtime_changed' | 'data_corrupt' | 'version_incompatible' | 'credential_unavailable' | 'host_tool_unavailable' | 'host_tool_unknown' | 'internal_error';
192
191
  interface RuntimeDaemonFrameBase {
193
192
  readonly protocol: typeof KODAX_DAEMON_PROTOCOL;
194
193
  readonly version: typeof KODAX_DAEMON_PROTOCOL_VERSION;
@@ -223,11 +222,15 @@ type RuntimeDaemonFrame = RuntimeDaemonRequest<RuntimeDaemonWireMethod> | Runtim
223
222
  declare const RUNTIME_DAEMON_METHODS: readonly RuntimeDaemonMethod[];
224
223
 
225
224
  interface RuntimeDaemonClientTransport {
226
- request(method: RuntimeDaemonMethod, params?: unknown, operation?: RuntimeDaemonOperationEnvelope): Promise<unknown>;
225
+ request(method: RuntimeDaemonMethod, params?: unknown, operation?: RuntimeDaemonOperationEnvelope, control?: RuntimeDaemonRequestControl): Promise<unknown>;
227
226
  subscribe(listener: (notification: RuntimeDaemonNotification) => void): RuntimeSubscription;
228
227
  subscribeLifecycle?(listener: (state: RuntimeDaemonTransportLifecycleState) => void): RuntimeSubscription;
229
228
  close?(): Promise<void> | void;
230
229
  }
230
+ interface RuntimeDaemonRequestControl {
231
+ readonly signal?: AbortSignal;
232
+ readonly onLateResult?: (value: unknown) => void;
233
+ }
231
234
  interface RuntimeDaemonTransportLifecycleState {
232
235
  readonly state: 'connected' | 'disconnected';
233
236
  readonly connectionId: string;
@@ -255,6 +258,11 @@ interface RuntimeWorkerResourceLimits {
255
258
  interface RuntimeWorkerOptions {
256
259
  readonly resourceLimits?: RuntimeWorkerResourceLimits;
257
260
  readonly shutdownTimeoutMs?: number;
261
+ /**
262
+ * Load `<homeDir>/.kodax/integrations/a2a.json` inside the Worker owner.
263
+ * Defaults to false so SDK hosts explicitly opt into ambient user integration.
264
+ */
265
+ readonly configuredA2A?: boolean;
258
266
  }
259
267
 
260
268
  interface RuntimeDaemonEndpoint {
@@ -355,6 +363,10 @@ declare const RUNTIME_DAEMON_METHOD_SCHEMAS: {
355
363
  params: RuntimeDaemonJsonSchema;
356
364
  result: RuntimeDaemonJsonSchema;
357
365
  };
366
+ 'session.status': {
367
+ params: RuntimeDaemonJsonSchema;
368
+ result: RuntimeDaemonJsonSchema;
369
+ };
358
370
  'session.transcript': {
359
371
  params: RuntimeDaemonJsonSchema;
360
372
  result: RuntimeDaemonJsonSchema;
@@ -375,6 +387,22 @@ declare const RUNTIME_DAEMON_METHOD_SCHEMAS: {
375
387
  params: RuntimeDaemonJsonSchema;
376
388
  result: RuntimeDaemonJsonSchema;
377
389
  };
390
+ 'session.conversation': {
391
+ params: RuntimeDaemonJsonSchema;
392
+ result: RuntimeDaemonJsonSchema;
393
+ };
394
+ 'session.conversation.page': {
395
+ params: RuntimeDaemonJsonSchema;
396
+ result: RuntimeDaemonJsonSchema;
397
+ };
398
+ 'session.conversation.entryChunk': {
399
+ params: RuntimeDaemonJsonSchema;
400
+ result: RuntimeDaemonJsonSchema;
401
+ };
402
+ 'session.diagnostics': {
403
+ params: RuntimeDaemonJsonSchema;
404
+ result: RuntimeDaemonJsonSchema;
405
+ };
378
406
  'session.fork': {
379
407
  params: RuntimeDaemonJsonSchema;
380
408
  result: RuntimeDaemonJsonSchema;
@@ -479,6 +507,14 @@ declare const RUNTIME_DAEMON_METHOD_SCHEMAS: {
479
507
  params: RuntimeDaemonJsonSchema;
480
508
  result: RuntimeDaemonJsonSchema;
481
509
  };
510
+ 'request.cancel': {
511
+ params: RuntimeDaemonJsonSchema;
512
+ result: RuntimeDaemonJsonSchema;
513
+ };
514
+ 'request.ack': {
515
+ params: RuntimeDaemonJsonSchema;
516
+ result: RuntimeDaemonJsonSchema;
517
+ };
482
518
  'event.subscribe': {
483
519
  params: RuntimeDaemonJsonSchema;
484
520
  result: RuntimeDaemonJsonSchema;
@@ -842,6 +878,7 @@ declare const RUNTIME_DAEMON_METHOD_SCHEMAS: {
842
878
  };
843
879
  declare const RUNTIME_DAEMON_NOTIFICATION_SCHEMAS: {
844
880
  event: RuntimeDaemonJsonSchema;
881
+ 'observation.invalidated': RuntimeDaemonJsonSchema;
845
882
  'credential.request': RuntimeDaemonJsonSchema;
846
883
  'host_tool.invoke': RuntimeDaemonJsonSchema;
847
884
  'runtime.warning': RuntimeDaemonJsonSchema;
@@ -861,10 +898,10 @@ declare function listRuntimeDaemonSchemaMethods(): readonly RuntimeDaemonMethod[
861
898
  declare class RuntimeDaemonCapabilityUpgradeError extends Error {
862
899
  readonly preflight?: RuntimeDaemonPreflight | undefined;
863
900
  readonly code: "daemon_capability_upgrade_required";
864
- readonly capability: "runtimeAutoModeGuardrail";
865
901
  readonly recoverable: true;
866
902
  readonly restartRequired: true;
867
- constructor(message: string, preflight?: RuntimeDaemonPreflight | undefined, options?: ErrorOptions);
903
+ readonly capability: string;
904
+ constructor(message: string, preflight?: RuntimeDaemonPreflight | undefined, options?: ErrorOptions, capability?: string);
868
905
  }
869
906
  /** A recoverable Auto LLM configuration error that must never become approval work. */
870
907
  declare class RuntimeAutoModeConfigurationError extends Error {
@@ -873,8 +910,8 @@ declare class RuntimeAutoModeConfigurationError extends Error {
873
910
  constructor(message: string);
874
911
  }
875
912
 
876
- type KodaXRuntimeMode = 'embedded' | 'daemon';
877
- type KodaXRuntimeIsolation = 'inline' | 'worker' | 'process';
913
+ type KodaXRuntimeMode = "embedded" | "daemon";
914
+ type KodaXRuntimeIsolation = "inline" | "worker" | "process";
878
915
 
879
916
  interface RuntimeInlineOwnerHandle {
880
917
  readonly profile: string;
@@ -883,7 +920,7 @@ interface RuntimeInlineOwnerHandle {
883
920
  close(): void;
884
921
  }
885
922
  interface RuntimeOwnerPolicyState {
886
- readonly mode: 'daemon' | 'inline';
923
+ readonly mode: "daemon" | "inline";
887
924
  readonly revision: number;
888
925
  readonly updatedAt: string;
889
926
  }
@@ -891,12 +928,12 @@ interface RuntimeOwnerIdentity {
891
928
  readonly runtimeId: string;
892
929
  readonly pid: number;
893
930
  readonly createdAt: string;
894
- readonly kind?: 'daemon' | 'inline';
931
+ readonly kind?: "daemon" | "inline";
895
932
  }
896
933
  interface RuntimeOwnerState {
897
934
  readonly profile: string;
898
935
  readonly policy: RuntimeOwnerPolicyState;
899
- readonly ownerStatus: 'unowned' | 'owned' | 'unreadable';
936
+ readonly ownerStatus: "unowned" | "owned" | "unreadable";
900
937
  readonly owner: RuntimeOwnerIdentity | null;
901
938
  }
902
939
  /**
@@ -922,12 +959,12 @@ declare function enableKodaXDaemonOwner(input?: {
922
959
  readonly profile?: string;
923
960
  }): RuntimeOwnerPolicyState;
924
961
  declare function setKodaXRuntimeOwnerMode(input: {
925
- readonly mode: 'daemon' | 'inline';
962
+ readonly mode: "daemon" | "inline";
926
963
  readonly expectedRevision: number;
927
964
  readonly homeDir?: string;
928
965
  readonly profile?: string;
929
966
  }): {
930
- readonly mode: 'daemon' | 'inline';
967
+ readonly mode: "daemon" | "inline";
931
968
  readonly revision: number;
932
969
  readonly updatedAt: string;
933
970
  };
@@ -962,7 +999,7 @@ interface RuntimeClientCapabilities {
962
999
  readonly contextDiagnostics?: boolean;
963
1000
  readonly operationDeduplication?: boolean;
964
1001
  }
965
- type RuntimeGrantedScope = 'session:observe' | 'session:write' | 'run:control' | 'interaction:respond' | 'permission:respond' | 'permission:grant-admin' | 'integration:admin' | 'workflow:control' | 'learning:read' | 'learning:control' | 'artifact:write' | 'agent:control' | 'credential:register' | 'host-tool:register' | 'owner:admin' | 'daemon:admin';
1002
+ type RuntimeGrantedScope = "session:observe" | "session:write" | "run:control" | "interaction:respond" | "permission:respond" | "permission:grant-admin" | "integration:admin" | "workflow:control" | "learning:read" | "learning:control" | "artifact:write" | "agent:control" | "credential:register" | "host-tool:register" | "owner:admin" | "daemon:admin";
966
1003
  interface RuntimeExternalAgentsOptions {
967
1004
  readonly factories: readonly AgentExecutorFactory[];
968
1005
  readonly policy: AgentDispatchPolicy;
@@ -976,7 +1013,7 @@ interface CreateKodaXRuntimeOptions {
976
1013
  /** Runtime ownership form. Defaults to a caller-owned embedded Runtime. */
977
1014
  readonly mode?: KodaXRuntimeMode;
978
1015
  /** Embedded-only execution location. Daemon mode selects host isolation internally. */
979
- readonly isolation?: 'inline' | 'worker';
1016
+ readonly isolation?: "inline" | "worker";
980
1017
  /** Requires `isolation: 'worker'`; rejected instead of being silently ignored. */
981
1018
  readonly worker?: RuntimeWorkerOptions;
982
1019
  /** Base directory that owns `.kodax`, matching CLI `--home`; not the `.kodax` directory used by `KODAX_HOME`. */
@@ -992,6 +1029,11 @@ interface CreateKodaXRuntimeOptions {
992
1029
  readonly daemonHostRuntimeId?: string;
993
1030
  readonly daemonStartupTimeoutMs?: number;
994
1031
  readonly daemonConnectTimeoutMs?: number;
1032
+ /**
1033
+ * Auto-started daemon only: after the last logical client disconnects,
1034
+ * stop once governed work is idle. Omit to keep the normal persistent daemon.
1035
+ */
1036
+ readonly daemonOrphanExitMs?: number;
995
1037
  readonly daemonTransport?: RuntimeDaemonClientTransport;
996
1038
  readonly daemonEndpoint?: string | RuntimeDaemonEndpoint;
997
1039
  /** Defaults to true for daemon mode unless a transport or endpoint is supplied. */
@@ -1017,11 +1059,18 @@ interface ConnectKodaXRuntimeOptions {
1017
1059
  readonly permissionTimeoutMs?: number;
1018
1060
  readonly daemonStartupTimeoutMs?: number;
1019
1061
  readonly daemonConnectTimeoutMs?: number;
1062
+ /** Auto-started daemon idle-exit policy; see CreateKodaXRuntimeOptions. */
1063
+ readonly daemonOrphanExitMs?: number;
1020
1064
  readonly daemonToken?: string;
1021
1065
  readonly clientInfo?: RuntimeClientInfo;
1022
1066
  readonly capabilities?: RuntimeClientCapabilities;
1023
1067
  readonly requirements?: RuntimeCapabilityRequirements;
1024
1068
  }
1069
+ /** SDK facts that embedders can inspect before auto-starting a daemon. */
1070
+ declare const KODAX_RUNTIME_SDK_CAPABILITIES: Readonly<{
1071
+ readonly daemonOrphanExit: 1;
1072
+ readonly runtimeEventCoalescing: 1;
1073
+ }>;
1025
1074
  interface RuntimeCapabilityRequirements {
1026
1075
  /** Reject inline and shared daemon hosts; only a Worker-hosted Runtime satisfies this. */
1027
1076
  readonly hardDispose?: boolean;
@@ -1035,6 +1084,7 @@ interface RuntimeCapabilityRequirements {
1035
1084
  readonly sessionObservation?: 1;
1036
1085
  readonly afterTurnInput?: 1;
1037
1086
  readonly learningCenter?: 1;
1087
+ readonly skillLearningLoop?: 1;
1038
1088
  readonly interruptInput?: 1;
1039
1089
  readonly askUserTransport?: 1;
1040
1090
  readonly permissionCas?: 1;
@@ -1051,17 +1101,25 @@ interface RuntimeCapabilityRequirements {
1051
1101
  readonly transcriptPaging?: 1;
1052
1102
  /** Require deterministic exact-history search over merged persisted lineage. */
1053
1103
  readonly transcriptSearch?: 1;
1104
+ /** Require SDK-resolved ordinary history with explicit legacy ambiguity. */
1105
+ readonly conversationHistory?: 1;
1054
1106
  readonly connectionLifecycle?: 1;
1055
1107
  readonly typedRuntimeEvents?: 1;
1056
1108
  readonly daemonSafeRunInput?: 1;
1057
1109
  readonly sharedSessionSettings?: 1;
1058
1110
  readonly durableRecoveryQueries?: 1;
1059
1111
  readonly daemonManagement?: 1;
1112
+ /** Require an auto-started daemon whose current host has orphan idle-exit enabled. */
1113
+ readonly daemonOrphanExit?: 1;
1114
+ /** Require source-level bounded coalescing before sequence allocation and persistence. */
1115
+ readonly runtimeEventCoalescing?: 1;
1116
+ /** Optional integration failures are isolated, observable, and hot-recoverable. */
1117
+ readonly integrationConfigResilience?: 1;
1060
1118
  readonly actorControlPlane?: 1;
1061
1119
  /** Runtime owns Auto LLM/rules classification before shared permission brokering. */
1062
- readonly runtimeAutoModeGuardrail?: 1 | 2 | 3;
1120
+ readonly runtimeAutoModeGuardrail?: 1 | 2 | 3 | 4;
1063
1121
  }
1064
- type RuntimeOperationState = 'accepted' | 'dispatched' | 'applied' | 'rejected' | 'interrupted' | 'unknown';
1122
+ type RuntimeOperationState = "accepted" | "dispatched" | "applied" | "rejected" | "interrupted" | "unknown";
1065
1123
  interface RuntimeOperationReceipt {
1066
1124
  readonly operationId: string;
1067
1125
  readonly journalEpoch: string;
@@ -1088,7 +1146,7 @@ interface RuntimeDiagnosticFilter {
1088
1146
  readonly sessionId?: string;
1089
1147
  readonly runId?: string;
1090
1148
  /** Defaults to root so child physical requests do not replace root diagnostics. */
1091
- readonly contextKind?: 'root' | 'child';
1149
+ readonly contextKind?: "root" | "child";
1092
1150
  readonly agentId?: string;
1093
1151
  }
1094
1152
  interface RuntimeDiagnosticsService {
@@ -1097,7 +1155,7 @@ interface RuntimeDiagnosticsService {
1097
1155
  latestProviderCacheDiagnostic(filter?: RuntimeDiagnosticFilter): Promise<KodaXPromptCacheDiagnosticEvent | null>;
1098
1156
  }
1099
1157
  interface RuntimeConnectionState {
1100
- readonly state: 'connected' | 'disconnected';
1158
+ readonly state: "connected" | "disconnected";
1101
1159
  readonly connectionId: string;
1102
1160
  readonly runtimeEpoch: string;
1103
1161
  readonly journalEpoch?: string;
@@ -1159,7 +1217,7 @@ interface RuntimeAgentService {
1159
1217
  interrupt(sessionId: string, actorPath: string, reason?: string): Promise<void>;
1160
1218
  output(sessionId: string, actorPath: string, turnId?: string): Promise<AgentOutput>;
1161
1219
  events(sessionId: string, afterSequence?: number): Promise<readonly AgentEvent[]>;
1162
- wait(sessionId: string, afterSequence?: number, timeoutMs?: number): Promise<AgentEvent | undefined>;
1220
+ wait(sessionId: string, afterSequence?: number, timeoutMs?: number, options?: Readonly<Pick<RuntimeReadOptions, "signal">>): Promise<AgentEvent | undefined>;
1163
1221
  }
1164
1222
  type RuntimeConfigPatch = Partial<Pick<ReplRuntimeConfigPatch, RuntimeConfigPatchKey>>;
1165
1223
  interface RuntimeConfigReloadResult {
@@ -1182,15 +1240,15 @@ interface RuntimeCommandInfo {
1182
1240
  readonly name: string;
1183
1241
  readonly aliases?: readonly string[];
1184
1242
  readonly description: string;
1185
- readonly source: CommandInfo['source'];
1243
+ readonly source: CommandInfo["source"];
1186
1244
  readonly usage?: string;
1187
1245
  readonly argumentHint?: string;
1188
- readonly location?: CommandInfo['location'];
1246
+ readonly location?: CommandInfo["location"];
1189
1247
  readonly path?: string;
1190
1248
  readonly userInvocable?: boolean;
1191
1249
  readonly disableModelInvocation?: boolean;
1192
1250
  readonly allowedTools?: string;
1193
- readonly context?: 'fork';
1251
+ readonly context?: "fork";
1194
1252
  readonly agent?: string;
1195
1253
  readonly model?: string;
1196
1254
  }
@@ -1213,7 +1271,7 @@ interface RuntimeSkillSummary {
1213
1271
  readonly userInvocable: boolean;
1214
1272
  readonly argumentHint?: string;
1215
1273
  readonly path: string;
1216
- readonly source: SkillMetadata['source'];
1274
+ readonly source: SkillMetadata["source"];
1217
1275
  readonly disableModelInvocation: boolean;
1218
1276
  }
1219
1277
  interface RuntimeSkillDescription extends RuntimeSkillSummary {
@@ -1272,7 +1330,7 @@ interface RuntimeMcpService {
1272
1330
  reloadServers(): Promise<RuntimeMcpReloadResult>;
1273
1331
  listTools(filter?: RuntimeMcpToolListFilter): Promise<readonly McpServerToolList[]>;
1274
1332
  }
1275
- type RuntimeArtifactKind = 'image' | 'file' | 'video';
1333
+ type RuntimeArtifactKind = "image" | "file" | "video";
1276
1334
  interface RuntimeCreateArtifactInput {
1277
1335
  readonly kind: RuntimeArtifactKind;
1278
1336
  readonly path: string;
@@ -1325,7 +1383,7 @@ interface RuntimeRunSessionLoadedEventPayload {
1325
1383
  readonly turnId?: string;
1326
1384
  readonly iteration?: number;
1327
1385
  }
1328
- /** `session.loaded` is emitted both for an explicit SDK load and a run provider session bind. */
1386
+ /** Durable compatibility event emitted when a run binds its provider session. */
1329
1387
  type RuntimeSessionLoadedEventPayload = RuntimeSession | RuntimeRunSessionLoadedEventPayload;
1330
1388
  interface RuntimeSessionSummary extends RuntimeSession {
1331
1389
  /** Opaque continuation token accepted by RuntimeSessionFilter.cursor. */
@@ -1336,6 +1394,31 @@ interface RuntimeSessionSummary extends RuntimeSession {
1336
1394
  readonly archived?: boolean;
1337
1395
  }
1338
1396
  type RuntimeTranscript = FullTranscriptSessionData;
1397
+ interface RuntimeConversationHistory extends SessionConversationHistoryData {
1398
+ /** Content-derived identity shared by direct and paged conversation reads. */
1399
+ readonly revision: string;
1400
+ }
1401
+ interface RuntimeConversationHistorySliceEntry {
1402
+ readonly index: number;
1403
+ readonly boundaryId?: string;
1404
+ readonly byteLength: number;
1405
+ readonly oversized: boolean;
1406
+ readonly entry?: SessionConversationHistoryEntry;
1407
+ }
1408
+ interface RuntimeConversationHistorySlice {
1409
+ readonly revision: string;
1410
+ readonly sourceRevision: string;
1411
+ readonly status: SessionConversationHistoryStatus;
1412
+ readonly issues: readonly SessionConversationHistoryIssue[];
1413
+ readonly entries: readonly RuntimeConversationHistorySliceEntry[];
1414
+ readonly hasMore: boolean;
1415
+ readonly nextCursor?: string;
1416
+ }
1417
+ interface RuntimeConversationHistoryPageInput {
1418
+ readonly sessionId: string;
1419
+ readonly cursor?: string;
1420
+ readonly limit?: number;
1421
+ }
1339
1422
  interface RuntimeTranscriptSliceEntry {
1340
1423
  readonly index: number;
1341
1424
  readonly entryId?: string;
@@ -1354,6 +1437,53 @@ interface RuntimeTranscriptPageInput {
1354
1437
  readonly cursor?: string;
1355
1438
  readonly limit?: number;
1356
1439
  }
1440
+ interface RuntimeReadOptions {
1441
+ readonly timeoutMs?: number;
1442
+ readonly signal?: AbortSignal;
1443
+ }
1444
+ interface RuntimeSessionDiagnosticsInput extends RuntimeReadOptions {
1445
+ readonly sessionId: string;
1446
+ /** Select one Run control record; otherwise the authoritative Session Run is used. */
1447
+ readonly runId?: string;
1448
+ }
1449
+ type RuntimeSessionDiagnosticErrorCode = "run_control_unknown" | "run_status_unknown" | "owner_liveness_unconfirmed" | "owner_recovery_required" | "stop_outcome_unconfirmed" | "actor_settlement_retrying" | "actor_settlement_not_persisted" | "run_failed" | "terminal_time_unknown";
1450
+ interface RuntimeSessionDiagnosticError {
1451
+ readonly code: RuntimeSessionDiagnosticErrorCode;
1452
+ readonly message: string;
1453
+ }
1454
+ interface RuntimeSessionDiagnosticRun {
1455
+ readonly controlRecord: "present" | "unknown";
1456
+ readonly runId?: string;
1457
+ readonly turnId?: string;
1458
+ readonly state: "queued" | "active" | "terminal" | "unknown";
1459
+ readonly phase?: RuntimeRunPhase;
1460
+ readonly stage: RuntimeRunStage | "unknown";
1461
+ readonly stageChangedAt?: string;
1462
+ readonly terminalAt?: string;
1463
+ readonly terminalTimeKnown: boolean;
1464
+ readonly terminal?: RuntimeTerminalFact;
1465
+ readonly activeSubtaskCount: number | null;
1466
+ readonly activeSubtaskCountSource: "run_status" | "unknown";
1467
+ readonly stop?: RuntimeRunStopStatus;
1468
+ readonly interruptInputs?: readonly RuntimeInterruptInputStatus[];
1469
+ readonly errors: readonly RuntimeSessionDiagnosticError[];
1470
+ }
1471
+ interface RuntimeSessionDiagnostics {
1472
+ readonly schemaVersion: 1;
1473
+ readonly captureStartedAt: string;
1474
+ readonly capturedAt: string;
1475
+ readonly sdkVersion: string;
1476
+ readonly runtimeVersion: string;
1477
+ readonly daemonVersion: string | null;
1478
+ readonly runtimeId: string;
1479
+ readonly runtimeMode: KodaXRuntimeMode;
1480
+ readonly sessionId: string;
1481
+ readonly observation: {
1482
+ readonly cursor: number;
1483
+ readonly transcriptRevision: string;
1484
+ };
1485
+ readonly run: RuntimeSessionDiagnosticRun;
1486
+ }
1357
1487
  interface RuntimeTranscriptEntryChunkInput {
1358
1488
  readonly sessionId: string;
1359
1489
  readonly revision: string;
@@ -1364,17 +1494,32 @@ interface RuntimeTranscriptEntryChunk {
1364
1494
  readonly revision: string;
1365
1495
  readonly entryIndex: number;
1366
1496
  readonly entryId?: string;
1367
- readonly encoding: 'base64-json';
1497
+ readonly encoding: "base64-json";
1368
1498
  readonly data: string;
1369
1499
  readonly hasMore: boolean;
1370
1500
  readonly nextCursor?: string;
1371
1501
  }
1502
+ interface RuntimeConversationHistoryEntryChunk {
1503
+ readonly revision: string;
1504
+ readonly entryIndex: number;
1505
+ readonly boundaryId?: string;
1506
+ readonly encoding: "base64-json";
1507
+ readonly data: string;
1508
+ readonly hasMore: boolean;
1509
+ readonly nextCursor?: string;
1510
+ }
1511
+ interface RuntimeConversationHistoryEntryChunkInput {
1512
+ readonly sessionId: string;
1513
+ readonly revision: string;
1514
+ readonly entryIndex: number;
1515
+ readonly cursor?: string;
1516
+ }
1372
1517
  interface RuntimeTranscriptSearchInput {
1373
1518
  readonly sessionId: string;
1374
1519
  readonly query: string;
1375
1520
  readonly limit?: number;
1376
- readonly role?: 'user' | 'assistant';
1377
- readonly scope?: 'compacted' | 'all';
1521
+ readonly role?: "user" | "assistant";
1522
+ readonly scope?: "compacted" | "all";
1378
1523
  }
1379
1524
  interface RuntimeTranscriptSearchHit extends KodaXSessionHistoryHit {
1380
1525
  /** Index accepted by transcriptEntryChunk for this exact transcript revision. */
@@ -1386,7 +1531,7 @@ interface RuntimeTranscriptSearchResult {
1386
1531
  }
1387
1532
  interface RuntimeSessionFilter {
1388
1533
  readonly projectRoot?: string;
1389
- readonly scope?: 'user' | 'managed-task-worker' | 'all';
1534
+ readonly scope?: "user" | "managed-task-worker" | "all";
1390
1535
  readonly includeArchived?: boolean;
1391
1536
  readonly limit?: number;
1392
1537
  readonly before?: string;
@@ -1399,18 +1544,23 @@ interface RuntimeForkSessionInput {
1399
1544
  readonly selector?: string;
1400
1545
  readonly newSessionId?: string;
1401
1546
  readonly title?: string;
1547
+ readonly historyBoundary?: RuntimeConversationHistoryBoundary;
1548
+ }
1549
+ interface RuntimeConversationHistoryBoundary {
1550
+ readonly entryId: string;
1551
+ readonly sourceRevision: string;
1402
1552
  }
1403
1553
  interface RuntimeSessionSettings {
1404
1554
  readonly provider?: string;
1405
1555
  readonly model?: string;
1406
- readonly effort?: KodaXOptions['effort'];
1556
+ readonly effort?: KodaXOptions["effort"];
1407
1557
  readonly thinking?: boolean;
1408
1558
  readonly reasoningMode?: KodaXReasoningMode;
1409
1559
  readonly permissionMode?: string;
1410
1560
  readonly executionCwd?: string;
1411
1561
  readonly shellExecution?: KodaXShellExecutionContract;
1412
- readonly agentMode?: KodaXOptions['agentMode'];
1413
- readonly autoModeEngine?: 'llm' | 'rules';
1562
+ readonly agentMode?: KodaXOptions["agentMode"];
1563
+ readonly autoModeEngine?: "llm" | "rules";
1414
1564
  readonly autoModeClassifierModel?: string;
1415
1565
  readonly autoModeTimeoutMs?: number;
1416
1566
  readonly autoModeSpeculativeWindowMs?: number;
@@ -1422,14 +1572,14 @@ interface RuntimeSessionSettings {
1422
1572
  interface RuntimeSessionSettingsPatch {
1423
1573
  readonly provider?: string | null;
1424
1574
  readonly model?: string | null;
1425
- readonly effort?: KodaXOptions['effort'] | null;
1575
+ readonly effort?: KodaXOptions["effort"] | null;
1426
1576
  readonly thinking?: boolean | null;
1427
1577
  readonly reasoningMode?: KodaXReasoningMode | null;
1428
1578
  readonly permissionMode?: string | null;
1429
1579
  readonly executionCwd?: string | null;
1430
1580
  readonly shellExecution?: KodaXShellExecutionContract | null;
1431
- readonly agentMode?: KodaXOptions['agentMode'] | null;
1432
- readonly autoModeEngine?: 'llm' | 'rules' | null;
1581
+ readonly agentMode?: KodaXOptions["agentMode"] | null;
1582
+ readonly autoModeEngine?: "llm" | "rules" | null;
1433
1583
  readonly autoModeClassifierModel?: string | null;
1434
1584
  readonly autoModeTimeoutMs?: number | null;
1435
1585
  readonly autoModeSpeculativeWindowMs?: number | null;
@@ -1444,6 +1594,7 @@ interface RuntimeAppendNoticeInput {
1444
1594
  interface RuntimeRewindSessionInput {
1445
1595
  readonly sessionId: string;
1446
1596
  readonly selector?: string;
1597
+ readonly historyBoundary?: RuntimeConversationHistoryBoundary;
1447
1598
  }
1448
1599
  interface RuntimeSetActiveEntryInput {
1449
1600
  readonly sessionId: string;
@@ -1476,6 +1627,7 @@ interface RuntimeActiveToolProjection {
1476
1627
  readonly turnId?: string;
1477
1628
  readonly started: unknown;
1478
1629
  readonly progress?: unknown;
1630
+ readonly sandbox?: RuntimeToolSandboxEventPayload;
1479
1631
  }
1480
1632
  interface RuntimePendingUserInputProjection {
1481
1633
  readonly requestId: string;
@@ -1510,16 +1662,32 @@ interface RuntimeSessionObservationSnapshot {
1510
1662
  }
1511
1663
  interface RuntimeSessionObservation extends RuntimeSubscription {
1512
1664
  readonly snapshot: RuntimeSessionObservationSnapshot;
1665
+ readonly invalidated: Promise<RuntimeObservationInvalidation>;
1666
+ }
1667
+ interface RuntimeObservationInvalidation {
1668
+ readonly code: "observation_invalidated";
1669
+ readonly reason: "event_overflow" | "event_order" | "delivery_failed" | "runtime_changed" | "transport_disconnected";
1670
+ readonly runtimeId: string;
1671
+ readonly message: string;
1513
1672
  }
1514
1673
  interface RuntimeSessionService {
1515
1674
  create(input?: RuntimeCreateSessionInput): Promise<RuntimeSession>;
1516
- load(sessionId: string): Promise<RuntimeSession>;
1675
+ load(sessionId: string, options?: RuntimeReadOptions): Promise<RuntimeSession>;
1517
1676
  list(filter?: RuntimeSessionFilter): Promise<readonly RuntimeSessionSummary[]>;
1518
- transcript(sessionId: string): Promise<RuntimeTranscript | null>;
1519
- transcriptPage(input: RuntimeTranscriptPageInput): Promise<RuntimeTranscriptSlice | null>;
1520
- transcriptEntryChunk(input: RuntimeTranscriptEntryChunkInput): Promise<RuntimeTranscriptEntryChunk | null>;
1521
- transcriptSearch(input: RuntimeTranscriptSearchInput): Promise<RuntimeTranscriptSearchResult | null>;
1522
- observe(sessionId: string, listener: RuntimeEventListener): Promise<RuntimeSessionObservation>;
1677
+ status(sessionId: string): Promise<RuntimeSessionStatus>;
1678
+ transcript(sessionId: string, options?: RuntimeReadOptions): Promise<RuntimeTranscript | null>;
1679
+ transcriptPage(input: RuntimeTranscriptPageInput, options?: RuntimeReadOptions): Promise<RuntimeTranscriptSlice | null>;
1680
+ transcriptEntryChunk(input: RuntimeTranscriptEntryChunkInput, options?: RuntimeReadOptions): Promise<RuntimeTranscriptEntryChunk | null>;
1681
+ transcriptSearch(input: RuntimeTranscriptSearchInput, options?: RuntimeReadOptions): Promise<RuntimeTranscriptSearchResult | null>;
1682
+ conversation(sessionId: string, options?: RuntimeReadOptions): Promise<RuntimeConversationHistory | null>;
1683
+ conversationPage(input: RuntimeConversationHistoryPageInput, options?: RuntimeReadOptions): Promise<RuntimeConversationHistorySlice | null>;
1684
+ conversationEntryChunk(input: RuntimeConversationHistoryEntryChunkInput, options?: RuntimeReadOptions): Promise<RuntimeConversationHistoryEntryChunk | null>;
1685
+ observe(sessionId: string, listener: RuntimeEventListener, options?: RuntimeReadOptions): Promise<RuntimeSessionObservation>;
1686
+ /**
1687
+ * Captures a bounded, read-only diagnostic boundary without recovering,
1688
+ * taking over, or otherwise mutating Session or Run state.
1689
+ */
1690
+ diagnostics(input: RuntimeSessionDiagnosticsInput): Promise<RuntimeSessionDiagnostics>;
1523
1691
  fork(input: RuntimeForkSessionInput): Promise<RuntimeSession | null>;
1524
1692
  getSettings(sessionId: string): Promise<RuntimeSessionSettings>;
1525
1693
  getSettingsVersioned(sessionId: string): Promise<RuntimeVersionedValue<RuntimeSessionSettings>>;
@@ -1535,21 +1703,29 @@ interface RuntimeSessionService {
1535
1703
  unarchive(sessionId: string): Promise<void>;
1536
1704
  delete(sessionId: string): Promise<void>;
1537
1705
  }
1538
- type RuntimeRunPhase = 'queued' | 'running' | 'waiting_permission' | 'waiting_user_input' | 'completed' | 'failed' | 'cancelled' | 'interrupted';
1539
- type RuntimeRunMode = 'coding' | 'managed_task';
1706
+ type RuntimeRunPhase = "queued" | "running" | "waiting_agent" | "recovering" | "waiting_permission" | "waiting_user_input" | "unknown" | "completed" | "failed" | "cancelled" | "interrupted";
1707
+ type RuntimeRunStage = "queued" | "executing" | "waiting_agent" | "recovering" | "finalizing" | "terminal" | "unknown" | "starting" | "routing" | "preflight" | "round" | "worker" | "upgrade" | "verifying";
1708
+ interface RuntimeSessionStatus {
1709
+ readonly sessionId: string;
1710
+ readonly runtimeId: string;
1711
+ readonly phase: "idle" | RuntimeRunPhase;
1712
+ readonly observedAt: string;
1713
+ readonly runId?: string;
1714
+ }
1715
+ type RuntimeRunMode = "coding" | "managed_task";
1540
1716
  interface RuntimeTextInput {
1541
- readonly type: 'text';
1717
+ readonly type: "text";
1542
1718
  readonly text: string;
1543
1719
  }
1544
1720
  interface RuntimeImageInput {
1545
- readonly type: 'image';
1721
+ readonly type: "image";
1546
1722
  readonly path: string;
1547
- readonly mediaType?: KodaXImageInputArtifact['mediaType'];
1723
+ readonly mediaType?: KodaXImageInputArtifact["mediaType"];
1548
1724
  readonly source?: KodaXInputArtifactSource;
1549
1725
  readonly description?: string;
1550
1726
  }
1551
1727
  interface RuntimeFileInput {
1552
- readonly type: 'file';
1728
+ readonly type: "file";
1553
1729
  readonly path: string;
1554
1730
  readonly mediaType?: string;
1555
1731
  readonly mimeType?: string;
@@ -1558,20 +1734,20 @@ interface RuntimeFileInput {
1558
1734
  readonly description?: string;
1559
1735
  }
1560
1736
  interface RuntimeVideoInput {
1561
- readonly type: 'video';
1737
+ readonly type: "video";
1562
1738
  readonly path: string;
1563
- readonly mediaType: KodaXVideoInputArtifact['mediaType'];
1739
+ readonly mediaType: KodaXVideoInputArtifact["mediaType"];
1564
1740
  readonly name?: string;
1565
1741
  readonly source?: KodaXInputArtifactSource;
1566
1742
  readonly description?: string;
1567
1743
  }
1568
1744
  interface RuntimeArtifactRefInput {
1569
- readonly type: 'artifact_ref';
1745
+ readonly type: "artifact_ref";
1570
1746
  readonly artifactId: string;
1571
1747
  readonly description?: string;
1572
1748
  }
1573
1749
  type RuntimeInput = RuntimeTextInput | RuntimeImageInput | RuntimeFileInput | RuntimeVideoInput | RuntimeArtifactRefInput;
1574
- type RuntimePermissionBroker = 'runtime' | 'client';
1750
+ type RuntimePermissionBroker = "runtime" | "client";
1575
1751
  interface RuntimeStartRunInput {
1576
1752
  readonly sessionId: string;
1577
1753
  readonly prompt?: string;
@@ -1595,7 +1771,7 @@ interface RuntimeStartRunInput {
1595
1771
  interface RuntimeSubmitInput {
1596
1772
  readonly sessionId: string;
1597
1773
  readonly afterRunId: string;
1598
- readonly delivery: 'after_turn' | 'interrupt';
1774
+ readonly delivery: "after_turn" | "interrupt";
1599
1775
  readonly input: RuntimeInput | readonly RuntimeInput[];
1600
1776
  /** Continuations receive only bindings explicitly supplied for this input. */
1601
1777
  readonly credential?: {
@@ -1609,14 +1785,14 @@ interface RuntimeSubmitInput {
1609
1785
  }
1610
1786
  type RuntimeSubmitInputResult = {
1611
1787
  readonly accepted: true;
1612
- readonly delivery: 'after_turn';
1788
+ readonly delivery: "after_turn";
1613
1789
  readonly runId: string;
1614
1790
  readonly sessionId: string;
1615
1791
  readonly afterRunId: string;
1616
1792
  readonly sessionOrder: number;
1617
1793
  } | {
1618
1794
  readonly accepted: true;
1619
- readonly delivery: 'interrupt';
1795
+ readonly delivery: "interrupt";
1620
1796
  readonly inputId: string;
1621
1797
  /** The existing active Run that owns this input; no new Run is created. */
1622
1798
  readonly runId: string;
@@ -1625,32 +1801,32 @@ type RuntimeSubmitInputResult = {
1625
1801
  readonly sessionOrder: number;
1626
1802
  } | {
1627
1803
  readonly accepted: false;
1628
- readonly delivery: 'after_turn' | 'interrupt';
1804
+ readonly delivery: "after_turn" | "interrupt";
1629
1805
  readonly sessionId: string;
1630
1806
  readonly afterRunId: string;
1631
- readonly reason: 'stale_run' | 'unsupported_capability' | 'interrupt_window_closed';
1807
+ readonly reason: "stale_run" | "unsupported_capability" | "interrupt_window_closed";
1632
1808
  };
1633
1809
  interface RuntimeOperationOptions {
1634
1810
  readonly operationId?: string;
1635
1811
  readonly journalEpoch?: string;
1636
1812
  readonly expectedRevision?: number;
1637
1813
  }
1638
- type RuntimeKodaXOptions = Omit<KodaXOptions, 'provider' | 'session' | 'events'> & {
1814
+ type RuntimeKodaXOptions = Omit<KodaXOptions, "provider" | "session" | "events"> & {
1639
1815
  readonly provider?: string;
1640
- readonly session?: KodaXOptions['session'];
1816
+ readonly session?: KodaXOptions["session"];
1641
1817
  readonly events?: KodaXEvents;
1642
1818
  };
1643
- type RuntimeDaemonContextOptions = Pick<KodaXContextOptions, 'memoryIdentity' | 'gitRoot' | 'executionCwd' | 'shellExecution' | 'contextTokenSnapshot' | 'projectSnapshot' | 'longRunning' | 'providerPolicyHints' | 'repoRoutingSignals' | 'repoIntelligenceMode' | 'repoIntelligenceTrace' | 'contextDiagnostics' | 'disableAutoTaskReroute' | 'toolConstructionMode' | 'skillsPrompt' | 'rawUserInput' | 'skillInvocation' | 'repoIntelligenceContext' | 'inputArtifacts' | 'promptOverlay' | 'taskSurface' | 'liveTurn' | 'managedTaskWorkspaceDir' | 'managedProtocolEmission' | 'excludeTools' | 'systemPromptOverride' | 'taskMetadata' | 'taskVerification' | 'agentProfile' | 'currentAgentId' | 'parentAgentId'>;
1644
- type RuntimeDaemonKodaXOptions = Pick<RuntimeKodaXOptions, 'provider' | 'model' | 'modelOverride' | 'effort' | 'thinking' | 'reasoningMode' | 'agentMode' | 'maxIter' | 'workflowHostPolicy' | 'workflowRunsBaseDir' | 'modelTiers' | 'maxOutputTokens' | 'disablePromptCache' | 'lsp' | 'workflow' | 'selfManual' | 'compaction' | 'timeouts'> & {
1819
+ type RuntimeDaemonContextOptions = Pick<KodaXContextOptions, "gitRoot" | "executionCwd" | "shellExecution" | "contextTokenSnapshot" | "projectSnapshot" | "longRunning" | "providerPolicyHints" | "repoRoutingSignals" | "repoIntelligenceMode" | "repoIntelligenceTrace" | "contextDiagnostics" | "disableAutoTaskReroute" | "toolConstructionMode" | "skillsPrompt" | "rawUserInput" | "skillInvocation" | "repoIntelligenceContext" | "inputArtifacts" | "promptOverlay" | "taskSurface" | "liveTurn" | "managedTaskWorkspaceDir" | "managedProtocolEmission" | "excludeTools" | "systemPromptOverride" | "taskMetadata" | "taskVerification" | "agentProfile" | "currentAgentId" | "parentAgentId">;
1820
+ type RuntimeDaemonKodaXOptions = Pick<RuntimeKodaXOptions, "provider" | "model" | "modelOverride" | "effort" | "thinking" | "reasoningMode" | "agentMode" | "maxIter" | "workflowHostPolicy" | "workflowRunsBaseDir" | "modelTiers" | "maxOutputTokens" | "disablePromptCache" | "lsp" | "workflow" | "selfManual" | "compaction" | "timeouts" | "sandbox"> & {
1645
1821
  readonly context?: RuntimeDaemonContextOptions;
1646
1822
  };
1647
- type RuntimeDaemonStartRunInput = Omit<RuntimeStartRunInput, 'options' | 'agentContext' | 'permissionBroker'> & {
1823
+ type RuntimeDaemonStartRunInput = Omit<RuntimeStartRunInput, "options" | "agentContext" | "permissionBroker"> & {
1648
1824
  readonly options?: RuntimeDaemonKodaXOptions;
1649
1825
  };
1650
- interface RuntimeDaemonRunService extends Omit<RuntimeRunService, 'start'> {
1826
+ interface RuntimeDaemonRunService extends Omit<RuntimeRunService, "start"> {
1651
1827
  start(input: RuntimeDaemonStartRunInput): Promise<RuntimeRunHandle>;
1652
1828
  }
1653
- type KodaXDaemonRuntime = Omit<KodaXRuntime, 'runs'> & {
1829
+ type KodaXDaemonRuntime = Omit<KodaXRuntime, "runs"> & {
1654
1830
  readonly runs: RuntimeDaemonRunService;
1655
1831
  readonly daemon: RuntimeDaemonManagementService;
1656
1832
  };
@@ -1659,6 +1835,11 @@ interface RuntimeRunStatus {
1659
1835
  readonly sessionId: string;
1660
1836
  readonly turnId?: string;
1661
1837
  readonly phase: RuntimeRunPhase;
1838
+ /** Fine-grained executor stage within the coarse lifecycle phase. */
1839
+ readonly stage?: RuntimeRunStage;
1840
+ readonly stageChangedAt?: string;
1841
+ /** Present only when the managed executor reported an authoritative count. */
1842
+ readonly activeSubtaskCount?: number;
1662
1843
  readonly startedAt: string;
1663
1844
  /** Durable acceptance timestamp; equals startedAt for protocol v1. */
1664
1845
  readonly acceptedAt?: string;
@@ -1678,45 +1859,71 @@ interface RuntimeRunStatus {
1678
1859
  readonly model?: string;
1679
1860
  readonly reasoning?: KodaXReasoningMode;
1680
1861
  readonly error?: string;
1862
+ readonly lifecycleError?: RuntimeRunLifecycleError;
1681
1863
  readonly terminal?: RuntimeTerminalFact;
1682
1864
  readonly continuation?: RuntimeContinuationStatus;
1683
1865
  readonly interruptInputs?: readonly RuntimeInterruptInputStatus[];
1866
+ /** Durable Stop request/result; distinct from chat interruptInputs. */
1867
+ readonly stop?: RuntimeRunStopStatus;
1684
1868
  readonly requirements?: RuntimeRunRequirements;
1685
1869
  }
1870
+ interface RuntimeRunLifecycleError {
1871
+ readonly code: "actor_settlement_retrying" | "actor_settlement_not_persisted";
1872
+ readonly message: string;
1873
+ readonly retryable: boolean;
1874
+ }
1686
1875
  interface RuntimeRunRequirements {
1687
1876
  readonly credential?: {
1688
1877
  readonly leaseId: string;
1689
1878
  readonly provider: string;
1690
- readonly state: 'ready' | 'expired' | 'terminal';
1879
+ readonly state: "ready" | "expired" | "terminal";
1691
1880
  };
1692
1881
  readonly hostTools?: {
1693
1882
  readonly leaseId: string;
1694
- readonly state: 'ready' | 'waiting_host' | 'expired' | 'terminal';
1883
+ readonly state: "ready" | "waiting_host" | "expired" | "terminal";
1695
1884
  };
1696
1885
  }
1697
1886
  interface RuntimeContinuationStatus {
1698
1887
  readonly inputId: string;
1699
1888
  readonly afterRunId: string;
1700
- readonly delivery: 'after_turn';
1701
- readonly state: 'queued' | 'delivered' | 'terminal';
1889
+ readonly delivery: "after_turn";
1890
+ readonly state: "queued" | "delivered" | "terminal";
1702
1891
  readonly contentPreview: string;
1703
1892
  }
1704
1893
  interface RuntimeInterruptInputStatus {
1705
1894
  readonly inputId: string;
1706
1895
  readonly afterRunId: string;
1707
- readonly delivery: 'interrupt';
1708
- readonly state: 'queued' | 'delivered' | 'terminal';
1896
+ readonly delivery: "interrupt";
1897
+ readonly state: "queued" | "delivered" | "terminal";
1709
1898
  readonly contentPreview: string;
1710
1899
  readonly queuedAt: string;
1711
1900
  readonly deliveredAt?: string;
1712
- readonly origin?: RuntimeRunStatus['origin'];
1901
+ readonly origin?: RuntimeRunStatus["origin"];
1902
+ }
1903
+ interface RuntimeRunStopStatus {
1904
+ readonly requestedAt: string;
1905
+ readonly state: "unknown" | "confirmed";
1906
+ readonly outcome: "unknown" | "cancelled" | "interrupted" | "completed" | "failed";
1907
+ readonly reason: string;
1908
+ readonly resolvedAt?: string;
1713
1909
  }
1714
- type RuntimeTerminalCode = 'completed' | 'run_failed' | 'blocked' | 'cancelled' | 'interrupted' | 'runtime_restarted' | 'daemon_crashed' | 'credential_unavailable' | 'host_not_dispatched' | 'host_outcome_unknown' | 'control_history_untrusted';
1910
+ interface RuntimeRunStopReceipt {
1911
+ readonly runId: string;
1912
+ readonly sessionId: string;
1913
+ /** True only when this invocation durably created the Stop request. */
1914
+ readonly accepted: boolean;
1915
+ readonly state: RuntimeRunStopStatus["state"];
1916
+ readonly outcome: RuntimeRunStopStatus["outcome"];
1917
+ readonly phase: RuntimeRunPhase;
1918
+ /** Durable Run control-record revision observed by this receipt. */
1919
+ readonly revision: number;
1920
+ }
1921
+ type RuntimeTerminalCode = "completed" | "run_failed" | "blocked" | "cancelled" | "interrupted" | "runtime_restarted" | "daemon_crashed" | "credential_unavailable" | "host_not_dispatched" | "host_outcome_unknown" | "control_history_untrusted";
1715
1922
  interface RuntimeTerminalFact {
1716
1923
  readonly revision: number;
1717
- readonly kind: 'completed' | 'failed' | 'cancelled' | 'interrupted';
1924
+ readonly kind: "completed" | "failed" | "cancelled" | "interrupted";
1718
1925
  readonly code: RuntimeTerminalCode;
1719
- readonly effectOutcome: 'none' | 'known' | 'unknown';
1926
+ readonly effectOutcome: "none" | "known" | "unknown";
1720
1927
  readonly message?: string;
1721
1928
  }
1722
1929
  interface RuntimeRunResult {
@@ -1726,6 +1933,7 @@ interface RuntimeRunResult {
1726
1933
  readonly result?: KodaXResult;
1727
1934
  readonly error?: Error;
1728
1935
  readonly terminal?: RuntimeTerminalFact;
1936
+ readonly stop?: RuntimeRunStopStatus;
1729
1937
  }
1730
1938
  interface RuntimeRunHandle {
1731
1939
  readonly runId: string;
@@ -1743,12 +1951,12 @@ interface RuntimeRunService {
1743
1951
  await(runId: string): Promise<RuntimeRunResult>;
1744
1952
  get(runId: string): Promise<RuntimeRunStatus>;
1745
1953
  list(filter?: RuntimeRunFilter): Promise<readonly RuntimeRunStatus[]>;
1746
- abort(runId: string): Promise<void>;
1954
+ abort(runId: string): Promise<RuntimeRunStopReceipt>;
1747
1955
  setModel(runId: string, model: string | undefined): Promise<void>;
1748
1956
  setProvider(runId: string, provider: string): Promise<void>;
1749
1957
  setReasoning(runId: string, reasoning: KodaXReasoningMode | undefined): Promise<void>;
1750
1958
  }
1751
- type RuntimeEventType = 'session.created' | 'session.loaded' | 'session.settings.updated' | 'session.notice.appended' | 'session.rewound' | 'session.active_entry.updated' | 'session.compacted' | 'run.queued' | 'run.started' | 'run.updated' | 'run.progress' | 'run.input.queued' | 'run.input.delivered' | 'turn.started' | 'turn.completed' | 'turn.failed' | 'assistant.delta' | 'thinking.delta' | 'thinking.finished' | 'tool.started' | 'tool.progress' | 'tool.finished' | 'user_input.requested' | 'user_input.resolved' | 'permission.requested' | 'permission.resolved' | 'permission.grant.changed' | 'workflow.started' | 'workflow.updated' | 'workflow.finished' | 'context.compaction.started' | 'context.compaction.stats' | 'context.compaction.finished' | 'context.compaction.messages' | 'context.compaction.ended' | 'context.compaction.skipped' | 'context.budget.snapshot' | 'tool.exposure.planned' | 'child_activity.finished' | 'provider.retry' | 'provider.recovery' | 'provider.cache.diagnostics' | 'repo_intelligence.trace' | 'todo.updated' | 'todo.warning' | 'sidecar.message' | 'run.completed' | 'run.failed' | 'run.cancelled' | 'run.interrupted' | 'artifact.created' | 'config.effective' | 'runtime.warning';
1959
+ type RuntimeEventType = "session.created" | "session.loaded" | "session.settings.updated" | "session.notice.appended" | "session.rewound" | "session.active_entry.updated" | "session.compacted" | "run.queued" | "run.started" | "run.updated" | "run.progress" | "run.input.queued" | "run.input.delivered" | "turn.started" | "turn.completed" | "turn.failed" | "assistant.delta" | "thinking.delta" | "thinking.finished" | "tool.started" | "tool.progress" | "tool.sandbox" | "tool.finished" | "user_input.requested" | "user_input.resolved" | "permission.requested" | "permission.resolved" | "permission.grant.changed" | "workflow.started" | "workflow.updated" | "workflow.finished" | "context.compaction.started" | "context.compaction.stats" | "context.compaction.finished" | "context.compaction.messages" | "context.compaction.ended" | "context.compaction.skipped" | "context.budget.snapshot" | "tool.exposure.planned" | "child_activity.finished" | "provider.retry" | "provider.recovery" | "provider.cache.diagnostics" | "repo_intelligence.trace" | "todo.updated" | "todo.warning" | "sidecar.message" | "run.completed" | "run.failed" | "run.cancelled" | "run.interrupted" | "artifact.created" | "config.effective" | "runtime.warning";
1752
1960
  interface RuntimeTextDeltaEventPayload {
1753
1961
  readonly text: string;
1754
1962
  readonly meta?: KodaXActivityEventMeta;
@@ -1776,6 +1984,10 @@ type RuntimeToolProgressEventPayload = {
1776
1984
  readonly partialJson: string;
1777
1985
  readonly meta?: KodaXToolEventMeta;
1778
1986
  };
1987
+ interface RuntimeToolSandboxEventPayload {
1988
+ readonly update: KodaXToolSandboxObservationUpdate;
1989
+ readonly meta?: KodaXToolEventMeta;
1990
+ }
1779
1991
  interface RuntimeToolFinishedEventPayload {
1780
1992
  readonly result: {
1781
1993
  readonly id: string;
@@ -1785,21 +1997,21 @@ interface RuntimeToolFinishedEventPayload {
1785
1997
  readonly meta?: KodaXToolEventMeta;
1786
1998
  }
1787
1999
  type RuntimeRunProgressEventPayload = {
1788
- readonly kind: 'managed_task_status';
2000
+ readonly kind: "managed_task_status";
1789
2001
  readonly status: KodaXManagedTaskStatusEvent;
1790
2002
  } | {
1791
- readonly kind: 'stream_end' | 'complete';
2003
+ readonly kind: "stream_end" | "complete";
1792
2004
  readonly meta?: KodaXActivityEventMeta;
1793
2005
  } | {
1794
- readonly kind: 'iteration_start';
2006
+ readonly kind: "iteration_start";
1795
2007
  readonly iter: number;
1796
2008
  readonly maxIter: number;
1797
2009
  readonly meta?: KodaXActivityEventMeta;
1798
2010
  } | {
1799
- readonly kind: 'iteration_end';
2011
+ readonly kind: "iteration_end";
1800
2012
  readonly info: Readonly<Record<string, unknown>>;
1801
2013
  } | {
1802
- readonly kind: 'mid_turn_user_messages';
2014
+ readonly kind: "mid_turn_user_messages";
1803
2015
  readonly contents: readonly string[];
1804
2016
  readonly meta?: KodaXActivityEventMeta;
1805
2017
  };
@@ -1816,7 +2028,7 @@ interface RuntimeDeliveredInterruptInput {
1816
2028
  readonly input: RuntimeInput | readonly RuntimeInput[];
1817
2029
  readonly queuedAt: string;
1818
2030
  readonly deliveredAt: string;
1819
- readonly origin?: RuntimeRunStatus['origin'];
2031
+ readonly origin?: RuntimeRunStatus["origin"];
1820
2032
  }
1821
2033
  interface RuntimeRunInputDeliveredEventPayload {
1822
2034
  readonly inputs: readonly RuntimeDeliveredInterruptInput[];
@@ -1828,7 +2040,7 @@ interface RuntimeInteractionResolvedEventPayload {
1828
2040
  readonly kind?: RuntimeUserInputKind;
1829
2041
  }
1830
2042
  interface RuntimePermissionGrantChangedEventPayload {
1831
- readonly action: 'created' | 'revoked' | 'expired';
2043
+ readonly action: "created" | "revoked" | "expired";
1832
2044
  readonly grant: RuntimePermissionGrant;
1833
2045
  readonly revision: number;
1834
2046
  }
@@ -1871,44 +2083,45 @@ type RuntimeUserInputRequestedEventPayload = RuntimeUserInputRequest | {
1871
2083
  type RuntimeEventPayloadDefaults = {
1872
2084
  readonly [K in RuntimeEventType]: unknown;
1873
2085
  };
1874
- type RuntimeEventPayloadMap = Omit<RuntimeEventPayloadDefaults, 'session.created' | 'session.loaded' | 'run.queued' | 'run.started' | 'run.updated' | 'run.completed' | 'run.failed' | 'run.cancelled' | 'run.interrupted' | 'assistant.delta' | 'thinking.delta' | 'thinking.finished' | 'tool.started' | 'tool.progress' | 'tool.finished' | 'run.progress' | 'run.input.queued' | 'run.input.delivered' | 'todo.updated' | 'user_input.requested' | 'user_input.resolved' | 'permission.requested' | 'permission.resolved' | 'permission.grant.changed' | 'session.settings.updated' | 'turn.started' | 'turn.completed' | 'turn.failed' | 'workflow.started' | 'workflow.updated' | 'workflow.finished' | 'context.budget.snapshot' | 'provider.cache.diagnostics' | 'tool.exposure.planned' | 'context.compaction.messages' | 'context.compaction.finished' | 'runtime.warning'> & {
1875
- readonly 'session.created': RuntimeSession;
1876
- readonly 'session.loaded': RuntimeSessionLoadedEventPayload;
1877
- readonly 'run.queued': RuntimeRunStatus;
1878
- readonly 'run.started': RuntimeRunStatus;
1879
- readonly 'run.updated': RuntimeRunStatus;
1880
- readonly 'run.completed': RuntimeRunStatus;
1881
- readonly 'run.failed': RuntimeRunStatus;
1882
- readonly 'run.cancelled': RuntimeRunStatus;
1883
- readonly 'run.interrupted': RuntimeRunStatus;
1884
- readonly 'assistant.delta': RuntimeTextDeltaEventPayload;
1885
- readonly 'thinking.delta': RuntimeTextDeltaEventPayload;
1886
- readonly 'thinking.finished': RuntimeThinkingFinishedEventPayload;
1887
- readonly 'tool.started': RuntimeToolStartedEventPayload;
1888
- readonly 'tool.progress': RuntimeToolProgressEventPayload;
1889
- readonly 'tool.finished': RuntimeToolFinishedEventPayload;
1890
- readonly 'run.progress': RuntimeRunProgressEventPayload;
1891
- readonly 'run.input.queued': RuntimeRunInputQueuedEventPayload;
1892
- readonly 'run.input.delivered': RuntimeRunInputDeliveredEventPayload;
1893
- readonly 'todo.updated': RuntimeTodoUpdatedEventPayload;
1894
- readonly 'user_input.requested': RuntimeUserInputRequestedEventPayload;
1895
- readonly 'user_input.resolved': RuntimeInteractionResolvedEventPayload;
1896
- readonly 'permission.requested': RuntimePermissionRequest;
1897
- readonly 'permission.resolved': RuntimeInteractionResolvedEventPayload;
1898
- readonly 'permission.grant.changed': RuntimePermissionGrantChangedEventPayload;
1899
- readonly 'session.settings.updated': RuntimeSessionSettingsUpdatedEventPayload;
1900
- readonly 'turn.started': KodaXTurnStartedEvent;
1901
- readonly 'turn.completed': KodaXTurnCompletedEvent;
1902
- readonly 'turn.failed': KodaXTurnFailedEvent;
1903
- readonly 'workflow.started': WorkflowProcessEvent;
1904
- readonly 'workflow.updated': WorkflowProcessEvent;
1905
- readonly 'workflow.finished': WorkflowProcessEvent;
1906
- readonly 'context.budget.snapshot': RuntimeContextBudgetSnapshot;
1907
- readonly 'provider.cache.diagnostics': KodaXPromptCacheDiagnosticEvent;
1908
- readonly 'tool.exposure.planned': RuntimeToolExposurePlan;
1909
- readonly 'context.compaction.messages': RuntimeContextCompactionMessagesEventPayload;
1910
- readonly 'context.compaction.finished': RuntimeContextCompactionFinishedEventPayload;
1911
- readonly 'runtime.warning': RuntimeWarningEventPayload;
2086
+ type RuntimeEventPayloadMap = Omit<RuntimeEventPayloadDefaults, "session.created" | "session.loaded" | "run.queued" | "run.started" | "run.updated" | "run.completed" | "run.failed" | "run.cancelled" | "run.interrupted" | "assistant.delta" | "thinking.delta" | "thinking.finished" | "tool.started" | "tool.progress" | "tool.sandbox" | "tool.finished" | "run.progress" | "run.input.queued" | "run.input.delivered" | "todo.updated" | "user_input.requested" | "user_input.resolved" | "permission.requested" | "permission.resolved" | "permission.grant.changed" | "session.settings.updated" | "turn.started" | "turn.completed" | "turn.failed" | "workflow.started" | "workflow.updated" | "workflow.finished" | "context.budget.snapshot" | "provider.cache.diagnostics" | "tool.exposure.planned" | "context.compaction.messages" | "context.compaction.finished" | "runtime.warning"> & {
2087
+ readonly "session.created": RuntimeSession;
2088
+ readonly "session.loaded": RuntimeSessionLoadedEventPayload;
2089
+ readonly "run.queued": RuntimeRunStatus;
2090
+ readonly "run.started": RuntimeRunStatus;
2091
+ readonly "run.updated": RuntimeRunStatus;
2092
+ readonly "run.completed": RuntimeRunStatus;
2093
+ readonly "run.failed": RuntimeRunStatus;
2094
+ readonly "run.cancelled": RuntimeRunStatus;
2095
+ readonly "run.interrupted": RuntimeRunStatus;
2096
+ readonly "assistant.delta": RuntimeTextDeltaEventPayload;
2097
+ readonly "thinking.delta": RuntimeTextDeltaEventPayload;
2098
+ readonly "thinking.finished": RuntimeThinkingFinishedEventPayload;
2099
+ readonly "tool.started": RuntimeToolStartedEventPayload;
2100
+ readonly "tool.progress": RuntimeToolProgressEventPayload;
2101
+ readonly "tool.sandbox": RuntimeToolSandboxEventPayload;
2102
+ readonly "tool.finished": RuntimeToolFinishedEventPayload;
2103
+ readonly "run.progress": RuntimeRunProgressEventPayload;
2104
+ readonly "run.input.queued": RuntimeRunInputQueuedEventPayload;
2105
+ readonly "run.input.delivered": RuntimeRunInputDeliveredEventPayload;
2106
+ readonly "todo.updated": RuntimeTodoUpdatedEventPayload;
2107
+ readonly "user_input.requested": RuntimeUserInputRequestedEventPayload;
2108
+ readonly "user_input.resolved": RuntimeInteractionResolvedEventPayload;
2109
+ readonly "permission.requested": RuntimePermissionRequest;
2110
+ readonly "permission.resolved": RuntimeInteractionResolvedEventPayload;
2111
+ readonly "permission.grant.changed": RuntimePermissionGrantChangedEventPayload;
2112
+ readonly "session.settings.updated": RuntimeSessionSettingsUpdatedEventPayload;
2113
+ readonly "turn.started": KodaXTurnStartedEvent;
2114
+ readonly "turn.completed": KodaXTurnCompletedEvent;
2115
+ readonly "turn.failed": KodaXTurnFailedEvent;
2116
+ readonly "workflow.started": WorkflowProcessEvent;
2117
+ readonly "workflow.updated": WorkflowProcessEvent;
2118
+ readonly "workflow.finished": WorkflowProcessEvent;
2119
+ readonly "context.budget.snapshot": RuntimeContextBudgetSnapshot;
2120
+ readonly "provider.cache.diagnostics": KodaXPromptCacheDiagnosticEvent;
2121
+ readonly "tool.exposure.planned": RuntimeToolExposurePlan;
2122
+ readonly "context.compaction.messages": RuntimeContextCompactionMessagesEventPayload;
2123
+ readonly "context.compaction.finished": RuntimeContextCompactionFinishedEventPayload;
2124
+ readonly "runtime.warning": RuntimeWarningEventPayload;
1912
2125
  };
1913
2126
  interface RuntimeEventEnvelope<TPayload = unknown> {
1914
2127
  readonly id: string;
@@ -1954,7 +2167,7 @@ interface RuntimeEventService {
1954
2167
  subscribe(filter: RuntimeEventFilter, listener: RuntimeEventListener): RuntimeSubscription;
1955
2168
  replay(filter?: RuntimeEventReplayFilter): Promise<readonly RuntimeEvent[]>;
1956
2169
  }
1957
- type RuntimePermissionRisk = 'low' | 'medium' | 'high';
2170
+ type RuntimePermissionRisk = "low" | "medium" | "high";
1958
2171
  interface RuntimePermissionScope {
1959
2172
  readonly toolName?: string;
1960
2173
  readonly sessionId?: string;
@@ -1964,7 +2177,7 @@ interface RuntimePermissionScope {
1964
2177
  interface RuntimePermissionGrantSuggestion {
1965
2178
  /** Opaque pending-request-local identifier; clients must return it unchanged. */
1966
2179
  readonly id: string;
1967
- readonly kind: 'session' | 'persistent';
2180
+ readonly kind: "session" | "persistent";
1968
2181
  readonly label: string;
1969
2182
  }
1970
2183
  interface RuntimePermissionRequest {
@@ -1979,6 +2192,8 @@ interface RuntimePermissionRequest {
1979
2192
  readonly inputPreview?: string;
1980
2193
  /** Effective directory used to resolve relative tool paths for this run. */
1981
2194
  readonly executionCwd?: string;
2195
+ /** Structured Auto[LLM] decision metadata; never includes prompt or response text. */
2196
+ readonly autoModeDiagnostics?: AutoModeDecisionDiagnostics;
1982
2197
  readonly grantSuggestions?: readonly RuntimePermissionGrantSuggestion[];
1983
2198
  readonly createdAt: string;
1984
2199
  readonly expiresAt?: string;
@@ -1993,6 +2208,8 @@ interface RuntimePermissionRequestInput {
1993
2208
  readonly risk?: RuntimePermissionRisk;
1994
2209
  readonly inputPreview?: string;
1995
2210
  readonly executionCwd?: string;
2211
+ /** Structured Auto[LLM] decision metadata; never includes prompt or response text. */
2212
+ readonly autoModeDiagnostics?: AutoModeDecisionDiagnostics;
1996
2213
  readonly expiresAt?: string;
1997
2214
  readonly timeoutMs?: number;
1998
2215
  /**
@@ -2002,12 +2219,12 @@ interface RuntimePermissionRequestInput {
2002
2219
  readonly toolInput?: Readonly<Record<string, unknown>>;
2003
2220
  }
2004
2221
  type RuntimePermissionDecision = {
2005
- readonly type: 'allow_once';
2222
+ readonly type: "allow_once";
2006
2223
  } | {
2007
- readonly type: 'allow_session';
2224
+ readonly type: "allow_session";
2008
2225
  readonly suggestionId: string;
2009
2226
  } | {
2010
- readonly type: 'allow_always';
2227
+ readonly type: "allow_always";
2011
2228
  readonly suggestionId: string;
2012
2229
  }
2013
2230
  /**
@@ -2015,11 +2232,12 @@ type RuntimePermissionDecision = {
2015
2232
  * its narrower concrete candidate and never persists the supplied scope.
2016
2233
  */
2017
2234
  | {
2018
- readonly type: 'allow_always';
2235
+ readonly type: "allow_always";
2019
2236
  readonly scope: RuntimePermissionScope;
2020
2237
  } | {
2021
- readonly type: 'reject';
2238
+ readonly type: "reject";
2022
2239
  readonly reason?: string;
2240
+ readonly cause?: "approval_timeout";
2023
2241
  };
2024
2242
  interface RuntimePermissionFilter {
2025
2243
  readonly sessionId?: string;
@@ -2033,7 +2251,7 @@ interface RuntimePermissionGrant {
2033
2251
  readonly id: string;
2034
2252
  readonly scope: RuntimePermissionScope;
2035
2253
  readonly createdAt: string;
2036
- readonly persistence?: 'session' | 'persistent';
2254
+ readonly persistence?: "session" | "persistent";
2037
2255
  readonly label?: string;
2038
2256
  readonly sourcePermissionId?: string;
2039
2257
  }
@@ -2044,7 +2262,7 @@ interface RuntimePermissionService {
2044
2262
  listGrants(): Promise<RuntimeVersionedValue<readonly RuntimePermissionGrant[]>>;
2045
2263
  revokeGrant(grantId: string, expectedRevision: number): Promise<boolean>;
2046
2264
  }
2047
- type RuntimeUserInputKind = 'askUser' | 'askUserMulti' | 'askUserInput';
2265
+ type RuntimeUserInputKind = "askUser" | "askUserMulti" | "askUserInput";
2048
2266
  interface RuntimeUserInputRequest {
2049
2267
  readonly id: string;
2050
2268
  readonly revision: number;
@@ -2063,7 +2281,7 @@ interface RuntimeUserInputFilter {
2063
2281
  interface RuntimeUserInputResolution {
2064
2282
  readonly requestId: string;
2065
2283
  readonly accepted: boolean;
2066
- readonly status: 'answered' | 'dismissed' | 'already_resolved';
2284
+ readonly status: "answered" | "dismissed" | "already_resolved";
2067
2285
  }
2068
2286
  interface RuntimeUserInputService {
2069
2287
  listPending(filter?: RuntimeUserInputFilter): Promise<readonly RuntimeUserInputRequest[]>;
@@ -2100,7 +2318,7 @@ interface RuntimeHostToolDescriptor {
2100
2318
  readonly name: string;
2101
2319
  readonly description: string;
2102
2320
  readonly inputSchema: Readonly<Record<string, unknown>>;
2103
- readonly sideEffect: 'none' | 'idempotent' | 'non_idempotent';
2321
+ readonly sideEffect: "none" | "idempotent" | "non_idempotent";
2104
2322
  }
2105
2323
  interface RuntimeHostToolInvocation {
2106
2324
  readonly invocationId: string;
@@ -2125,7 +2343,7 @@ interface RuntimeHostToolInvocationStatus {
2125
2343
  readonly toolName: string;
2126
2344
  readonly sessionId: string;
2127
2345
  readonly runId: string;
2128
- readonly state: 'prepared' | 'dispatched' | 'completed' | 'unknown' | 'not_dispatched';
2346
+ readonly state: "prepared" | "dispatched" | "completed" | "unknown" | "not_dispatched";
2129
2347
  readonly updatedAt: string;
2130
2348
  }
2131
2349
  interface RuntimeHostToolService {
@@ -2171,7 +2389,7 @@ interface RuntimeDaemonPreflight {
2171
2389
  readonly activeAgentTasks: readonly RuntimeActiveAgentTurn[];
2172
2390
  readonly pendingPermissions: readonly RuntimePermissionRequest[];
2173
2391
  readonly pendingUserInputs: readonly RuntimeUserInputRequest[];
2174
- readonly blockers: readonly ('connected_clients' | 'active_runs' | 'queued_runs' | 'active_workflows' | 'active_agent_turns' | 'active_agent_tasks' | 'pending_interactions')[];
2392
+ readonly blockers: readonly ("connected_clients" | "active_runs" | "queued_runs" | "active_workflows" | "active_agent_turns" | "active_agent_tasks" | "pending_interactions")[];
2175
2393
  readonly canStop: boolean;
2176
2394
  }
2177
2395
  interface RuntimeActiveAgentTurn {
@@ -2180,6 +2398,24 @@ interface RuntimeActiveAgentTurn {
2180
2398
  readonly turnId: string;
2181
2399
  readonly kind: AgentExecutionKind;
2182
2400
  }
2401
+ interface RuntimeIntegrationDiagnostic {
2402
+ readonly code: "invalid-config" | "activation-failed" | "watcher-degraded";
2403
+ readonly message: string;
2404
+ readonly time: string;
2405
+ }
2406
+ interface RuntimeIntegrationDomainStatus {
2407
+ readonly domain: "mcp" | "a2a" | "extensions";
2408
+ readonly path: string;
2409
+ readonly revision?: string;
2410
+ readonly source?: "user" | "legacy-user" | "default";
2411
+ readonly lastReloadAt?: string;
2412
+ readonly diagnostic?: RuntimeIntegrationDiagnostic;
2413
+ readonly watching: boolean;
2414
+ }
2415
+ interface RuntimeIntegrationHealth {
2416
+ readonly state: "healthy" | "degraded";
2417
+ readonly domains: readonly RuntimeIntegrationDomainStatus[];
2418
+ }
2183
2419
  interface RuntimeDaemonManagementState {
2184
2420
  readonly runtimeId: string;
2185
2421
  /** Monotonic for logical client, mutation, Runtime event, and preflight state changes. */
@@ -2187,6 +2423,8 @@ interface RuntimeDaemonManagementState {
2187
2423
  readonly ownerPolicy: RuntimeOwnerPolicyState;
2188
2424
  readonly owner: RuntimeOwnerIdentity;
2189
2425
  readonly preflight: RuntimeDaemonPreflight;
2426
+ /** Optional integrations never make the core daemon unavailable. */
2427
+ readonly integrations?: RuntimeIntegrationHealth;
2190
2428
  }
2191
2429
  interface RuntimeDaemonRollbackInput {
2192
2430
  readonly expectedRuntimeId: string;
@@ -2199,7 +2437,7 @@ interface RuntimeDaemonRollbackResult {
2199
2437
  readonly runtimeId: string;
2200
2438
  readonly revision: number;
2201
2439
  readonly ownerPolicy: RuntimeOwnerPolicyState & {
2202
- readonly mode: 'inline';
2440
+ readonly mode: "inline";
2203
2441
  };
2204
2442
  }
2205
2443
  interface RuntimeDaemonManagementService {
@@ -2210,11 +2448,16 @@ interface RuntimeStatusService {
2210
2448
  snapshot(): Promise<RuntimeStatusSnapshot>;
2211
2449
  preflight(): Promise<RuntimeDaemonPreflight>;
2212
2450
  }
2451
+ /**
2452
+ * Capture one read-only, boundary-labelled diagnostic record without taking
2453
+ * ownership of, resuming, or otherwise mutating the Session.
2454
+ */
2455
+ declare function captureRuntimeSessionDiagnostics(runtime: KodaXRuntime, input: RuntimeSessionDiagnosticsInput): Promise<RuntimeSessionDiagnostics>;
2213
2456
  declare function createKodaXRuntime(options: CreateKodaXRuntimeOptions & {
2214
- readonly mode: 'daemon';
2457
+ readonly mode: "daemon";
2215
2458
  }): Promise<KodaXDaemonRuntime>;
2216
2459
  declare function createKodaXRuntime(options?: CreateKodaXRuntimeOptions): Promise<KodaXRuntime>;
2217
2460
  declare function connectKodaXRuntime(options?: ConnectKodaXRuntimeOptions): Promise<KodaXDaemonRuntime>;
2218
2461
 
2219
- export { KODAX_DAEMON_PROTOCOL, KODAX_DAEMON_PROTOCOL_VERSION, KodaXEvents, KodaXPromptCacheDiagnosticEvent, KodaXResult, RUNTIME_DAEMON_METHODS, RUNTIME_DAEMON_METHOD_SCHEMAS, RUNTIME_DAEMON_NOTIFICATION_SCHEMAS, RUNTIME_DAEMON_PROTOCOL_SCHEMA, RUNTIME_DAEMON_PROTOCOL_SCHEMA_JSON, RuntimeAutoModeConfigurationError, RuntimeContextBudgetSnapshot, RuntimeDaemonCapabilityUpgradeError, RuntimePermissionScopeUpgradeRequiredError, RuntimeToolExposurePlan, RuntimeTransportBoundaryError, SessionTranscriptEntry, acquireKodaXInlineOwner, connectKodaXRuntime, createKodaXRuntime, enableKodaXDaemonOwner, getKodaXRuntimeOwnerPolicy, getKodaXRuntimeOwnerState, listRuntimeDaemonSchemaMethods, parseRuntimeEvent, setKodaXRuntimeOwnerMode };
2220
- export type { ConnectKodaXRuntimeOptions, CreateKodaXRuntimeOptions, KodaXDaemonRuntime, KodaXRuntime, KodaXRuntimeIsolation, KodaXRuntimeMode, RuntimeActiveAgentTurn, RuntimeActiveToolProjection, RuntimeAdminService, RuntimeAgentBindingService, RuntimeAgentOwnerSession, RuntimeAgentService, RuntimeAppendNoticeInput, RuntimeArtifact, RuntimeArtifactKind, RuntimeArtifactRefInput, RuntimeArtifactService, RuntimeBoundDefaultAgent, RuntimeBoundLocalAgent, RuntimeCapabilityRequirements, RuntimeCatalogService, RuntimeClientCapabilities, RuntimeClientInfo, RuntimeCommandInfo, RuntimeCommandResolveInput, RuntimeCompactSessionInput, RuntimeCompactSessionResult, RuntimeConfigPatch, RuntimeConfigReloadResult, RuntimeConfigService, RuntimeConnectionService, RuntimeConnectionState, RuntimeContextCompactionFinishedEventPayload, RuntimeContextCompactionMessagesEventPayload, RuntimeContinuationStatus, RuntimeCreateArtifactInput, RuntimeCreateSessionInput, RuntimeCredentialBroker, RuntimeCredentialLease, RuntimeCredentialRequest, RuntimeCredentialService, RuntimeDaemonClientTransport, RuntimeDaemonContextOptions, RuntimeDaemonEndpoint, RuntimeDaemonError, RuntimeDaemonErrorCode, RuntimeDaemonFrame, RuntimeDaemonJsonSchema, RuntimeDaemonKodaXOptions, RuntimeDaemonManagementService, RuntimeDaemonManagementState, RuntimeDaemonMethod, RuntimeDaemonMethodSchema, RuntimeDaemonNotification, RuntimeDaemonNotificationMethod, RuntimeDaemonPreflight, RuntimeDaemonProtocolSchema, RuntimeDaemonRequest, RuntimeDaemonRollbackInput, RuntimeDaemonRollbackResult, RuntimeDaemonRunService, RuntimeDaemonStartRunInput, RuntimeDaemonTransportLifecycleState, RuntimeDefaultAgentStartInput, RuntimeDeliveredInterruptInput, RuntimeDiagnosticFilter, RuntimeDiagnosticsService, RuntimeEffectiveSkillRef, RuntimeEvent, RuntimeEventEnvelope, RuntimeEventFilter, RuntimeEventListener, RuntimeEventParseResult, RuntimeEventPayloadMap, RuntimeEventReplayFilter, RuntimeEventService, RuntimeEventType, RuntimeExactCallPermissionMatcher, RuntimeExactCommandPermissionMatcher, RuntimeExactPathPermissionMatcher, RuntimeExecutionToolPolicy, RuntimeExtensionListResult, RuntimeExtensionReloadResult, RuntimeExternalAgentsOptions, RuntimeFileInput, RuntimeForkSessionInput, RuntimeGrantedScope, RuntimeHostToolDescriptor, RuntimeHostToolHandler, RuntimeHostToolInvocation, RuntimeHostToolInvocationStatus, RuntimeHostToolLease, RuntimeHostToolResult, RuntimeHostToolService, RuntimeIdentity, RuntimeImageInput, RuntimeInlineOwnerHandle, RuntimeInput, RuntimeInteractionResolvedEventPayload, RuntimeInterruptInputStatus, RuntimeKodaXOptions, RuntimeLocalAgentStartInput, RuntimeManagedTaskProjection, RuntimeMcpReloadResult, RuntimeMcpService, RuntimeMcpToolListFilter, RuntimeMcpValidateResult, RuntimeModelListFilter, RuntimeOperationOptions, RuntimeOperationReceipt, RuntimeOperationService, RuntimeOperationState, RuntimeOwnerIdentity, RuntimeOwnerPolicyState, RuntimeOwnerState, RuntimePendingUserInputProjection, RuntimePermissionBroker, RuntimePermissionDecision, RuntimePermissionFilter, RuntimePermissionGrant, RuntimePermissionGrantChangedEventPayload, RuntimePermissionGrantSuggestion, RuntimePermissionHostPlatform, RuntimePermissionMatcher, RuntimePermissionRequest, RuntimePermissionRequestInput, RuntimePermissionRespondOptions, RuntimePermissionRisk, RuntimePermissionScope, RuntimePermissionService, RuntimeResolvedLocalAgent, RuntimeRewindSessionInput, RuntimeRunFilter, RuntimeRunHandle, RuntimeRunInputDeliveredEventPayload, RuntimeRunInputQueuedEventPayload, RuntimeRunMode, RuntimeRunPhase, RuntimeRunProgressEventPayload, RuntimeRunRequirements, RuntimeRunResult, RuntimeRunService, RuntimeRunSessionLoadedEventPayload, RuntimeRunStatus, RuntimeSession, RuntimeSessionFilter, RuntimeSessionLiveProjection, RuntimeSessionLoadedEventPayload, RuntimeSessionObservation, RuntimeSessionObservationSnapshot, RuntimeSessionService, RuntimeSessionSettings, RuntimeSessionSettingsPatch, RuntimeSessionSettingsUpdatedEventPayload, RuntimeSessionSummary, RuntimeSetActiveEntryInput, RuntimeSkillDescribeInput, RuntimeSkillDescription, RuntimeSkillFileSummary, RuntimeSkillListFilter, RuntimeSkillSummary, RuntimeStartRunInput, RuntimeStatusService, RuntimeStatusSnapshot, RuntimeSubmitInput, RuntimeSubmitInputResult, RuntimeSubscription, RuntimeTerminalCode, RuntimeTerminalFact, RuntimeTextDeltaEventPayload, RuntimeTextInput, RuntimeThinkingFinishedEventPayload, RuntimeTodoUpdatedEventPayload, RuntimeToolFinishedEventPayload, RuntimeToolProgressEventPayload, RuntimeToolStartedEventPayload, RuntimeTranscript, RuntimeTranscriptEntryChunk, RuntimeTranscriptEntryChunkInput, RuntimeTranscriptPageInput, RuntimeTranscriptSearchHit, RuntimeTranscriptSearchInput, RuntimeTranscriptSearchResult, RuntimeTranscriptSlice, RuntimeTranscriptSliceEntry, RuntimeTypedEvent, RuntimeTypedEventListener, RuntimeUserInputFilter, RuntimeUserInputKind, RuntimeUserInputRequest, RuntimeUserInputRequestedEventPayload, RuntimeUserInputResolution, RuntimeUserInputService, RuntimeUserMarkdownAgentRef, RuntimeVersionedUpdateOptions, RuntimeVersionedValue, RuntimeVideoInput, RuntimeWarningEventPayload, RuntimeWorkerOptions, RuntimeWorkerResourceLimits, RuntimeWorkflowFilter, RuntimeWorkflowListener, RuntimeWorkflowService, RuntimeWorkflowSnapshot, RuntimeWorkflowSummary, RuntimeWorkspaceBinding };
2462
+ export { KODAX_DAEMON_PROTOCOL, KODAX_DAEMON_PROTOCOL_VERSION, KODAX_RUNTIME_SDK_CAPABILITIES, KodaXEvents, KodaXPromptCacheDiagnosticEvent, KodaXResult, RUNTIME_DAEMON_METHODS, RUNTIME_DAEMON_METHOD_SCHEMAS, RUNTIME_DAEMON_NOTIFICATION_SCHEMAS, RUNTIME_DAEMON_PROTOCOL_SCHEMA, RUNTIME_DAEMON_PROTOCOL_SCHEMA_JSON, RuntimeAutoModeConfigurationError, RuntimeContextBudgetSnapshot, RuntimeDaemonCapabilityUpgradeError, RuntimePermissionScopeUpgradeRequiredError, RuntimeToolExposurePlan, RuntimeTransportBoundaryError, SessionTranscriptEntry, acquireKodaXInlineOwner, captureRuntimeSessionDiagnostics, connectKodaXRuntime, createKodaXRuntime, enableKodaXDaemonOwner, getKodaXRuntimeOwnerPolicy, getKodaXRuntimeOwnerState, listRuntimeDaemonSchemaMethods, parseRuntimeEvent, setKodaXRuntimeOwnerMode };
2463
+ export type { ConnectKodaXRuntimeOptions, CreateKodaXRuntimeOptions, KodaXDaemonRuntime, KodaXRuntime, KodaXRuntimeIsolation, KodaXRuntimeMode, RuntimeActiveAgentTurn, RuntimeActiveToolProjection, RuntimeAdminService, RuntimeAgentBindingService, RuntimeAgentOwnerSession, RuntimeAgentService, RuntimeAppendNoticeInput, RuntimeArtifact, RuntimeArtifactKind, RuntimeArtifactRefInput, RuntimeArtifactService, RuntimeBoundDefaultAgent, RuntimeBoundLocalAgent, RuntimeCapabilityRequirements, RuntimeCatalogService, RuntimeClientCapabilities, RuntimeClientInfo, RuntimeCommandInfo, RuntimeCommandResolveInput, RuntimeCompactSessionInput, RuntimeCompactSessionResult, RuntimeConfigPatch, RuntimeConfigReloadResult, RuntimeConfigService, RuntimeConnectionService, RuntimeConnectionState, RuntimeContextCompactionFinishedEventPayload, RuntimeContextCompactionMessagesEventPayload, RuntimeContinuationStatus, RuntimeConversationHistory, RuntimeConversationHistoryBoundary, RuntimeConversationHistoryEntryChunk, RuntimeConversationHistoryEntryChunkInput, RuntimeConversationHistoryPageInput, RuntimeConversationHistorySlice, RuntimeConversationHistorySliceEntry, RuntimeCreateArtifactInput, RuntimeCreateSessionInput, RuntimeCredentialBroker, RuntimeCredentialLease, RuntimeCredentialRequest, RuntimeCredentialService, RuntimeDaemonClientTransport, RuntimeDaemonContextOptions, RuntimeDaemonEndpoint, RuntimeDaemonError, RuntimeDaemonErrorCode, RuntimeDaemonFrame, RuntimeDaemonJsonSchema, RuntimeDaemonKodaXOptions, RuntimeDaemonManagementService, RuntimeDaemonManagementState, RuntimeDaemonMethod, RuntimeDaemonMethodSchema, RuntimeDaemonNotification, RuntimeDaemonNotificationMethod, RuntimeDaemonPreflight, RuntimeDaemonProtocolSchema, RuntimeDaemonRequest, RuntimeDaemonRequestControl, RuntimeDaemonRollbackInput, RuntimeDaemonRollbackResult, RuntimeDaemonRunService, RuntimeDaemonStartRunInput, RuntimeDaemonTransportLifecycleState, RuntimeDefaultAgentStartInput, RuntimeDeliveredInterruptInput, RuntimeDiagnosticFilter, RuntimeDiagnosticsService, RuntimeEffectiveSkillRef, RuntimeEvent, RuntimeEventEnvelope, RuntimeEventFilter, RuntimeEventListener, RuntimeEventParseResult, RuntimeEventPayloadMap, RuntimeEventReplayFilter, RuntimeEventService, RuntimeEventType, RuntimeExactCallPermissionMatcher, RuntimeExactCommandPermissionMatcher, RuntimeExactPathPermissionMatcher, RuntimeExecutionToolPolicy, RuntimeExtensionListResult, RuntimeExtensionReloadResult, RuntimeExternalAgentsOptions, RuntimeFileInput, RuntimeForkSessionInput, RuntimeGrantedScope, RuntimeHostToolDescriptor, RuntimeHostToolHandler, RuntimeHostToolInvocation, RuntimeHostToolInvocationStatus, RuntimeHostToolLease, RuntimeHostToolResult, RuntimeHostToolService, RuntimeIdentity, RuntimeImageInput, RuntimeInlineOwnerHandle, RuntimeInput, RuntimeIntegrationDiagnostic, RuntimeIntegrationDomainStatus, RuntimeIntegrationHealth, RuntimeInteractionResolvedEventPayload, RuntimeInterruptInputStatus, RuntimeKodaXOptions, RuntimeLearningService, RuntimeLocalAgentStartInput, RuntimeManagedTaskProjection, RuntimeMcpReloadResult, RuntimeMcpService, RuntimeMcpToolListFilter, RuntimeMcpValidateResult, RuntimeModelListFilter, RuntimeObservationInvalidation, RuntimeOperationOptions, RuntimeOperationReceipt, RuntimeOperationService, RuntimeOperationState, RuntimeOwnerIdentity, RuntimeOwnerPolicyState, RuntimeOwnerState, RuntimePendingUserInputProjection, RuntimePermissionBroker, RuntimePermissionDecision, RuntimePermissionFilter, RuntimePermissionGrant, RuntimePermissionGrantChangedEventPayload, RuntimePermissionGrantSuggestion, RuntimePermissionHostPlatform, RuntimePermissionMatcher, RuntimePermissionRequest, RuntimePermissionRequestInput, RuntimePermissionRespondOptions, RuntimePermissionRisk, RuntimePermissionScope, RuntimePermissionService, RuntimeReadOptions, RuntimeResolvedLocalAgent, RuntimeRewindSessionInput, RuntimeRunFilter, RuntimeRunHandle, RuntimeRunInputDeliveredEventPayload, RuntimeRunInputQueuedEventPayload, RuntimeRunLifecycleError, RuntimeRunMode, RuntimeRunPhase, RuntimeRunProgressEventPayload, RuntimeRunRequirements, RuntimeRunResult, RuntimeRunService, RuntimeRunSessionLoadedEventPayload, RuntimeRunStage, RuntimeRunStatus, RuntimeRunStopReceipt, RuntimeRunStopStatus, RuntimeSession, RuntimeSessionDiagnosticError, RuntimeSessionDiagnosticErrorCode, RuntimeSessionDiagnosticRun, RuntimeSessionDiagnostics, RuntimeSessionDiagnosticsInput, RuntimeSessionFilter, RuntimeSessionLiveProjection, RuntimeSessionLoadedEventPayload, RuntimeSessionObservation, RuntimeSessionObservationSnapshot, RuntimeSessionService, RuntimeSessionSettings, RuntimeSessionSettingsPatch, RuntimeSessionSettingsUpdatedEventPayload, RuntimeSessionStatus, RuntimeSessionSummary, RuntimeSetActiveEntryInput, RuntimeSkillDescribeInput, RuntimeSkillDescription, RuntimeSkillFileSummary, RuntimeSkillListFilter, RuntimeSkillSummary, RuntimeStartRunInput, RuntimeStatusService, RuntimeStatusSnapshot, RuntimeSubmitInput, RuntimeSubmitInputResult, RuntimeSubscription, RuntimeTerminalCode, RuntimeTerminalFact, RuntimeTextDeltaEventPayload, RuntimeTextInput, RuntimeThinkingFinishedEventPayload, RuntimeTodoUpdatedEventPayload, RuntimeToolFinishedEventPayload, RuntimeToolProgressEventPayload, RuntimeToolSandboxEventPayload, RuntimeToolStartedEventPayload, RuntimeTranscript, RuntimeTranscriptEntryChunk, RuntimeTranscriptEntryChunkInput, RuntimeTranscriptPageInput, RuntimeTranscriptSearchHit, RuntimeTranscriptSearchInput, RuntimeTranscriptSearchResult, RuntimeTranscriptSlice, RuntimeTranscriptSliceEntry, RuntimeTypedEvent, RuntimeTypedEventListener, RuntimeUserInputFilter, RuntimeUserInputKind, RuntimeUserInputRequest, RuntimeUserInputRequestedEventPayload, RuntimeUserInputResolution, RuntimeUserInputService, RuntimeUserMarkdownAgentRef, RuntimeVersionedUpdateOptions, RuntimeVersionedValue, RuntimeVideoInput, RuntimeWarningEventPayload, RuntimeWorkerOptions, RuntimeWorkerResourceLimits, RuntimeWorkflowFilter, RuntimeWorkflowListener, RuntimeWorkflowService, RuntimeWorkflowSnapshot, RuntimeWorkflowSummary, RuntimeWorkspaceBinding };