@kodax-ai/kodax 0.7.96 → 0.7.97-alpha.2

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 (127) hide show
  1. package/CHANGELOG.md +86 -0
  2. package/README.md +85 -62
  3. package/README_CN.md +57 -67
  4. package/config-templates/config.example.jsonc +0 -14
  5. package/dist/chunks/{agent-7N427EVB.js → agent-J7SHFM5N.js} +1 -1
  6. package/dist/chunks/argument-completer-ZJQOWTIS.js +2 -0
  7. package/dist/chunks/{chunk-ABZDFK2X.js → chunk-2GV6MQ4T.js} +14 -14
  8. package/dist/chunks/{chunk-6QI3GOYG.js → chunk-3PS3YEDS.js} +1 -1
  9. package/dist/chunks/chunk-4VJMQDTH.js +417 -0
  10. package/dist/chunks/{chunk-NI7PBPUR.js → chunk-5DSUVP46.js} +1 -1
  11. package/dist/chunks/chunk-5P7RTSZT.js +21 -0
  12. package/dist/chunks/{chunk-XXNR6S4Q.js → chunk-6ZAQKFIM.js} +1 -1
  13. package/dist/chunks/chunk-7V2QBZ73.js +137 -0
  14. package/dist/chunks/{chunk-C7U542KM.js → chunk-F7DHZH6T.js} +1 -1
  15. package/dist/chunks/{chunk-7IMWOR34.js → chunk-HSRYDDPF.js} +1 -1
  16. package/dist/chunks/chunk-K3DQGSQU.js +372 -0
  17. package/dist/chunks/chunk-NO23K2CB.js +2 -0
  18. package/dist/chunks/{chunk-NKT3B3DR.js → chunk-OT5WHAX4.js} +1 -1
  19. package/dist/chunks/{chunk-YEAUDI6U.js → chunk-QGWHJIO4.js} +1 -1
  20. package/dist/chunks/chunk-QOFFAY5C.js +261 -0
  21. package/dist/chunks/{chunk-4PFZ7BEE.js → chunk-QVDTORL3.js} +11 -11
  22. package/dist/chunks/chunk-QZ4B4AWG.js +473 -0
  23. package/dist/chunks/chunk-RXDS6CNA.js +355 -0
  24. package/dist/chunks/{chunk-WV3DJVW4.js → chunk-VDGPJQL7.js} +135 -135
  25. package/dist/chunks/chunk-VEZ4WHPN.js +641 -0
  26. package/dist/chunks/chunk-ZPPAT25E.js +5 -0
  27. package/dist/chunks/chunk-ZQYWDI4O.js +1 -0
  28. package/dist/chunks/chunk-ZS2GUADU.js +498 -0
  29. package/dist/chunks/{chunk-GN2IY5YE.js → chunk-ZTYZYXGV.js} +1 -1
  30. package/dist/chunks/{chunk-EM4XJBTK.js → chunk-ZZQ4GDVU.js} +1 -1
  31. package/dist/chunks/{client-6WZZTTSV.js → client-MXOJ5XUN.js} +1 -1
  32. package/dist/chunks/{compaction-config-ZMEJU4U7.js → compaction-config-5VZSGKBQ.js} +1 -1
  33. package/dist/chunks/{construction-bootstrap-RX4DMHI7.js → construction-bootstrap-U2ZU2WAT.js} +1 -1
  34. package/dist/chunks/dist-CSLNWLOE.js +2 -0
  35. package/dist/chunks/dist-XXMJMJDU.js +2 -0
  36. package/dist/chunks/host-RUXYZFYN.js +2 -0
  37. package/dist/chunks/readline-helpers-JCVULR4C.js +2 -0
  38. package/dist/chunks/run-manager-DRIM5VNE.js +2 -0
  39. package/dist/chunks/utils-MQEBGKIX.js +2 -0
  40. package/dist/index.d.ts +63 -30
  41. package/dist/index.js +10 -6
  42. package/dist/kodax_bootstrap.js +1 -1
  43. package/dist/kodax_cli.js +1745 -1734
  44. package/dist/kodax_resume.js +32 -35
  45. package/dist/native/win32-x64/kodax-windows-sandbox.exe +0 -0
  46. package/dist/native/win32-x64/kodax-windows-text-transaction.node +0 -0
  47. package/dist/native/win32-x64/manifest.json +2 -2
  48. package/dist/sandbox-network-broker.js +77 -77
  49. package/dist/sdk-a2a.d.ts +33 -18
  50. package/dist/sdk-a2a.js +8 -9
  51. package/dist/sdk-agent.d.ts +33 -26
  52. package/dist/sdk-agent.js +1 -1
  53. package/dist/sdk-client.d.ts +40 -0
  54. package/dist/sdk-client.js +2 -0
  55. package/dist/sdk-coding.d.ts +87 -499
  56. package/dist/sdk-coding.js +1 -1
  57. package/dist/sdk-experimental-memory.d.ts +3 -4
  58. package/dist/sdk-experimental-memory.js +1 -1
  59. package/dist/sdk-llm.d.ts +11 -9
  60. package/dist/sdk-llm.js +1 -1
  61. package/dist/sdk-mcp.d.ts +3 -3
  62. package/dist/sdk-mcp.js +1 -1
  63. package/dist/sdk-media.d.ts +3 -1
  64. package/dist/sdk-media.js +1 -1
  65. package/dist/sdk-repl.d.ts +317 -70
  66. package/dist/sdk-repl.js +2 -2
  67. package/dist/sdk-runtime.d.ts +580 -452
  68. package/dist/sdk-runtime.js +1 -1
  69. package/dist/sdk-sandbox.js +1 -1
  70. package/dist/sdk-session.d.ts +13 -9
  71. package/dist/sdk-session.js +1 -1
  72. package/dist/sdk-skills.js +1 -1
  73. package/dist/semantic-worker.js +57 -57
  74. package/dist/types-chunks/{base.d-Bt9lhwSV.d.ts → base.d-ZBOdjDUT.d.ts} +2 -1
  75. package/dist/types-chunks/{bash-prefix-extractor.d-DWFIMg0v.d.ts → bash-prefix-extractor.d-DvswAXKS.d.ts} +136 -66
  76. package/dist/types-chunks/{capability-learning.d-gRtO03f6.d.ts → capability-learning.d-B4pxKwP4.d.ts} +1 -1
  77. package/dist/types-chunks/{capability.d-Ch5Vos33.d.ts → capability.d-DOF3r0fJ.d.ts} +1 -1
  78. package/dist/types-chunks/{capsule.d-Dj1n6s0Y.d.ts → capsule.d-B4atvlxE.d.ts} +7 -19
  79. package/dist/types-chunks/client-contract-A1jdk6xz.d.ts +1993 -0
  80. package/dist/types-chunks/{controller.d-C0IM1Tud.d.ts → controller.d-BkUJ_3sl.d.ts} +1 -1
  81. package/dist/types-chunks/{controller.d-J2t1q8Ly.d.ts → controller.d-yyKajPTi.d.ts} +140 -1380
  82. package/dist/types-chunks/{cost-tracker.d-BWI4lFWn.d.ts → cost-tracker.d-BeaenODW.d.ts} +2 -47
  83. package/dist/types-chunks/{history-retrieval.d-CPN5PMBV.d.ts → history-retrieval.d-JdFfkeF3.d.ts} +2 -2
  84. package/dist/types-chunks/{manager.d-rtmywU9M.d.ts → manager.d-C_20XqCV.d.ts} +8 -1
  85. package/dist/types-chunks/manifest.d-Bw2i-zQi.d.ts +18 -0
  86. package/dist/types-chunks/provider-credential-context.d-BH2OaB1b.d.ts +47 -0
  87. package/dist/types-chunks/provider-request-observation.d-jL8T6wVO.d.ts +34 -0
  88. package/dist/types-chunks/{public-api.d-amBop8Nk.d.ts → public-api.d-Cq8ILMte.d.ts} +52 -13
  89. package/dist/types-chunks/{resolver.d-BrwLoWNr.d.ts → resolver.d-DLY01RHx.d.ts} +4 -2
  90. package/dist/types-chunks/{types.d-CSv0_cZC.d.ts → review-inbox.d-BeaLRNHx.d.ts} +251 -3
  91. package/dist/types-chunks/{shell-command-sets.d-oejwpP_7.d.ts → review-packet.d-D4bbTbq3.d.ts} +46 -3
  92. package/dist/types-chunks/{exec-policy.d-BPESl90L.d.ts → run-manager.d-C7Q71rin.d.ts} +385 -62
  93. package/dist/types-chunks/runtime-client-info-CxnlZlW5.d.ts +175 -0
  94. package/dist/types-chunks/{sdk-session-B6XjHNU1.d.ts → sdk-session-BDFjCpDn.d.ts} +12 -4
  95. package/dist/types-chunks/{side-query.d-DHWG1JZg.d.ts → side-query.d-DTrhVd_r.d.ts} +4 -3
  96. package/dist/types-chunks/trusted-repl-entry-vbUM8R6P.d.ts +445 -0
  97. package/dist/types-chunks/{types.d-CtO8mR1s.d.ts → types.d-BJTN-RZr.d.ts} +5 -5
  98. package/dist/types-chunks/{types.d-BrQMB-hy.d.ts → types.d-BjOq57-z.d.ts} +6 -0
  99. package/dist/types-chunks/types.d-o7t9dds4.d.ts +1484 -0
  100. package/dist/types-chunks/{utils.d-DcznBeQ3.d.ts → utils.d-CWiMhFfu.d.ts} +202 -36
  101. package/docs/CLIENT_CONTRACT.md +441 -0
  102. package/docs/SDK_MIGRATION.md +123 -0
  103. package/docs/SPACE_SDK_SEAMS.md +139 -0
  104. package/package.json +10 -5
  105. package/public_docs/README.md +12 -133
  106. package/public_docs/configuration/config-files.md +8 -14
  107. package/public_docs/sdk/embedder-guide.md +494 -420
  108. package/dist/chunks/argument-completer-FAIHW7HZ.js +0 -2
  109. package/dist/chunks/chunk-66XN5AFU.js +0 -417
  110. package/dist/chunks/chunk-7O2AIFNE.js +0 -373
  111. package/dist/chunks/chunk-DSXUXUZG.js +0 -5
  112. package/dist/chunks/chunk-GYO73UYQ.js +0 -275
  113. package/dist/chunks/chunk-HPCS3LZ5.js +0 -324
  114. package/dist/chunks/chunk-HZYRLIOC.js +0 -137
  115. package/dist/chunks/chunk-SC2ELSUS.js +0 -675
  116. package/dist/chunks/chunk-TEUD5VPJ.js +0 -471
  117. package/dist/chunks/chunk-TYZ2ZAYL.js +0 -487
  118. package/dist/chunks/dist-3UCCMCYR.js +0 -2
  119. package/dist/chunks/dist-F5IWZSAY.js +0 -2
  120. package/dist/chunks/host-W2JJ3V3Q.js +0 -2
  121. package/dist/chunks/run-manager-RBWU3EVE.js +0 -2
  122. package/dist/chunks/utils-DJ4ZFJGL.js +0 -2
  123. package/dist/runtime-worker.js +0 -5381
  124. package/dist/types-chunks/review-inbox.d-CTeUIKda.d.ts +0 -225
  125. package/dist/types-chunks/run-manager.d-hm1XgEou.d.ts +0 -94
  126. package/dist/types-chunks/trusted-repl-entry-D0w5M0UZ.d.ts +0 -323
  127. package/dist/types-chunks/types.d-B1l9pWyX.d.ts +0 -146
