@runtypelabs/sdk 6.2.0 → 6.3.0

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.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. The vocabulary follows the same negotiation as the execution stream (`?events=`, `X-Persona-Version`, then the default-sse-event-format flag).
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: {
@@ -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) cases replay: "next_step" (default) or "continue" (serve recorded toolMocks and run past the first action).
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) cases replay: "next_step" (default) or "continue" (serve recorded toolMocks and run past the first action).
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?: unknown;
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?: unknown;
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?: unknown;
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?: unknown;
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 by default; use a raw/streaming client helper for flow tools.
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) cases replay: "next_step" (default) or "continue" (serve recorded toolMocks and run past the first action).
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;
@@ -42698,6 +42771,10 @@ interface components {
42698
42771
  approvalId: string;
42699
42772
  description?: string;
42700
42773
  executionId: string;
42774
+ externalAgent?: {
42775
+ contextId?: string;
42776
+ taskId?: string;
42777
+ };
42701
42778
  iteration?: number;
42702
42779
  parameters?: {
42703
42780
  [key: string]: unknown;
@@ -42841,382 +42918,6 @@ interface components {
42841
42918
  /** @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
42919
  warnings?: string[];
42843
42920
  };
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
42921
  FlowValidationIssue: {
43221
42922
  code: string;
43222
42923
  details?: unknown;
@@ -43744,10 +43445,12 @@ interface components {
43744
43445
  * the rest of the SDK (and `types.ts`) re-exports, so the published surface
43745
43446
  * never exposes `paths['/v1/...'][...]` indexing.
43746
43447
  *
43747
- * Two flavors live here:
43748
- * 1. Streaming event unions — sourced from named `components.schemas` (the
43749
- * OAS 3.2 SSE itemSchema unions). Clean `$ref` → named type.
43750
- * 2. Entity types sourced by indexing into `paths`, because entities are
43448
+ * Three flavors live here:
43449
+ * 1. The unified streaming wire union — sourced from the named OAS 3.2
43450
+ * `ExecutionStreamEvent` itemSchema component.
43451
+ * 2. The compatibility-only FlowBuilder callback union hand-maintained
43452
+ * because it is a client presentation shape, not a server wire schema.
43453
+ * 3. Entity types — sourced by indexing into `paths`, because entities are
43751
43454
  * inline in the spec (no named components, no operationIds). The `Flow`
43752
43455
  * alias below is the REFERENCE PATTERN the entity-codegen workflow clones.
43753
43456
  */
@@ -43762,12 +43465,121 @@ type ExecutionStreamEvent = components['schemas']['ExecutionStreamEvent'];
43762
43465
  */
43763
43466
  type DispatchEvent = components['schemas']['ExecutionStreamEvent'];
43764
43467
  /**
43765
- * Legacy flow-execution event union. Kept for the SDK's FlowBuilder convenience
43766
- * types (`StreamEventOf<FlowStreamEvent, 'flow_start' | 'step_delta' | …>`),
43767
- * which use the historical event names. The wire is the unified stream;
43768
- * {@link ExecutionStreamEvent} is the current shape.
43769
- */
43770
- type FlowStreamEvent = components['schemas']['FlowSSEEvent'];
43468
+ * SDK presentation shape for FlowBuilder callbacks.
43469
+ *
43470
+ * This is deliberately hand-written instead of sourced from OpenAPI: the public
43471
+ * wire has one vocabulary ({@link ExecutionStreamEvent}), while the SDK
43472
+ * reverse-translates those frames to its long-standing callback names for
43473
+ * compatibility. These types describe that client-side presentation layer, not
43474
+ * an alternate server wire contract.
43475
+ */
43476
+ type FlowStreamEvent = (LegacyFlowEventBase & {
43477
+ type: 'flow_start';
43478
+ flowId: string;
43479
+ flowName?: string;
43480
+ totalSteps?: number;
43481
+ startedAt?: string;
43482
+ input?: unknown;
43483
+ }) | (LegacyFlowEventBase & {
43484
+ type: 'flow_complete';
43485
+ flowId?: string;
43486
+ flowName?: string;
43487
+ totalSteps?: number;
43488
+ successfulSteps?: number;
43489
+ failedSteps?: number;
43490
+ skippedSteps?: number;
43491
+ executionTime?: number;
43492
+ duration?: number;
43493
+ durationMs?: number;
43494
+ success?: boolean;
43495
+ finalOutput?: unknown;
43496
+ completedAt?: string;
43497
+ }) | (LegacyFlowEventBase & {
43498
+ type: 'flow_error';
43499
+ flowId?: string;
43500
+ stepId?: string;
43501
+ error?: string | Record<string, unknown> | null;
43502
+ code?: string;
43503
+ timestamp?: string;
43504
+ }) | (LegacyFlowEventBase & {
43505
+ type: 'flow_await';
43506
+ flowId?: string;
43507
+ stepId?: string;
43508
+ toolId?: string;
43509
+ toolCallId?: string;
43510
+ toolName?: string;
43511
+ awaitedAt?: string;
43512
+ awaitReason?: string;
43513
+ status?: string;
43514
+ }) | (LegacyFlowEventBase & {
43515
+ type: 'step_start';
43516
+ id?: string;
43517
+ stepId?: string;
43518
+ name?: string;
43519
+ stepName?: string;
43520
+ index?: number;
43521
+ stepType?: string;
43522
+ input?: unknown;
43523
+ startedAt?: string;
43524
+ }) | (LegacyFlowEventBase & {
43525
+ type: 'step_delta';
43526
+ id?: string;
43527
+ stepId?: string;
43528
+ index?: number;
43529
+ text?: string;
43530
+ delta?: string;
43531
+ partId?: string;
43532
+ }) | (LegacyFlowEventBase & {
43533
+ type: 'step_complete';
43534
+ id?: string;
43535
+ stepId?: string;
43536
+ name?: string;
43537
+ stepName?: string;
43538
+ index?: number;
43539
+ stepType?: string;
43540
+ result?: unknown;
43541
+ executionTime?: number;
43542
+ duration?: number;
43543
+ durationMs?: number;
43544
+ success?: boolean;
43545
+ stopReason?: string;
43546
+ completedAt?: string;
43547
+ }) | (LegacyFlowEventBase & {
43548
+ type: 'step_error';
43549
+ id?: string;
43550
+ stepId?: string;
43551
+ name?: string;
43552
+ stepName?: string;
43553
+ error?: string | Record<string, unknown> | null;
43554
+ success?: false;
43555
+ }) | (LegacyFlowEventBase & {
43556
+ type: 'step_await';
43557
+ id?: string;
43558
+ stepId?: string;
43559
+ name?: string;
43560
+ stepName?: string;
43561
+ index?: number;
43562
+ stepType?: string;
43563
+ toolId?: string;
43564
+ toolCallId?: string;
43565
+ toolName?: string;
43566
+ parameters?: unknown;
43567
+ }) | 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'>;
43568
+ type LegacyFlowNamedEvent<T extends string> = T extends unknown ? LegacyFlowEventBase & {
43569
+ type: T;
43570
+ } : never;
43571
+ interface LegacyFlowEventBase {
43572
+ executionContext?: Record<string, unknown>;
43573
+ executionId?: string;
43574
+ seq?: number;
43575
+ source?: string;
43576
+ toolContext?: {
43577
+ executionId: string;
43578
+ stepId: string;
43579
+ toolId: string;
43580
+ };
43581
+ [key: string]: unknown;
43582
+ }
43771
43583
  /**
43772
43584
  * @deprecated Alias of {@link ExecutionStreamEvent}. Prefer `ExecutionStreamEvent`.
43773
43585
  */
@@ -43790,20 +43602,11 @@ type StreamEventOf<U, T extends string> = Extract<U, {
43790
43602
  /**
43791
43603
  * Options for the flow stream consumers.
43792
43604
  *
43793
- * `unified` controls translation of the SSE branch from the unified 33-event
43794
- * wire vocabulary back to the legacy flow event shapes:
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.
43605
+ * Kept for source compatibility with older SDK consumers. Unified SSE
43606
+ * translation is unconditional; `unified` is ignored.
43805
43607
  */
43806
43608
  interface StreamConsumeOptions {
43609
+ /** @deprecated The API wire is always unified; this option is ignored. */
43807
43610
  unified?: boolean;
43808
43611
  }
43809
43612
  /**
@@ -43840,7 +43643,7 @@ declare function parseFinalBuffer(buffer: string): string | null;
43840
43643
  * })
43841
43644
  * ```
43842
43645
  */
43843
- declare function processStream(response: Response, callbacks?: StreamCallbacks, options?: StreamConsumeOptions): Promise<FlowSummary>;
43646
+ declare function processStream(response: Response, callbacks?: StreamCallbacks, _options?: StreamConsumeOptions): Promise<FlowSummary>;
43844
43647
  /**
43845
43648
  * Create an async iterator over SSE events
43846
43649
  *
@@ -43855,7 +43658,7 @@ declare function processStream(response: Response, callbacks?: StreamCallbacks,
43855
43658
  * }
43856
43659
  * ```
43857
43660
  */
43858
- declare function streamEvents(response: Response, options?: StreamConsumeOptions): AsyncGenerator<StreamEvent>;
43661
+ declare function streamEvents(response: Response, _options?: StreamConsumeOptions): AsyncGenerator<StreamEvent>;
43859
43662
 
43860
43663
  /**
43861
43664
  * FlowResult - Wrapper for streaming flow execution responses
@@ -43893,13 +43696,11 @@ declare class FlowResult {
43893
43696
  private response;
43894
43697
  private consumed;
43895
43698
  private cachedSummary;
43896
- private streamOptions;
43897
43699
  /**
43898
- * @param options.unified - The response is a unified-vocabulary SSE stream
43899
- * (`/dispatch` since the unified-SSE cutover). Set by dispatch call sites;
43900
- * left unset by the still-legacy eval stream producer.
43700
+ * @param _options Deprecated stream-format options retained for source
43701
+ * compatibility. The API wire is always unified.
43901
43702
  */
43902
- constructor(response: Response, summary?: FlowSummary, options?: StreamConsumeOptions);
43703
+ constructor(response: Response, summary?: FlowSummary, _options?: StreamConsumeOptions);
43903
43704
  /**
43904
43705
  * Get the raw Response object for manual handling
43905
43706
  *
@@ -44456,15 +44257,10 @@ interface Message$1 {
44456
44257
  /**
44457
44258
  * Union type of all possible flow-execution SSE events.
44458
44259
  *
44459
- * Sourced from the GENERATED OpenAPI spec (`components.schemas.FlowSSEEvent`,
44460
- * a 26-member discriminated union on `type`) rather than hand-mirrored
44461
- * interfaces. The per-event member types below are back-compat aliases that
44462
- * narrow this union via its `type` discriminant. The generated union is a
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.
44260
+ * This compatibility-only presentation union is produced by the SDK's unified
44261
+ * wire adapter. It preserves the long-standing FlowBuilder callback names and
44262
+ * field aliases without exposing a second server vocabulary. The per-event
44263
+ * aliases below narrow it via the `type` discriminant.
44468
44264
  */
44469
44265
  type StreamEvent = FlowStreamEvent;
44470
44266
  type FlowStartEvent = StreamEventOf<FlowStreamEvent, 'flow_start'>;
@@ -46446,16 +46242,19 @@ interface EvalCaseCheckpoint {
46446
46242
  forkMessageIndex: number;
46447
46243
  }
46448
46244
  /**
46449
- * One recorded tool result attached to a captured case (mirror of `ToolMock` in
46450
- * `@runtypelabs/shared`). A future next-step replay serves these by tool name;
46451
- * editing `output` turns the case into a counterfactual.
46245
+ * One tool result a `recordedToolMode: 'continue'` suite serves by tool name
46246
+ * instead of dispatching the real tool (mirror of `ToolMock` in
46247
+ * `@runtypelabs/shared`). Either captured from a real run or hand-authored in
46248
+ * `defineEval` directly — a `toolType: 'local'` tool otherwise pauses the run
46249
+ * on its first call, so a mock is how an eval case gets an agent past it.
46452
46250
  */
46453
46251
  interface EvalToolMock {
46454
46252
  toolName: string;
46455
46253
  input?: unknown;
46456
46254
  output: unknown;
46457
- /** True when the recorded call failed: `output` is its error payload and a replay serves it as a failure. */
46255
+ /** True when the call should replay as a FAILURE: `output` is its error payload. */
46458
46256
  isError?: boolean;
46257
+ /** Present when captured: the `tool_executions.id` this mock came from. */
46459
46258
  sourceToolExecutionId?: string;
46460
46259
  /** True when `output` was capped at capture (the case is then non-fully-replayable). */
46461
46260
  truncated?: boolean;
@@ -46464,9 +46263,19 @@ interface EvalToolMock {
46464
46263
  interface EvalCaseInput {
46465
46264
  variables?: Record<string, unknown>;
46466
46265
  messages?: EvalMessage[];
46467
- /** Present on `saved_from_run` cases: where the run was forked. */
46266
+ /**
46267
+ * Present on `saved_from_run` cases: where the run was forked. Execution
46268
+ * state, not something `defineEval` accepts as authored input — it round-
46269
+ * trips through `client.evals.pull()` but is dropped if you feed a pulled
46270
+ * case straight back into `defineEval` (the server rejects it too).
46271
+ */
46468
46272
  checkpoint?: EvalCaseCheckpoint;
46469
- /** Present on `saved_from_run` cases: recorded tool results, for replay/counterfactuals. */
46273
+ /**
46274
+ * Tool results served instead of dispatching the real tool, when the
46275
+ * suite's `recordedToolMode` is `'continue'`. Present on `saved_from_run`
46276
+ * cases (recorded from the fork) — and, as of round-2 item 7, also
46277
+ * writable directly on a hand-authored case with no `checkpoint` at all.
46278
+ */
46470
46279
  toolMocks?: EvalToolMock[];
46471
46280
  }
46472
46281
  /** The target a suite evaluates — a saved flow or agent, by portable name. */
@@ -46580,7 +46389,8 @@ interface EvalPullResult {
46580
46389
  }
46581
46390
  /**
46582
46391
  * One grader's verdict for one case (mirror of `@runtypelabs/shared`'s
46583
- * `GraderOutcome`). `graderIndex` is the position in the suite's grader list.
46392
+ * `GraderOutcome`). `graderIndex` is the index into the case's effective grader
46393
+ * array (`case.graders ?? suite.graders`).
46584
46394
  */
46585
46395
  interface GraderOutcome {
46586
46396
  graderIndex: number;
@@ -47491,6 +47301,11 @@ interface EvalSuiteCase {
47491
47301
  name: string;
47492
47302
  input: EvalCaseInput;
47493
47303
  expected: CaseExpected | null;
47304
+ /**
47305
+ * Per-case graders that REPLACE the suite graders for this case, or null when
47306
+ * the case is scored with the suite's `graders`.
47307
+ */
47308
+ graders: GraderConfig[] | null;
47494
47309
  notes: string | null;
47495
47310
  origin: string;
47496
47311
  enabled: boolean;
@@ -47518,6 +47333,11 @@ interface EvalSuiteCaseInput {
47518
47333
  name: string;
47519
47334
  input?: EvalCaseInput;
47520
47335
  expected?: CaseExpected;
47336
+ /**
47337
+ * Per-case graders. When set, they REPLACE the suite graders for this case
47338
+ * (not appended). Omit to score the case with the suite graders.
47339
+ */
47340
+ graders?: GraderConfig[];
47521
47341
  notes?: string;
47522
47342
  enabled?: boolean;
47523
47343
  /** Case provenance. Defaults to 'manual' server-side when omitted. */
@@ -47606,6 +47426,12 @@ interface UpdateEvalCaseInput {
47606
47426
  name?: string;
47607
47427
  input?: EvalCaseInput;
47608
47428
  expected?: CaseExpected | null;
47429
+ /**
47430
+ * Per-case graders that REPLACE the suite graders for this case. `null` clears
47431
+ * the override (the case scores with the suite graders again); `undefined`
47432
+ * leaves it unchanged.
47433
+ */
47434
+ graders?: GraderConfig[] | null;
47609
47435
  notes?: string | null;
47610
47436
  enabled?: boolean;
47611
47437
  }
@@ -51773,10 +51599,10 @@ interface ParsedSSEEvent {
51773
51599
  interface AgentStreamCallbacks {
51774
51600
  onAgentStart?: (event: AgentStartEvent) => void;
51775
51601
  /**
51776
- * @deprecated No longer emitted on the unified wire vocabulary (the default
51777
- * since the unified-SSE cutover): iteration boundaries are folded into the
51602
+ * @deprecated Not represented on the public unified wire: iteration
51603
+ * boundaries are folded into the
51778
51604
  * `iteration` field on `onTurnStart` / `onTurnComplete` / tool events. Read
51779
- * that field instead. Still fires on a legacy stream during the rollout.
51605
+ * that field instead. Retained only for source compatibility.
51780
51606
  */
51781
51607
  onIterationStart?: (event: AgentIterationStartEvent) => void;
51782
51608
  onTurnStart?: (event: AgentTurnStartEvent) => void;
@@ -51791,10 +51617,10 @@ interface AgentStreamCallbacks {
51791
51617
  onApprovalStart?: (event: AgentApprovalStartEvent) => void;
51792
51618
  onApprovalComplete?: (event: AgentApprovalCompleteEvent) => void;
51793
51619
  /**
51794
- * @deprecated No longer emitted on the unified wire vocabulary (the default
51795
- * since the unified-SSE cutover): iteration boundaries are folded into the
51620
+ * @deprecated Not represented on the public unified wire: iteration
51621
+ * boundaries are folded into the
51796
51622
  * `iteration` field on turn/tool events. Use `onTurnComplete` for per-turn
51797
- * cost/token data. Still fires on a legacy stream during the rollout.
51623
+ * cost/token data. Retained only for source compatibility.
51798
51624
  */
51799
51625
  onIterationComplete?: (event: AgentIterationCompleteEvent) => void;
51800
51626
  onReflection?: (event: AgentReflectionEvent) => void;
@@ -53339,17 +53165,15 @@ declare function parseOffloadedOutputId(value: string): string | undefined;
53339
53165
  declare function parseLedgerArtifactRelativePath(value: string): string | undefined;
53340
53166
 
53341
53167
  /**
53342
- * Unified → legacy SSE event adapter (the client-side mirror of the api's
53168
+ * Unified wire stable SDK callback adapter (the client-side mirror of the api's
53343
53169
  * `apps/api/src/lib/unified-event-stream.ts`).
53344
53170
  *
53345
53171
  * As of the unified-SSE cutover (runtypelabs/core unified-sse-default) the
53346
53172
  * execution streams the SDK consumes — `/dispatch`, `/dispatch/resume`,
53347
- * `/agents/{id}/execute`, `/agents/{id}/resume` — default to the 33-event
53348
- * unified vocabulary (`unifiedSSEEventSchema` in `@runtypelabs/shared`). The
53349
- * SDK opts INTO that vocabulary explicitly with `?events=unified` on those
53350
- * requests (see the call sites in `endpoints.ts` / `runtype.ts` /
53351
- * `flows-namespace.ts`), then translates the unified frames back into the
53352
- * SDK's stable, hand-written legacy event shapes here.
53173
+ * `/agents/{id}/execute`, `/agents/{id}/resume` — use the 33-event unified
53174
+ * vocabulary (`unifiedSSEEventSchema` in `@runtypelabs/shared`). The SDK
53175
+ * translates those frames back into its stable, hand-written callback shapes
53176
+ * here.
53353
53177
  *
53354
53178
  * Why translate instead of rewriting every consumer switch: the SDK's public
53355
53179
  * callback contracts (`StreamCallbacks`, `AgentStreamCallbacks`) and their event
@@ -53361,52 +53185,49 @@ declare function parseLedgerArtifactRelativePath(value: string): string | undefi
53361
53185
  *
53362
53186
  * Scope: only the events the SDK's consumers actually read are reconstructed;
53363
53187
  * everything else (artifact channel, `source`, `custom`, fallback live-beat,
53364
- * `step_skip`) maps to zero legacy events. Two unified-contract folds are NOT
53188
+ * `step_skip`) maps to zero callback events. Two unified-contract folds are NOT
53365
53189
  * reconstructed because the unified vocabulary deliberately discards them:
53366
53190
  * - `agent_iteration_start` / `agent_iteration_complete` are folded into the
53367
53191
  * `iteration` field on turn/tool frames, so `onIterationStart` /
53368
53192
  * `onIterationComplete` no longer fire.
53369
53193
  * - the additive `fallback` summary on `step_complete` / `turn_complete` is
53370
- * dropped (the SDK never consumed the legacy `fallback_*` events either).
53194
+ * dropped (the SDK callback surface never consumed `fallback_*` events).
53371
53195
  *
53372
53196
  * Each translator is STATEFUL (channel block ids, current step/turn/iteration,
53373
53197
  * media accumulation) and therefore must be constructed once PER STREAM — never
53374
53198
  * shared across executions.
53375
53199
  */
53376
53200
  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
53201
  /**
53382
- * Query string that opts a streaming request into the unified SSE vocabulary
53383
- * (`?events=unified`, resolved by the api's `resolveSseEventFormat`). The SDK
53384
- * requests it explicitly on the cut-over routes so it controls its own wire
53385
- * format regardless of the server-side `default-sse-event-format` rollout flag.
53202
+ * @deprecated Unified events are now the only public execution-stream format.
53203
+ * Retained so published SDK consumers can compile while removing old opt-in
53204
+ * plumbing at their convenience.
53386
53205
  */
53387
53206
  declare const UNIFIED_EVENTS_QUERY = "events=unified";
53388
- /** Append the unified-events opt-in to a request path, preserving any existing query. */
53207
+ /**
53208
+ * @deprecated Unified events are now unconditional; the request path is
53209
+ * returned unchanged and no negotiation query is appended.
53210
+ */
53389
53211
  declare function withUnifiedEvents(path: string): string;
53390
- /** True when `type` is an unambiguous unified-vocabulary event discriminator. */
53212
+ /** True when `type` belongs to the canonical unified vocabulary. */
53391
53213
  declare function isUnifiedEventType(type: unknown): boolean;
53214
+ /** A reconstructed compatibility event (validated by the consumer switch/cast). */
53215
+ type CompatibilityEvent = Json & {
53216
+ type: string;
53217
+ };
53392
53218
  /**
53393
- * Create a stateful translator from the unified vocabulary to the legacy flow
53394
- * event shapes consumed by `stream-utils.ts` / `flows-namespace.ts` /
53395
- * `client.ts`. Returns 0+ legacy events per unified event. Construct one per
53219
+ * Create a stateful translator from the unified vocabulary to the stable flow
53220
+ * callback shapes consumed by `stream-utils.ts` / `flows-namespace.ts` /
53221
+ * `client.ts`. Returns 0+ callback events per unified event. Construct one per
53396
53222
  * 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
53223
  */
53403
- declare function createFlowEventTranslator(): (event: unknown) => LegacyEvent[];
53224
+ declare function createFlowEventTranslator(): (event: unknown) => CompatibilityEvent[];
53404
53225
  /**
53405
- * Create a stateful translator from the unified vocabulary to the legacy
53406
- * `agent_*` event shapes dispatched by `processAgentStream` in `endpoints.ts`.
53407
- * Returns 0+ legacy events per unified event. Construct one per stream.
53226
+ * Create a stateful translator from the unified vocabulary to the stable
53227
+ * `agent_*` callback shapes dispatched by `processAgentStream` in `endpoints.ts`.
53228
+ * Returns 0+ callback events per unified event. Construct one per stream.
53408
53229
  */
53409
- declare function createAgentEventTranslator(): (event: unknown) => LegacyEvent[];
53230
+ declare function createAgentEventTranslator(): (event: unknown) => CompatibilityEvent[];
53410
53231
 
53411
53232
  /**
53412
53233
  * BatchBuilder - Fluent builder for batch operations