@runtypelabs/sdk 6.2.0 → 6.3.1
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/dist/index.cjs +99 -101
- package/dist/index.d.cts +292 -469
- package/dist/index.d.ts +292 -469
- package/dist/index.mjs +99 -101
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -3086,7 +3086,7 @@ interface paths {
|
|
|
3086
3086
|
};
|
|
3087
3087
|
/**
|
|
3088
3088
|
* Stream execution events
|
|
3089
|
-
* @description Reconnect to a durable Claude Managed agent turn: replay-and-tail its Server-Sent Events. Resolves the per-conversation session owner by (agentId, conversationId), replays buffered events strictly past the `after` cursor, then live-tails if the turn is still running. Each event carries an SSE `id:` line — a durable row seq, or (unified vocabulary) a composite `<seq>.<subIndex>` when one durable row translates to multiple events. Reconnect after a disconnect (tab reload, sleep, stream timeout) by passing the last seen id verbatim as `after` to resume without missing or duplicating events.
|
|
3089
|
+
* @description Reconnect to a durable Claude Managed agent turn: replay-and-tail its Server-Sent Events. Resolves the per-conversation session owner by (agentId, conversationId), replays buffered events strictly past the `after` cursor, then live-tails if the turn is still running. Each event carries an SSE `id:` line — a durable row seq, or (unified vocabulary) a composite `<seq>.<subIndex>` when one durable row translates to multiple events. Reconnect after a disconnect (tab reload, sleep, stream timeout) by passing the last seen id verbatim as `after` to resume without missing or duplicating events. Replayed and live-tailed frames use the unified execution vocabulary.
|
|
3090
3090
|
*/
|
|
3091
3091
|
get: {
|
|
3092
3092
|
parameters: {
|
|
@@ -6561,7 +6561,7 @@ interface paths {
|
|
|
6561
6561
|
"application/json": components["schemas"]["Error"];
|
|
6562
6562
|
};
|
|
6563
6563
|
};
|
|
6564
|
-
/** @description
|
|
6564
|
+
/** @description Forbidden. Either the client token is inactive or the origin is not allowed, or the tenancy lock-down refused the execution: the agent requires an end-user scope and no valid `identityProof` was supplied (`end_user_scope_required`), or this session's conversation record belongs to a different signed-in end user (`conversation_scope_mismatch`; start a new conversation). */
|
|
6565
6565
|
403: {
|
|
6566
6566
|
headers: {
|
|
6567
6567
|
[name: string]: unknown;
|
|
@@ -11072,6 +11072,16 @@ interface paths {
|
|
|
11072
11072
|
content: string;
|
|
11073
11073
|
role: string;
|
|
11074
11074
|
}[];
|
|
11075
|
+
toolMocks?: {
|
|
11076
|
+
input?: unknown;
|
|
11077
|
+
isError?: boolean;
|
|
11078
|
+
output: null | boolean | number | string | unknown[] | {
|
|
11079
|
+
[key: string]: unknown;
|
|
11080
|
+
};
|
|
11081
|
+
sourceToolExecutionId?: string;
|
|
11082
|
+
toolName: string;
|
|
11083
|
+
truncated?: boolean;
|
|
11084
|
+
}[];
|
|
11075
11085
|
variables?: {
|
|
11076
11086
|
[key: string]: unknown;
|
|
11077
11087
|
};
|
|
@@ -11080,7 +11090,7 @@ interface paths {
|
|
|
11080
11090
|
}[];
|
|
11081
11091
|
name: string;
|
|
11082
11092
|
/**
|
|
11083
|
-
* @description How captured (saved_from_run)
|
|
11093
|
+
* @description How cases carrying toolMocks replay — captured (saved_from_run) or hand-authored alike: "next_step" (default; captured cases only) captures the first tool intent and stops, or "continue" serves each case's toolMocks by tool name and runs past the first action.
|
|
11084
11094
|
* @enum {string}
|
|
11085
11095
|
*/
|
|
11086
11096
|
recordedToolMode?: "next_step" | "continue";
|
|
@@ -11529,6 +11539,16 @@ interface paths {
|
|
|
11529
11539
|
content: string;
|
|
11530
11540
|
role: string;
|
|
11531
11541
|
}[];
|
|
11542
|
+
toolMocks?: {
|
|
11543
|
+
input?: unknown;
|
|
11544
|
+
isError?: boolean;
|
|
11545
|
+
output: null | boolean | number | string | unknown[] | {
|
|
11546
|
+
[key: string]: unknown;
|
|
11547
|
+
};
|
|
11548
|
+
sourceToolExecutionId?: string;
|
|
11549
|
+
toolName: string;
|
|
11550
|
+
truncated?: boolean;
|
|
11551
|
+
}[];
|
|
11532
11552
|
variables?: {
|
|
11533
11553
|
[key: string]: unknown;
|
|
11534
11554
|
};
|
|
@@ -11537,7 +11557,7 @@ interface paths {
|
|
|
11537
11557
|
}[];
|
|
11538
11558
|
name: string;
|
|
11539
11559
|
/**
|
|
11540
|
-
* @description How captured (saved_from_run)
|
|
11560
|
+
* @description How cases carrying toolMocks replay — captured (saved_from_run) or hand-authored alike: "next_step" (default; captured cases only) captures the first tool intent and stops, or "continue" serves each case's toolMocks by tool name and runs past the first action.
|
|
11541
11561
|
* @enum {string}
|
|
11542
11562
|
*/
|
|
11543
11563
|
recordedToolMode?: "next_step" | "continue";
|
|
@@ -12097,6 +12117,12 @@ interface paths {
|
|
|
12097
12117
|
json?: unknown;
|
|
12098
12118
|
text?: string;
|
|
12099
12119
|
};
|
|
12120
|
+
/** @description Per-case graders. When set, they REPLACE the suite-level graders for this case (not appended). Omit to score the case with the suite graders. */
|
|
12121
|
+
graders?: ({
|
|
12122
|
+
kind: string;
|
|
12123
|
+
} & {
|
|
12124
|
+
[key: string]: unknown;
|
|
12125
|
+
})[];
|
|
12100
12126
|
/** @default {} */
|
|
12101
12127
|
input?: {
|
|
12102
12128
|
checkpoint?: {
|
|
@@ -12121,7 +12147,9 @@ interface paths {
|
|
|
12121
12147
|
toolMocks?: {
|
|
12122
12148
|
input?: unknown;
|
|
12123
12149
|
isError?: boolean;
|
|
12124
|
-
output
|
|
12150
|
+
output: null | boolean | number | string | unknown[] | {
|
|
12151
|
+
[key: string]: unknown;
|
|
12152
|
+
};
|
|
12125
12153
|
sourceToolExecutionId?: string;
|
|
12126
12154
|
toolName: string;
|
|
12127
12155
|
truncated?: boolean;
|
|
@@ -12495,6 +12523,12 @@ interface paths {
|
|
|
12495
12523
|
json?: unknown;
|
|
12496
12524
|
text?: string;
|
|
12497
12525
|
};
|
|
12526
|
+
/** @description Per-case graders. When set, they REPLACE the suite-level graders for this case (not appended). Omit to score the case with the suite graders. */
|
|
12527
|
+
graders?: ({
|
|
12528
|
+
kind: string;
|
|
12529
|
+
} & {
|
|
12530
|
+
[key: string]: unknown;
|
|
12531
|
+
})[];
|
|
12498
12532
|
/** @default {} */
|
|
12499
12533
|
input?: {
|
|
12500
12534
|
checkpoint?: {
|
|
@@ -12519,7 +12553,9 @@ interface paths {
|
|
|
12519
12553
|
toolMocks?: {
|
|
12520
12554
|
input?: unknown;
|
|
12521
12555
|
isError?: boolean;
|
|
12522
|
-
output
|
|
12556
|
+
output: null | boolean | number | string | unknown[] | {
|
|
12557
|
+
[key: string]: unknown;
|
|
12558
|
+
};
|
|
12523
12559
|
sourceToolExecutionId?: string;
|
|
12524
12560
|
toolName: string;
|
|
12525
12561
|
truncated?: boolean;
|
|
@@ -12806,6 +12842,12 @@ interface paths {
|
|
|
12806
12842
|
json?: unknown;
|
|
12807
12843
|
text?: string;
|
|
12808
12844
|
} | null;
|
|
12845
|
+
/** @description Per-case graders that REPLACE the suite graders for this case. null clears the override so the case uses the suite graders again. */
|
|
12846
|
+
graders?: ({
|
|
12847
|
+
kind: string;
|
|
12848
|
+
} & {
|
|
12849
|
+
[key: string]: unknown;
|
|
12850
|
+
})[] | null;
|
|
12809
12851
|
input?: {
|
|
12810
12852
|
checkpoint?: {
|
|
12811
12853
|
forkMessageIndex: number;
|
|
@@ -12829,7 +12871,9 @@ interface paths {
|
|
|
12829
12871
|
toolMocks?: {
|
|
12830
12872
|
input?: unknown;
|
|
12831
12873
|
isError?: boolean;
|
|
12832
|
-
output
|
|
12874
|
+
output: null | boolean | number | string | unknown[] | {
|
|
12875
|
+
[key: string]: unknown;
|
|
12876
|
+
};
|
|
12833
12877
|
sourceToolExecutionId?: string;
|
|
12834
12878
|
toolName: string;
|
|
12835
12879
|
truncated?: boolean;
|
|
@@ -13256,7 +13300,9 @@ interface paths {
|
|
|
13256
13300
|
toolMocks?: {
|
|
13257
13301
|
input?: unknown;
|
|
13258
13302
|
isError?: boolean;
|
|
13259
|
-
output
|
|
13303
|
+
output: null | boolean | number | string | unknown[] | {
|
|
13304
|
+
[key: string]: unknown;
|
|
13305
|
+
};
|
|
13260
13306
|
sourceToolExecutionId?: string;
|
|
13261
13307
|
toolName: string;
|
|
13262
13308
|
truncated?: boolean;
|
|
@@ -26005,6 +26051,8 @@ interface paths {
|
|
|
26005
26051
|
data: {
|
|
26006
26052
|
behavior?: unknown;
|
|
26007
26053
|
createdAt: string;
|
|
26054
|
+
/** @description Canonical public URL of this surface (MCP, API, A2A, AG-UI, webhook, chat). Null for surface types reached through their own channels (Slack, email, schedule, ...). Clients should use this instead of constructing the URL themselves. */
|
|
26055
|
+
endpoint: string | null;
|
|
26008
26056
|
environment: string;
|
|
26009
26057
|
id: string;
|
|
26010
26058
|
inbound?: unknown;
|
|
@@ -26114,6 +26162,8 @@ interface paths {
|
|
|
26114
26162
|
"application/json": {
|
|
26115
26163
|
behavior?: unknown;
|
|
26116
26164
|
createdAt: string;
|
|
26165
|
+
/** @description Canonical public URL of this surface (MCP, API, A2A, AG-UI, webhook, chat). Null for surface types reached through their own channels (Slack, email, schedule, ...). Clients should use this instead of constructing the URL themselves. */
|
|
26166
|
+
endpoint: string | null;
|
|
26117
26167
|
environment: string;
|
|
26118
26168
|
id: string;
|
|
26119
26169
|
inbound?: unknown;
|
|
@@ -26443,6 +26493,8 @@ interface paths {
|
|
|
26443
26493
|
"application/json": {
|
|
26444
26494
|
behavior?: unknown;
|
|
26445
26495
|
createdAt: string;
|
|
26496
|
+
/** @description Canonical public URL of this surface (MCP, API, A2A, AG-UI, webhook, chat). Null for surface types reached through their own channels (Slack, email, schedule, ...). Clients should use this instead of constructing the URL themselves. */
|
|
26497
|
+
endpoint: string | null;
|
|
26446
26498
|
environment: string;
|
|
26447
26499
|
id: string;
|
|
26448
26500
|
inbound?: unknown;
|
|
@@ -26580,6 +26632,8 @@ interface paths {
|
|
|
26580
26632
|
"application/json": {
|
|
26581
26633
|
behavior?: unknown;
|
|
26582
26634
|
createdAt: string;
|
|
26635
|
+
/** @description Canonical public URL of this surface (MCP, API, A2A, AG-UI, webhook, chat). Null for surface types reached through their own channels (Slack, email, schedule, ...). Clients should use this instead of constructing the URL themselves. */
|
|
26636
|
+
endpoint: string | null;
|
|
26583
26637
|
environment: string;
|
|
26584
26638
|
id: string;
|
|
26585
26639
|
inbound?: unknown;
|
|
@@ -39006,6 +39060,8 @@ interface paths {
|
|
|
39006
39060
|
"application/json": {
|
|
39007
39061
|
data: {
|
|
39008
39062
|
createdAt: string;
|
|
39063
|
+
/** @description Canonical public URL of this surface (MCP, API, A2A, AG-UI, webhook, chat). Null for surface types reached through their own channels (Slack, email, schedule, ...). Clients should use this instead of constructing the URL themselves. */
|
|
39064
|
+
endpoint: string | null;
|
|
39009
39065
|
environment: string;
|
|
39010
39066
|
id: string;
|
|
39011
39067
|
inbound: {
|
|
@@ -40672,7 +40728,7 @@ interface paths {
|
|
|
40672
40728
|
put?: never;
|
|
40673
40729
|
/**
|
|
40674
40730
|
* Execute tool
|
|
40675
|
-
* @description Execute a tool by ID with the provided parameters. Non-flow tools return the documented JSON result. Flow tools return a text/event-stream response whose frames use the ExecutionStreamEvent vocabulary
|
|
40731
|
+
* @description Execute a tool by ID with the provided parameters. Non-flow tools return the documented JSON result. Flow tools return a text/event-stream response whose frames use the ExecutionStreamEvent vocabulary; use a raw/streaming client helper for flow tools.
|
|
40676
40732
|
*/
|
|
40677
40733
|
post: {
|
|
40678
40734
|
parameters: {
|
|
@@ -41165,6 +41221,7 @@ interface paths {
|
|
|
41165
41221
|
};
|
|
41166
41222
|
id: string;
|
|
41167
41223
|
orgId?: string | null;
|
|
41224
|
+
orgName: string | null;
|
|
41168
41225
|
preferences: {
|
|
41169
41226
|
notifications: boolean;
|
|
41170
41227
|
theme: string;
|
|
@@ -42039,6 +42096,8 @@ interface components {
|
|
|
42039
42096
|
createdAt: string;
|
|
42040
42097
|
enabled: boolean;
|
|
42041
42098
|
expected?: unknown;
|
|
42099
|
+
/** @description Per-case graders that REPLACE the suite graders for this case, or null when the case uses the suite graders. */
|
|
42100
|
+
graders: unknown[] | null;
|
|
42042
42101
|
id: string;
|
|
42043
42102
|
/** @description { variables?, messages? } — what the case feeds the target. */
|
|
42044
42103
|
input?: unknown;
|
|
@@ -42152,6 +42211,16 @@ interface components {
|
|
|
42152
42211
|
content: string;
|
|
42153
42212
|
role: string;
|
|
42154
42213
|
}[];
|
|
42214
|
+
toolMocks?: {
|
|
42215
|
+
input?: unknown;
|
|
42216
|
+
isError?: boolean;
|
|
42217
|
+
output: null | boolean | number | string | unknown[] | {
|
|
42218
|
+
[key: string]: unknown;
|
|
42219
|
+
};
|
|
42220
|
+
sourceToolExecutionId?: string;
|
|
42221
|
+
toolName: string;
|
|
42222
|
+
truncated?: boolean;
|
|
42223
|
+
}[];
|
|
42155
42224
|
variables?: {
|
|
42156
42225
|
[key: string]: unknown;
|
|
42157
42226
|
};
|
|
@@ -42160,7 +42229,7 @@ interface components {
|
|
|
42160
42229
|
}[];
|
|
42161
42230
|
name: string;
|
|
42162
42231
|
/**
|
|
42163
|
-
* @description How captured (saved_from_run)
|
|
42232
|
+
* @description How cases carrying toolMocks replay — captured (saved_from_run) or hand-authored alike: "next_step" (default; captured cases only) captures the first tool intent and stops, or "continue" serves each case's toolMocks by tool name and runs past the first action.
|
|
42164
42233
|
* @enum {string}
|
|
42165
42234
|
*/
|
|
42166
42235
|
recordedToolMode?: "next_step" | "continue";
|
|
@@ -42368,6 +42437,10 @@ interface components {
|
|
|
42368
42437
|
completedAt?: string;
|
|
42369
42438
|
durationMs?: number;
|
|
42370
42439
|
executionId: string;
|
|
42440
|
+
externalAgent?: {
|
|
42441
|
+
contextId?: string;
|
|
42442
|
+
taskId?: string;
|
|
42443
|
+
};
|
|
42371
42444
|
failedSteps?: number;
|
|
42372
42445
|
finalOutput?: string;
|
|
42373
42446
|
iterations?: number;
|
|
@@ -42383,6 +42456,7 @@ interface components {
|
|
|
42383
42456
|
input: number;
|
|
42384
42457
|
output: number;
|
|
42385
42458
|
};
|
|
42459
|
+
totalTokensUsed?: number;
|
|
42386
42460
|
/** @enum {string} */
|
|
42387
42461
|
type: "execution_complete";
|
|
42388
42462
|
} | {
|
|
@@ -42691,6 +42765,7 @@ interface components {
|
|
|
42691
42765
|
stepId?: string;
|
|
42692
42766
|
success: boolean;
|
|
42693
42767
|
toolCallId: string;
|
|
42768
|
+
toolCost?: number;
|
|
42694
42769
|
toolName?: string;
|
|
42695
42770
|
/** @enum {string} */
|
|
42696
42771
|
type: "tool_complete";
|
|
@@ -42698,6 +42773,10 @@ interface components {
|
|
|
42698
42773
|
approvalId: string;
|
|
42699
42774
|
description?: string;
|
|
42700
42775
|
executionId: string;
|
|
42776
|
+
externalAgent?: {
|
|
42777
|
+
contextId?: string;
|
|
42778
|
+
taskId?: string;
|
|
42779
|
+
};
|
|
42701
42780
|
iteration?: number;
|
|
42702
42781
|
parameters?: {
|
|
42703
42782
|
[key: string]: unknown;
|
|
@@ -42841,382 +42920,6 @@ interface components {
|
|
|
42841
42920
|
/** @description Present only when a raw tool_… reference could not be emitted as a portable tool:<name> (the tool was deleted, or its name is shadowed by an older same-named tool). Those references are left as raw ids, which the ensure surface rejects; each warning explains how to fix it. */
|
|
42842
42921
|
warnings?: string[];
|
|
42843
42922
|
};
|
|
42844
|
-
FlowSSEEvent: {
|
|
42845
|
-
executionContext?: {
|
|
42846
|
-
[key: string]: unknown;
|
|
42847
|
-
};
|
|
42848
|
-
executionId?: string;
|
|
42849
|
-
flowId: string;
|
|
42850
|
-
flowName?: string;
|
|
42851
|
-
input?: unknown;
|
|
42852
|
-
seq?: number;
|
|
42853
|
-
source?: string;
|
|
42854
|
-
startedAt: string;
|
|
42855
|
-
toolContext?: {
|
|
42856
|
-
executionId: string;
|
|
42857
|
-
stepId: string;
|
|
42858
|
-
toolId: string;
|
|
42859
|
-
};
|
|
42860
|
-
totalSteps?: number;
|
|
42861
|
-
/** @enum {string} */
|
|
42862
|
-
type: "flow_start";
|
|
42863
|
-
} | {
|
|
42864
|
-
claudeManagedAgentId?: string;
|
|
42865
|
-
completedAt?: string;
|
|
42866
|
-
completedSteps?: number;
|
|
42867
|
-
duration?: number;
|
|
42868
|
-
executionContext?: {
|
|
42869
|
-
[key: string]: unknown;
|
|
42870
|
-
};
|
|
42871
|
-
executionId?: string;
|
|
42872
|
-
executionTime?: number;
|
|
42873
|
-
failedSteps?: number;
|
|
42874
|
-
finalOutput?: string;
|
|
42875
|
-
flowId?: string;
|
|
42876
|
-
flowName?: string;
|
|
42877
|
-
output?: unknown;
|
|
42878
|
-
seq?: number;
|
|
42879
|
-
source?: string;
|
|
42880
|
-
success?: boolean;
|
|
42881
|
-
successfulSteps?: number;
|
|
42882
|
-
toolContext?: {
|
|
42883
|
-
executionId: string;
|
|
42884
|
-
stepId: string;
|
|
42885
|
-
toolId: string;
|
|
42886
|
-
};
|
|
42887
|
-
totalSteps?: number;
|
|
42888
|
-
totalTokensUsed?: number;
|
|
42889
|
-
/** @enum {string} */
|
|
42890
|
-
type: "flow_complete";
|
|
42891
|
-
} | {
|
|
42892
|
-
blockReason?: string;
|
|
42893
|
-
code?: string;
|
|
42894
|
-
error: string | {
|
|
42895
|
-
code: string;
|
|
42896
|
-
message: string;
|
|
42897
|
-
stepId?: string;
|
|
42898
|
-
stepType?: string;
|
|
42899
|
-
};
|
|
42900
|
-
executionId?: string;
|
|
42901
|
-
executionTime?: number;
|
|
42902
|
-
flowId?: string;
|
|
42903
|
-
seq?: number;
|
|
42904
|
-
timestamp?: string;
|
|
42905
|
-
toolContext?: {
|
|
42906
|
-
executionId: string;
|
|
42907
|
-
stepId: string;
|
|
42908
|
-
toolId: string;
|
|
42909
|
-
};
|
|
42910
|
-
/** @enum {string} */
|
|
42911
|
-
type: "flow_error";
|
|
42912
|
-
upgradeUrl?: string;
|
|
42913
|
-
} | {
|
|
42914
|
-
approvalId?: string;
|
|
42915
|
-
awaitReason?: string;
|
|
42916
|
-
awaitedAt: string;
|
|
42917
|
-
crawlId?: string;
|
|
42918
|
-
elicitation?: {
|
|
42919
|
-
message: string;
|
|
42920
|
-
/** @enum {string} */
|
|
42921
|
-
mode: "form" | "url";
|
|
42922
|
-
pauseCount?: number;
|
|
42923
|
-
requestedSchema?: {
|
|
42924
|
-
[key: string]: unknown;
|
|
42925
|
-
};
|
|
42926
|
-
serverName?: string;
|
|
42927
|
-
url?: string;
|
|
42928
|
-
};
|
|
42929
|
-
executionId?: string;
|
|
42930
|
-
flowId: string;
|
|
42931
|
-
/** @enum {string} */
|
|
42932
|
-
origin?: "webmcp" | "sdk";
|
|
42933
|
-
pageOrigin?: string;
|
|
42934
|
-
parameters?: {
|
|
42935
|
-
[key: string]: unknown;
|
|
42936
|
-
};
|
|
42937
|
-
seq?: number;
|
|
42938
|
-
stepId?: string;
|
|
42939
|
-
timeout?: number;
|
|
42940
|
-
toolCallId?: string;
|
|
42941
|
-
toolId?: string;
|
|
42942
|
-
toolName?: string;
|
|
42943
|
-
/** @enum {string} */
|
|
42944
|
-
type: "flow_await";
|
|
42945
|
-
} | {
|
|
42946
|
-
estimatedTokens?: number;
|
|
42947
|
-
executionId?: string;
|
|
42948
|
-
id?: string;
|
|
42949
|
-
index?: number;
|
|
42950
|
-
name?: string;
|
|
42951
|
-
outputVariable?: string;
|
|
42952
|
-
seq?: number;
|
|
42953
|
-
startedAt: string;
|
|
42954
|
-
stepId?: string;
|
|
42955
|
-
stepName?: string;
|
|
42956
|
-
stepType?: string;
|
|
42957
|
-
toolContext?: {
|
|
42958
|
-
executionId: string;
|
|
42959
|
-
stepId: string;
|
|
42960
|
-
toolId: string;
|
|
42961
|
-
};
|
|
42962
|
-
totalSteps?: number;
|
|
42963
|
-
/** @enum {string} */
|
|
42964
|
-
type: "step_start";
|
|
42965
|
-
} | {
|
|
42966
|
-
delta?: string;
|
|
42967
|
-
executionId?: string;
|
|
42968
|
-
id?: string;
|
|
42969
|
-
messageId?: string;
|
|
42970
|
-
partId?: string;
|
|
42971
|
-
seq?: number;
|
|
42972
|
-
text?: string;
|
|
42973
|
-
toolContext?: {
|
|
42974
|
-
executionId: string;
|
|
42975
|
-
stepId: string;
|
|
42976
|
-
toolId: string;
|
|
42977
|
-
};
|
|
42978
|
-
toolId?: string;
|
|
42979
|
-
/** @enum {string} */
|
|
42980
|
-
type: "step_delta";
|
|
42981
|
-
} | {
|
|
42982
|
-
completedAt?: string;
|
|
42983
|
-
duration?: number;
|
|
42984
|
-
durationMs?: number;
|
|
42985
|
-
error?: string | null;
|
|
42986
|
-
executionId?: string;
|
|
42987
|
-
executionTime?: number;
|
|
42988
|
-
id?: string;
|
|
42989
|
-
index?: number;
|
|
42990
|
-
name?: string;
|
|
42991
|
-
output?: unknown;
|
|
42992
|
-
result?: unknown;
|
|
42993
|
-
seq?: number;
|
|
42994
|
-
stepId?: string;
|
|
42995
|
-
stepName?: string;
|
|
42996
|
-
stepType?: string;
|
|
42997
|
-
/** @enum {string} */
|
|
42998
|
-
stopReason?: "end_turn" | "max_tool_calls" | "length" | "content_filter" | "error" | "unknown";
|
|
42999
|
-
success?: boolean;
|
|
43000
|
-
tokensUsed?: number;
|
|
43001
|
-
toolContext?: {
|
|
43002
|
-
executionId: string;
|
|
43003
|
-
stepId: string;
|
|
43004
|
-
toolId: string;
|
|
43005
|
-
};
|
|
43006
|
-
/** @enum {string} */
|
|
43007
|
-
type: "step_complete";
|
|
43008
|
-
unresolvedVariables?: string[];
|
|
43009
|
-
} | {
|
|
43010
|
-
error: string;
|
|
43011
|
-
executionId?: string;
|
|
43012
|
-
executionTime?: number;
|
|
43013
|
-
id?: string;
|
|
43014
|
-
index?: number;
|
|
43015
|
-
name?: string;
|
|
43016
|
-
seq?: number;
|
|
43017
|
-
stepType?: string;
|
|
43018
|
-
/** @enum {string} */
|
|
43019
|
-
type: "step_error";
|
|
43020
|
-
} | {
|
|
43021
|
-
error?: string;
|
|
43022
|
-
executionId?: string;
|
|
43023
|
-
id: string;
|
|
43024
|
-
index?: number;
|
|
43025
|
-
name?: string;
|
|
43026
|
-
seq?: number;
|
|
43027
|
-
skippedAt: string;
|
|
43028
|
-
stepType: string;
|
|
43029
|
-
totalSteps: number;
|
|
43030
|
-
/** @enum {string} */
|
|
43031
|
-
type: "step_skip";
|
|
43032
|
-
when: string;
|
|
43033
|
-
} | ({
|
|
43034
|
-
elicitation?: {
|
|
43035
|
-
message: string;
|
|
43036
|
-
/** @enum {string} */
|
|
43037
|
-
mode: "form" | "url";
|
|
43038
|
-
pauseCount?: number;
|
|
43039
|
-
requestedSchema?: {
|
|
43040
|
-
[key: string]: unknown;
|
|
43041
|
-
};
|
|
43042
|
-
serverName?: string;
|
|
43043
|
-
url?: string;
|
|
43044
|
-
};
|
|
43045
|
-
executionId?: string;
|
|
43046
|
-
reason?: string;
|
|
43047
|
-
seq?: number;
|
|
43048
|
-
/** @enum {string} */
|
|
43049
|
-
type: "step_await";
|
|
43050
|
-
} & {
|
|
43051
|
-
[key: string]: unknown;
|
|
43052
|
-
}) | ({
|
|
43053
|
-
agentContext?: {
|
|
43054
|
-
executionId: string;
|
|
43055
|
-
iteration: number;
|
|
43056
|
-
seq: number;
|
|
43057
|
-
};
|
|
43058
|
-
executionId?: string;
|
|
43059
|
-
hiddenParameterNames?: string[];
|
|
43060
|
-
name?: string;
|
|
43061
|
-
parameters?: {
|
|
43062
|
-
[key: string]: unknown;
|
|
43063
|
-
};
|
|
43064
|
-
providerOptions?: {
|
|
43065
|
-
[key: string]: unknown;
|
|
43066
|
-
};
|
|
43067
|
-
seq?: number;
|
|
43068
|
-
startedAt?: string;
|
|
43069
|
-
stepId?: string;
|
|
43070
|
-
toolCallId?: string;
|
|
43071
|
-
toolId?: string;
|
|
43072
|
-
toolName?: string;
|
|
43073
|
-
/** @enum {string} */
|
|
43074
|
-
toolType: "flow" | "mcp" | "builtin" | "custom" | "external" | "advisor" | "subagent" | "local";
|
|
43075
|
-
/** @enum {string} */
|
|
43076
|
-
type: "tool_start";
|
|
43077
|
-
} & {
|
|
43078
|
-
[key: string]: unknown;
|
|
43079
|
-
}) | ({
|
|
43080
|
-
delta?: string;
|
|
43081
|
-
executionId?: string;
|
|
43082
|
-
seq?: number;
|
|
43083
|
-
toolId?: string;
|
|
43084
|
-
/** @enum {string} */
|
|
43085
|
-
type: "tool_delta";
|
|
43086
|
-
} & {
|
|
43087
|
-
[key: string]: unknown;
|
|
43088
|
-
}) | {
|
|
43089
|
-
delta: string;
|
|
43090
|
-
executionId?: string;
|
|
43091
|
-
seq?: number;
|
|
43092
|
-
stepId?: string;
|
|
43093
|
-
toolCallId?: string;
|
|
43094
|
-
toolId?: string;
|
|
43095
|
-
/** @enum {string} */
|
|
43096
|
-
type: "tool_input_delta";
|
|
43097
|
-
} | {
|
|
43098
|
-
executionId?: string;
|
|
43099
|
-
hiddenParameterNames?: string[];
|
|
43100
|
-
parameters: {
|
|
43101
|
-
[key: string]: unknown;
|
|
43102
|
-
};
|
|
43103
|
-
providerOptions?: {
|
|
43104
|
-
[key: string]: unknown;
|
|
43105
|
-
};
|
|
43106
|
-
seq?: number;
|
|
43107
|
-
stepId?: string;
|
|
43108
|
-
toolCallId?: string;
|
|
43109
|
-
toolId?: string;
|
|
43110
|
-
toolName?: string;
|
|
43111
|
-
/** @enum {string} */
|
|
43112
|
-
type: "tool_input_complete";
|
|
43113
|
-
} | {
|
|
43114
|
-
agentContext?: {
|
|
43115
|
-
executionId: string;
|
|
43116
|
-
iteration: number;
|
|
43117
|
-
seq: number;
|
|
43118
|
-
};
|
|
43119
|
-
completedAt?: string;
|
|
43120
|
-
error?: string;
|
|
43121
|
-
executionId?: string;
|
|
43122
|
-
executionTime?: number;
|
|
43123
|
-
name?: string;
|
|
43124
|
-
result?: unknown;
|
|
43125
|
-
seq?: number;
|
|
43126
|
-
stepId?: string;
|
|
43127
|
-
success: boolean;
|
|
43128
|
-
toolCallId?: string;
|
|
43129
|
-
toolCost?: number;
|
|
43130
|
-
toolId?: string;
|
|
43131
|
-
toolName?: string;
|
|
43132
|
-
/** @enum {string} */
|
|
43133
|
-
type: "tool_complete";
|
|
43134
|
-
} | {
|
|
43135
|
-
agentContext?: {
|
|
43136
|
-
executionId: string;
|
|
43137
|
-
iteration: number;
|
|
43138
|
-
seq: number;
|
|
43139
|
-
};
|
|
43140
|
-
error: string;
|
|
43141
|
-
executionId?: string;
|
|
43142
|
-
executionTime?: number;
|
|
43143
|
-
failedAt?: string;
|
|
43144
|
-
name: string;
|
|
43145
|
-
seq?: number;
|
|
43146
|
-
toolId: string;
|
|
43147
|
-
/** @enum {string} */
|
|
43148
|
-
type: "tool_error";
|
|
43149
|
-
} | {
|
|
43150
|
-
executionId?: string;
|
|
43151
|
-
id: string;
|
|
43152
|
-
seq?: number;
|
|
43153
|
-
text: string;
|
|
43154
|
-
/** @enum {string} */
|
|
43155
|
-
type: "chunk";
|
|
43156
|
-
} | ({
|
|
43157
|
-
executionId?: string;
|
|
43158
|
-
seq?: number;
|
|
43159
|
-
/** @enum {string} */
|
|
43160
|
-
type: "text_start";
|
|
43161
|
-
} & {
|
|
43162
|
-
[key: string]: unknown;
|
|
43163
|
-
}) | ({
|
|
43164
|
-
executionId?: string;
|
|
43165
|
-
seq?: number;
|
|
43166
|
-
/** @enum {string} */
|
|
43167
|
-
type: "text_end";
|
|
43168
|
-
} & {
|
|
43169
|
-
[key: string]: unknown;
|
|
43170
|
-
}) | ({
|
|
43171
|
-
executionId?: string;
|
|
43172
|
-
seq?: number;
|
|
43173
|
-
/** @enum {string} */
|
|
43174
|
-
type: "reason_start";
|
|
43175
|
-
} & {
|
|
43176
|
-
[key: string]: unknown;
|
|
43177
|
-
}) | ({
|
|
43178
|
-
executionId?: string;
|
|
43179
|
-
seq?: number;
|
|
43180
|
-
/** @enum {string} */
|
|
43181
|
-
type: "reason_delta";
|
|
43182
|
-
} & {
|
|
43183
|
-
[key: string]: unknown;
|
|
43184
|
-
}) | ({
|
|
43185
|
-
executionId?: string;
|
|
43186
|
-
seq?: number;
|
|
43187
|
-
/** @enum {string} */
|
|
43188
|
-
type: "reason_complete";
|
|
43189
|
-
} & {
|
|
43190
|
-
[key: string]: unknown;
|
|
43191
|
-
}) | ({
|
|
43192
|
-
executionId?: string;
|
|
43193
|
-
seq?: number;
|
|
43194
|
-
/** @enum {string} */
|
|
43195
|
-
type: "source";
|
|
43196
|
-
} & {
|
|
43197
|
-
[key: string]: unknown;
|
|
43198
|
-
}) | ({
|
|
43199
|
-
executionId?: string;
|
|
43200
|
-
seq?: number;
|
|
43201
|
-
/** @enum {string} */
|
|
43202
|
-
type: "fallback_start";
|
|
43203
|
-
} & {
|
|
43204
|
-
[key: string]: unknown;
|
|
43205
|
-
}) | ({
|
|
43206
|
-
executionId?: string;
|
|
43207
|
-
seq?: number;
|
|
43208
|
-
/** @enum {string} */
|
|
43209
|
-
type: "fallback_complete";
|
|
43210
|
-
} & {
|
|
43211
|
-
[key: string]: unknown;
|
|
43212
|
-
}) | ({
|
|
43213
|
-
executionId?: string;
|
|
43214
|
-
seq?: number;
|
|
43215
|
-
/** @enum {string} */
|
|
43216
|
-
type: "fallback_exhausted";
|
|
43217
|
-
} & {
|
|
43218
|
-
[key: string]: unknown;
|
|
43219
|
-
});
|
|
43220
42923
|
FlowValidationIssue: {
|
|
43221
42924
|
code: string;
|
|
43222
42925
|
details?: unknown;
|
|
@@ -43744,10 +43447,12 @@ interface components {
|
|
|
43744
43447
|
* the rest of the SDK (and `types.ts`) re-exports, so the published surface
|
|
43745
43448
|
* never exposes `paths['/v1/...'][...]` indexing.
|
|
43746
43449
|
*
|
|
43747
|
-
*
|
|
43748
|
-
* 1.
|
|
43749
|
-
*
|
|
43750
|
-
* 2.
|
|
43450
|
+
* Three flavors live here:
|
|
43451
|
+
* 1. The unified streaming wire union — sourced from the named OAS 3.2
|
|
43452
|
+
* `ExecutionStreamEvent` itemSchema component.
|
|
43453
|
+
* 2. The compatibility-only FlowBuilder callback union — hand-maintained
|
|
43454
|
+
* because it is a client presentation shape, not a server wire schema.
|
|
43455
|
+
* 3. Entity types — sourced by indexing into `paths`, because entities are
|
|
43751
43456
|
* inline in the spec (no named components, no operationIds). The `Flow`
|
|
43752
43457
|
* alias below is the REFERENCE PATTERN the entity-codegen workflow clones.
|
|
43753
43458
|
*/
|
|
@@ -43762,12 +43467,121 @@ type ExecutionStreamEvent = components['schemas']['ExecutionStreamEvent'];
|
|
|
43762
43467
|
*/
|
|
43763
43468
|
type DispatchEvent = components['schemas']['ExecutionStreamEvent'];
|
|
43764
43469
|
/**
|
|
43765
|
-
*
|
|
43766
|
-
*
|
|
43767
|
-
*
|
|
43768
|
-
* {@link ExecutionStreamEvent}
|
|
43769
|
-
|
|
43770
|
-
|
|
43470
|
+
* SDK presentation shape for FlowBuilder callbacks.
|
|
43471
|
+
*
|
|
43472
|
+
* This is deliberately hand-written instead of sourced from OpenAPI: the public
|
|
43473
|
+
* wire has one vocabulary ({@link ExecutionStreamEvent}), while the SDK
|
|
43474
|
+
* reverse-translates those frames to its long-standing callback names for
|
|
43475
|
+
* compatibility. These types describe that client-side presentation layer, not
|
|
43476
|
+
* an alternate server wire contract.
|
|
43477
|
+
*/
|
|
43478
|
+
type FlowStreamEvent = (LegacyFlowEventBase & {
|
|
43479
|
+
type: 'flow_start';
|
|
43480
|
+
flowId: string;
|
|
43481
|
+
flowName?: string;
|
|
43482
|
+
totalSteps?: number;
|
|
43483
|
+
startedAt?: string;
|
|
43484
|
+
input?: unknown;
|
|
43485
|
+
}) | (LegacyFlowEventBase & {
|
|
43486
|
+
type: 'flow_complete';
|
|
43487
|
+
flowId?: string;
|
|
43488
|
+
flowName?: string;
|
|
43489
|
+
totalSteps?: number;
|
|
43490
|
+
successfulSteps?: number;
|
|
43491
|
+
failedSteps?: number;
|
|
43492
|
+
skippedSteps?: number;
|
|
43493
|
+
executionTime?: number;
|
|
43494
|
+
duration?: number;
|
|
43495
|
+
durationMs?: number;
|
|
43496
|
+
success?: boolean;
|
|
43497
|
+
finalOutput?: unknown;
|
|
43498
|
+
completedAt?: string;
|
|
43499
|
+
}) | (LegacyFlowEventBase & {
|
|
43500
|
+
type: 'flow_error';
|
|
43501
|
+
flowId?: string;
|
|
43502
|
+
stepId?: string;
|
|
43503
|
+
error?: string | Record<string, unknown> | null;
|
|
43504
|
+
code?: string;
|
|
43505
|
+
timestamp?: string;
|
|
43506
|
+
}) | (LegacyFlowEventBase & {
|
|
43507
|
+
type: 'flow_await';
|
|
43508
|
+
flowId?: string;
|
|
43509
|
+
stepId?: string;
|
|
43510
|
+
toolId?: string;
|
|
43511
|
+
toolCallId?: string;
|
|
43512
|
+
toolName?: string;
|
|
43513
|
+
awaitedAt?: string;
|
|
43514
|
+
awaitReason?: string;
|
|
43515
|
+
status?: string;
|
|
43516
|
+
}) | (LegacyFlowEventBase & {
|
|
43517
|
+
type: 'step_start';
|
|
43518
|
+
id?: string;
|
|
43519
|
+
stepId?: string;
|
|
43520
|
+
name?: string;
|
|
43521
|
+
stepName?: string;
|
|
43522
|
+
index?: number;
|
|
43523
|
+
stepType?: string;
|
|
43524
|
+
input?: unknown;
|
|
43525
|
+
startedAt?: string;
|
|
43526
|
+
}) | (LegacyFlowEventBase & {
|
|
43527
|
+
type: 'step_delta';
|
|
43528
|
+
id?: string;
|
|
43529
|
+
stepId?: string;
|
|
43530
|
+
index?: number;
|
|
43531
|
+
text?: string;
|
|
43532
|
+
delta?: string;
|
|
43533
|
+
partId?: string;
|
|
43534
|
+
}) | (LegacyFlowEventBase & {
|
|
43535
|
+
type: 'step_complete';
|
|
43536
|
+
id?: string;
|
|
43537
|
+
stepId?: string;
|
|
43538
|
+
name?: string;
|
|
43539
|
+
stepName?: string;
|
|
43540
|
+
index?: number;
|
|
43541
|
+
stepType?: string;
|
|
43542
|
+
result?: unknown;
|
|
43543
|
+
executionTime?: number;
|
|
43544
|
+
duration?: number;
|
|
43545
|
+
durationMs?: number;
|
|
43546
|
+
success?: boolean;
|
|
43547
|
+
stopReason?: string;
|
|
43548
|
+
completedAt?: string;
|
|
43549
|
+
}) | (LegacyFlowEventBase & {
|
|
43550
|
+
type: 'step_error';
|
|
43551
|
+
id?: string;
|
|
43552
|
+
stepId?: string;
|
|
43553
|
+
name?: string;
|
|
43554
|
+
stepName?: string;
|
|
43555
|
+
error?: string | Record<string, unknown> | null;
|
|
43556
|
+
success?: false;
|
|
43557
|
+
}) | (LegacyFlowEventBase & {
|
|
43558
|
+
type: 'step_await';
|
|
43559
|
+
id?: string;
|
|
43560
|
+
stepId?: string;
|
|
43561
|
+
name?: string;
|
|
43562
|
+
stepName?: string;
|
|
43563
|
+
index?: number;
|
|
43564
|
+
stepType?: string;
|
|
43565
|
+
toolId?: string;
|
|
43566
|
+
toolCallId?: string;
|
|
43567
|
+
toolName?: string;
|
|
43568
|
+
parameters?: unknown;
|
|
43569
|
+
}) | LegacyFlowNamedEvent<'step_skip' | 'tool_start' | 'tool_delta' | 'tool_input_delta' | 'tool_input_complete' | 'tool_complete' | 'tool_error' | 'chunk' | 'text_start' | 'text_end' | 'reason_start' | 'reason_delta' | 'reason_complete' | 'source' | 'fallback_start' | 'fallback_complete' | 'fallback_exhausted'>;
|
|
43570
|
+
type LegacyFlowNamedEvent<T extends string> = T extends unknown ? LegacyFlowEventBase & {
|
|
43571
|
+
type: T;
|
|
43572
|
+
} : never;
|
|
43573
|
+
interface LegacyFlowEventBase {
|
|
43574
|
+
executionContext?: Record<string, unknown>;
|
|
43575
|
+
executionId?: string;
|
|
43576
|
+
seq?: number;
|
|
43577
|
+
source?: string;
|
|
43578
|
+
toolContext?: {
|
|
43579
|
+
executionId: string;
|
|
43580
|
+
stepId: string;
|
|
43581
|
+
toolId: string;
|
|
43582
|
+
};
|
|
43583
|
+
[key: string]: unknown;
|
|
43584
|
+
}
|
|
43771
43585
|
/**
|
|
43772
43586
|
* @deprecated Alias of {@link ExecutionStreamEvent}. Prefer `ExecutionStreamEvent`.
|
|
43773
43587
|
*/
|
|
@@ -43790,20 +43604,11 @@ type StreamEventOf<U, T extends string> = Extract<U, {
|
|
|
43790
43604
|
/**
|
|
43791
43605
|
* Options for the flow stream consumers.
|
|
43792
43606
|
*
|
|
43793
|
-
*
|
|
43794
|
-
*
|
|
43795
|
-
* - `undefined` (default): AUTO-DETECT — translate iff the stream is detected
|
|
43796
|
-
* as unified (an execution stream always leads with `execution_start`).
|
|
43797
|
-
* This makes the public `streamEvents(response)` / `processStream(response,
|
|
43798
|
-
* cb)` pattern correct on a `dispatch()` response without the caller knowing
|
|
43799
|
-
* the wire format, and keeps a still-legacy stream (the eval stream)
|
|
43800
|
-
* flowing through untouched.
|
|
43801
|
-
* - `true`: force translation (internal callers that KNOW the route is unified).
|
|
43802
|
-
* - `false`: force legacy passthrough (never translate).
|
|
43803
|
-
* The non-streaming JSON branch always stays legacy — the api only translates
|
|
43804
|
-
* the SSE writer, never the JSON `events` array.
|
|
43607
|
+
* Kept for source compatibility with older SDK consumers. Unified SSE
|
|
43608
|
+
* translation is unconditional; `unified` is ignored.
|
|
43805
43609
|
*/
|
|
43806
43610
|
interface StreamConsumeOptions {
|
|
43611
|
+
/** @deprecated The API wire is always unified; this option is ignored. */
|
|
43807
43612
|
unified?: boolean;
|
|
43808
43613
|
}
|
|
43809
43614
|
/**
|
|
@@ -43840,7 +43645,7 @@ declare function parseFinalBuffer(buffer: string): string | null;
|
|
|
43840
43645
|
* })
|
|
43841
43646
|
* ```
|
|
43842
43647
|
*/
|
|
43843
|
-
declare function processStream(response: Response, callbacks?: StreamCallbacks,
|
|
43648
|
+
declare function processStream(response: Response, callbacks?: StreamCallbacks, _options?: StreamConsumeOptions): Promise<FlowSummary>;
|
|
43844
43649
|
/**
|
|
43845
43650
|
* Create an async iterator over SSE events
|
|
43846
43651
|
*
|
|
@@ -43855,7 +43660,7 @@ declare function processStream(response: Response, callbacks?: StreamCallbacks,
|
|
|
43855
43660
|
* }
|
|
43856
43661
|
* ```
|
|
43857
43662
|
*/
|
|
43858
|
-
declare function streamEvents(response: Response,
|
|
43663
|
+
declare function streamEvents(response: Response, _options?: StreamConsumeOptions): AsyncGenerator<StreamEvent>;
|
|
43859
43664
|
|
|
43860
43665
|
/**
|
|
43861
43666
|
* FlowResult - Wrapper for streaming flow execution responses
|
|
@@ -43893,13 +43698,11 @@ declare class FlowResult {
|
|
|
43893
43698
|
private response;
|
|
43894
43699
|
private consumed;
|
|
43895
43700
|
private cachedSummary;
|
|
43896
|
-
private streamOptions;
|
|
43897
43701
|
/**
|
|
43898
|
-
* @param
|
|
43899
|
-
*
|
|
43900
|
-
* left unset by the still-legacy eval stream producer.
|
|
43702
|
+
* @param _options Deprecated stream-format options retained for source
|
|
43703
|
+
* compatibility. The API wire is always unified.
|
|
43901
43704
|
*/
|
|
43902
|
-
constructor(response: Response, summary?: FlowSummary,
|
|
43705
|
+
constructor(response: Response, summary?: FlowSummary, _options?: StreamConsumeOptions);
|
|
43903
43706
|
/**
|
|
43904
43707
|
* Get the raw Response object for manual handling
|
|
43905
43708
|
*
|
|
@@ -44456,15 +44259,10 @@ interface Message$1 {
|
|
|
44456
44259
|
/**
|
|
44457
44260
|
* Union type of all possible flow-execution SSE events.
|
|
44458
44261
|
*
|
|
44459
|
-
*
|
|
44460
|
-
*
|
|
44461
|
-
*
|
|
44462
|
-
* narrow
|
|
44463
|
-
* superset of the old hand-written shapes: some fields are optional or
|
|
44464
|
-
* field-name-aliased (`id`/`stepId`, `name`/`stepName`, `text`/`delta`,
|
|
44465
|
-
* `duration`/`durationMs`/`executionTime`), and `flow_error.error` may be a
|
|
44466
|
-
* string OR a structured `{ code, message, ... }` object — consumers must
|
|
44467
|
-
* read these fields defensively.
|
|
44262
|
+
* This compatibility-only presentation union is produced by the SDK's unified
|
|
44263
|
+
* wire adapter. It preserves the long-standing FlowBuilder callback names and
|
|
44264
|
+
* field aliases without exposing a second server vocabulary. The per-event
|
|
44265
|
+
* aliases below narrow it via the `type` discriminant.
|
|
44468
44266
|
*/
|
|
44469
44267
|
type StreamEvent = FlowStreamEvent;
|
|
44470
44268
|
type FlowStartEvent = StreamEventOf<FlowStreamEvent, 'flow_start'>;
|
|
@@ -46446,16 +46244,19 @@ interface EvalCaseCheckpoint {
|
|
|
46446
46244
|
forkMessageIndex: number;
|
|
46447
46245
|
}
|
|
46448
46246
|
/**
|
|
46449
|
-
* One
|
|
46450
|
-
*
|
|
46451
|
-
*
|
|
46247
|
+
* One tool result a `recordedToolMode: 'continue'` suite serves by tool name
|
|
46248
|
+
* instead of dispatching the real tool (mirror of `ToolMock` in
|
|
46249
|
+
* `@runtypelabs/shared`). Either captured from a real run or hand-authored in
|
|
46250
|
+
* `defineEval` directly — a `toolType: 'local'` tool otherwise pauses the run
|
|
46251
|
+
* on its first call, so a mock is how an eval case gets an agent past it.
|
|
46452
46252
|
*/
|
|
46453
46253
|
interface EvalToolMock {
|
|
46454
46254
|
toolName: string;
|
|
46455
46255
|
input?: unknown;
|
|
46456
46256
|
output: unknown;
|
|
46457
|
-
/** True when the
|
|
46257
|
+
/** True when the call should replay as a FAILURE: `output` is its error payload. */
|
|
46458
46258
|
isError?: boolean;
|
|
46259
|
+
/** Present when captured: the `tool_executions.id` this mock came from. */
|
|
46459
46260
|
sourceToolExecutionId?: string;
|
|
46460
46261
|
/** True when `output` was capped at capture (the case is then non-fully-replayable). */
|
|
46461
46262
|
truncated?: boolean;
|
|
@@ -46464,9 +46265,19 @@ interface EvalToolMock {
|
|
|
46464
46265
|
interface EvalCaseInput {
|
|
46465
46266
|
variables?: Record<string, unknown>;
|
|
46466
46267
|
messages?: EvalMessage[];
|
|
46467
|
-
/**
|
|
46268
|
+
/**
|
|
46269
|
+
* Present on `saved_from_run` cases: where the run was forked. Execution
|
|
46270
|
+
* state, not something `defineEval` accepts as authored input — it round-
|
|
46271
|
+
* trips through `client.evals.pull()` but is dropped if you feed a pulled
|
|
46272
|
+
* case straight back into `defineEval` (the server rejects it too).
|
|
46273
|
+
*/
|
|
46468
46274
|
checkpoint?: EvalCaseCheckpoint;
|
|
46469
|
-
/**
|
|
46275
|
+
/**
|
|
46276
|
+
* Tool results served instead of dispatching the real tool, when the
|
|
46277
|
+
* suite's `recordedToolMode` is `'continue'`. Present on `saved_from_run`
|
|
46278
|
+
* cases (recorded from the fork) — and, as of round-2 item 7, also
|
|
46279
|
+
* writable directly on a hand-authored case with no `checkpoint` at all.
|
|
46280
|
+
*/
|
|
46470
46281
|
toolMocks?: EvalToolMock[];
|
|
46471
46282
|
}
|
|
46472
46283
|
/** The target a suite evaluates — a saved flow or agent, by portable name. */
|
|
@@ -46580,7 +46391,8 @@ interface EvalPullResult {
|
|
|
46580
46391
|
}
|
|
46581
46392
|
/**
|
|
46582
46393
|
* One grader's verdict for one case (mirror of `@runtypelabs/shared`'s
|
|
46583
|
-
* `GraderOutcome`). `graderIndex` is the
|
|
46394
|
+
* `GraderOutcome`). `graderIndex` is the index into the case's effective grader
|
|
46395
|
+
* array (`case.graders ?? suite.graders`).
|
|
46584
46396
|
*/
|
|
46585
46397
|
interface GraderOutcome {
|
|
46586
46398
|
graderIndex: number;
|
|
@@ -47491,6 +47303,11 @@ interface EvalSuiteCase {
|
|
|
47491
47303
|
name: string;
|
|
47492
47304
|
input: EvalCaseInput;
|
|
47493
47305
|
expected: CaseExpected | null;
|
|
47306
|
+
/**
|
|
47307
|
+
* Per-case graders that REPLACE the suite graders for this case, or null when
|
|
47308
|
+
* the case is scored with the suite's `graders`.
|
|
47309
|
+
*/
|
|
47310
|
+
graders: GraderConfig[] | null;
|
|
47494
47311
|
notes: string | null;
|
|
47495
47312
|
origin: string;
|
|
47496
47313
|
enabled: boolean;
|
|
@@ -47518,6 +47335,11 @@ interface EvalSuiteCaseInput {
|
|
|
47518
47335
|
name: string;
|
|
47519
47336
|
input?: EvalCaseInput;
|
|
47520
47337
|
expected?: CaseExpected;
|
|
47338
|
+
/**
|
|
47339
|
+
* Per-case graders. When set, they REPLACE the suite graders for this case
|
|
47340
|
+
* (not appended). Omit to score the case with the suite graders.
|
|
47341
|
+
*/
|
|
47342
|
+
graders?: GraderConfig[];
|
|
47521
47343
|
notes?: string;
|
|
47522
47344
|
enabled?: boolean;
|
|
47523
47345
|
/** Case provenance. Defaults to 'manual' server-side when omitted. */
|
|
@@ -47606,6 +47428,12 @@ interface UpdateEvalCaseInput {
|
|
|
47606
47428
|
name?: string;
|
|
47607
47429
|
input?: EvalCaseInput;
|
|
47608
47430
|
expected?: CaseExpected | null;
|
|
47431
|
+
/**
|
|
47432
|
+
* Per-case graders that REPLACE the suite graders for this case. `null` clears
|
|
47433
|
+
* the override (the case scores with the suite graders again); `undefined`
|
|
47434
|
+
* leaves it unchanged.
|
|
47435
|
+
*/
|
|
47436
|
+
graders?: GraderConfig[] | null;
|
|
47609
47437
|
notes?: string | null;
|
|
47610
47438
|
enabled?: boolean;
|
|
47611
47439
|
}
|
|
@@ -51773,10 +51601,10 @@ interface ParsedSSEEvent {
|
|
|
51773
51601
|
interface AgentStreamCallbacks {
|
|
51774
51602
|
onAgentStart?: (event: AgentStartEvent) => void;
|
|
51775
51603
|
/**
|
|
51776
|
-
* @deprecated
|
|
51777
|
-
*
|
|
51604
|
+
* @deprecated Not represented on the public unified wire: iteration
|
|
51605
|
+
* boundaries are folded into the
|
|
51778
51606
|
* `iteration` field on `onTurnStart` / `onTurnComplete` / tool events. Read
|
|
51779
|
-
* that field instead.
|
|
51607
|
+
* that field instead. Retained only for source compatibility.
|
|
51780
51608
|
*/
|
|
51781
51609
|
onIterationStart?: (event: AgentIterationStartEvent) => void;
|
|
51782
51610
|
onTurnStart?: (event: AgentTurnStartEvent) => void;
|
|
@@ -51791,10 +51619,10 @@ interface AgentStreamCallbacks {
|
|
|
51791
51619
|
onApprovalStart?: (event: AgentApprovalStartEvent) => void;
|
|
51792
51620
|
onApprovalComplete?: (event: AgentApprovalCompleteEvent) => void;
|
|
51793
51621
|
/**
|
|
51794
|
-
* @deprecated
|
|
51795
|
-
*
|
|
51622
|
+
* @deprecated Not represented on the public unified wire: iteration
|
|
51623
|
+
* boundaries are folded into the
|
|
51796
51624
|
* `iteration` field on turn/tool events. Use `onTurnComplete` for per-turn
|
|
51797
|
-
* cost/token data.
|
|
51625
|
+
* cost/token data. Retained only for source compatibility.
|
|
51798
51626
|
*/
|
|
51799
51627
|
onIterationComplete?: (event: AgentIterationCompleteEvent) => void;
|
|
51800
51628
|
onReflection?: (event: AgentReflectionEvent) => void;
|
|
@@ -53339,17 +53167,15 @@ declare function parseOffloadedOutputId(value: string): string | undefined;
|
|
|
53339
53167
|
declare function parseLedgerArtifactRelativePath(value: string): string | undefined;
|
|
53340
53168
|
|
|
53341
53169
|
/**
|
|
53342
|
-
* Unified →
|
|
53170
|
+
* Unified wire → stable SDK callback adapter (the client-side mirror of the api's
|
|
53343
53171
|
* `apps/api/src/lib/unified-event-stream.ts`).
|
|
53344
53172
|
*
|
|
53345
53173
|
* As of the unified-SSE cutover (runtypelabs/core unified-sse-default) the
|
|
53346
53174
|
* execution streams the SDK consumes — `/dispatch`, `/dispatch/resume`,
|
|
53347
|
-
* `/agents/{id}/execute`, `/agents/{id}/resume` —
|
|
53348
|
-
*
|
|
53349
|
-
*
|
|
53350
|
-
*
|
|
53351
|
-
* `flows-namespace.ts`), then translates the unified frames back into the
|
|
53352
|
-
* SDK's stable, hand-written legacy event shapes here.
|
|
53175
|
+
* `/agents/{id}/execute`, `/agents/{id}/resume` — use the 33-event unified
|
|
53176
|
+
* vocabulary (`unifiedSSEEventSchema` in `@runtypelabs/shared`). The SDK
|
|
53177
|
+
* translates those frames back into its stable, hand-written callback shapes
|
|
53178
|
+
* here.
|
|
53353
53179
|
*
|
|
53354
53180
|
* Why translate instead of rewriting every consumer switch: the SDK's public
|
|
53355
53181
|
* callback contracts (`StreamCallbacks`, `AgentStreamCallbacks`) and their event
|
|
@@ -53361,52 +53187,49 @@ declare function parseLedgerArtifactRelativePath(value: string): string | undefi
|
|
|
53361
53187
|
*
|
|
53362
53188
|
* Scope: only the events the SDK's consumers actually read are reconstructed;
|
|
53363
53189
|
* everything else (artifact channel, `source`, `custom`, fallback live-beat,
|
|
53364
|
-
* `step_skip`) maps to zero
|
|
53190
|
+
* `step_skip`) maps to zero callback events. Two unified-contract folds are NOT
|
|
53365
53191
|
* reconstructed because the unified vocabulary deliberately discards them:
|
|
53366
53192
|
* - `agent_iteration_start` / `agent_iteration_complete` are folded into the
|
|
53367
53193
|
* `iteration` field on turn/tool frames, so `onIterationStart` /
|
|
53368
53194
|
* `onIterationComplete` no longer fire.
|
|
53369
53195
|
* - the additive `fallback` summary on `step_complete` / `turn_complete` is
|
|
53370
|
-
* dropped (the SDK never consumed
|
|
53196
|
+
* dropped (the SDK callback surface never consumed `fallback_*` events).
|
|
53371
53197
|
*
|
|
53372
53198
|
* Each translator is STATEFUL (channel block ids, current step/turn/iteration,
|
|
53373
53199
|
* media accumulation) and therefore must be constructed once PER STREAM — never
|
|
53374
53200
|
* shared across executions.
|
|
53375
53201
|
*/
|
|
53376
53202
|
type Json = Record<string, unknown>;
|
|
53377
|
-
/** A reconstructed legacy event (shape validated by the consumer switch/cast). */
|
|
53378
|
-
type LegacyEvent = Json & {
|
|
53379
|
-
type: string;
|
|
53380
|
-
};
|
|
53381
53203
|
/**
|
|
53382
|
-
*
|
|
53383
|
-
*
|
|
53384
|
-
*
|
|
53385
|
-
* format regardless of the server-side `default-sse-event-format` rollout flag.
|
|
53204
|
+
* @deprecated Unified events are now the only public execution-stream format.
|
|
53205
|
+
* Retained so published SDK consumers can compile while removing old opt-in
|
|
53206
|
+
* plumbing at their convenience.
|
|
53386
53207
|
*/
|
|
53387
53208
|
declare const UNIFIED_EVENTS_QUERY = "events=unified";
|
|
53388
|
-
/**
|
|
53209
|
+
/**
|
|
53210
|
+
* @deprecated Unified events are now unconditional; the request path is
|
|
53211
|
+
* returned unchanged and no negotiation query is appended.
|
|
53212
|
+
*/
|
|
53389
53213
|
declare function withUnifiedEvents(path: string): string;
|
|
53390
|
-
/** True when `type`
|
|
53214
|
+
/** True when `type` belongs to the canonical unified vocabulary. */
|
|
53391
53215
|
declare function isUnifiedEventType(type: unknown): boolean;
|
|
53216
|
+
/** A reconstructed compatibility event (validated by the consumer switch/cast). */
|
|
53217
|
+
type CompatibilityEvent = Json & {
|
|
53218
|
+
type: string;
|
|
53219
|
+
};
|
|
53392
53220
|
/**
|
|
53393
|
-
* Create a stateful translator from the unified vocabulary to the
|
|
53394
|
-
*
|
|
53395
|
-
* `client.ts`. Returns 0+
|
|
53221
|
+
* Create a stateful translator from the unified vocabulary to the stable flow
|
|
53222
|
+
* callback shapes consumed by `stream-utils.ts` / `flows-namespace.ts` /
|
|
53223
|
+
* `client.ts`. Returns 0+ callback events per unified event. Construct one per
|
|
53396
53224
|
* stream.
|
|
53397
|
-
*
|
|
53398
|
-
* Tolerant by design: unified frames are translated; legacy flow frames pass
|
|
53399
|
-
* through unchanged (so a legacy stream — e.g. during the rollout window —
|
|
53400
|
-
* still works). The overlapping `step_start` / `step_complete` read both
|
|
53401
|
-
* vocabularies' field names.
|
|
53402
53225
|
*/
|
|
53403
|
-
declare function createFlowEventTranslator(): (event: unknown) =>
|
|
53226
|
+
declare function createFlowEventTranslator(): (event: unknown) => CompatibilityEvent[];
|
|
53404
53227
|
/**
|
|
53405
|
-
* Create a stateful translator from the unified vocabulary to the
|
|
53406
|
-
* `agent_*`
|
|
53407
|
-
* Returns 0+
|
|
53228
|
+
* Create a stateful translator from the unified vocabulary to the stable
|
|
53229
|
+
* `agent_*` callback shapes dispatched by `processAgentStream` in `endpoints.ts`.
|
|
53230
|
+
* Returns 0+ callback events per unified event. Construct one per stream.
|
|
53408
53231
|
*/
|
|
53409
|
-
declare function createAgentEventTranslator(): (event: unknown) =>
|
|
53232
|
+
declare function createAgentEventTranslator(): (event: unknown) => CompatibilityEvent[];
|
|
53410
53233
|
|
|
53411
53234
|
/**
|
|
53412
53235
|
* BatchBuilder - Fluent builder for batch operations
|