@@ -1,12 +1,16 @@
1
- import { j as CreatableHistoryItem, av as ToolCall } from './public-api.d-amBop8Nk.js';
2
- import { k as KodaXMessage, c as KodaXContentBlock } from './types.d-BrQMB-hy.js';
3
- import { ar as KodaXSessionUiHistoryItem, av as KodaXSessionUiToolCall } from './types.d-CSv0_cZC.js';
1
+ import { aI as KodaXSessionUiHistoryItem, aM as KodaXSessionUiToolCall } from './review-inbox.d-BeaLRNHx.js';
2
+ import { k as KodaXMessage, c as KodaXContentBlock } from './types.d-BjOq57-z.js';
3
+ import { j as CreatableHistoryItem, av as ToolCall } from './public-api.d-Cq8ILMte.js';
4
4
 
5
5
  interface RestoreHistoryItemsFromSessionInput {
6
6
  messages: readonly KodaXMessage[];
7
7
  uiHistory?: readonly KodaXSessionUiHistoryItem[];
8
+ /** Canonical history pages must retain all blocks; live restoration stays bounded. */
9
+ historyScope?: 'window' | 'all';
8
10
  }
9
- declare function trimPersistedUiHistorySnapshot(items: readonly KodaXSessionUiHistoryItem[]): KodaXSessionUiHistoryItem[];
11
+ declare function trimPersistedUiHistorySnapshot<T extends {
12
+ readonly type: string;
13
+ }>(items: readonly T[]): T[];
10
14
  declare function restoreHistoryItemsFromSession(input: RestoreHistoryItemsFromSessionInput): CreatableHistoryItem[];
