@kodax-ai/kodax 0.7.71 → 0.7.72
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +602 -487
- package/README.md +46 -27
- package/README_CN.md +30 -13
- package/dist/chunks/agent-YKGU4USA.js +2 -0
- package/dist/chunks/argument-completer-QZETLNAB.js +2 -0
- package/dist/chunks/{chunk-SX2WFHIS.js → chunk-2RI252RN.js} +1 -1
- package/dist/chunks/chunk-CLFP6UGU.js +71 -0
- package/dist/chunks/chunk-E27LHEIP.js +37 -0
- package/dist/chunks/chunk-EDZ5KJFT.js +5 -0
- package/dist/chunks/chunk-GIK4SGAT.js +364 -0
- package/dist/chunks/chunk-GVWPHE23.js +310 -0
- package/dist/chunks/{chunk-A2TFSV5M.js → chunk-IR5KIK7E.js} +1 -1
- package/dist/chunks/chunk-JSDLBXME.js +755 -0
- package/dist/chunks/chunk-MVARIMQV.js +22 -0
- package/dist/chunks/chunk-PKQOEDHJ.js +628 -0
- package/dist/chunks/{chunk-64NQBOSN.js → chunk-SQODXBLX.js} +1 -1
- package/dist/chunks/chunk-VDGCGOQH.js +328 -0
- package/dist/chunks/chunk-VVE3UM4F.js +410 -0
- package/dist/chunks/chunk-WIBLZK4G.js +151 -0
- package/dist/chunks/{compaction-config-5KKKXYFT.js → compaction-config-TWCDFLX6.js} +1 -1
- package/dist/chunks/{construction-bootstrap-OXDDDW6O.js → construction-bootstrap-ZJPXUPXQ.js} +1 -1
- package/dist/chunks/dist-JT4ATXVM.js +2 -0
- package/dist/chunks/host-SVEDZUC5.js +2 -0
- package/dist/chunks/{run-manager-Z3W6MDO7.js → run-manager-RX42UNEM.js} +1 -1
- package/dist/chunks/{utils-CFOXDCB5.js → utils-OTT5CG5J.js} +1 -1
- package/dist/index.d.ts +13 -13
- package/dist/index.js +4 -4
- package/dist/kodax_bootstrap.js +28 -0
- package/dist/kodax_cli.js +1325 -1333
- package/dist/kodax_resume.js +44 -0
- package/dist/provider-capabilities.json +50 -48
- package/dist/runtime-worker.js +1322 -1330
- package/dist/sdk-a2a.d.ts +10 -9
- package/dist/sdk-a2a.js +1 -1
- package/dist/sdk-agent.d.ts +382 -206
- package/dist/sdk-agent.js +1 -1
- package/dist/sdk-coding.d.ts +80 -128
- package/dist/sdk-coding.js +1 -1
- package/dist/sdk-experimental-memory.js +1 -1
- package/dist/sdk-mcp.js +1 -1
- package/dist/sdk-media.d.ts +3 -0
- package/dist/sdk-media.js +1 -1
- package/dist/sdk-repl.d.ts +71 -23
- package/dist/sdk-repl.js +2 -2
- package/dist/sdk-runtime.d.ts +143 -31
- package/dist/sdk-runtime.js +1 -1
- package/dist/sdk-session.d.ts +6 -5
- package/dist/sdk-session.js +1 -1
- package/dist/sdk-skills.d.ts +5 -5
- package/dist/sdk-skills.js +1 -1
- package/dist/semantic-worker.js +14 -14
- package/dist/types-chunks/{bash-prefix-extractor.d-YoiZl5yt.d.ts → bash-prefix-extractor.d-CHJO5y94.d.ts} +107 -248
- package/dist/types-chunks/{capsule.d-CK5Pfz1k.d.ts → capsule.d-DxtdE-GD.d.ts} +24 -95
- package/dist/types-chunks/center-types.d-BBT122uJ.d.ts +91 -0
- package/dist/types-chunks/{commands.d-D6g2jq8V.d.ts → commands.d-DZxHzH5-.d.ts} +6 -4
- package/dist/types-chunks/{guardrail.d-DilYC1dh.d.ts → guardrail.d-DlpMnd-Y.d.ts} +1 -1
- package/dist/types-chunks/{guardrail.d-DdeDWnVu.d.ts → guardrail.d-auV61_h5.d.ts} +83 -10
- package/dist/types-chunks/public-api.d--IDNJsu1.d.ts +1342 -0
- package/dist/types-chunks/{run-manager.d-DxU3SSGR.d.ts → run-manager.d-Bh50OdVl.d.ts} +1 -1
- package/dist/types-chunks/sdk-session-Cfw6NFu-.d.ts +82 -0
- package/dist/types-chunks/{types.d-CEZZSY9s.d.ts → types.d-CNZgY52F.d.ts} +2 -2
- package/dist/types-chunks/{types.d-vJExiRje.d.ts → types.d-DCQVBqVn.d.ts} +10 -5
- package/dist/types-chunks/{types.d-CRCaLt_s.d.ts → types.d-DH1mvdcl.d.ts} +284 -164
- package/dist/types-chunks/{types.d-CzsLFqmf.d.ts → types.d-EqQmHztg.d.ts} +9 -10
- package/dist/types-chunks/{utils.d-Cb6vdvFM.d.ts → utils.d-gmn3c5U4.d.ts} +9 -12
- package/docs/SDK_EMBEDDER_GUIDE.md +171 -26
- package/package.json +4 -4
- package/scripts/kodax-bin.cjs +4 -2
- package/scripts/production-env.cjs +9 -0
- package/dist/chunks/agent-X2EWQADL.js +0 -2
- package/dist/chunks/argument-completer-BLNXDO2F.js +0 -2
- package/dist/chunks/chunk-4DY756KL.js +0 -70
- package/dist/chunks/chunk-52JSZ77P.js +0 -37
- package/dist/chunks/chunk-A574DBTV.js +0 -422
- package/dist/chunks/chunk-F7KGYHJ3.js +0 -624
- package/dist/chunks/chunk-GVTM4Z6O.js +0 -151
- package/dist/chunks/chunk-PHH4TRGF.js +0 -22
- package/dist/chunks/chunk-PVUXONQB.js +0 -366
- package/dist/chunks/chunk-T7LYK53M.js +0 -329
- package/dist/chunks/chunk-VRSVNU2Y.js +0 -7
- package/dist/chunks/chunk-Y5XKAN7C.js +0 -755
- package/dist/chunks/chunk-Z535BARK.js +0 -306
- package/dist/chunks/dist-IXJRJ27U.js +0 -2
- package/dist/chunks/host-VRKDAN26.js +0 -2
- package/dist/types-chunks/public-api.d-BvCp5VkW.d.ts +0 -601
- package/dist/types-chunks/sdk-session-wGpa7X_U.d.ts +0 -796
|
@@ -1,5 +1,235 @@
|
|
|
1
1
|
import { k as KodaXMessage, a1 as KodaXToolDefinition, F as KodaXReasoningMode, a9 as KodaXWireReasoningEffort, a3 as KodaXToolResultContentItem, Y as KodaXThinkingBlock, I as KodaXRedactedThinkingBlock } from './types.d-Cqaw71Ax.js';
|
|
2
2
|
|
|
3
|
+
type AgentActorState = 'running' | 'idle' | 'closed';
|
|
4
|
+
type AgentTurnState = 'accepted' | 'running' | 'completed' | 'failed' | 'interrupted';
|
|
5
|
+
type AgentExecutionKind = 'native' | 'constructed' | 'workflow' | 'external';
|
|
6
|
+
type AgentForkTurns = 'all' | 'none' | number;
|
|
7
|
+
type AgentDataClassification = 'public' | 'internal' | 'sensitive';
|
|
8
|
+
type AgentProgressKind = 'status' | 'tool' | 'assistant';
|
|
9
|
+
type AgentInterruptScope = 'turn' | 'subtree';
|
|
10
|
+
type AgentMetadataValue = string | number | boolean | null | readonly AgentMetadataValue[] | {
|
|
11
|
+
readonly [key: string]: AgentMetadataValue;
|
|
12
|
+
};
|
|
13
|
+
interface AgentCapabilities {
|
|
14
|
+
readonly tools: readonly string[];
|
|
15
|
+
readonly filesystem: 'none' | 'read' | 'write';
|
|
16
|
+
readonly network: boolean;
|
|
17
|
+
readonly providers: readonly string[];
|
|
18
|
+
readonly canAskUser: boolean;
|
|
19
|
+
/** Backend operation support. Omitted means the complete native contract. */
|
|
20
|
+
readonly control?: {
|
|
21
|
+
readonly followup: boolean;
|
|
22
|
+
readonly interrupt: boolean;
|
|
23
|
+
readonly streaming: boolean;
|
|
24
|
+
readonly artifacts: boolean;
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
interface AgentActor {
|
|
28
|
+
readonly path: string;
|
|
29
|
+
readonly taskName: string;
|
|
30
|
+
readonly parentPath?: string;
|
|
31
|
+
readonly kind: AgentExecutionKind;
|
|
32
|
+
readonly state: AgentActorState;
|
|
33
|
+
readonly capabilities: AgentCapabilities;
|
|
34
|
+
readonly turnIds: readonly string[];
|
|
35
|
+
readonly currentTurnId?: string;
|
|
36
|
+
readonly mailboxCursor: number;
|
|
37
|
+
readonly createdAt: string;
|
|
38
|
+
readonly updatedAt: string;
|
|
39
|
+
readonly revision: number;
|
|
40
|
+
}
|
|
41
|
+
/** Executor-neutral artifact metadata retained beside the legacy string reference. */
|
|
42
|
+
interface AgentArtifactDescriptor {
|
|
43
|
+
readonly name: string;
|
|
44
|
+
readonly uri?: string;
|
|
45
|
+
readonly mimeType?: string;
|
|
46
|
+
readonly size?: number;
|
|
47
|
+
readonly hash?: string;
|
|
48
|
+
readonly provenance?: string;
|
|
49
|
+
readonly producingAgentId?: string;
|
|
50
|
+
readonly remoteTaskId?: string;
|
|
51
|
+
}
|
|
52
|
+
interface AgentTurn {
|
|
53
|
+
readonly turnId: string;
|
|
54
|
+
readonly actorPath: string;
|
|
55
|
+
readonly sequence: number;
|
|
56
|
+
readonly state: AgentTurnState;
|
|
57
|
+
readonly objective: string;
|
|
58
|
+
readonly forkTurns: AgentForkTurns;
|
|
59
|
+
readonly metadata?: Readonly<Record<string, AgentMetadataValue>>;
|
|
60
|
+
readonly createdAt: string;
|
|
61
|
+
readonly startedAt?: string;
|
|
62
|
+
readonly completedAt?: string;
|
|
63
|
+
readonly output?: string;
|
|
64
|
+
readonly artifacts?: readonly string[];
|
|
65
|
+
readonly artifactDetails?: readonly AgentArtifactDescriptor[];
|
|
66
|
+
readonly structured?: AgentMetadataValue;
|
|
67
|
+
readonly error?: string;
|
|
68
|
+
/** Bounded Runtime-owned activity projection; full transcripts remain executor-owned. */
|
|
69
|
+
readonly progress?: readonly AgentProgressItem[];
|
|
70
|
+
readonly revision: number;
|
|
71
|
+
}
|
|
72
|
+
interface AgentProgressUpdate {
|
|
73
|
+
readonly kind: AgentProgressKind;
|
|
74
|
+
readonly summary: string;
|
|
75
|
+
}
|
|
76
|
+
interface AgentProgressItem extends AgentProgressUpdate {
|
|
77
|
+
readonly sequence: number;
|
|
78
|
+
readonly createdAt: string;
|
|
79
|
+
}
|
|
80
|
+
interface AgentMailboxMessage {
|
|
81
|
+
readonly messageId: string;
|
|
82
|
+
readonly sequence: number;
|
|
83
|
+
readonly senderPath: string;
|
|
84
|
+
readonly recipientPath: string;
|
|
85
|
+
readonly turnId?: string;
|
|
86
|
+
readonly kind: 'message' | 'followup' | 'completion';
|
|
87
|
+
readonly classification: AgentDataClassification;
|
|
88
|
+
/** Canonical actors that handled this chain; absent only on pre-hardening schema-v1 snapshots. */
|
|
89
|
+
readonly lineage?: readonly string[];
|
|
90
|
+
readonly forwardedMessageId?: string;
|
|
91
|
+
readonly content: string;
|
|
92
|
+
readonly createdAt: string;
|
|
93
|
+
}
|
|
94
|
+
type AgentEventKind = 'actor_spawned' | 'turn_started' | 'message_delivered' | 'turn_progress' | 'turn_completed' | 'turn_failed' | 'turn_interrupted' | 'actor_closed';
|
|
95
|
+
interface AgentEvent {
|
|
96
|
+
readonly sequence: number;
|
|
97
|
+
readonly kind: AgentEventKind;
|
|
98
|
+
readonly actorPath: string;
|
|
99
|
+
readonly turnId?: string;
|
|
100
|
+
readonly parentPath?: string;
|
|
101
|
+
readonly progress?: AgentProgressItem;
|
|
102
|
+
readonly createdAt: string;
|
|
103
|
+
}
|
|
104
|
+
interface AgentSpawnInput {
|
|
105
|
+
readonly taskName: string;
|
|
106
|
+
readonly objective: string;
|
|
107
|
+
readonly kind?: AgentExecutionKind;
|
|
108
|
+
readonly forkTurns?: AgentForkTurns;
|
|
109
|
+
readonly capabilities?: Partial<AgentCapabilities>;
|
|
110
|
+
readonly metadata?: Readonly<Record<string, AgentMetadataValue>>;
|
|
111
|
+
}
|
|
112
|
+
interface AgentTurnRef {
|
|
113
|
+
readonly actorPath: string;
|
|
114
|
+
readonly turnId: string;
|
|
115
|
+
readonly state: 'accepted' | 'running';
|
|
116
|
+
}
|
|
117
|
+
interface AgentFollowupResult {
|
|
118
|
+
readonly delivery: 'started_turn' | 'current_turn';
|
|
119
|
+
readonly turn: AgentTurnRef;
|
|
120
|
+
}
|
|
121
|
+
interface AgentTreeSnapshot {
|
|
122
|
+
readonly rootPath: '/root';
|
|
123
|
+
readonly actors: readonly AgentListEntry[];
|
|
124
|
+
readonly activeNonRootTurns: number;
|
|
125
|
+
readonly maxConcurrentThreads: number;
|
|
126
|
+
readonly revision: number;
|
|
127
|
+
}
|
|
128
|
+
interface AgentTurnSummary {
|
|
129
|
+
readonly turnId: string;
|
|
130
|
+
readonly state: AgentTurnState;
|
|
131
|
+
readonly summary: string;
|
|
132
|
+
readonly summaryTruncated: boolean;
|
|
133
|
+
readonly recentActivity: readonly AgentProgressItem[];
|
|
134
|
+
}
|
|
135
|
+
interface AgentListEntry extends AgentActor {
|
|
136
|
+
readonly latestTurn?: AgentTurnSummary;
|
|
137
|
+
}
|
|
138
|
+
interface AgentDetail {
|
|
139
|
+
readonly actor: AgentActor;
|
|
140
|
+
readonly turns: readonly AgentTurn[];
|
|
141
|
+
readonly mailbox: readonly AgentMailboxMessage[];
|
|
142
|
+
}
|
|
143
|
+
interface AgentOutput {
|
|
144
|
+
readonly actorPath: string;
|
|
145
|
+
readonly turnId: string;
|
|
146
|
+
readonly state: AgentTurnState;
|
|
147
|
+
readonly output?: string;
|
|
148
|
+
readonly outputTruncated?: boolean;
|
|
149
|
+
readonly artifacts: readonly string[];
|
|
150
|
+
readonly artifactDetails?: readonly AgentArtifactDescriptor[];
|
|
151
|
+
readonly progress: readonly AgentProgressItem[];
|
|
152
|
+
readonly structured?: AgentMetadataValue;
|
|
153
|
+
readonly error?: string;
|
|
154
|
+
}
|
|
155
|
+
interface AgentLimitReached {
|
|
156
|
+
readonly code: 'agent_limit_reached';
|
|
157
|
+
readonly maxConcurrentThreads: number;
|
|
158
|
+
readonly activeNonRootTurns: number;
|
|
159
|
+
readonly availableNonRootSlots: 0;
|
|
160
|
+
readonly retryable: true;
|
|
161
|
+
}
|
|
162
|
+
interface AgentBudgetExhausted {
|
|
163
|
+
readonly code: 'agent_budget_exhausted';
|
|
164
|
+
readonly retryable: false;
|
|
165
|
+
readonly reason: string;
|
|
166
|
+
}
|
|
167
|
+
interface AgentBudgetAdmissionInput {
|
|
168
|
+
readonly actorPath: string;
|
|
169
|
+
readonly parentPath: string;
|
|
170
|
+
readonly turnId: string;
|
|
171
|
+
readonly kind: AgentExecutionKind;
|
|
172
|
+
readonly units: 1;
|
|
173
|
+
}
|
|
174
|
+
type AgentBudgetAdmission = {
|
|
175
|
+
readonly admitted: true;
|
|
176
|
+
} | {
|
|
177
|
+
readonly admitted: false;
|
|
178
|
+
readonly fact: AgentBudgetExhausted;
|
|
179
|
+
};
|
|
180
|
+
interface AgentBudgetPort {
|
|
181
|
+
admit(input: AgentBudgetAdmissionInput): Promise<AgentBudgetAdmission>;
|
|
182
|
+
refund?(turnId: string): Promise<void>;
|
|
183
|
+
snapshot?(): unknown;
|
|
184
|
+
}
|
|
185
|
+
interface AgentExecutionInput {
|
|
186
|
+
readonly actor: AgentActor;
|
|
187
|
+
readonly turn: AgentTurn;
|
|
188
|
+
readonly priorTurns: readonly AgentTurn[];
|
|
189
|
+
readonly signal: AbortSignal;
|
|
190
|
+
drainMailbox(): Promise<readonly AgentMailboxMessage[]>;
|
|
191
|
+
reportProgress(update: AgentProgressUpdate): Promise<void>;
|
|
192
|
+
}
|
|
193
|
+
interface AgentExecutionResult {
|
|
194
|
+
readonly output: string;
|
|
195
|
+
readonly artifacts?: readonly string[];
|
|
196
|
+
readonly artifactDetails?: readonly AgentArtifactDescriptor[];
|
|
197
|
+
readonly structured?: AgentMetadataValue;
|
|
198
|
+
}
|
|
199
|
+
interface AgentMutationOptions {
|
|
200
|
+
/** Optimistic Actor revision checked inside the serialized durable mutation. */
|
|
201
|
+
readonly expectedRevision?: number;
|
|
202
|
+
}
|
|
203
|
+
interface AgentTurnExecutor {
|
|
204
|
+
execute(input: AgentExecutionInput): Promise<AgentExecutionResult>;
|
|
205
|
+
}
|
|
206
|
+
interface AgentActorSnapshot {
|
|
207
|
+
readonly schemaVersion: 1;
|
|
208
|
+
readonly revision: number;
|
|
209
|
+
readonly maxConcurrentThreads: number;
|
|
210
|
+
readonly actors: readonly AgentActor[];
|
|
211
|
+
readonly turns: readonly AgentTurn[];
|
|
212
|
+
readonly mailboxes: Readonly<Record<string, readonly AgentMailboxMessage[]>>;
|
|
213
|
+
readonly events: readonly AgentEvent[];
|
|
214
|
+
}
|
|
215
|
+
interface AgentActorStore {
|
|
216
|
+
load(): Promise<AgentActorSnapshot | undefined>;
|
|
217
|
+
save(snapshot: AgentActorSnapshot, expectedRevision: number): Promise<void>;
|
|
218
|
+
}
|
|
219
|
+
/** Runtime-bound actor control surface. The caller path is minted by Runtime. */
|
|
220
|
+
interface AgentActorClient {
|
|
221
|
+
readonly callerPath: string;
|
|
222
|
+
spawn(input: AgentSpawnInput): Promise<AgentTurnRef>;
|
|
223
|
+
send(targetPath: string, content: string, classification?: AgentDataClassification, forwardedMessageId?: string): Promise<AgentMailboxMessage>;
|
|
224
|
+
followup(targetPath: string, objective: string, metadata?: Readonly<Record<string, AgentMetadataValue>>, options?: AgentMutationOptions): Promise<AgentFollowupResult>;
|
|
225
|
+
interrupt(targetPath: string, reason?: string, scope?: AgentInterruptScope): Promise<void>;
|
|
226
|
+
list(): AgentTreeSnapshot;
|
|
227
|
+
get(targetPath: string): AgentDetail;
|
|
228
|
+
output(targetPath: string, turnId?: string): AgentOutput;
|
|
229
|
+
eventSnapshot(afterSequence?: number): readonly AgentEvent[];
|
|
230
|
+
wait(afterSequence?: number, timeoutMs?: number, signal?: AbortSignal): Promise<AgentEvent | undefined>;
|
|
231
|
+
}
|
|
232
|
+
|
|
3
233
|
/**
|
|
4
234
|
* @kodax-ai/agent Types
|
|
5
235
|
*
|
|
@@ -230,6 +460,8 @@ type KodaXSessionUiHistoryItemType = KodaXSessionUiTextHistoryItemType | 'tool_g
|
|
|
230
460
|
interface KodaXSessionUiTextHistoryItem {
|
|
231
461
|
type: KodaXSessionUiTextHistoryItemType;
|
|
232
462
|
text: string;
|
|
463
|
+
/** Original UI event time in epoch milliseconds. Absent on older sessions. */
|
|
464
|
+
timestamp?: number;
|
|
233
465
|
icon?: string;
|
|
234
466
|
compactText?: string;
|
|
235
467
|
}
|
|
@@ -249,6 +481,8 @@ interface KodaXSessionUiToolCall {
|
|
|
249
481
|
}
|
|
250
482
|
interface KodaXSessionUiToolGroupHistoryItem {
|
|
251
483
|
type: 'tool_group';
|
|
484
|
+
/** Original UI event time in epoch milliseconds. Absent on older sessions. */
|
|
485
|
+
timestamp?: number;
|
|
252
486
|
tools: KodaXSessionUiToolCall[];
|
|
253
487
|
}
|
|
254
488
|
type KodaXSessionUiHistoryItem = KodaXSessionUiTextHistoryItem | KodaXSessionUiToolGroupHistoryItem;
|
|
@@ -273,7 +507,7 @@ interface KodaXSessionRuntimeInfo {
|
|
|
273
507
|
reasoningMode?: string;
|
|
274
508
|
/** Permission mode active at session start, e.g. `'auto'` | `'plan'`. */
|
|
275
509
|
permissionMode?: string;
|
|
276
|
-
/** Agent mode active at session start, e.g. `'sa'` | `'ama'
|
|
510
|
+
/** Agent mode active at session start, e.g. `'sa'` | `'ama'`. */
|
|
277
511
|
agentMode?: string;
|
|
278
512
|
}
|
|
279
513
|
interface KodaXSessionData {
|
|
@@ -290,6 +524,8 @@ interface KodaXSessionData {
|
|
|
290
524
|
extensionRecords?: KodaXExtensionSessionRecord[];
|
|
291
525
|
lineage?: KodaXSessionLineage;
|
|
292
526
|
artifactLedger?: KodaXSessionArtifactLedgerEntry[];
|
|
527
|
+
/** Runtime-owned F270 Actor tree snapshot; persisted with the session owner. */
|
|
528
|
+
actorSnapshot?: AgentActorSnapshot;
|
|
293
529
|
}
|
|
294
530
|
interface KodaXSessionMeta {
|
|
295
531
|
_type: 'meta';
|
|
@@ -305,6 +541,8 @@ interface KodaXSessionMeta {
|
|
|
305
541
|
extensionState?: KodaXExtensionSessionState;
|
|
306
542
|
extensionRecordCount?: number;
|
|
307
543
|
artifactLedgerCount?: number;
|
|
544
|
+
/** Runtime-owned F270 Actor tree snapshot; absent on pre-v0.7.72 sessions. */
|
|
545
|
+
actorSnapshot?: AgentActorSnapshot;
|
|
308
546
|
lineageVersion?: 2;
|
|
309
547
|
activeEntryId?: string | null;
|
|
310
548
|
lineageEntryCount?: number;
|
|
@@ -481,7 +719,7 @@ interface Guardrail {
|
|
|
481
719
|
* the caller exits. Mirrors the Scout → Generator upgrade path.
|
|
482
720
|
* - `as-tool`: `target` is invoked like a tool from within the caller loop;
|
|
483
721
|
* only the generated input is passed, and control returns on completion.
|
|
484
|
-
* Mirrors
|
|
722
|
+
* Mirrors the bounded handoff used by an Actor Turn.
|
|
485
723
|
*
|
|
486
724
|
* `inputFilter` is applied to the visible history before the target runs;
|
|
487
725
|
* default is no filtering.
|
|
@@ -512,8 +750,8 @@ interface Agent<TContext = unknown> {
|
|
|
512
750
|
readonly guardrails?: readonly Guardrail[];
|
|
513
751
|
/**
|
|
514
752
|
* FEATURE_191 — one-sentence human-readable summary surfaced to
|
|
515
|
-
* other agents that may
|
|
516
|
-
* `
|
|
753
|
+
* other agents that may select this one (e.g., via
|
|
754
|
+
* `spawn_agent(agent_id=<name>)`). The
|
|
517
755
|
* field propagates from `AgentContent.description` when the agent is
|
|
518
756
|
* built via the construction substrate; built-in / SDK-created
|
|
519
757
|
* agents may set it directly. Optional for backward compatibility
|
|
@@ -1441,8 +1679,8 @@ interface SessionDispatchResult {
|
|
|
1441
1679
|
* functions of the immutable event payload + read-only context.
|
|
1442
1680
|
* - `assertTerminal` must be called exactly once at run end. The
|
|
1443
1681
|
* Runner is responsible for honoring this.
|
|
1444
|
-
* - The session is single-run; spawning a sub-run (handoff /
|
|
1445
|
-
*
|
|
1682
|
+
* - The session is single-run; spawning a sub-run (handoff / Actor Turn)
|
|
1683
|
+
* creates a fresh session for the target.
|
|
1446
1684
|
*
|
|
1447
1685
|
* The session is never exposed across module boundaries — it lives in
|
|
1448
1686
|
* the Runner closure and dies when the run ends. WeakMap is overkill
|
|
@@ -2263,154 +2501,6 @@ interface KodaXVideoInputArtifact {
|
|
|
2263
2501
|
}
|
|
2264
2502
|
type KodaXInputArtifact = KodaXImageInputArtifact | KodaXFileInputArtifact | KodaXVideoInputArtifact;
|
|
2265
2503
|
|
|
2266
|
-
/**
|
|
2267
|
-
* Child task registry primitive — generic fan-out tracking.
|
|
2268
|
-
*
|
|
2269
|
-
* FEATURE_120 v0.7.39 Step 0 (package-attribution migration, ADR-021).
|
|
2270
|
-
* Lifted from `@kodax-ai/coding`'s `KodaXToolExecutionContext.childTaskRegistry`
|
|
2271
|
-
* field + inline cleanup chain in `tools/dispatch-child-tasks.ts`. The
|
|
2272
|
-
* coding side now consumes this primitive specialized to its
|
|
2273
|
-
* `KodaXChildExecutionResult` type; any other agent-flavor downstream
|
|
2274
|
-
* can specialize on its own child-result type without re-implementing
|
|
2275
|
-
* the cleanup contract.
|
|
2276
|
-
*
|
|
2277
|
-
* The shape is intentionally minimal: a Map plus a `register` helper
|
|
2278
|
-
* that bundles the v0.7.38 FEATURE_155 Bug A hotfix (`c1bdaf4e`)
|
|
2279
|
-
* cleanup chain into a single call site. The helper exists because
|
|
2280
|
-
* the cleanup is **not optional** — without it, every settled promise
|
|
2281
|
-
* stays in the registry forever, gets re-wrapped by the next
|
|
2282
|
-
* idle-yield `waitForWakeEvent` call, and fires spurious
|
|
2283
|
-
* `child-completed` wakes (production symptom: Evaluator gets
|
|
2284
|
-
* bombarded by duplicate `<task-completed>` notifications, consuming
|
|
2285
|
-
* an LLM turn each up to `IDLE_YIELD_MAX_ITERATIONS=64`).
|
|
2286
|
-
*/
|
|
2287
|
-
/**
|
|
2288
|
-
* Map of `task_id` → in-flight child-execution promise. Generic over
|
|
2289
|
-
* the child-result type so the agent layer doesn't depend on any
|
|
2290
|
-
* specific agent flavor's result shape.
|
|
2291
|
-
*
|
|
2292
|
-
* Mutation contract:
|
|
2293
|
-
* - Owned by the runner's per-turn execution context. The dispatch
|
|
2294
|
-
* tool writes via `registerChildTask`; the idle-yield outer loop
|
|
2295
|
-
* reads via `Map.prototype.entries()` / `.size`.
|
|
2296
|
-
* - **Never delete entries manually** — call `registerChildTask`
|
|
2297
|
-
* and the cleanup chain it installs will run on settle.
|
|
2298
|
-
*/
|
|
2299
|
-
type ChildTaskRegistry<T> = Map<string, Promise<T>>;
|
|
2300
|
-
/**
|
|
2301
|
-
* Register an in-flight child-execution promise in the registry and
|
|
2302
|
-
* install the cleanup chain that removes the entry once the promise
|
|
2303
|
-
* settles (success or failure).
|
|
2304
|
-
*
|
|
2305
|
-
* The cleanup chain is two stages:
|
|
2306
|
-
* 1. `.finally(() => registry.delete(childId))` — runs on settle
|
|
2307
|
-
* regardless of outcome, removing the entry before the next
|
|
2308
|
-
* idle-yield outer-loop iteration observes the registry.
|
|
2309
|
-
* 2. `.catch(() => {})` — swallows the rejection on the cleanup
|
|
2310
|
-
* chain so a child that crashes before any consumer awaits it
|
|
2311
|
-
* doesn't surface as `unhandledRejection` on Node. Must come
|
|
2312
|
-
* AFTER `.finally` because `.finally` returns a NEW promise
|
|
2313
|
-
* that rejects with the same reason.
|
|
2314
|
-
*
|
|
2315
|
-
* The original `promise` argument is **not** returned — the helper's
|
|
2316
|
-
* value-add is the cleanup side-effect, not promise transformation.
|
|
2317
|
-
* Callers that need to await the result read from `registry.get(id)`
|
|
2318
|
-
* or hold their own reference.
|
|
2319
|
-
*
|
|
2320
|
-
* @throws Error when `childId` already exists in the registry. Caller
|
|
2321
|
-
* should report this to the LLM as a tool-error (duplicate task_id);
|
|
2322
|
-
* the helper does NOT swallow the conflict because that would
|
|
2323
|
-
* silently overwrite an in-flight child's tracking entry.
|
|
2324
|
-
*/
|
|
2325
|
-
declare function registerChildTask<T>(registry: ChildTaskRegistry<T>, childId: string, promise: Promise<T>): void;
|
|
2326
|
-
|
|
2327
|
-
/**
|
|
2328
|
-
* Generic per-task abort primitive — `requestTaskStop`.
|
|
2329
|
-
*
|
|
2330
|
-
* FEATURE_120 v0.7.39 Phase 3a (ADR-021). Coordinator-style agents need
|
|
2331
|
-
* to request that a specific in-flight child task exit gracefully. The
|
|
2332
|
-
* @kodax-ai/agent layer owns the abort-controller registry shape and
|
|
2333
|
-
* the abort-dispatch decision; agent-flavor wrappers (e.g. the coding
|
|
2334
|
-
* `task_stop` tool, Phase 3b) layer in domain framing such as the
|
|
2335
|
-
* `<coordinator-stop-request>` message tag.
|
|
2336
|
-
*
|
|
2337
|
-
* What this primitive owns:
|
|
2338
|
-
* - A `TaskAbortRegistry` type alias = `Map<string, AbortController>`.
|
|
2339
|
-
* The map is owned + mutated by the caller; the primitive only
|
|
2340
|
-
* reads it. Callers use `registry.set(id, controller)` /
|
|
2341
|
-
* `registry.delete(id)` directly — the standard `Map` mutators
|
|
2342
|
-
* are simple enough that wrapping them adds no value.
|
|
2343
|
-
* - `requestTaskStop({taskId, registry, reason?})` — looks up the
|
|
2344
|
-
* controller, decides whether to abort, calls `controller.abort`,
|
|
2345
|
-
* returns a structured outcome.
|
|
2346
|
-
*
|
|
2347
|
-
* Abort semantics (matches the existing FEATURE_115 soft-pause
|
|
2348
|
-
* principle): aborting fires the signal but does NOT interrupt any
|
|
2349
|
-
* synchronous tool that's already executing. The child's next abort
|
|
2350
|
-
* check (`signal.throwIfAborted()` or an `signal.aborted` poll)
|
|
2351
|
-
* surfaces the abort. This matches Node's AbortController contract.
|
|
2352
|
-
*
|
|
2353
|
-
* What this primitive does NOT do (deliberate):
|
|
2354
|
-
* - Enqueue a coordinator-stop-request message — that's a
|
|
2355
|
-
* coding-flavor convenience and uses the existing
|
|
2356
|
-
* `routeMessage` primitive at the tool layer.
|
|
2357
|
-
* - Track abort lifecycle / auto-cleanup the registry — the
|
|
2358
|
-
* controller's lifetime is tied to its owning task's Promise;
|
|
2359
|
-
* the caller removes the registry entry when the task settles
|
|
2360
|
-
* (typically in a `.finally` chain alongside the child-task
|
|
2361
|
-
* registry cleanup).
|
|
2362
|
-
* - Time-out enforcement / retry — orthogonal concerns owned at
|
|
2363
|
-
* higher layers if needed.
|
|
2364
|
-
*/
|
|
2365
|
-
/**
|
|
2366
|
-
* Registry mapping task ids to their owning AbortController.
|
|
2367
|
-
* Lifetime: created per parent-run, populated at child dispatch,
|
|
2368
|
-
* cleared when the child Promise settles.
|
|
2369
|
-
*/
|
|
2370
|
-
type TaskAbortRegistry = Map<string, AbortController>;
|
|
2371
|
-
interface RequestTaskStopOptions {
|
|
2372
|
-
/** Target task id. Must exist as a key in `registry`. */
|
|
2373
|
-
readonly taskId: string;
|
|
2374
|
-
/** Registry of in-flight task abort controllers. */
|
|
2375
|
-
readonly registry: ReadonlyMap<string, AbortController>;
|
|
2376
|
-
/**
|
|
2377
|
-
* Optional cause forwarded to `AbortController.abort(reason)`.
|
|
2378
|
-
* - Error → passed through verbatim (preserves stack / custom
|
|
2379
|
-
* subclasses).
|
|
2380
|
-
* - string → wrapped in `new Error(reason)`.
|
|
2381
|
-
* - undefined → a default Error mentioning the taskId is
|
|
2382
|
-
* fabricated so the child receives a non-empty signal.reason.
|
|
2383
|
-
*/
|
|
2384
|
-
readonly reason?: string | Error;
|
|
2385
|
-
}
|
|
2386
|
-
type RequestTaskStopResult = {
|
|
2387
|
-
readonly ok: true;
|
|
2388
|
-
readonly taskId: string;
|
|
2389
|
-
} | {
|
|
2390
|
-
readonly ok: false;
|
|
2391
|
-
readonly reason: 'unknown-target';
|
|
2392
|
-
readonly taskId: string;
|
|
2393
|
-
} | {
|
|
2394
|
-
readonly ok: false;
|
|
2395
|
-
readonly reason: 'already-aborted';
|
|
2396
|
-
readonly taskId: string;
|
|
2397
|
-
};
|
|
2398
|
-
/**
|
|
2399
|
-
* Look up `taskId` in `registry`. If found and not yet aborted, abort
|
|
2400
|
-
* the controller with the supplied reason. Returns a discriminated
|
|
2401
|
-
* outcome so callers can render success / error UX without string
|
|
2402
|
-
* matching.
|
|
2403
|
-
*
|
|
2404
|
-
* `already-aborted` is reported separately from success because the
|
|
2405
|
-
* first-abort `signal.reason` is preserved verbatim — debugging
|
|
2406
|
-
* chains depend on the original cause not being overwritten by
|
|
2407
|
-
* subsequent stop requests.
|
|
2408
|
-
*
|
|
2409
|
-
* Synchronous: `AbortController.abort` is synchronous; no async work
|
|
2410
|
-
* is performed by this primitive.
|
|
2411
|
-
*/
|
|
2412
|
-
declare function requestTaskStop(opts: RequestTaskStopOptions): RequestTaskStopResult;
|
|
2413
|
-
|
|
2414
2504
|
/**
|
|
2415
2505
|
* FEATURE_125 (v0.7.41) — Team Mode Layer 1: per-instance state broadcast.
|
|
2416
2506
|
*
|
|
@@ -3189,6 +3279,8 @@ interface WorkflowTaskResult {
|
|
|
3189
3279
|
* spawn carried `outputSchema` and a JSON value was parsed from the child's
|
|
3190
3280
|
* output. The workflow script consumes it directly (e.g. `result.structured`). */
|
|
3191
3281
|
readonly structured?: unknown;
|
|
3282
|
+
/** Durable artifacts produced by this Agent turn. */
|
|
3283
|
+
readonly artifacts?: readonly string[];
|
|
3192
3284
|
/** Short user-facing digest, separate from the full finalText used for synthesis/audit. */
|
|
3193
3285
|
readonly digest?: string;
|
|
3194
3286
|
/** True when a digest was attempted but failed (error/timeout/empty); the UI then labels the excerpt fallback. */
|
|
@@ -3293,7 +3385,7 @@ interface WorkflowApi {
|
|
|
3293
3385
|
/** Snapshot a (possibly running) agent.
|
|
3294
3386
|
* @deprecated Prefer `snapshot(taskId)`; `output` is kept as a compatibility alias. */
|
|
3295
3387
|
output(taskId: string): Promise<WorkflowTaskSnapshot>;
|
|
3296
|
-
/** Send a message to a running
|
|
3388
|
+
/** Send a message to a running Agent through its Actor mailbox. */
|
|
3297
3389
|
send(taskId: string, content: string): Promise<void>;
|
|
3298
3390
|
/** Stop a running agent (graceful abort). */
|
|
3299
3391
|
stop(taskId: string, reason: string): Promise<void>;
|
|
@@ -3372,14 +3464,11 @@ interface WorkflowModule<TArgs = unknown, TResult = unknown> {
|
|
|
3372
3464
|
readonly meta: WorkflowMeta;
|
|
3373
3465
|
readonly run: WorkflowRun<TArgs, TResult>;
|
|
3374
3466
|
}
|
|
3375
|
-
/**
|
|
3376
|
-
* Injected execution backend. The coding layer implements this over its
|
|
3377
|
-
* child-dispatch substrate (ChildTaskRegistry / childProgressSnapshots /
|
|
3378
|
-
* MessageQueue / executeChildAgents); tests inject a fake. The agent
|
|
3379
|
-
* runtime depends ONLY on this interface — never on coding.
|
|
3380
|
-
*/
|
|
3467
|
+
/** Injected execution backend over the host's Runtime-owned Actor plane. */
|
|
3381
3468
|
interface WorkflowAgentBackend {
|
|
3382
3469
|
spawn(input: WorkflowSpawnAgentInput): Promise<WorkflowTaskHandle>;
|
|
3470
|
+
/** Wait until the global Actor scheduler can admit a step. False means no slot can ever exist. */
|
|
3471
|
+
waitForAgentCapacity?(signal?: AbortSignal): Promise<boolean>;
|
|
3383
3472
|
wait(taskId: string, opts?: WorkflowWaitOptions): Promise<WorkflowTaskResult>;
|
|
3384
3473
|
output(taskId: string): Promise<WorkflowTaskSnapshot>;
|
|
3385
3474
|
send(taskId: string, content: string): Promise<void>;
|
|
@@ -3392,11 +3481,42 @@ interface WorkflowAgentBackend {
|
|
|
3392
3481
|
writeArtifact?(name: string, value: unknown): Promise<WorkflowArtifactRef>;
|
|
3393
3482
|
}
|
|
3394
3483
|
type WorkflowRunStatus = 'running' | 'completed' | 'failed' | 'stopped';
|
|
3484
|
+
type WorkflowOutcomeStatus = 'completed' | 'partial' | 'failed' | 'interrupted';
|
|
3485
|
+
interface WorkflowOutcomeResult {
|
|
3486
|
+
readonly taskId: string;
|
|
3487
|
+
readonly name: string;
|
|
3488
|
+
readonly status: WorkflowTaskStatus;
|
|
3489
|
+
readonly summary: string;
|
|
3490
|
+
readonly structured?: unknown;
|
|
3491
|
+
readonly artifacts: readonly string[];
|
|
3492
|
+
readonly usage?: WorkflowTaskUsage;
|
|
3493
|
+
}
|
|
3494
|
+
interface WorkflowOutcomeError {
|
|
3495
|
+
readonly taskId?: string;
|
|
3496
|
+
readonly name?: string;
|
|
3497
|
+
readonly message: string;
|
|
3498
|
+
}
|
|
3499
|
+
interface WorkflowOutcomeUsage extends WorkflowTaskUsage {
|
|
3500
|
+
readonly totalSpawned: number;
|
|
3501
|
+
}
|
|
3502
|
+
/** Stable terminal payload exposed through the Workflow protocol owner's Agent output. */
|
|
3503
|
+
interface WorkflowOutcome {
|
|
3504
|
+
readonly runId: string;
|
|
3505
|
+
readonly status: WorkflowOutcomeStatus;
|
|
3506
|
+
readonly summary: string;
|
|
3507
|
+
readonly results: readonly WorkflowOutcomeResult[];
|
|
3508
|
+
readonly artifacts: readonly WorkflowArtifactRef[];
|
|
3509
|
+
readonly coverage: readonly string[];
|
|
3510
|
+
readonly unresolved: readonly string[];
|
|
3511
|
+
readonly errors: readonly WorkflowOutcomeError[];
|
|
3512
|
+
readonly usage: WorkflowOutcomeUsage;
|
|
3513
|
+
}
|
|
3395
3514
|
/** Immutable snapshot of a workflow run's accumulated state. */
|
|
3396
3515
|
interface WorkflowRunState {
|
|
3397
3516
|
readonly runId: string;
|
|
3398
3517
|
readonly status: WorkflowRunStatus;
|
|
3399
3518
|
readonly totalSpawned: number;
|
|
3519
|
+
readonly results: readonly WorkflowTaskResult[];
|
|
3400
3520
|
readonly events: readonly WorkflowEvent[];
|
|
3401
3521
|
readonly artifacts: readonly WorkflowArtifactRef[];
|
|
3402
3522
|
}
|
|
@@ -3412,7 +3532,7 @@ type WorkflowProcessItemKind = 'phase' | 'agent' | 'step' | 'artifact';
|
|
|
3412
3532
|
*/
|
|
3413
3533
|
type WorkflowProcessItemOrigin = 'ran' | 'replayed-from-cache';
|
|
3414
3534
|
type WorkflowProcessSummaryStatus = 'pending' | 'result' | 'notice' | 'unavailable';
|
|
3415
|
-
type WorkflowProcessSource = 'command' | '
|
|
3535
|
+
type WorkflowProcessSource = 'command' | 'review' | 'sdk' | 'capsule' | 'extension' | 'automation';
|
|
3416
3536
|
interface WorkflowProcessItem {
|
|
3417
3537
|
readonly id: string;
|
|
3418
3538
|
readonly title: string;
|
|
@@ -3928,5 +4048,5 @@ interface CreateAgentExecutorPlaneOptions {
|
|
|
3928
4048
|
readonly closeTimeoutMs?: number;
|
|
3929
4049
|
}
|
|
3930
4050
|
|
|
3931
|
-
export { ASK_USER_BACK_SIGNAL as A, ASK_USER_CUSTOM_INPUT_SIGNAL as a,
|
|
3932
|
-
export type {
|
|
4051
|
+
export { ASK_USER_BACK_SIGNAL as A, ASK_USER_CUSTOM_INPUT_SIGNAL as a, DEFAULT_SYSTEM_CAP as aV, InvariantSession as bi, MAX_TOOL_LOOP_ITERATIONS as c6, Runner as d0, Tracer as dE, WorkflowEventRecorder as dP, SpanImpl as dm, registerPresetDispatcher as e$, attachRunnerRecoveryTranscript as eA, buildAssistantMessageFromLlmResult as eB, buildSystemPrompt as eC, buildToolResultMessage as eD, createAgent as eE, createHandoff as eF, createInMemorySession as eG, createInvariantSessionForAgent as eH, createStateWriter as eI, createTrace as eJ, createWorkflowProcessTracker as eK, defaultTracer as eL, detectInstructionsInjection as eM, discoverInstances as eN, executeRunnerToolCall as eO, extractAssistantTextFromMessage as eP, getActiveUserInteraction as eQ, getAdmittedAgentBindings as eR, hashMemoryIdentityComponent as eS, isAskUserCustomInputAnswer as eT, isFinalWorkflowProcessStatus as eU, isRunnableTool as eV, isRunnerLlmResult as eW, matchesMemoryApplicability as eX, memoryApplicabilityFingerprint as eY, normalizeHostMetadata as eZ, readRunnerRecoveryTranscript as e_, _resetAdmittedAgentBindings as ex, _resetPresetDispatchers as ey, asSingleSelection as ez, runAdmissionAudit as f0, setActiveUserInteraction as f1, setAdmittedAgentBindings as f2 };
|
|
4052
|
+
export type { AgentFollowupResult as $, AgentDetail as B, AgentDispatchContext as C, AgentDispatchPolicy as D, AgentDispatchPolicyDecision as E, AgentDispatchPolicyInput as F, AgentDispatchabilitySnapshot as G, AgentDispatchabilityStatus as H, AgentEffectDeclaration as I, AgentEvent as J, AgentEventKind as K, AgentExecutionInput as L, AgentExecutionKind as M, AgentExecutionResult as N, AgentExecutor as O, AgentExecutorEvent as P, AgentExecutorFactory as Q, AgentExecutorFactoryContext as R, AgentExecutorPlane as S, AgentExecutorPlaneBackgroundErrorContext as T, AgentExecutorPlaneBackgroundErrorHandler as U, AgentExecutorPlaneBinding as V, AgentExecutorPlaneStore as W, AgentExecutorPreflightResult as X, AgentExecutorProtocol as Y, AgentExecutorTaskReference as Z, AgentExecutorTaskSnapshot as _, DispatchableAgentOrigin as a$, AgentForkTurns as a0, AgentInterruptScope as a1, AgentJsonObject as a2, AgentJsonValue as a3, AgentLimitReached as a4, AgentListEntry as a5, AgentMailboxMessage as a6, AgentManifest as a7, AgentMessage as a8, AgentMetadataValue as a9, AgentTreeSnapshot as aA, AgentTurn as aB, AgentTurnExecutor as aC, AgentTurnRef as aD, AgentTurnState as aE, AgentTurnSummary as aF, AskUserAnswer as aG, AskUserCustomInputAnswer as aH, AskUserMultiOptions as aI, AskUserQuestionItem as aJ, AskUserQuestionOptions as aK, AskUserSelectionAnswer as aL, CapabilitySupport as aM, CompactionAnchor as aN, CompactionConfig as aO, CompactionDetails as aP, CompactionResult as aQ, CompactionSpanData as aR, CompactionUpdate as aS, CreateAgentExecutorPlaneOptions as aT, CurrentTodoSummary as aU, Deliverable as aW, DiscoveredInstance as aX, DiscoveryOptions as aY, DispatchableAgentDescriptor as aZ, DispatchableAgentListing as a_, AgentMiddlewareDeclaration as aa, AgentMutationOptions as ab, AgentOutput as ac, AgentPreflightInput as ad, AgentPreflightResult as ae, AgentProgressItem as af, AgentProgressKind as ag, AgentProgressUpdate as ah, AgentReasoningProfile as ai, AgentRegistrationEnabledMutationOptions as aj, AgentRegistrationMutationOptions as ak, AgentRegistrationService as al, AgentSpanData as am, AgentSpawnInput as an, AgentTaskCancellation as ao, AgentTaskCorrelation as ap, AgentTaskEvent as aq, AgentTaskFilter as ar, AgentTaskProgress as as, AgentTaskRegistrationSnapshot as at, AgentTaskService as au, AgentTaskSnapshot as av, AgentTaskStartInput as aw, AgentTaskState as ax, AgentTaskUsage as ay, AgentTool as az, AdmissionAuditOptions as b, KodaXSessionUiToolCallStatus as b$, DispatchableAgentQuery as b0, EvidenceSpanData as b1, ExternalAgentEffectDeclaration as b2, ExternalAgentHealth as b3, ExternalAgentProtocol as b4, ExternalAgentRegistration as b5, ExternalAgentRegistrationSummary as b6, FanoutSpanData as b7, FileOperations as b8, GenerationSpanData as b9, KodaXMemoryOutcomeEvidence as bA, KodaXSessionArchiveMarkerEntry as bB, KodaXSessionArtifactLedgerEntry as bC, KodaXSessionBranchSummaryEntry as bD, KodaXSessionClientNoticeEntry as bE, KodaXSessionCompactionEntry as bF, KodaXSessionData as bG, KodaXSessionEntry as bH, KodaXSessionEntryBase as bI, KodaXSessionGoalEntry as bJ, KodaXSessionLabelEntry as bK, KodaXSessionLineage as bL, KodaXSessionMemoryOutcomeDigestEntry as bM, KodaXSessionMemoryReviewReceiptEntry as bN, KodaXSessionMessageEntry as bO, KodaXSessionMeta as bP, KodaXSessionNavigationOptions as bQ, KodaXSessionRewindMarkerEntry as bR, KodaXSessionRuntimeInfo as bS, KodaXSessionScope as bT, KodaXSessionStorage as bU, KodaXSessionTreeNode as bV, KodaXSessionUiHistoryItem as bW, KodaXSessionUiHistoryItemType as bX, KodaXSessionUiTextHistoryItem as bY, KodaXSessionUiTextHistoryItemType as bZ, KodaXSessionUiToolCall as b_, Guardrail as ba, GuardrailSpanData as bb, Handoff as bc, HandoffSpanData as bd, InMemorySessionOptions as be, InstanceDiscoveryFs as bf, InvariantId as bg, InvariantResult as bh, KodaXCompactMemoryProgress as bj, KodaXCompactMemorySeed as bk, KodaXExtensionSessionRecord as bl, KodaXExtensionSessionState as bm, KodaXExtensionStore as bn, KodaXExtensionStoreEntry as bo, KodaXFileInputArtifact as bp, KodaXGoalEventType as bq, KodaXGoalState as br, KodaXGoalStatus as bs, KodaXImageInputArtifact as bt, KodaXImageMediaType as bu, KodaXInputArtifact as bv, KodaXInputArtifactSource as bw, KodaXJsonValue as bx, KodaXMemoryInfluenceRef as by, KodaXMemoryOutcomeDigest as bz, AdmissionCtx as c, RunnableTool as c$, KodaXSessionUiToolGroupHistoryItem as c0, KodaXSessionWorkspaceKind as c1, KodaXVideoInputArtifact as c2, KodaXVideoMediaType as c3, LocalAgentTaskInput as c4, LocalAgentTaskUpdate as c5, ManifestPatch as c7, MemoryActionProposal as c8, MemoryApplicability as c9, MemoryRefKind as cA, MemoryRejectResult as cB, MemoryReviewCandidateRef as cC, MemoryReviewDraftAction as cD, MemoryReviewInput as cE, MemoryReviewModelInput as cF, MemoryReviewPersistenceDecision as cG, MemoryReviewPersistenceKind as cH, MemoryReviewPlan as cI, MemoryReviewRunner as cJ, MemoryReviewTrigger as cK, MemoryScope as cL, MemorySourceAdapter as cM, MemoryVisibility as cN, MessageEntry as cO, ObserveCtx as cP, PersistedSessionState as cQ, PresetDispatcher as cR, PresetTracingContext as cS, QualityInvariant as cT, ReadonlyMutationTracker as cU, ReadonlyRecorder as cV, ReasoningDepth as cW, RecentlyModifiedFile as cX, RunEvent as cY, RunOptions as cZ, RunResult as c_, MemoryApplyPreview as ca, MemoryApplyResult as cb, MemoryApproval as cc, MemoryAuthority as cd, MemoryAutoCuratorInput as ce, MemoryAutoCuratorResult as cf, MemoryBodySnapshot as cg, MemoryClaimKind as ch, MemoryContextIdentity as ci, MemoryController as cj, MemoryCuratorInput as ck, MemoryDecisionTraceReceipt as cl, MemoryEpisodeReviewResult as cm, MemoryEvent as cn, MemoryGovernanceFinding as co, MemoryGovernanceFindingKind as cp, MemoryGovernanceReport as cq, MemoryItemRef as cr, MemoryLifecycle as cs, MemoryLifecycleOperationResult as ct, MemoryPack as cu, MemoryPackHint as cv, MemoryPackInput as cw, MemoryPackTraceMetadata as cx, MemoryProposalAction as cy, MemoryRefFilter as cz, AdmissionVerdict as d, WorkflowOutcomeUsage as d$, RunnerEvent as d1, RunnerLlmResult as d2, RunnerLlmReturn as d3, RunnerRecoveryTranscriptCarrier as d4, RunnerToolCall as d5, RunnerToolContext as d6, RunnerToolObserver as d7, RunnerToolResult as d8, RunnerToolResultBatch as d9, ToolCapability as dA, ToolPermission as dB, Trace as dC, TraceOptions as dD, TracerOptions as dF, UserInteraction as dG, WorkflowAgentBackend as dH, WorkflowApi as dI, WorkflowApproval as dJ, WorkflowApprovalSummary as dK, WorkflowArtifactRef as dL, WorkflowBudget as dM, WorkflowEvent as dN, WorkflowEventCorrelation as dO, WorkflowEventType as dQ, WorkflowIsolation as dR, WorkflowLimits as dS, WorkflowLogEvent as dT, WorkflowMeta as dU, WorkflowModelHint as dV, WorkflowModule as dW, WorkflowOutcome as dX, WorkflowOutcomeError as dY, WorkflowOutcomeResult as dZ, WorkflowOutcomeStatus as d_, RunnerToolResultBatchTransform as da, Session as db, SessionDispatchResult as dc, SessionEntry as dd, SessionErrorMetadata as de, SessionExtension as df, SessionForkOptions as dg, SessionMeta as dh, SessionStateSnapshot as di, Span as dj, SpanData as dk, SpanError as dl, SpanImplOptions as dn, StartTraceOptions as dp, StateWriter as dq, StateWriterFs as dr, StateWriterOptions as ds, StopHookContext as dt, StopHookFn as du, StopHookResult as dv, StopHookSpanData as dw, SystemCap as dx, TerminalCtx as dy, ToolCallSpanData as dz, AdmittedHandle as e, WorkflowParallelOptions as e0, WorkflowProcessArtifact as e1, WorkflowProcessCounts as e2, WorkflowProcessEvent as e3, WorkflowProcessItem as e4, WorkflowProcessItemKind as e5, WorkflowProcessItemOrigin as e6, WorkflowProcessItemStatus as e7, WorkflowProcessProgress as e8, WorkflowProcessSnapshot as e9, WorkflowProcessSource as ea, WorkflowProcessStatus as eb, WorkflowProcessSummaryStatus as ec, WorkflowProcessTokenUsage as ed, WorkflowProcessTracker as ee, WorkflowProcessTrackerOptions as ef, WorkflowRun as eg, WorkflowRunState as eh, WorkflowRunStatus as ei, WorkflowSpawnAgentInput as ej, WorkflowSynthesis as ek, WorkflowSynthesizeInput as el, WorkflowTaskHandle as em, WorkflowTaskResult as en, WorkflowTaskSnapshot as eo, WorkflowTaskStatus as ep, WorkflowTaskSummaryEventUpdate as eq, WorkflowTaskSummaryKind as er, WorkflowTaskSummaryUpdate as es, WorkflowTaskUsage as et, WorkflowTaskVerification as eu, WorkflowTaskVerificationResult as ev, WorkflowWaitOptions as ew, Agent as f, AgentActor as g, AgentActorClient as h, AgentActorSnapshot as i, AgentActorState as j, AgentActorStore as k, AgentArtifactDescriptor as l, AgentArtifactPolicy as m, AgentArtifactPolicyDecision as n, AgentArtifactPolicyInput as o, AgentArtifactReference as p, AgentBudgetAdmission as q, AgentBudgetAdmissionInput as r, AgentBudgetExhausted as s, AgentBudgetPort as t, AgentCapabilities as u, AgentCapabilityDeclaration as v, AgentCapabilityRequirements as w, AgentContinuationInput as x, AgentCredentialBroker as y, AgentDataClassification as z };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { a9 as KodaXWireReasoningEffort, a1 as KodaXToolDefinition, a3 as KodaXToolResultContentItem, k as KodaXMessage } from './types.d-Cqaw71Ax.js';
|
|
2
2
|
import { K as KodaXBaseProvider } from './base.d-Cz_rwpOi.js';
|
|
3
3
|
import { C as CapabilityKind, a as CapabilityProvider } from './capability.d-K664nHOS.js';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { bx as KodaXJsonValue, bl as KodaXExtensionSessionRecord, bn as KodaXExtensionStore } from './types.d-DH1mvdcl.js';
|
|
5
|
+
import { aE as KodaXToolExecutionContext, bl as ToolSideEffect } from './bash-prefix-extractor.d-CHJO5y94.js';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* KodaX Constructed-World types (FEATURE_087, v0.7.28).
|
|
@@ -360,9 +360,8 @@ interface RuntimeRemoteToolContract {
|
|
|
360
360
|
* immediately) or queues the prompt to run after the tool resolves.
|
|
361
361
|
*
|
|
362
362
|
* - `'cancel'` — long-running tools whose work the user is likely to want
|
|
363
|
-
* to abandon when they redirect (e.g., `bash` running a 30s script
|
|
364
|
-
*
|
|
365
|
-
* tools). InkREPL submit handler aborts the round immediately.
|
|
363
|
+
* to abandon when they redirect (e.g., `bash` running a 30s script or
|
|
364
|
+
* sleep-style tools). InkREPL submit handler aborts the round immediately.
|
|
366
365
|
*
|
|
367
366
|
* - `'wait'` (default) — atomic / fast tools (read, grep, glob, write,
|
|
368
367
|
* edit, …) where waiting for completion is cheaper than aborting and
|
|
@@ -390,7 +389,7 @@ interface LocalToolDefinition extends KodaXToolDefinition {
|
|
|
390
389
|
* 'readonly'` tools.
|
|
391
390
|
* - `true`: explicitly permitted in plan mode even when sideEffect is
|
|
392
391
|
* not `'readonly'`. Reserve for tools whose effect is itself part of
|
|
393
|
-
* the planning loop (`exit_plan_mode`, `
|
|
392
|
+
* the planning loop (`exit_plan_mode`, `interrupt_agent`, `todo_update`,
|
|
394
393
|
* `todo_create`, `ask_user_question`).
|
|
395
394
|
* - `false`: explicitly blocked in plan mode even when sideEffect is
|
|
396
395
|
* `'readonly'`. Rare — useful for read-only tools whose output would
|
|
@@ -452,7 +451,7 @@ interface LocalToolDefinition extends KodaXToolDefinition {
|
|
|
452
451
|
* Examples: semantic_lookup (refresh: true rebuilds index)
|
|
453
452
|
*
|
|
454
453
|
* KEEP IT SHORT: ≤ 100 chars typical. Variable-length user-provided fields
|
|
455
|
-
* (bash command, URL,
|
|
454
|
+
* (bash command, URL, `spawn_agent` objective) may legitimately
|
|
456
455
|
* exceed this — the projection's job is to make the risk visible, not to
|
|
457
456
|
* fit a fixed budget at the cost of hiding it.
|
|
458
457
|
*
|
|
@@ -723,9 +722,9 @@ interface ExtensionTurnSettleHookContext {
|
|
|
723
722
|
* the chain (matches `tool:before` semantics).
|
|
724
723
|
*
|
|
725
724
|
* Scope note: this hook fires on the AMA `runner-driven` path only
|
|
726
|
-
* (main loop, B1 retry, V2 worker).
|
|
727
|
-
*
|
|
728
|
-
*
|
|
725
|
+
* (main loop, B1 retry, V2 worker). Native child Actor turns go through
|
|
726
|
+
* `runKodaX` and do NOT trigger this hook — observe their lifecycle via
|
|
727
|
+
* `turn:settle` on the SA
|
|
729
728
|
* path. Extensions wanting "every agent termination" semantics must
|
|
730
729
|
* register both hooks.
|
|
731
730
|
*/
|