11
15
 
12
16
  /**
@@ -16,6 +20,7 @@ declare function restoreHistoryItemsFromSession(input: RestoreHistoryItemsFromSe
16
20
  type RestoredHistorySeed = ({
17
21
  type: "user";
18
22
  text: string;
23
+ inputId?: string;
19
24
  } | {
20
25
  type: "assistant";
21
26
  text: string;
@@ -40,6 +45,7 @@ type RestoredHistorySeed = ({
40
45
  tools: KodaXSessionUiToolCall[];
41
46
  }) & {
42
47
  timestamp?: number;
48
+ outputId?: string;
43
49
  };
44
50
  /** Convert a RestoredHistorySeed to a CreatableHistoryItem. tool_summary / task_completed → event with icon. */
45
51
  declare function seedToHistoryItem(seed: RestoredHistorySeed): CreatableHistoryItem;
@@ -48,6 +54,8 @@ declare function toolCallSeedToHistoryToolCall(tool: KodaXSessionUiToolCall): To
48
54
  * Minimal message shape required to restore UI history items.
49
55
  */
50
56
  interface HistorySeedSourceMessage {
57
+ outputId?: string;
58
+ inputId?: string;
51
59
  role: KodaXMessage["role"];
52
60
  content: string | KodaXContentBlock[];
53
61
  timestamp?: string;
@@ -1,6 +1,7 @@
1
- import { k as KodaXMessage, I as KodaXReasoningRequest, a2 as KodaXTokenUsage, H as KodaXReasoningProfile } from './types.d-BrQMB-hy.js';
2
- import { K as KodaXBaseProvider } from './base.d-Bt9lhwSV.js';
3
- import { f as ProviderCredentialPurpose, a as CostTracker } from './cost-tracker.d-BWI4lFWn.js';
1
+ import { k as KodaXMessage, I as KodaXReasoningRequest, a2 as KodaXTokenUsage, H as KodaXReasoningProfile } from './types.d-BjOq57-z.js';
2
+ import { K as KodaXBaseProvider } from './base.d-ZBOdjDUT.js';
3
+ import { a as CostTracker } from './cost-tracker.d-BeaenODW.js';
4
+ import { c as ProviderCredentialPurpose } from './provider-credential-context.d-BH2OaB1b.js';
4
5
 
5
6
  /**
6
7
  * sideQuery — independent one-shot LLM invocation.
@@ -0,0 +1,445 @@
1
+ import { r as ResolvedAutoModeSettings, b as CommandDefinition, g as CommandSource, d as CommandInfo, C as Command$1, I as InteractiveContext, a as CommandCallbacks, j as CurrentConfig, e as CommandInvocationRequest, h as CommandWorkflowInvocationRequest, t as RuntimeSurfaceStatus, S as SessionCommandBinding } from './utils.d-CWiMhFfu.js';
2
+ import { c as CanonicalPermissionMode, h as ConfirmResult, o as HistoryItem, ai as SessionStorage$1, L as LearningBinding } from './public-api.d-Cq8ILMte.js';
3
+ import { at as KodaXResult, aa as KodaXOptions } from './bash-prefix-extractor.d-DvswAXKS.js';
4
+ import { W as ExecPolicyRuleInput, r as AutoModeStats } from './run-manager.d-C7Q71rin.js';
5
+ import { ar as ClientToolInvocationInput, ac as ClientSessionCancelInput, ad as ClientSessionCancelReceipt, aj as ClientSessionSettingsPatch, a8 as ClientRunStopReceipt, am as ClientSessionView, Y as ClientObserveOptions, E as ClientItemReadOptions, D as ClientItemContent, v as ClientHistoryReadOptions, u as ClientHistoryPage, A as ClientInteractionResponse, a0 as ClientPermissionInteractionOptions, z as ClientInteraction, at as ClientViewItem } from './client-contract-A1jdk6xz.js';
6
+ import { am as KodaXInputArtifact, _ as AskUserQuestionOptions, W as AskUserAnswer, Y as AskUserMultiOptions } from './types.d-o7t9dds4.js';
7
+ import { aG as KodaXSessionStorage, as as KodaXSessionData } from './review-inbox.d-BeaLRNHx.js';
8
+
9
+ /** Host-owned user Stop; acceptance is distinct from execution settlement. */
10
+ interface RuntimeStopControl {
11
+ request(): Promise<{
12
+ readonly state: 'unknown' | 'confirmed';
13
+ }>;
14
+ }
15
+ interface RuntimeStopCallbacks {
16
+ readonly onStopControl?: (control: RuntimeStopControl | undefined) => void;
17
+ readonly onStopState?: (state: 'requesting' | 'accepted' | 'confirmed' | 'rejected', detail?: string) => void;
18
+ }
19
+
20
+ interface StandaloneExecPolicyOptions {
21
+ readonly adminRules?: readonly ExecPolicyRuleInput[];
22
+ readonly trustedProjectRoots?: readonly string[];
23
+ }
24
+
25
+ interface ReplRuntimePermissionGrantSuggestion {
26
+ readonly id: string;
27
+ readonly kind: 'session' | 'persistent';
28
+ readonly label: string;
29
+ }
30
+ interface ReplRuntimePermissionRequest {
31
+ readonly id: string;
32
+ readonly toolName: string;
33
+ readonly toolCallId?: string;
34
+ readonly input: Readonly<Record<string, unknown>>;
35
+ readonly reason?: string;
36
+ readonly risk?: 'low' | 'medium' | 'high';
37
+ readonly executionCwd?: string;
38
+ readonly grantSuggestions?: readonly ReplRuntimePermissionGrantSuggestion[];
39
+ readonly createdAt?: string;
40
+ readonly expiresAt?: string;
41
+ }
42
+ interface ReplRuntimePermissionPromptContext {
43
+ readonly signal: AbortSignal;
44
+ }
45
+ type ReplRuntimePermissionDecision = {
46
+ readonly type: 'allow_once';
47
+ } | {
48
+ readonly type: 'allow_session';
49
+ readonly suggestionId: string;
50
+ } | {
51
+ readonly type: 'allow_always';
52
+ readonly suggestionId: string;
53
+ } | {
54
+ readonly type: 'reject';
55
+ readonly reason?: string;
56
+ };
57
+ type ReplRuntimePermissionPrompt = (request: ReplRuntimePermissionRequest, context: ReplRuntimePermissionPromptContext) => Promise<ReplRuntimePermissionDecision>;
58
+ declare const RUNTIME_PERMISSION_PENDING_NOTICE = "Runtime state: run active until this approval is resolved.";
59
+ interface ReplRuntimeAutoModeControl {
60
+ getStats(sessionId: string): Promise<AutoModeStats | undefined>;
61
+ syncSettings?(sessionId: string, permissionMode: CanonicalPermissionMode, settings: ReplRuntimeAutoModeSettings): Promise<AutoModeStats | undefined>;
62
+ subscribe?(sessionId: string, listener: (stats: AutoModeStats | undefined) => void): {
63
+ close(): void;
64
+ };
65
+ }
66
+ interface ReplRuntimeAutoModeSettings {
67
+ readonly classifierModel?: string;
68
+ readonly reviewPolicy?: string;
69
+ }
70
+ declare function toReplRuntimeAutoModeSettings(settings: ResolvedAutoModeSettings): ReplRuntimeAutoModeSettings;
71
+
72
+ /**
73
+ * Command Registry - Dynamic command registration system
74
+ * 命令注册表 - 动态命令注册系统
75
+ *
76
+ * Provides centralized command management with source tracking,
77
+ * supporting dynamic registration, lookup, and listing of commands.
78
+ */
79
+
80
+ /**
81
+ * CommandRegistry - Centralized command management
82
+ * 命令注册表 - 集中式命令管理
83
+ *
84
+ * @example
85
+ * ```typescript
86
+ * const registry = new CommandRegistry();
87
+ *
88
+ * // Register a command
89
+ * registry.register({
90
+ * name: 'copy',
91
+ * description: 'Copy last message to clipboard',
92
+ * source: 'builtin',
93
+ * handler: async (args, context, callbacks, config) => {
94
+ * // Implementation
95
+ * }
96
+ * });
97
+ *
98
+ * // Get a command
99
+ * const cmd = registry.get('copy');
100
+ *
101
+ * // List all commands
102
+ * const allCommands = registry.getAll();
103
+ *
104
+ * // List builtin commands only
105
+ * const builtinCommands = registry.getBySource('builtin');
106
+ * ```
107
+ */
108
+ declare class CommandRegistry {
109
+ /**
110
+ * Internal command storage
111
+ * 内部命令存储
112
+ */
113
+ private commands;
114
+ /**
115
+ * Alias to command name mapping
116
+ * 别名到命令名称的映射
117
+ */
118
+ private aliases;
119
+ /**
120
+ * Register a command
121
+ * 注册命令
122
+ *
123
+ * @param def - Command definition
124
+ * @throws Error if command with same name already exists
125
+ */
126
+ register(def: CommandDefinition): void;
127
+ /**
128
+ * Unregister a command
129
+ * 注销命令
130
+ *
131
+ * @param name - Command name or alias
132
+ * @returns true if command was unregistered, false if not found
133
+ */
134
+ unregister(name: string): boolean;
135
+ /**
136
+ * Get a command by name or alias
137
+ * 通过名称或别名获取命令
138
+ *
139
+ * @param name - Command name or alias
140
+ * @returns Command definition or undefined if not found
141
+ */
142
+ get(name: string): CommandDefinition | undefined;
143
+ /**
144
+ * Check if a command exists
145
+ * 检查命令是否存在
146
+ *
147
+ * @param name - Command name or alias
148
+ * @returns true if command exists, false otherwise
149
+ */
150
+ has(name: string): boolean;
151
+ /**
152
+ * Get all commands with optional source filter
153
+ * 获取所有命令,可选按来源过滤
154
+ *
155
+ * @param source - Optional source filter
156
+ * @returns Array of command information
157
+ */
158
+ getAll(source?: CommandSource): CommandInfo[];
159
+ /**
160
+ * Get commands by source
161
+ * 按来源获取命令
162
+ *
163
+ * @param source - Command source
164
+ * @returns Array of command information
165
+ */
166
+ getBySource(source: CommandSource): CommandInfo[];
167
+ /**
168
+ * Get all command names
169
+ * 获取所有命令名称
170
+ *
171
+ * @returns Array of command names
172
+ */
173
+ getNames(): string[];
174
+ /**
175
+ * Clear all commands
176
+ * 清空所有命令
177
+ */
178
+ clear(): void;
179
+ /**
180
+ * Get command count
181
+ * 获取命令数量
182
+ *
183
+ * @returns Number of registered commands
184
+ */
185
+ get size(): number;
186
+ /**
187
+ * Get alias count
188
+ * 获取别名数量
189
+ *
190
+ * @returns Number of registered aliases
191
+ */
192
+ get aliasCount(): number;
193
+ }
194
+
195
+ /**
196
+ * KodaX Interactive Command System
197
+ */
198
+
199
+ type Command = Command$1;
200
+ declare const BUILTIN_COMMANDS: Command[];
201
+ declare function getCommandRegistry(projectRoot?: string): CommandRegistry;
202
+ declare function parseCommand(input: string): {
203
+ command: string;
204
+ args: string[];
205
+ skillInvocation?: {
206
+ name: string;
207
+ };
208
+ } | null;
209
+ type CommandResult = boolean | {
210
+ success?: boolean;
211
+ message?: string;
212
+ startedRunId?: string;
213
+ skillContent?: string;
214
+ invocation?: CommandInvocationRequest;
215
+ workflow?: CommandWorkflowInvocationRequest;
216
+ };
217
+ declare function executeCommand(parsed: {
218
+ command: string;
219
+ args: string[];
220
+ skillInvocation?: {
221
+ name: string;
222
+ };
223
+ }, context: InteractiveContext, callbacks: CommandCallbacks, currentConfig: CurrentConfig, rawInput?: string): Promise<CommandResult>;
224
+
225
+ /** Terminal projection of one client round; `result` is the legacy shape Ink's loop expects. */
226
+ interface ClientRoundOutcome {
227
+ readonly phase: string;
228
+ readonly result?: KodaXResult;
229
+ readonly error?: string;
230
+ }
231
+ interface InkClientPlane {
232
+ executeTool(input: ClientToolInvocationInput): Promise<{
233
+ readonly runId: string;
234
+ readonly sessionId: string;
235
+ }>;
236
+ cancelSession(input: ClientSessionCancelInput): Promise<ClientSessionCancelReceipt>;
237
+ /** Configure the Host-owned Session before starting or changing a round. */
238
+ updateSettings?(sessionId: string, patch: ClientSessionSettingsPatch): Promise<void>;
239
+ /** Persist client-only command feedback without submitting model input. */
240
+ appendNotice?(sessionId: string, input: {
241
+ content: string;
242
+ source?: string;
243
+ }): Promise<void>;
244
+ /**
245
+ * Submit user text. 'immediate' starts the run, 'after_turn' queues
246
+ * Host-side, 'redirect' queues and cancels the target run (FEATURE_149
247
+ * fast-redirect parity; requires targetRunId).
248
+ */
249
+ submit(input: {
250
+ readonly sessionId: string;
251
+ readonly text: string;
252
+ readonly inputId: string;
253
+ readonly delivery?: 'immediate' | 'after_turn' | 'steer' | 'redirect';
254
+ readonly targetRunId?: string;
255
+ readonly inputArtifacts?: readonly KodaXInputArtifact[];
256
+ }): Promise<{
257
+ readonly runId?: string;
258
+ readonly state?: 'submitted' | 'queued' | 'withdrawn' | 'dropped';
259
+ }>;
260
+ /** Withdraw a queued input, retaining attachments; standalone bindings may return plain text. */
261
+ withdraw(sessionId: string, inputId: string): Promise<string | {
262
+ readonly text: string;
263
+ readonly inputArtifacts?: readonly KodaXInputArtifact[];
264
+ } | undefined>;
265
+ /** Resolve uncertain acceptance without starting new work. */
266
+ readInput?(sessionId: string, inputId: string): Promise<{
267
+ readonly state: 'submitted' | 'queued' | 'withdrawn' | 'dropped';
268
+ } | null>;
269
+ /** Resolve when the run reaches a terminal phase. */
270
+ awaitRun(sessionId: string, runId: string): Promise<ClientRoundOutcome>;
271
+ /** Request a stop for one run (Esc); the receipt never implies terminal state. */
272
+ stop(runId: string): Promise<ClientRunStopReceipt | undefined>;
273
+ /** Newest run in a live phase for the session, or undefined when idle. */
274
+ activeRun(sessionId: string): Promise<string | undefined>;
275
+ /** Live current-state replacement; resolves with the closer. */
276
+ observe(sessionId: string, onView: (view: ClientSessionView) => void, options?: ClientObserveOptions): Promise<() => void>;
277
+ /** Page the complete content of a bounded view item by stable id. */
278
+ readItem(sessionId: string, itemId: string, options?: ClientItemReadOptions | number): Promise<ClientItemContent | null>;
279
+ readHistory?(sessionId: string, options?: ClientHistoryReadOptions): Promise<ClientHistoryPage>;
280
+ readHistoryEntry?(sessionId: string, itemId: string, options?: ClientItemReadOptions): Promise<ClientItemContent | null>;
281
+ /** Answer a pending Host question/permission; first valid answer wins. */
282
+ respondInteraction(requestId: string, response: ClientInteractionResponse): Promise<boolean>;
283
+ }
284
+ /** Client-minted input identity; withdraw targets it while the input is queued. */
285
+ declare function mintInkInputId(): string;
286
+ /** Submit one input, following its Run and the Host's queued continuations. */
287
+ declare function runClientPlaneRound(input: {
288
+ readonly plane: InkClientPlane;
289
+ readonly submit?: InkClientPlane['submit'];
290
+ readonly sessionId: string;
291
+ readonly prompt: string;
292
+ readonly abortSignal?: AbortSignal;
293
+ /** Read the Run already displayed to the user synchronously at interruption. */
294
+ readonly getDisplayedRunId?: () => string | undefined;
295
+ readonly inputArtifacts?: readonly KodaXInputArtifact[];
296
+ } & RuntimeStopCallbacks): Promise<KodaXResult>;
297
+ /** First run in a live phase; run lists are ordered oldest-first. */
298
+ declare function firstActiveRunId(runs: readonly {
299
+ readonly runId: string;
300
+ readonly phase: string;
301
+ }[]): string | undefined;
302
+ /** Active run id from the view's run list, or undefined when idle. */
303
+ declare function viewRunsActive(view: Pick<ClientSessionView, 'runs'>): string | undefined;
304
+ /** Adapter-side memo entry: reuse the mapped item while the fingerprint holds. */
305
+ interface ClientViewItemMemo {
306
+ readonly entries: Map<string, {
307
+ fingerprint: string;
308
+ item: HistoryItem;
309
+ }>;
310
+ }
311
+ /**
312
+ * Map the Host's display items onto the Ink render model (types align by
313
+ * design). Streaming marks only the TRAILING assistant item — the item the
314
+ * active run is appending to. Pass a `memo` (kept across calls by the
315
+ * observer) so unchanged items keep their HistoryItem identity and the
316
+ * memoized renderers skip re-rendering the whole transcript per delta.
317
+ */
318
+ declare function clientViewToHistoryItems(items: readonly ClientViewItem[], options?: {
319
+ readonly activeRunId?: string;
320
+ readonly memo?: ClientViewItemMemo;
321
+ }): HistoryItem[];
322
+ /**
323
+ * FEATURE_298 T17 — the dialog surface the plane drives. Ink binds these to
324
+ * its existing askUser/permission dialog implementations; tests inject fakes.
325
+ */
326
+ interface ClientPlaneDialogSurface {
327
+ readonly question: (options: AskUserQuestionOptions, signal?: AbortSignal) => Promise<AskUserAnswer>;
328
+ readonly questionMulti: (options: AskUserMultiOptions, signal?: AbortSignal) => Promise<Record<string, AskUserAnswer> | undefined>;
329
+ readonly questionInput: (options: {
330
+ readonly question: string;
331
+ readonly default?: string;
332
+ }, signal?: AbortSignal) => Promise<string | undefined>;
333
+ readonly permission: (options: ClientPermissionInteractionOptions, signal?: AbortSignal) => Promise<ConfirmResult>;
334
+ }
335
+ /**
336
+ * Answer one pending Host interaction through the dialog surface and forward
337
+ * the typed response; first valid answer wins Host-side, so a late dialog
338
+ * result simply resolves as `false`.
339
+ */
340
+ declare function answerClientPlaneInteraction(plane: Pick<InkClientPlane, 'respondInteraction'>, interaction: ClientInteraction, surface: ClientPlaneDialogSurface, signal?: AbortSignal): Promise<boolean>;
341
+
342
+ type InkRuntimeStatusProvider = () => Promise<RuntimeSurfaceStatus | undefined>;
343
+ interface InkTransientNotice {
344
+ readonly text: string;
345
+ readonly tone: "success" | "warning";
346
+ }
347
+ interface InkREPLOptions extends KodaXOptions {
348
+ initialClientSettings?: ClientSessionSettingsPatch;
349
+ storage?: SessionStorage$1;
350
+ execPolicy?: StandaloneExecPolicyOptions;
351
+ hardExitOnClose?: boolean;
352
+ runtimeAutoModeControl?: ReplRuntimeAutoModeControl;
353
+ getRuntimeStatus?: InkRuntimeStatusProvider;
354
+ validateSetupA2AConfig?: (value: unknown) => unknown;
355
+ prepareSetupSandbox?: CommandCallbacks['prepareSetupSandbox'];
356
+ inspectSandbox?: CommandCallbacks['inspectSandbox'];
357
+ learning?: LearningBinding;
358
+ /** FEATURE_298 T22 — Host workflow plane; required for start/control. */
359
+ workflows?: CommandCallbacks['workflows'];
360
+ commandClient?: CommandCallbacks['commandClient'];
361
+ listHostCommands?: CommandCallbacks['listHostCommands'];
362
+ inspectExtensions?: CommandCallbacks['inspectExtensions'];
363
+ mcp?: CommandCallbacks['mcp'];
364
+ config?: CommandCallbacks['config'];
365
+ catalog?: CommandCallbacks['catalog'];
366
+ providerCapabilities?: CommandCallbacks['providerCapabilities'];
367
+ startReview?: CommandCallbacks['startReview'];
368
+ reviewAgentsLean?: CommandCallbacks['reviewAgentsLean'];
369
+ goal?: CommandCallbacks['goal'];
370
+ sessionCommands?: SessionCommandBinding;
371
+ compactSession?: CommandCallbacks['compactSession'];
372
+ memory?: CommandCallbacks['memory'];
373
+ /** FEATURE_298 T17 — when bound, execution/observation travel the Client plane. */
374
+ clientPlane?: InkClientPlane;
375
+ subscribeTransientNotices?: (listener: (notice: InkTransientNotice) => void) => () => void;
376
+ }
377
+
378
+ /** Manual shell syntax is a host tool invocation under the current Session owner. */
379
+ interface ShellExecutorConfig {
380
+ maxBuffer?: number;
381
+ timeout?: number;
382
+ maxOutputLength?: number;
383
+ maxErrorLength?: number;
384
+ cwd?: string;
385
+ execute?: (command: string) => Promise<{
386
+ success: boolean;
387
+ lastText: string;
388
+ interrupted?: boolean;
389
+ }>;
390
+ onOutput?: (text: string) => void;
391
+ }
392
+ declare function executeShellCommand(command: string, config?: ShellExecutorConfig): Promise<string>;
393
+ declare function isShellCommand(input: string): boolean;
394
+ declare function isShellCommandSuccess(result: string): boolean;
395
+
396
+ interface SessionStorage extends KodaXSessionStorage {
397
+ list(gitRoot?: string, options?: {
398
+ limit?: number;
399
+ includeArchived?: boolean;
400
+ }): Promise<Array<{
401
+ id: string;
402
+ title: string;
403
+ msgCount: number;
404
+ tag?: string;
405
+ runtimeInfo?: KodaXSessionData['runtimeInfo'];
406
+ }>>;
407
+ }
408
+ type ReplRuntimeStatusProvider = () => Promise<RuntimeSurfaceStatus | undefined>;
409
+ interface RepLOptions extends KodaXOptions {
410
+ initialClientSettings?: ClientSessionSettingsPatch;
411
+ storage?: SessionStorage;
412
+ execPolicy?: StandaloneExecPolicyOptions;
413
+ /** FEATURE_298 T18 — bound rounds travel the Host input/run faces. */
414
+ clientPlane?: InkClientPlane;
415
+ runtimeAutoModeControl?: ReplRuntimeAutoModeControl;
416
+ getRuntimeStatus?: ReplRuntimeStatusProvider;
417
+ validateSetupA2AConfig?: (value: unknown) => unknown;
418
+ prepareSetupSandbox?: CommandCallbacks['prepareSetupSandbox'];
419
+ inspectSandbox?: CommandCallbacks['inspectSandbox'];
420
+ learning?: LearningBinding;
421
+ /** FEATURE_298 T22 — Host workflow plane; required for start/control. */
422
+ workflows?: CommandCallbacks['workflows'];
423
+ commandClient?: CommandCallbacks['commandClient'];
424
+ listHostCommands?: CommandCallbacks['listHostCommands'];
425
+ inspectExtensions?: CommandCallbacks['inspectExtensions'];
426
+ mcp?: CommandCallbacks['mcp'];
427
+ config?: CommandCallbacks['config'];
428
+ catalog?: CommandCallbacks['catalog'];
429
+ providerCapabilities?: CommandCallbacks['providerCapabilities'];
430
+ startReview?: CommandCallbacks['startReview'];
431
+ reviewAgentsLean?: CommandCallbacks['reviewAgentsLean'];
432
+ goal?: CommandCallbacks['goal'];
433
+ sessionCommands?: SessionCommandBinding;
434
+ compactSession?: CommandCallbacks['compactSession'];
435
+ memory?: CommandCallbacks['memory'];
436
+ }
437
+ declare function processSpecialSyntax(input: string, executionCwd?: string, execute?: ShellExecutorConfig['execute']): Promise<string>;
438
+
439
+ /** KodaX-owned classic REPL entry with the native trusted-text authority bound. */
440
+ declare function runInteractiveMode(options: RepLOptions): Promise<void>;
441
+ /** KodaX-owned Ink REPL entry with the native trusted-text authority bound. */
442
+ declare function runInkInteractiveMode(options: InkREPLOptions): Promise<void>;
443
+
444
+ export { parseCommand as A, BUILTIN_COMMANDS as B, processSpecialSyntax as D, runClientPlaneRound as E, runInkInteractiveMode as F, runInteractiveMode as G, toReplRuntimeAutoModeSettings as H, viewRunsActive as J, RUNTIME_PERMISSION_PENDING_NOTICE as R, answerClientPlaneInteraction as r, clientViewToHistoryItems as s, executeCommand as t, executeShellCommand as u, firstActiveRunId as v, getCommandRegistry as w, isShellCommand as x, isShellCommandSuccess as y, mintInkInputId as z };
445
+ export type { ClientPlaneDialogSurface as C, InkClientPlane as I, ShellExecutorConfig as S, ClientRoundOutcome as a, ClientViewItemMemo as b, Command as c, InkREPLOptions as d, InkRuntimeStatusProvider as e, InkTransientNotice as f, RepLOptions as g, ReplRuntimeAutoModeControl as h, ReplRuntimeAutoModeSettings as i, ReplRuntimePermissionDecision as j, ReplRuntimePermissionGrantSuggestion as k, ReplRuntimePermissionPrompt as l, ReplRuntimePermissionRequest as m, ReplRuntimeStatusProvider as n, RuntimeStopCallbacks as o, RuntimeStopControl as p, StandaloneExecPolicyOptions as q };
@@ -1,8 +1,8 @@
1
- import { ab as KodaXWireReasoningEffort, a3 as KodaXToolDefinition, a5 as KodaXToolResultContentItem, k as KodaXMessage } from './types.d-BrQMB-hy.js';
2
- import { K as KodaXBaseProvider } from './base.d-Bt9lhwSV.js';
3
- import { C as CapabilityKind, a as CapabilityProvider, b as CapabilityResult } from './capability.d-Ch5Vos33.js';
4
- import { a1 as KodaXJsonValue, V as KodaXExtensionSessionRecord, X as KodaXExtensionStore } from './types.d-CSv0_cZC.js';
5
- import { b8 as KodaXToolExecutionContext, b$ as ToolSideEffect, E as ExtensionExecutionScope } from './bash-prefix-extractor.d-DWFIMg0v.js';
1
+ import { ab as KodaXWireReasoningEffort, a3 as KodaXToolDefinition, a5 as KodaXToolResultContentItem, k as KodaXMessage } from './types.d-BjOq57-z.js';
2
+ import { K as KodaXBaseProvider } from './base.d-ZBOdjDUT.js';
3
+ import { C as CapabilityKind, a as CapabilityProvider, b as CapabilityResult } from './capability.d-DOF3r0fJ.js';
4
+ import { ai as KodaXJsonValue, aa as KodaXExtensionSessionRecord, ac as KodaXExtensionStore } from './review-inbox.d-BeaLRNHx.js';
5
+ import { b9 as KodaXToolExecutionContext, c0 as ToolSideEffect, E as ExtensionExecutionScope } from './bash-prefix-extractor.d-DvswAXKS.js';
6
6
 
7
7
  /**
8
8
  * KodaX Constructed-World types (FEATURE_087, v0.7.28).
@@ -163,6 +163,12 @@ interface KodaXMessage {
163
163
  * sessions and provider-internal synthetic messages.
164
164
  */
165
165
  turnId?: string;
166
+ /** Stable identity of one generated assistant message, shared by its live projection. */
167
+ outputId?: string;
168
+ /** Accepted user input identity; absent on older and system-generated messages. */
169
+ inputId?: string;
170
+ /** User inputs merged into this canonical message by the Host queue. */
171
+ inputIds?: readonly string[];
166
172
  /**
167
173
  * ISO-8601 timestamp of when this message was finalized (assistant: when the
168
174
  * LLM stream completed; user: when submitted/injected). Optional and