@runtypelabs/sdk 4.9.0 → 4.10.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
@@ -908,6 +908,7 @@ interface paths {
908
908
  config: {
909
909
  [key: string]: unknown;
910
910
  } | null;
911
+ configHash: string | null;
911
912
  createdAt: string;
912
913
  dashboardUrl?: string;
913
914
  description: string | null;
@@ -919,6 +920,7 @@ interface paths {
919
920
  icon: string | null;
920
921
  id: string;
921
922
  lastHealthCheckAt: string | null;
923
+ lastModifiedSource: string | null;
922
924
  name: string;
923
925
  organizationId: string | null;
924
926
  primaryFlowId: string | null;
@@ -991,6 +993,268 @@ interface paths {
991
993
  patch?: never;
992
994
  trace?: never;
993
995
  };
996
+ "/v1/agents/ensure": {
997
+ parameters: {
998
+ query?: never;
999
+ header?: never;
1000
+ path?: never;
1001
+ cookie?: never;
1002
+ };
1003
+ get?: never;
1004
+ put?: never;
1005
+ /**
1006
+ * Ensure agent (config-as-code converge)
1007
+ * @description Idempotently converge a repo-defined agent definition onto the platform. Identity is name + account scope. Hash-only probes skip the payload in the steady state (a miss is a normal 200 `definitionRequired` response, not an error); full requests create the agent or append a new version when the canonical content hash differs. Non-executing: never touches the execution pipeline. The response always carries the server-computed canonical hash. Set dryRun to plan without writing (CI drift gate), onConflict: "overwrite" to converge over dashboard/API edits, and release: "publish" to also re-aim the published-version pointer.
1008
+ */
1009
+ post: {
1010
+ parameters: {
1011
+ query?: never;
1012
+ header?: never;
1013
+ path?: never;
1014
+ cookie?: never;
1015
+ };
1016
+ requestBody?: {
1017
+ content: {
1018
+ "application/json": {
1019
+ contentHash?: string;
1020
+ definition?: {
1021
+ config?: {
1022
+ advisor?: {
1023
+ model: string;
1024
+ systemPrompt?: string;
1025
+ } | null;
1026
+ artifacts?: {
1027
+ /** @enum {boolean} */
1028
+ enabled: true;
1029
+ types: ("markdown" | "component")[];
1030
+ };
1031
+ errorHandling?: {
1032
+ fallbacks?: ({
1033
+ delay?: number;
1034
+ /** @enum {string} */
1035
+ type: "retry";
1036
+ } | {
1037
+ delay?: number;
1038
+ maxTokens?: number;
1039
+ model: string;
1040
+ temperature?: number;
1041
+ /** @enum {string} */
1042
+ type: "model";
1043
+ } | {
1044
+ delay?: number;
1045
+ message: string;
1046
+ /** @enum {string} */
1047
+ type: "message";
1048
+ })[];
1049
+ /** @enum {string} */
1050
+ onError: "fail" | "continue" | "fallback";
1051
+ triggers?: {
1052
+ /** @enum {string} */
1053
+ type: "error" | "empty-output";
1054
+ }[];
1055
+ };
1056
+ frequencyPenalty?: number;
1057
+ /** @enum {string} */
1058
+ loggingPolicy?: "default" | "on" | "off";
1059
+ loopConfig?: {
1060
+ enableReflection?: boolean;
1061
+ maxCost?: number;
1062
+ maxTurns?: number;
1063
+ reflectionInterval?: number;
1064
+ };
1065
+ memory?: {
1066
+ enabled: boolean;
1067
+ injectSummary?: boolean;
1068
+ profileTemplate?: string;
1069
+ };
1070
+ model?: string;
1071
+ presencePenalty?: number;
1072
+ reasoning?: boolean | {
1073
+ budgetTokens?: number;
1074
+ enabled: boolean;
1075
+ includeThoughts?: boolean;
1076
+ /** @enum {string} */
1077
+ reasoningEffort?: "minimal" | "low" | "medium" | "high" | "xhigh";
1078
+ /** @enum {string} */
1079
+ reasoningSummary?: "auto" | "detailed";
1080
+ thinkingBudget?: number;
1081
+ };
1082
+ seed?: number;
1083
+ systemPrompt?: string;
1084
+ temperature?: number;
1085
+ temporal?: {
1086
+ elapsedThresholdSeconds?: number;
1087
+ groundNow?: boolean;
1088
+ injectElapsed?: boolean;
1089
+ timezone?: string;
1090
+ };
1091
+ tools?: {
1092
+ approval?: {
1093
+ requestReason?: boolean;
1094
+ require: string[] | boolean;
1095
+ timeout?: number;
1096
+ };
1097
+ codeModeConfig?: {
1098
+ description?: string;
1099
+ timeoutMs?: number;
1100
+ toolPool: string[];
1101
+ };
1102
+ maxToolCalls?: number;
1103
+ mcpServers?: {
1104
+ allowedTools?: string[];
1105
+ auth?: {
1106
+ headerName?: string;
1107
+ password?: string;
1108
+ token?: string;
1109
+ /** @enum {string} */
1110
+ type: "api_key" | "bearer" | "basic" | "custom_header" | "none";
1111
+ username?: string;
1112
+ };
1113
+ enabled?: boolean;
1114
+ id: string;
1115
+ name?: string;
1116
+ timeout?: number;
1117
+ /** @enum {string} */
1118
+ transport?: "streamable_http" | "rest";
1119
+ url: string;
1120
+ }[];
1121
+ perToolLimits?: {
1122
+ [key: string]: {
1123
+ maxCalls?: number;
1124
+ required?: boolean;
1125
+ };
1126
+ };
1127
+ runtimeTools?: {
1128
+ config: {
1129
+ [key: string]: unknown;
1130
+ };
1131
+ description: string;
1132
+ name: string;
1133
+ parametersSchema: {
1134
+ [key: string]: unknown;
1135
+ };
1136
+ /** @enum {string} */
1137
+ toolType: "flow" | "custom" | "external" | "local" | "advisor" | "subagent" | "search";
1138
+ }[];
1139
+ subagentConfig?: {
1140
+ allowNesting?: boolean;
1141
+ defaultMaxTurns?: number;
1142
+ defaultModel?: string;
1143
+ defaultTimeoutMs?: number;
1144
+ maxSpawnsPerRun?: number;
1145
+ maxTurnsLimit?: number;
1146
+ toolPool: string[];
1147
+ };
1148
+ /** @enum {string} */
1149
+ toolCallStrategy?: "auto" | "required" | "none";
1150
+ toolConfigs?: {
1151
+ [key: string]: {
1152
+ [key: string]: unknown;
1153
+ };
1154
+ };
1155
+ toolIds?: string[];
1156
+ };
1157
+ topK?: number;
1158
+ topP?: number;
1159
+ voice?: {
1160
+ elevenLabs?: {
1161
+ modelId?: string;
1162
+ similarity?: number;
1163
+ stability?: number;
1164
+ voiceId?: string;
1165
+ };
1166
+ enabled?: boolean;
1167
+ /** @enum {string} */
1168
+ interruptionMode?: "none" | "cancel" | "barge-in";
1169
+ provider?: string;
1170
+ };
1171
+ };
1172
+ description?: string;
1173
+ icon?: string;
1174
+ name: string;
1175
+ };
1176
+ dryRun?: boolean;
1177
+ expectedRemoteHash?: string;
1178
+ name: string;
1179
+ /** @enum {string} */
1180
+ onConflict?: "error" | "overwrite";
1181
+ /** @enum {string} */
1182
+ release?: "none" | "publish";
1183
+ };
1184
+ };
1185
+ };
1186
+ responses: {
1187
+ /** @description Converge result: unchanged | created | updated | definitionRequired (hash miss — retry with the full definition) | plan (dryRun) */
1188
+ 200: {
1189
+ headers: {
1190
+ [name: string]: unknown;
1191
+ };
1192
+ content: {
1193
+ "application/json": components["schemas"]["AgentEnsureResponse"];
1194
+ };
1195
+ };
1196
+ /** @description Validation error (or unsupported agent type for ensure) */
1197
+ 400: {
1198
+ headers: {
1199
+ [name: string]: unknown;
1200
+ };
1201
+ content: {
1202
+ "application/json": components["schemas"]["Error"];
1203
+ };
1204
+ };
1205
+ /** @description Unauthorized */
1206
+ 401: {
1207
+ headers: {
1208
+ [name: string]: unknown;
1209
+ };
1210
+ content: {
1211
+ "application/json": components["schemas"]["Error"];
1212
+ };
1213
+ };
1214
+ /** @description Insufficient permissions */
1215
+ 403: {
1216
+ headers: {
1217
+ [name: string]: unknown;
1218
+ };
1219
+ content: {
1220
+ "application/json": components["schemas"]["Error"];
1221
+ };
1222
+ };
1223
+ /** @description Conflict: external_modification (last write was not ensure; pass onConflict: "overwrite") or remote_changed (expectedRemoteHash guard) */
1224
+ 409: {
1225
+ headers: {
1226
+ [name: string]: unknown;
1227
+ };
1228
+ content: {
1229
+ "application/json": components["schemas"]["AgentEnsureConflict"];
1230
+ };
1231
+ };
1232
+ /** @description Submitted contentHash does not match the server-recomputed canonical hash */
1233
+ 422: {
1234
+ headers: {
1235
+ [name: string]: unknown;
1236
+ };
1237
+ content: {
1238
+ "application/json": components["schemas"]["AgentEnsureHashMismatch"];
1239
+ };
1240
+ };
1241
+ /** @description Internal server error */
1242
+ 500: {
1243
+ headers: {
1244
+ [name: string]: unknown;
1245
+ };
1246
+ content: {
1247
+ "application/json": components["schemas"]["Error"];
1248
+ };
1249
+ };
1250
+ };
1251
+ };
1252
+ delete?: never;
1253
+ options?: never;
1254
+ head?: never;
1255
+ patch?: never;
1256
+ trace?: never;
1257
+ };
994
1258
  "/v1/agents/fetch-agent-card": {
995
1259
  parameters: {
996
1260
  query?: never;
@@ -1124,6 +1388,92 @@ interface paths {
1124
1388
  patch?: never;
1125
1389
  trace?: never;
1126
1390
  };
1391
+ "/v1/agents/pull": {
1392
+ parameters: {
1393
+ query?: never;
1394
+ header?: never;
1395
+ path?: never;
1396
+ cookie?: never;
1397
+ };
1398
+ /**
1399
+ * Pull agent definition (config-as-code)
1400
+ * @description Return the canonical config-as-code definition and provenance for an agent by name — the absorb-drift direction of the ensure protocol. The contentHash is recomputed from the live agent state, so it is accurate even immediately after a dashboard edit.
1401
+ */
1402
+ get: {
1403
+ parameters: {
1404
+ query: {
1405
+ name: string;
1406
+ };
1407
+ header?: never;
1408
+ path?: never;
1409
+ cookie?: never;
1410
+ };
1411
+ requestBody?: never;
1412
+ responses: {
1413
+ /** @description Canonical definition + provenance */
1414
+ 200: {
1415
+ headers: {
1416
+ [name: string]: unknown;
1417
+ };
1418
+ content: {
1419
+ "application/json": components["schemas"]["AgentPullResponse"];
1420
+ };
1421
+ };
1422
+ /** @description Invalid parameters or unsupported agent type */
1423
+ 400: {
1424
+ headers: {
1425
+ [name: string]: unknown;
1426
+ };
1427
+ content: {
1428
+ "application/json": components["schemas"]["Error"];
1429
+ };
1430
+ };
1431
+ /** @description Unauthorized */
1432
+ 401: {
1433
+ headers: {
1434
+ [name: string]: unknown;
1435
+ };
1436
+ content: {
1437
+ "application/json": components["schemas"]["Error"];
1438
+ };
1439
+ };
1440
+ /** @description Insufficient permissions */
1441
+ 403: {
1442
+ headers: {
1443
+ [name: string]: unknown;
1444
+ };
1445
+ content: {
1446
+ "application/json": components["schemas"]["Error"];
1447
+ };
1448
+ };
1449
+ /** @description No agent with that name in the account scope */
1450
+ 404: {
1451
+ headers: {
1452
+ [name: string]: unknown;
1453
+ };
1454
+ content: {
1455
+ "application/json": components["schemas"]["Error"];
1456
+ };
1457
+ };
1458
+ /** @description Internal server error */
1459
+ 500: {
1460
+ headers: {
1461
+ [name: string]: unknown;
1462
+ };
1463
+ content: {
1464
+ "application/json": components["schemas"]["Error"];
1465
+ };
1466
+ };
1467
+ };
1468
+ };
1469
+ put?: never;
1470
+ post?: never;
1471
+ delete?: never;
1472
+ options?: never;
1473
+ head?: never;
1474
+ patch?: never;
1475
+ trace?: never;
1476
+ };
1127
1477
  "/v1/agents/{id}": {
1128
1478
  parameters: {
1129
1479
  query?: never;
@@ -1173,6 +1523,7 @@ interface paths {
1173
1523
  config: {
1174
1524
  [key: string]: unknown;
1175
1525
  } | null;
1526
+ configHash: string | null;
1176
1527
  createdAt: string;
1177
1528
  dashboardUrl?: string;
1178
1529
  description: string | null;
@@ -1183,6 +1534,7 @@ interface paths {
1183
1534
  icon: string | null;
1184
1535
  id: string;
1185
1536
  lastHealthCheckAt: string | null;
1537
+ lastModifiedSource: string | null;
1186
1538
  name: string;
1187
1539
  organizationId: string | null;
1188
1540
  primaryFlow: {
@@ -1551,6 +1903,7 @@ interface paths {
1551
1903
  config: {
1552
1904
  [key: string]: unknown;
1553
1905
  } | null;
1906
+ configHash: string | null;
1554
1907
  createdAt: string;
1555
1908
  dashboardUrl?: string;
1556
1909
  description: string | null;
@@ -1562,6 +1915,7 @@ interface paths {
1562
1915
  icon: string | null;
1563
1916
  id: string;
1564
1917
  lastHealthCheckAt: string | null;
1918
+ lastModifiedSource: string | null;
1565
1919
  name: string;
1566
1920
  organizationId: string | null;
1567
1921
  primaryFlowId: string | null;
@@ -3938,9 +4292,19 @@ interface paths {
3938
4292
  };
3939
4293
  cookie?: never;
3940
4294
  };
3941
- /** @description The app bundle as a zip archive. */
4295
+ /** @description The app bundle: either a raw zip archive (application/zip) or JSON file maps (application/json) that the API zips server-side. */
3942
4296
  requestBody: {
3943
4297
  content: {
4298
+ "application/json": {
4299
+ /** @description Text files for the bundle, path (relative to bundle root) to content. */
4300
+ files: {
4301
+ [key: string]: string;
4302
+ };
4303
+ /** @description Binary files for the bundle, path to base64-encoded content. */
4304
+ filesBase64?: {
4305
+ [key: string]: string;
4306
+ };
4307
+ };
3944
4308
  "application/zip": string;
3945
4309
  };
3946
4310
  };
@@ -10273,6 +10637,202 @@ interface paths {
10273
10637
  patch?: never;
10274
10638
  trace?: never;
10275
10639
  };
10640
+ "/v1/flows/ensure": {
10641
+ parameters: {
10642
+ query?: never;
10643
+ header?: never;
10644
+ path?: never;
10645
+ cookie?: never;
10646
+ };
10647
+ get?: never;
10648
+ put?: never;
10649
+ /**
10650
+ * Ensure flow (config-as-code converge)
10651
+ * @description Idempotently converge a repo-defined flow definition onto the platform. Identity is name + account scope. Hash-only probes skip the payload in the steady state (a miss is a normal 200 `definitionRequired` response, not an error); full requests create the flow or append a new version when the canonical content hash differs. Non-executing: never touches the execution pipeline — the deploy-time sibling of the dispatch-coupled `flowMode: "upsert"` (which saves and runs in one request). The response always carries the server-computed canonical hash. Set dryRun to plan without writing (CI drift gate), onConflict: "overwrite" to converge over dashboard/API edits, and release: "publish" to also re-aim the published-version pointer.
10652
+ */
10653
+ post: {
10654
+ parameters: {
10655
+ query?: never;
10656
+ header?: never;
10657
+ path?: never;
10658
+ cookie?: never;
10659
+ };
10660
+ requestBody?: {
10661
+ content: {
10662
+ "application/json": {
10663
+ contentHash?: string;
10664
+ definition?: {
10665
+ name: string;
10666
+ steps: {
10667
+ config?: {
10668
+ [key: string]: unknown;
10669
+ };
10670
+ enabled?: boolean;
10671
+ name: string;
10672
+ order?: number;
10673
+ type: string;
10674
+ when?: string;
10675
+ }[];
10676
+ };
10677
+ dryRun?: boolean;
10678
+ expectedRemoteHash?: string;
10679
+ name: string;
10680
+ /** @enum {string} */
10681
+ onConflict?: "error" | "overwrite";
10682
+ /** @enum {string} */
10683
+ release?: "none" | "publish";
10684
+ };
10685
+ };
10686
+ };
10687
+ responses: {
10688
+ /** @description Converge result: unchanged | created | updated | definitionRequired (hash miss — retry with the full definition) | plan (dryRun) */
10689
+ 200: {
10690
+ headers: {
10691
+ [name: string]: unknown;
10692
+ };
10693
+ content: {
10694
+ "application/json": components["schemas"]["FlowEnsureResponse"];
10695
+ };
10696
+ };
10697
+ /** @description Validation error */
10698
+ 400: {
10699
+ headers: {
10700
+ [name: string]: unknown;
10701
+ };
10702
+ content: {
10703
+ "application/json": components["schemas"]["Error"];
10704
+ };
10705
+ };
10706
+ /** @description Unauthorized */
10707
+ 401: {
10708
+ headers: {
10709
+ [name: string]: unknown;
10710
+ };
10711
+ content: {
10712
+ "application/json": components["schemas"]["Error"];
10713
+ };
10714
+ };
10715
+ /** @description Insufficient permissions */
10716
+ 403: {
10717
+ headers: {
10718
+ [name: string]: unknown;
10719
+ };
10720
+ content: {
10721
+ "application/json": components["schemas"]["Error"];
10722
+ };
10723
+ };
10724
+ /** @description Conflict: external_modification (last write was not ensure; pass onConflict: "overwrite") or remote_changed (expectedRemoteHash guard) */
10725
+ 409: {
10726
+ headers: {
10727
+ [name: string]: unknown;
10728
+ };
10729
+ content: {
10730
+ "application/json": components["schemas"]["FlowEnsureConflict"];
10731
+ };
10732
+ };
10733
+ /** @description Submitted contentHash does not match the server-recomputed canonical hash */
10734
+ 422: {
10735
+ headers: {
10736
+ [name: string]: unknown;
10737
+ };
10738
+ content: {
10739
+ "application/json": components["schemas"]["FlowEnsureHashMismatch"];
10740
+ };
10741
+ };
10742
+ /** @description Internal server error */
10743
+ 500: {
10744
+ headers: {
10745
+ [name: string]: unknown;
10746
+ };
10747
+ content: {
10748
+ "application/json": components["schemas"]["Error"];
10749
+ };
10750
+ };
10751
+ };
10752
+ };
10753
+ delete?: never;
10754
+ options?: never;
10755
+ head?: never;
10756
+ patch?: never;
10757
+ trace?: never;
10758
+ };
10759
+ "/v1/flows/pull": {
10760
+ parameters: {
10761
+ query?: never;
10762
+ header?: never;
10763
+ path?: never;
10764
+ cookie?: never;
10765
+ };
10766
+ /**
10767
+ * Pull flow definition (config-as-code)
10768
+ * @description Return the canonical config-as-code definition and provenance for a flow by name — the absorb-drift direction of the ensure protocol. The contentHash is recomputed from the live flow state, so it is accurate even immediately after a dashboard edit.
10769
+ */
10770
+ get: {
10771
+ parameters: {
10772
+ query: {
10773
+ name: string;
10774
+ };
10775
+ header?: never;
10776
+ path?: never;
10777
+ cookie?: never;
10778
+ };
10779
+ requestBody?: never;
10780
+ responses: {
10781
+ /** @description Canonical definition + provenance */
10782
+ 200: {
10783
+ headers: {
10784
+ [name: string]: unknown;
10785
+ };
10786
+ content: {
10787
+ "application/json": components["schemas"]["FlowPullResponse"];
10788
+ };
10789
+ };
10790
+ /** @description Unauthorized */
10791
+ 401: {
10792
+ headers: {
10793
+ [name: string]: unknown;
10794
+ };
10795
+ content: {
10796
+ "application/json": components["schemas"]["Error"];
10797
+ };
10798
+ };
10799
+ /** @description Insufficient permissions */
10800
+ 403: {
10801
+ headers: {
10802
+ [name: string]: unknown;
10803
+ };
10804
+ content: {
10805
+ "application/json": components["schemas"]["Error"];
10806
+ };
10807
+ };
10808
+ /** @description No flow with that name in the account scope */
10809
+ 404: {
10810
+ headers: {
10811
+ [name: string]: unknown;
10812
+ };
10813
+ content: {
10814
+ "application/json": components["schemas"]["Error"];
10815
+ };
10816
+ };
10817
+ /** @description Internal server error */
10818
+ 500: {
10819
+ headers: {
10820
+ [name: string]: unknown;
10821
+ };
10822
+ content: {
10823
+ "application/json": components["schemas"]["Error"];
10824
+ };
10825
+ };
10826
+ };
10827
+ };
10828
+ put?: never;
10829
+ post?: never;
10830
+ delete?: never;
10831
+ options?: never;
10832
+ head?: never;
10833
+ patch?: never;
10834
+ trace?: never;
10835
+ };
10276
10836
  "/v1/flows/{id}": {
10277
10837
  parameters: {
10278
10838
  query?: never;
@@ -17730,6 +18290,12 @@ interface paths {
17730
18290
  supported: boolean;
17731
18291
  supportsReasoningSummary?: boolean;
17732
18292
  };
18293
+ /** @description True when any provider entry supports extended reasoning */
18294
+ supportsReasoning?: boolean;
18295
+ /** @description True when any provider entry supports tool/function calling */
18296
+ supportsToolUse?: boolean;
18297
+ /** @description True when any provider entry supports image input */
18298
+ supportsVision?: boolean;
17733
18299
  tags: string[];
17734
18300
  uiCategory?: string;
17735
18301
  uiPriority?: number;
@@ -30106,9 +30672,7 @@ interface paths {
30106
30672
  };
30107
30673
  content: {
30108
30674
  "application/json": {
30109
- data: {
30110
- [key: string]: unknown;
30111
- }[];
30675
+ data: components["schemas"]["EnrichedSkillProposal"][];
30112
30676
  };
30113
30677
  };
30114
30678
  };
@@ -30171,7 +30735,7 @@ interface paths {
30171
30735
  };
30172
30736
  content: {
30173
30737
  "application/json": {
30174
- [key: string]: unknown;
30738
+ proposal: components["schemas"]["SkillProposal"];
30175
30739
  };
30176
30740
  };
30177
30741
  };
@@ -30244,7 +30808,7 @@ interface paths {
30244
30808
  };
30245
30809
  content: {
30246
30810
  "application/json": {
30247
- [key: string]: unknown;
30811
+ proposal: components["schemas"]["SkillProposal"];
30248
30812
  };
30249
30813
  };
30250
30814
  };
@@ -30283,12 +30847,16 @@ interface paths {
30283
30847
  };
30284
30848
  /**
30285
30849
  * List skills
30286
- * @description List skills for the authenticated owner, optionally filtered by status.
30850
+ * @description List skills for the authenticated owner with cursor pagination, optionally filtered by status. Ordered newest-first (id descending).
30287
30851
  */
30288
30852
  get: {
30289
30853
  parameters: {
30290
30854
  query?: {
30291
30855
  status?: "draft" | "active" | "archived";
30856
+ limit?: string;
30857
+ cursor?: string;
30858
+ direction?: string;
30859
+ includeCount?: string;
30292
30860
  };
30293
30861
  header?: never;
30294
30862
  path?: never;
@@ -30296,7 +30864,7 @@ interface paths {
30296
30864
  };
30297
30865
  requestBody?: never;
30298
30866
  responses: {
30299
- /** @description Skills */
30867
+ /** @description Paginated list of skills */
30300
30868
  200: {
30301
30869
  headers: {
30302
30870
  [name: string]: unknown;
@@ -30306,9 +30874,19 @@ interface paths {
30306
30874
  data: {
30307
30875
  [key: string]: unknown;
30308
30876
  }[];
30877
+ pagination: components["schemas"]["Pagination"];
30309
30878
  };
30310
30879
  };
30311
30880
  };
30881
+ /** @description Invalid parameters */
30882
+ 400: {
30883
+ headers: {
30884
+ [name: string]: unknown;
30885
+ };
30886
+ content: {
30887
+ "application/json": components["schemas"]["Error"];
30888
+ };
30889
+ };
30312
30890
  /** @description Unauthorized */
30313
30891
  401: {
30314
30892
  headers: {
@@ -33464,6 +34042,205 @@ interface components {
33464
34042
  timestamp?: string;
33465
34043
  };
33466
34044
  };
34045
+ AgentEnsureConflict: {
34046
+ /** @enum {string} */
34047
+ code: "external_modification" | "remote_changed";
34048
+ currentHash?: string | null;
34049
+ error: string;
34050
+ lastModifiedSource?: string;
34051
+ modifiedAt?: string | null;
34052
+ };
34053
+ AgentEnsureHashMismatch: {
34054
+ /** @enum {string} */
34055
+ code: "content_hash_mismatch";
34056
+ /** @description The server-computed canonical hash of the submitted definition. */
34057
+ contentHash: string;
34058
+ error: string;
34059
+ };
34060
+ AgentEnsureResponse: {
34061
+ agentId: string;
34062
+ /** @description Server-computed canonical content hash. Clients should echo this hash in probes. */
34063
+ contentHash: string;
34064
+ /** @enum {string} */
34065
+ result: "unchanged" | "created" | "updated";
34066
+ /** @description The version snapshot backing this state (null if snapshotting failed). */
34067
+ versionId: string | null;
34068
+ } | {
34069
+ /** @enum {string} */
34070
+ result: "definitionRequired";
34071
+ } | {
34072
+ agentId?: string;
34073
+ changedKeys: string[];
34074
+ /** @enum {string} */
34075
+ changes: "none" | "create" | "update";
34076
+ contentHash: string;
34077
+ remoteHash?: string;
34078
+ /** @enum {string} */
34079
+ result: "plan";
34080
+ };
34081
+ AgentPullResponse: {
34082
+ agentId: string;
34083
+ contentHash: string;
34084
+ definition: {
34085
+ config?: {
34086
+ advisor?: {
34087
+ model: string;
34088
+ systemPrompt?: string;
34089
+ } | null;
34090
+ artifacts?: {
34091
+ /** @enum {boolean} */
34092
+ enabled: true;
34093
+ types: ("markdown" | "component")[];
34094
+ };
34095
+ errorHandling?: {
34096
+ fallbacks?: ({
34097
+ delay?: number;
34098
+ /** @enum {string} */
34099
+ type: "retry";
34100
+ } | {
34101
+ delay?: number;
34102
+ maxTokens?: number;
34103
+ model: string;
34104
+ temperature?: number;
34105
+ /** @enum {string} */
34106
+ type: "model";
34107
+ } | {
34108
+ delay?: number;
34109
+ message: string;
34110
+ /** @enum {string} */
34111
+ type: "message";
34112
+ })[];
34113
+ /** @enum {string} */
34114
+ onError: "fail" | "continue" | "fallback";
34115
+ triggers?: {
34116
+ /** @enum {string} */
34117
+ type: "error" | "empty-output";
34118
+ }[];
34119
+ };
34120
+ frequencyPenalty?: number;
34121
+ /** @enum {string} */
34122
+ loggingPolicy?: "default" | "on" | "off";
34123
+ loopConfig?: {
34124
+ enableReflection?: boolean;
34125
+ maxCost?: number;
34126
+ maxTurns?: number;
34127
+ reflectionInterval?: number;
34128
+ };
34129
+ memory?: {
34130
+ enabled: boolean;
34131
+ injectSummary?: boolean;
34132
+ profileTemplate?: string;
34133
+ };
34134
+ model?: string;
34135
+ presencePenalty?: number;
34136
+ reasoning?: boolean | {
34137
+ budgetTokens?: number;
34138
+ enabled: boolean;
34139
+ includeThoughts?: boolean;
34140
+ /** @enum {string} */
34141
+ reasoningEffort?: "minimal" | "low" | "medium" | "high" | "xhigh";
34142
+ /** @enum {string} */
34143
+ reasoningSummary?: "auto" | "detailed";
34144
+ thinkingBudget?: number;
34145
+ };
34146
+ seed?: number;
34147
+ systemPrompt?: string;
34148
+ temperature?: number;
34149
+ temporal?: {
34150
+ elapsedThresholdSeconds?: number;
34151
+ groundNow?: boolean;
34152
+ injectElapsed?: boolean;
34153
+ timezone?: string;
34154
+ };
34155
+ tools?: {
34156
+ approval?: {
34157
+ requestReason?: boolean;
34158
+ require: string[] | boolean;
34159
+ timeout?: number;
34160
+ };
34161
+ codeModeConfig?: {
34162
+ description?: string;
34163
+ timeoutMs?: number;
34164
+ toolPool: string[];
34165
+ };
34166
+ maxToolCalls?: number;
34167
+ mcpServers?: {
34168
+ allowedTools?: string[];
34169
+ auth?: {
34170
+ headerName?: string;
34171
+ password?: string;
34172
+ token?: string;
34173
+ /** @enum {string} */
34174
+ type: "api_key" | "bearer" | "basic" | "custom_header" | "none";
34175
+ username?: string;
34176
+ };
34177
+ enabled?: boolean;
34178
+ id: string;
34179
+ name?: string;
34180
+ timeout?: number;
34181
+ /** @enum {string} */
34182
+ transport?: "streamable_http" | "rest";
34183
+ url: string;
34184
+ }[];
34185
+ perToolLimits?: {
34186
+ [key: string]: {
34187
+ maxCalls?: number;
34188
+ required?: boolean;
34189
+ };
34190
+ };
34191
+ runtimeTools?: {
34192
+ config: {
34193
+ [key: string]: unknown;
34194
+ };
34195
+ description: string;
34196
+ name: string;
34197
+ parametersSchema: {
34198
+ [key: string]: unknown;
34199
+ };
34200
+ /** @enum {string} */
34201
+ toolType: "flow" | "custom" | "external" | "local" | "advisor" | "subagent" | "search";
34202
+ }[];
34203
+ subagentConfig?: {
34204
+ allowNesting?: boolean;
34205
+ defaultMaxTurns?: number;
34206
+ defaultModel?: string;
34207
+ defaultTimeoutMs?: number;
34208
+ maxSpawnsPerRun?: number;
34209
+ maxTurnsLimit?: number;
34210
+ toolPool: string[];
34211
+ };
34212
+ /** @enum {string} */
34213
+ toolCallStrategy?: "auto" | "required" | "none";
34214
+ toolConfigs?: {
34215
+ [key: string]: {
34216
+ [key: string]: unknown;
34217
+ };
34218
+ };
34219
+ toolIds?: string[];
34220
+ };
34221
+ topK?: number;
34222
+ topP?: number;
34223
+ voice?: {
34224
+ elevenLabs?: {
34225
+ modelId?: string;
34226
+ similarity?: number;
34227
+ stability?: number;
34228
+ voiceId?: string;
34229
+ };
34230
+ enabled?: boolean;
34231
+ /** @enum {string} */
34232
+ interruptionMode?: "none" | "cancel" | "barge-in";
34233
+ provider?: string;
34234
+ };
34235
+ };
34236
+ description?: string;
34237
+ icon?: string;
34238
+ name: string;
34239
+ };
34240
+ lastModifiedSource: string | null;
34241
+ updatedAt: string | null;
34242
+ versionId: string | null;
34243
+ };
33467
34244
  AgentSSEEvent: {
33468
34245
  agentId: string;
33469
34246
  agentName: string;
@@ -34506,6 +35283,34 @@ interface components {
34506
35283
  } & {
34507
35284
  [key: string]: unknown;
34508
35285
  });
35286
+ EnrichedSkillProposal: components["schemas"]["SkillProposal"] & {
35287
+ proposingAgent: {
35288
+ id: string;
35289
+ name: string;
35290
+ } | null;
35291
+ resolvedCapabilityNames: {
35292
+ [key: string]: string | null;
35293
+ };
35294
+ skill: {
35295
+ description: string | null;
35296
+ id: string;
35297
+ name: string;
35298
+ status: string;
35299
+ } | null;
35300
+ version: {
35301
+ id: string;
35302
+ manifest: {
35303
+ body: string;
35304
+ frontmatter: {
35305
+ [key: string]: unknown;
35306
+ };
35307
+ runtype: {
35308
+ [key: string]: unknown;
35309
+ };
35310
+ };
35311
+ versionNumber: number;
35312
+ } | null;
35313
+ };
34509
35314
  Error: {
34510
35315
  details?: {
34511
35316
  /** @description Stable Runtype validation code (e.g. MISSING_REQUIRED_FIELD, INVALID_ENUM). */
@@ -34518,6 +35323,62 @@ interface components {
34518
35323
  }[];
34519
35324
  error: string;
34520
35325
  };
35326
+ FlowEnsureConflict: {
35327
+ /** @enum {string} */
35328
+ code: "external_modification" | "remote_changed";
35329
+ currentHash?: string | null;
35330
+ error: string;
35331
+ lastModifiedSource?: string;
35332
+ modifiedAt?: string | null;
35333
+ };
35334
+ FlowEnsureHashMismatch: {
35335
+ /** @enum {string} */
35336
+ code: "content_hash_mismatch";
35337
+ /** @description The server-computed canonical hash of the submitted definition. */
35338
+ contentHash: string;
35339
+ error: string;
35340
+ };
35341
+ FlowEnsureResponse: {
35342
+ /** @description Server-computed canonical content hash. Clients should echo this hash in probes. */
35343
+ contentHash: string;
35344
+ flowId: string;
35345
+ /** @enum {string} */
35346
+ result: "unchanged" | "created" | "updated";
35347
+ /** @description The version snapshot backing this state (null if snapshotting failed). */
35348
+ versionId: string | null;
35349
+ } | {
35350
+ /** @enum {string} */
35351
+ result: "definitionRequired";
35352
+ } | {
35353
+ changedKeys: string[];
35354
+ /** @enum {string} */
35355
+ changes: "none" | "create" | "update";
35356
+ contentHash: string;
35357
+ flowId?: string;
35358
+ remoteHash?: string;
35359
+ /** @enum {string} */
35360
+ result: "plan";
35361
+ };
35362
+ FlowPullResponse: {
35363
+ contentHash: string;
35364
+ definition: {
35365
+ name: string;
35366
+ steps: {
35367
+ config?: {
35368
+ [key: string]: unknown;
35369
+ };
35370
+ enabled?: boolean;
35371
+ name: string;
35372
+ order?: number;
35373
+ type: string;
35374
+ when?: string;
35375
+ }[];
35376
+ };
35377
+ flowId: string;
35378
+ lastModifiedSource: string | null;
35379
+ updatedAt: string | null;
35380
+ versionId: string | null;
35381
+ };
34521
35382
  FlowSSEEvent: {
34522
35383
  executionContext?: {
34523
35384
  [key: string]: unknown;
@@ -34903,6 +35764,18 @@ interface components {
34903
35764
  op: "eq" | "neq" | "gt" | "gte" | "lt" | "lte" | "between" | "contains" | "startsWith" | "endsWith" | "in" | "notIn" | "isSet" | "isNotSet" | "isTrue" | "isFalse" | "withinLastDays" | "olderThanDays";
34904
35765
  value?: unknown;
34905
35766
  };
35767
+ SkillProposal: {
35768
+ createdAt: string;
35769
+ id: string;
35770
+ organizationId: string | null;
35771
+ proposingAgentExecutionId: string | null;
35772
+ proposingUserId: string;
35773
+ rejectionReason: string | null;
35774
+ reviewedAt: string | null;
35775
+ reviewedBy: string | null;
35776
+ skillVersionId: string;
35777
+ status: string;
35778
+ };
34906
35779
  UpdateUserProfileResponse: {
34907
35780
  email?: string;
34908
35781
  firstName?: string;
@@ -36232,6 +37105,9 @@ interface ModelConfig {
36232
37105
  supportsStreaming?: boolean;
36233
37106
  supportedResponseFormats?: string[];
36234
37107
  supportsSearch?: boolean;
37108
+ supportsVision?: boolean;
37109
+ supportsToolUse?: boolean;
37110
+ supportsReasoning?: boolean;
36235
37111
  isEnabled: boolean;
36236
37112
  isDefault: boolean;
36237
37113
  settings: JsonObject;
@@ -37084,6 +37960,151 @@ interface BillingSpendAnalyticsParams {
37084
37960
  days?: number;
37085
37961
  }
37086
37962
 
37963
+ /**
37964
+ * Flow config-as-code: `defineFlow`, `flows.ensure`, `flows.pull`.
37965
+ *
37966
+ * The non-executing sibling of `flows.upsert()` — `upsert` is the
37967
+ * dispatch-coupled save-and-run motion (it saves the flow AND executes it in
37968
+ * one request); `ensure` is the deploy-time convergence postcondition: "make
37969
+ * the platform's definition of this flow match this object; no-op if it
37970
+ * already does." Identity is name + account scope (the API key's org, else
37971
+ * personal); environment is whichever API the client points at. `ensure`
37972
+ * never deletes, and renaming a definition orphans the old flow and creates a
37973
+ * new one.
37974
+ *
37975
+ * Wire protocol (POST /v1/flows/ensure — APQ-shaped, both APQ scars fixed):
37976
+ * 1. Hash-only probe `{ name, contentHash }`. A match is
37977
+ * `{ result: 'unchanged' }`; a miss is a NORMAL 200
37978
+ * `{ result: 'definitionRequired' }`, never an error.
37979
+ * 2. On a miss, retry with the full `definition`. The server recomputes the
37980
+ * canonical hash itself and returns it on every response — this SDK
37981
+ * echoes the server's hash (memoized per client instance) rather than
37982
+ * trusting its own serialization.
37983
+ *
37984
+ * The content hash is the SAME steps-only hash the flow upsert protocol uses
37985
+ * (`computeFlowContentHash` — mirrored from
37986
+ * `packages/shared/src/utils/flow-content-hash.ts`; this package is
37987
+ * dependency-free by convention), so ensure and upsert interoperate on the
37988
+ * same flow. The flow definition surface is `{ name, steps }` — description
37989
+ * is not part of the v1 ensure surface (the shared hash covers steps only).
37990
+ *
37991
+ * See docs/adr/0003-agent-config-as-code-ensure.md for the design rationale.
37992
+ */
37993
+
37994
+ /** SHA-256 (hex) over the canonical normalized step list (steps only). */
37995
+ declare function computeFlowContentHash(steps: unknown[]): Promise<string>;
37996
+ /**
37997
+ * A definition step. Deliberately has no `id` — step ids are server artifacts
37998
+ * (minted on create, carried by name across converges), so definitions stay
37999
+ * environment-portable. The step config is typed loosely per SDK convention;
38000
+ * the server validates strictly through the canonical flow validator.
38001
+ */
38002
+ interface FlowDefinitionStep {
38003
+ type: string;
38004
+ name: string;
38005
+ order?: number;
38006
+ enabled?: boolean;
38007
+ when?: string;
38008
+ config?: Record<string, unknown>;
38009
+ }
38010
+ /** `defineFlow` input: identity + the ordered step list. */
38011
+ interface DefineFlowInput {
38012
+ name: string;
38013
+ steps: FlowDefinitionStep[];
38014
+ }
38015
+ /** The canonical (wire) definition produced by `defineFlow`. */
38016
+ interface FlowDefinition {
38017
+ name: string;
38018
+ steps: Array<FlowDefinitionStep & {
38019
+ order: number;
38020
+ }>;
38021
+ }
38022
+ /**
38023
+ * Pure-local declarative constructor for a flow definition. No I/O.
38024
+ * Validates structure, rejects unknown fields, assigns explicit step order
38025
+ * (1-based, matching the flow builder) when omitted, and rejects
38026
+ * account-scoped `tool_…` references (definitions must be
38027
+ * environment-portable: the same `defineFlow` converges staging and
38028
+ * production). Deep per-step validation happens server-side at ensure time
38029
+ * through the canonical flow validator.
38030
+ *
38031
+ * @example
38032
+ * ```typescript
38033
+ * const onboardingFlow = defineFlow({
38034
+ * name: 'Onboarding Digest',
38035
+ * steps: [
38036
+ * {
38037
+ * type: 'prompt',
38038
+ * name: 'Summarize signups',
38039
+ * config: { model: 'claude-sonnet-4-6', userPrompt: 'Summarize: {{signups}}' },
38040
+ * },
38041
+ * ],
38042
+ * })
38043
+ * ```
38044
+ */
38045
+ declare function defineFlow(input: DefineFlowInput): FlowDefinition;
38046
+ interface EnsureFlowOptions {
38047
+ /** Plan without writing (the CI drift gate). Sends the full definition. */
38048
+ dryRun?: boolean;
38049
+ /**
38050
+ * What to do when the flow's last write came from the dashboard/API
38051
+ * rather than ensure. Default 'error' (HTTP 409 → FlowEnsureConflictError).
38052
+ */
38053
+ onConflict?: 'error' | 'overwrite';
38054
+ /** 'publish' also re-aims the published-version pointer. Default 'none'. */
38055
+ release?: 'none' | 'publish';
38056
+ /**
38057
+ * TOCTOU guard binding a dry run to its apply: the write only proceeds if
38058
+ * the remote still hashes to this value (409 remote_changed otherwise).
38059
+ */
38060
+ expectedRemoteHash?: string;
38061
+ /** Implies dryRun; throws FlowDriftError unless the plan is 'none'. */
38062
+ expectNoChanges?: boolean;
38063
+ }
38064
+ interface EnsureFlowConverged {
38065
+ result: 'unchanged' | 'created' | 'updated';
38066
+ flowId: string;
38067
+ versionId: string | null;
38068
+ /** The server-computed canonical hash (echo this — never your own). */
38069
+ contentHash: string;
38070
+ }
38071
+ interface EnsureFlowPlan {
38072
+ result: 'plan';
38073
+ changes: 'none' | 'create' | 'update';
38074
+ changedKeys: string[];
38075
+ contentHash: string;
38076
+ remoteHash?: string;
38077
+ flowId?: string;
38078
+ }
38079
+ type EnsureFlowResult = EnsureFlowConverged | EnsureFlowPlan;
38080
+ interface FlowPullResult {
38081
+ flowId: string;
38082
+ definition: FlowDefinition;
38083
+ contentHash: string;
38084
+ lastModifiedSource: string | null;
38085
+ updatedAt: string | null;
38086
+ versionId: string | null;
38087
+ }
38088
+ /** A 409 from the ensure protocol (external_modification or remote_changed). */
38089
+ declare class FlowEnsureConflictError extends Error {
38090
+ readonly code: 'external_modification' | 'remote_changed';
38091
+ readonly lastModifiedSource?: string;
38092
+ readonly modifiedAt?: string | null;
38093
+ readonly currentHash?: string | null;
38094
+ constructor(body: {
38095
+ error?: string;
38096
+ code: 'external_modification' | 'remote_changed';
38097
+ lastModifiedSource?: string;
38098
+ modifiedAt?: string | null;
38099
+ currentHash?: string | null;
38100
+ });
38101
+ }
38102
+ /** Thrown by `ensure(def, { expectNoChanges: true })` when drift is detected. */
38103
+ declare class FlowDriftError extends Error {
38104
+ readonly plan: EnsureFlowPlan;
38105
+ constructor(plan: EnsureFlowPlan);
38106
+ }
38107
+
37087
38108
  /**
37088
38109
  * FlowsNamespace - Static namespace for flow operations
37089
38110
  *
@@ -37145,8 +38166,11 @@ declare class FlowsNamespace {
37145
38166
  /**
37146
38167
  * Create or update a flow by name (upsert mode)
37147
38168
  *
37148
- * The recommended pattern for code-first flow management.
37149
- * Creates the flow if it doesn't exist, updates if steps changed.
38169
+ * The recommended pattern for code-first flow management when you want to
38170
+ * save AND run in one dispatch. For a deploy-time, non-executing converge
38171
+ * (CI/CD config-as-code), use {@link ensure} instead — upsert and ensure
38172
+ * are siblings, not versions of each other: upsert is the runtime verb
38173
+ * (save-and-run), ensure is the deploy verb (converge only).
37150
38174
  *
37151
38175
  * @example
37152
38176
  * ```typescript
@@ -37159,6 +38183,29 @@ declare class FlowsNamespace {
37159
38183
  * ```
37160
38184
  */
37161
38185
  upsert(config: UpsertFlowConfig): RuntypeFlowBuilder;
38186
+ /**
38187
+ * Idempotently converge a `defineFlow` definition onto the platform —
38188
+ * the deploy-time, non-executing sibling of {@link upsert}. Hash-first:
38189
+ * the steady state is one tiny probe request. Creates an immutable version
38190
+ * snapshot on every change; never deletes; never executes the flow.
38191
+ *
38192
+ * @example
38193
+ * ```typescript
38194
+ * const def = defineFlow({ name: 'Onboarding Digest', steps: [...] })
38195
+ *
38196
+ * // Converge (CI/deploy).
38197
+ * const result = await Runtype.flows.ensure(def)
38198
+ *
38199
+ * // PR drift gate.
38200
+ * await Runtype.flows.ensure(def, { expectNoChanges: true })
38201
+ * ```
38202
+ */
38203
+ ensure(definition: FlowDefinition, options?: EnsureFlowOptions): Promise<EnsureFlowResult>;
38204
+ /**
38205
+ * Pull the canonical definition + provenance for a flow by name — the
38206
+ * absorb-drift direction of the ensure protocol.
38207
+ */
38208
+ pull(name: string): Promise<FlowPullResult>;
37162
38209
  /**
37163
38210
  * Create a virtual flow (one-off, not saved)
37164
38211
  *
@@ -38158,6 +39205,58 @@ interface SkillProposal {
38158
39205
  reviewedAt: string | null;
38159
39206
  rejectionReason: string | null;
38160
39207
  createdAt: string;
39208
+ /**
39209
+ * Server-enrichment field: the skill this proposal targets. Present on the
39210
+ * list endpoint (`proposals.list()`) so reviewers can see WHAT they are
39211
+ * approving. `null` when the underlying skill row was deleted out from under
39212
+ * the proposal; entirely **absent** on older API servers — consumers must
39213
+ * tolerate it being `undefined`.
39214
+ */
39215
+ skill?: {
39216
+ id: string;
39217
+ name: string;
39218
+ description: string | null;
39219
+ status: string;
39220
+ } | null;
39221
+ /**
39222
+ * Server-enrichment field: the proposed skill version's content. Present on
39223
+ * the list endpoint so reviewers can read the manifest body (the instructions
39224
+ * that would be injected into another agent's context) before approving.
39225
+ * `null` when the underlying version row was deleted; entirely **absent** on
39226
+ * older API servers — consumers must tolerate it being `undefined`.
39227
+ */
39228
+ version?: {
39229
+ id: string;
39230
+ versionNumber: number;
39231
+ manifest: {
39232
+ frontmatter: Record<string, unknown>;
39233
+ /**
39234
+ * The `runtype` extension block — capability bindings (flows, agents,
39235
+ * tools, MCP servers, inline tools) + trustLevel. These bindings are the
39236
+ * most security-relevant part of an approval decision, so the review queue
39237
+ * surfaces them. Optional: older API servers omit it from this list view.
39238
+ */
39239
+ runtype?: SkillRuntypeExtensions;
39240
+ body: string;
39241
+ };
39242
+ } | null;
39243
+ /**
39244
+ * Server-enrichment field: the agent that authored this proposal, resolved
39245
+ * from the proposing execution. `null` when the execution/agent row is gone,
39246
+ * the execution was a synthesized subagent, or the agent is outside the
39247
+ * reviewer's tenant; entirely **absent** on older API servers.
39248
+ */
39249
+ proposingAgent?: {
39250
+ id: string;
39251
+ name: string;
39252
+ } | null;
39253
+ /**
39254
+ * Server-enrichment field: tenant-scoped id → name map for every flow/agent/
39255
+ * tool ID referenced in the manifest's capability block. A `null` name means
39256
+ * the ID does not resolve inside the reviewer's account (a review signal —
39257
+ * surfaced, not dropped); entirely **absent** on older API servers.
39258
+ */
39259
+ resolvedCapabilityNames?: Record<string, string | null>;
38161
39260
  }
38162
39261
  /**
38163
39262
  * Create/update a skill from a raw SKILL.md document. The frontmatter +
@@ -38195,6 +39294,37 @@ interface SkillWithVersion {
38195
39294
  skill: Skill;
38196
39295
  version: SkillVersion;
38197
39296
  }
39297
+ /** Query params accepted by the skills list endpoint. */
39298
+ interface SkillListParams {
39299
+ /** Filter by lifecycle status. */
39300
+ status?: SkillStatus;
39301
+ /** Page size (1-200, server default 100). */
39302
+ limit?: number;
39303
+ /** Opaque cursor from a previous page's `pagination.nextCursor`/`prevCursor`. */
39304
+ cursor?: string;
39305
+ /** Pagination direction relative to the cursor (default `'next'`). */
39306
+ direction?: 'next' | 'prev';
39307
+ /** Include `totalCount`/`totalPages` in the pagination envelope (extra query). */
39308
+ includeCount?: boolean;
39309
+ }
39310
+ /** The standard cursor-pagination envelope returned by list endpoints. */
39311
+ interface SkillListPagination {
39312
+ nextCursor: string | null;
39313
+ prevCursor: string | null;
39314
+ hasMore: boolean;
39315
+ hasPrev: boolean;
39316
+ limit: number;
39317
+ currentOffset: number;
39318
+ totalPages?: number;
39319
+ currentPage?: number;
39320
+ totalCount?: number;
39321
+ }
39322
+ /** A page of skills with its pagination envelope. */
39323
+ interface SkillListPage {
39324
+ data: Skill[];
39325
+ /** Absent on older API servers that predate skills-list pagination. */
39326
+ pagination?: SkillListPagination;
39327
+ }
38198
39328
  /**
38199
39329
  * The admin review queue for agent-authored skill proposals. This is the human
38200
39330
  * review surface for the deployed-agent data plane — listing, approving, and
@@ -38256,15 +39386,26 @@ declare class SkillsNamespace {
38256
39386
  create(input: SkillWriteInput): Promise<SkillWithVersion>;
38257
39387
  /**
38258
39388
  * List skills for the authenticated owner, optionally filtered by status.
39389
+ * Returns just the rows (one page); pass `cursor`/`limit` to page, or use
39390
+ * {@link listPage} when you need the pagination envelope.
38259
39391
  *
38260
39392
  * @example
38261
39393
  * ```typescript
38262
39394
  * const active = await Runtype.skills.list({ status: 'active' })
38263
39395
  * ```
38264
39396
  */
38265
- list(params?: {
38266
- status?: SkillStatus;
38267
- }): Promise<Skill[]>;
39397
+ list(params?: SkillListParams): Promise<Skill[]>;
39398
+ /**
39399
+ * List skills with the cursor-pagination envelope (mirrors the tools list
39400
+ * shape: `{ data, pagination }`).
39401
+ *
39402
+ * @example
39403
+ * ```typescript
39404
+ * const page1 = await Runtype.skills.listPage({ limit: 50, includeCount: true })
39405
+ * const page2 = await Runtype.skills.listPage({ limit: 50, cursor: page1.pagination?.nextCursor ?? undefined })
39406
+ * ```
39407
+ */
39408
+ listPage(params?: SkillListParams): Promise<SkillListPage>;
38268
39409
  /**
38269
39410
  * Get a skill and its full version history.
38270
39411
  *
@@ -38329,6 +39470,246 @@ declare class SkillsNamespace {
38329
39470
  listBindings(agentId: string): Promise<AgentSkillBinding[]>;
38330
39471
  }
38331
39472
 
39473
+ /**
39474
+ * AgentsNamespace — agent config-as-code: `defineAgent`, `ensure`, `pull`.
39475
+ *
39476
+ * `ensure` is a convergence postcondition, not a save button: "make the
39477
+ * platform's definition of this agent match this object; no-op if it already
39478
+ * does." Identity is name + account scope (the API key's org, else personal);
39479
+ * environment is whichever API the client points at. `ensure` never deletes,
39480
+ * and renaming a definition orphans the old agent and creates a new one.
39481
+ *
39482
+ * Wire protocol (POST /v1/agents/ensure — APQ-shaped, both APQ scars fixed):
39483
+ * 1. Hash-only probe `{ name, contentHash }`. A match is
39484
+ * `{ result: 'unchanged' }`; a miss is a NORMAL 200
39485
+ * `{ result: 'definitionRequired' }`, never an error.
39486
+ * 2. On a miss, retry with the full `definition`. The server recomputes the
39487
+ * canonical hash itself and returns it on every response — this SDK
39488
+ * echoes the server's hash (memoized per client instance) rather than
39489
+ * trusting its own serialization.
39490
+ *
39491
+ * The content-hash implementation below is an INLINED COPY of
39492
+ * `packages/shared/src/utils/agent-content-hash.ts` (this package is
39493
+ * dependency-free by convention, mirroring the flow content hash in
39494
+ * flows-namespace.ts). Parity is pinned by the shared fixture corpus in
39495
+ * `packages/shared/test-fixtures/agent-content-hash/cases.json`, asserted by
39496
+ * both packages' test suites. Change both copies (and regenerate the corpus)
39497
+ * in the same PR.
39498
+ *
39499
+ * See docs/adr/0003-agent-config-as-code-ensure.md for the design rationale.
39500
+ */
39501
+
39502
+ /** Canonical normalized form — must stay byte-identical to the shared impl. */
39503
+ declare function normalizeAgentDefinition(definition: {
39504
+ name: string;
39505
+ description?: string | null;
39506
+ icon?: string | null;
39507
+ config?: Record<string, unknown> | null;
39508
+ }): {
39509
+ name: string;
39510
+ description?: string;
39511
+ icon?: string;
39512
+ config: Record<string, unknown>;
39513
+ };
39514
+ /** SHA-256 (hex) over the canonical normalized definition. */
39515
+ declare function computeAgentContentHash(definition: {
39516
+ name: string;
39517
+ description?: string | null;
39518
+ icon?: string | null;
39519
+ config?: Record<string, unknown> | null;
39520
+ }): Promise<string>;
39521
+ /**
39522
+ * The runtime-config surface accepted in a definition (mirrors
39523
+ * `agentRuntimeConfigSchema` in @runtypelabs/shared; deep leaves are typed
39524
+ * loosely per SDK convention — the server validates strictly).
39525
+ */
39526
+ interface AgentDefinitionConfig {
39527
+ model?: string;
39528
+ systemPrompt?: string;
39529
+ temperature?: number;
39530
+ topP?: number;
39531
+ topK?: number;
39532
+ frequencyPenalty?: number;
39533
+ presencePenalty?: number;
39534
+ seed?: number;
39535
+ tools?: {
39536
+ toolIds?: string[];
39537
+ toolConfigs?: Record<string, Record<string, unknown>>;
39538
+ runtimeTools?: Array<Record<string, unknown>>;
39539
+ mcpServers?: Array<Record<string, unknown>>;
39540
+ maxToolCalls?: number;
39541
+ toolCallStrategy?: 'auto' | 'required' | 'none';
39542
+ approval?: {
39543
+ require: string[] | boolean;
39544
+ timeout?: number;
39545
+ requestReason?: boolean;
39546
+ };
39547
+ perToolLimits?: Record<string, {
39548
+ maxCalls?: number;
39549
+ required?: boolean;
39550
+ }>;
39551
+ subagentConfig?: Record<string, unknown>;
39552
+ codeModeConfig?: Record<string, unknown>;
39553
+ };
39554
+ artifacts?: {
39555
+ enabled: true;
39556
+ types: Array<'markdown' | 'component'>;
39557
+ };
39558
+ reasoning?: boolean | Record<string, unknown>;
39559
+ advisor?: {
39560
+ model: string;
39561
+ systemPrompt?: string;
39562
+ } | null;
39563
+ loopConfig?: {
39564
+ maxTurns?: number;
39565
+ maxCost?: number;
39566
+ enableReflection?: boolean;
39567
+ reflectionInterval?: number;
39568
+ };
39569
+ voice?: Record<string, unknown>;
39570
+ errorHandling?: Record<string, unknown>;
39571
+ loggingPolicy?: 'default' | 'on' | 'off';
39572
+ temporal?: Record<string, unknown>;
39573
+ memory?: {
39574
+ enabled: boolean;
39575
+ profileTemplate?: string;
39576
+ injectSummary?: boolean;
39577
+ };
39578
+ }
39579
+ /**
39580
+ * `defineAgent` input — the flat authoring shape: identity + presentation
39581
+ * fields alongside the runtime-config fields.
39582
+ */
39583
+ interface DefineAgentInput extends AgentDefinitionConfig {
39584
+ name: string;
39585
+ description?: string;
39586
+ icon?: string;
39587
+ }
39588
+ /** The canonical (wire) definition produced by `defineAgent`. */
39589
+ interface AgentDefinition {
39590
+ name: string;
39591
+ description?: string;
39592
+ icon?: string;
39593
+ config: AgentDefinitionConfig;
39594
+ }
39595
+ /**
39596
+ * Pure-local declarative constructor for an agent definition. No I/O.
39597
+ * Validates structure, rejects unknown top-level fields, and rejects
39598
+ * account-scoped `tool_…` references (definitions must be
39599
+ * environment-portable: the same `defineAgent` converges staging and
39600
+ * production). Deep validation happens server-side at ensure time.
39601
+ *
39602
+ * @example
39603
+ * ```typescript
39604
+ * const pricingAssistant = defineAgent({
39605
+ * name: 'Pricing Assistant',
39606
+ * description: 'Marketing pricing page chat assistant.',
39607
+ * icon: '💬',
39608
+ * model: 'claude-sonnet-4-6',
39609
+ * temperature: 0.7,
39610
+ * loopConfig: { maxTurns: 1 },
39611
+ * systemPrompt: renderPricingPrompt(plans),
39612
+ * })
39613
+ * ```
39614
+ */
39615
+ declare function defineAgent(input: DefineAgentInput): AgentDefinition;
39616
+ interface EnsureAgentOptions {
39617
+ /** Plan without writing (the CI drift gate). Sends the full definition. */
39618
+ dryRun?: boolean;
39619
+ /**
39620
+ * What to do when the agent's last write came from the dashboard/API/MCP
39621
+ * rather than ensure. Default 'error' (HTTP 409 → AgentEnsureConflictError).
39622
+ */
39623
+ onConflict?: 'error' | 'overwrite';
39624
+ /** 'publish' also re-aims the published-version pointer. Default 'none'. */
39625
+ release?: 'none' | 'publish';
39626
+ /**
39627
+ * TOCTOU guard binding a dry run to its apply: the write only proceeds if
39628
+ * the remote still hashes to this value (409 remote_changed otherwise).
39629
+ */
39630
+ expectedRemoteHash?: string;
39631
+ /** Implies dryRun; throws AgentDriftError unless the plan is 'none'. */
39632
+ expectNoChanges?: boolean;
39633
+ }
39634
+ interface EnsureAgentConverged {
39635
+ result: 'unchanged' | 'created' | 'updated';
39636
+ agentId: string;
39637
+ versionId: string | null;
39638
+ /** The server-computed canonical hash (echo this — never your own). */
39639
+ contentHash: string;
39640
+ }
39641
+ interface EnsureAgentPlan {
39642
+ result: 'plan';
39643
+ changes: 'none' | 'create' | 'update';
39644
+ changedKeys: string[];
39645
+ contentHash: string;
39646
+ remoteHash?: string;
39647
+ agentId?: string;
39648
+ }
39649
+ type EnsureAgentResult = EnsureAgentConverged | EnsureAgentPlan;
39650
+ interface AgentPullResult {
39651
+ agentId: string;
39652
+ definition: AgentDefinition;
39653
+ contentHash: string;
39654
+ lastModifiedSource: string | null;
39655
+ updatedAt: string | null;
39656
+ versionId: string | null;
39657
+ }
39658
+ /** A 409 from the ensure protocol (external_modification or remote_changed). */
39659
+ declare class AgentEnsureConflictError extends Error {
39660
+ readonly code: 'external_modification' | 'remote_changed';
39661
+ readonly lastModifiedSource?: string;
39662
+ readonly modifiedAt?: string | null;
39663
+ readonly currentHash?: string | null;
39664
+ constructor(body: {
39665
+ error?: string;
39666
+ code: 'external_modification' | 'remote_changed';
39667
+ lastModifiedSource?: string;
39668
+ modifiedAt?: string | null;
39669
+ currentHash?: string | null;
39670
+ });
39671
+ }
39672
+ /** Thrown by `ensure(def, { expectNoChanges: true })` when drift is detected. */
39673
+ declare class AgentDriftError extends Error {
39674
+ readonly plan: EnsureAgentPlan;
39675
+ constructor(plan: EnsureAgentPlan);
39676
+ }
39677
+ /**
39678
+ * Agent config-as-code operations.
39679
+ *
39680
+ * @example
39681
+ * ```typescript
39682
+ * const def = defineAgent({ name: 'Pricing Assistant', model: 'claude-sonnet-4-6', systemPrompt })
39683
+ *
39684
+ * // Converge (CI/deploy). Steady state is one tiny probe request.
39685
+ * const result = await Runtype.agents.ensure(def)
39686
+ *
39687
+ * // PR drift gate.
39688
+ * await Runtype.agents.ensure(def, { expectNoChanges: true })
39689
+ *
39690
+ * // Absorb a dashboard edit back into the repo.
39691
+ * const { definition } = await Runtype.agents.pull('Pricing Assistant')
39692
+ * ```
39693
+ */
39694
+ declare class AgentsNamespace {
39695
+ private getClient;
39696
+ constructor(getClient: () => RuntypeClient$1);
39697
+ /**
39698
+ * Idempotently converge a definition onto the platform. Hash-first: probes
39699
+ * with a content hash, and only ships the full definition when the server
39700
+ * reports a miss (`definitionRequired`). Creates an immutable version
39701
+ * snapshot on every change; never deletes.
39702
+ */
39703
+ ensure(definition: AgentDefinition, options?: EnsureAgentOptions): Promise<EnsureAgentResult>;
39704
+ /**
39705
+ * Pull the canonical definition + provenance for an agent by name — the
39706
+ * absorb-drift direction. The contentHash reflects the live agent state.
39707
+ */
39708
+ pull(name: string): Promise<AgentPullResult>;
39709
+ private memoize;
39710
+ private request;
39711
+ }
39712
+
38332
39713
  /**
38333
39714
  * Runtype - The unified SDK client for building and executing flows, batches, evals, and prompts
38334
39715
  *
@@ -38580,6 +39961,30 @@ declare class Runtype {
38580
39961
  * ```
38581
39962
  */
38582
39963
  static get skills(): SkillsNamespace;
39964
+ /**
39965
+ * Agents namespace - Agent config-as-code (define / ensure / pull)
39966
+ *
39967
+ * @example
39968
+ * ```typescript
39969
+ * import { defineAgent, Runtype } from '@runtypelabs/sdk'
39970
+ *
39971
+ * const assistant = defineAgent({
39972
+ * name: 'Pricing Assistant',
39973
+ * model: 'claude-sonnet-4-6',
39974
+ * systemPrompt: renderPrompt(pricingData),
39975
+ * })
39976
+ *
39977
+ * // Converge at deploy time (idempotent; one tiny probe in steady state)
39978
+ * await Runtype.agents.ensure(assistant)
39979
+ *
39980
+ * // CI drift gate
39981
+ * await Runtype.agents.ensure(assistant, { expectNoChanges: true })
39982
+ *
39983
+ * // Absorb a dashboard edit back into the repo
39984
+ * const { definition } = await Runtype.agents.pull('Pricing Assistant')
39985
+ * ```
39986
+ */
39987
+ static get agents(): AgentsNamespace;
38583
39988
  }
38584
39989
 
38585
39990
  /**
@@ -38931,6 +40336,7 @@ interface ApiClient {
38931
40336
  patch<T>(path: string, data?: any): Promise<T>;
38932
40337
  delete<T>(path: string, data?: any): Promise<T>;
38933
40338
  postFormData<T>(path: string, formData: FormData): Promise<T>;
40339
+ postBinary<T>(path: string, body: Uint8Array, contentType: string): Promise<T>;
38934
40340
  requestStream(path: string, options?: RequestInit): Promise<Response>;
38935
40341
  }
38936
40342
  /**
@@ -40181,6 +41587,14 @@ interface ExecuteWithLocalToolsOptions {
40181
41587
  * delivered at the next session boundary instead of after the full session.
40182
41588
  */
40183
41589
  shouldInterrupt?: () => boolean;
41590
+ /**
41591
+ * Hard-abort signal for the in-flight execution. When it aborts, the
41592
+ * active SSE stream is cancelled and the pause/resume loop returns a
41593
+ * synthetic `agent_complete` (stopReason 'end_turn') carrying the cost and
41594
+ * tokens observed so far — it does NOT throw. Callers distinguish an
41595
+ * aborted run by checking their own signal, not the returned event.
41596
+ */
41597
+ abortSignal?: AbortSignal;
40184
41598
  }
40185
41599
  /**
40186
41600
  * Status of a long-task agent run
@@ -40243,6 +41657,14 @@ interface RunTaskSessionSummary {
40243
41657
  /** ISO timestamp when this session completed */
40244
41658
  completedAt: string;
40245
41659
  }
41660
+ interface RunTaskContextSummaryEntry {
41661
+ id: string;
41662
+ sessionIndex: number;
41663
+ mode: 'auto' | 'forced';
41664
+ strategy: 'provider_native' | 'summary_fallback';
41665
+ content: string;
41666
+ createdAt: string;
41667
+ }
40246
41668
  /**
40247
41669
  * Accumulated state for a long-task agent run.
40248
41670
  * This is both the in-memory state and the record metadata shape.
@@ -40321,10 +41743,19 @@ interface RunTaskState {
40321
41743
  lastCompletionRejectionReason?: string;
40322
41744
  /** Number of consecutive sessions with no tool actions (for stall detection) */
40323
41745
  consecutiveEmptySessions?: number;
41746
+ /** Durable summaries generated by history compaction; mirrored into the marathon tree log. */
41747
+ contextCompactionSummaries?: RunTaskContextSummaryEntry[];
41748
+ /**
41749
+ * Send-window base: index into `messages` of the first message NOT covered
41750
+ * by the latest compaction summary. Replay sends
41751
+ * `[latest summary, messages since base, continuation]` and re-compacts only
41752
+ * when that window re-crosses the threshold. 0/undefined = no compaction yet.
41753
+ */
41754
+ contextWindowBaseIndex?: number;
40324
41755
  /** Arbitrary bag for workflow-specific data */
40325
41756
  workflowState?: Record<string, unknown>;
40326
41757
  }
40327
- type RunTaskResumeState = Pick<RunTaskState, 'originalMessage' | 'bootstrapContext' | 'workflowPhase' | 'planPath' | 'planWritten' | 'bestCandidatePath' | 'bestCandidateReason' | 'candidatePaths' | 'recentReadPaths' | 'recentActionKeys' | 'bestCandidateNeedsVerification' | 'bestCandidateVerified' | 'verificationRequired' | 'lastVerificationPassed' | 'consecutiveBlockedVerificationSessions' | 'isCreationTask' | 'outputRoot' | 'workflowVariant' | 'workflowState'>;
41758
+ type RunTaskResumeState = Pick<RunTaskState, 'originalMessage' | 'bootstrapContext' | 'workflowPhase' | 'planPath' | 'planWritten' | 'bestCandidatePath' | 'bestCandidateReason' | 'candidatePaths' | 'recentReadPaths' | 'recentActionKeys' | 'bestCandidateNeedsVerification' | 'bestCandidateVerified' | 'verificationRequired' | 'lastVerificationPassed' | 'consecutiveBlockedVerificationSessions' | 'isCreationTask' | 'outputRoot' | 'workflowVariant' | 'contextCompactionSummaries' | 'contextWindowBaseIndex' | 'workflowState'>;
40328
41759
  /**
40329
41760
  * Callback invoked after each session completes.
40330
41761
  * Return `false` to stop the loop early.
@@ -40339,6 +41770,12 @@ interface RunTaskContextBudgetBreakdown {
40339
41770
  summaryTokens?: number;
40340
41771
  reservedOutputTokens?: number;
40341
41772
  effectiveInputBudgetTokens?: number;
41773
+ /** Estimated tokens in the actual send-view after tool-result reduction. */
41774
+ sendEstimatedInputTokens?: number;
41775
+ /** Tool-result tokens in the actual send-view after tool-result reduction. */
41776
+ sendToolOutputTokens?: number;
41777
+ /** Estimated tokens saved by deriving the send-view from full-fidelity history. */
41778
+ toolOutputReductionTokens?: number;
40342
41779
  estimatedInputTokens: number;
40343
41780
  }
40344
41781
  interface RunTaskContextCompactionEvent {
@@ -40450,6 +41887,15 @@ interface RunTaskOptions {
40450
41887
  * instead of after the session completes.
40451
41888
  */
40452
41889
  hasQueuedUserMessages?: () => boolean;
41890
+ /**
41891
+ * Hard abort for the in-flight task (e.g. user pressed Esc). Aborting
41892
+ * cancels the active session's stream, preserves the cost/tokens observed
41893
+ * so far, persists state via `onSession`, and resolves `runTask` with
41894
+ * status 'paused' (resumable) — it never rejects because of the abort.
41895
+ * In-flight stream cancellation requires the `localTools` streaming path;
41896
+ * other execution paths honor the abort at the next session boundary.
41897
+ */
41898
+ abortSignal?: AbortSignal;
40453
41899
  }
40454
41900
  /**
40455
41901
  * Final result returned by `agents.runTask()`
@@ -40571,7 +42017,9 @@ declare class AgentsEndpoint {
40571
42017
  * // ...
40572
42018
  * ```
40573
42019
  */
40574
- executeStream(id: string, data: AgentExecuteRequest): Promise<Response>;
42020
+ executeStream(id: string, data: AgentExecuteRequest, init?: {
42021
+ signal?: AbortSignal;
42022
+ }): Promise<Response>;
40575
42023
  /**
40576
42024
  * Execute an agent with streaming and callbacks
40577
42025
  *
@@ -40651,10 +42099,21 @@ declare class AgentsEndpoint {
40651
42099
  private normalizeCandidatePath;
40652
42100
  private dedupeNormalizedCandidatePaths;
40653
42101
  /**
40654
- * Compact old tool results based on context mode and window setting.
40655
- * Modifies messages in-place.
42102
+ * Resolve the replay window: the base index sliced off the full history and
42103
+ * the durable summary message that stands in for everything before it.
42104
+ * The base is honored ONLY when the latest summary actually exists —
42105
+ * slicing history with no summary substitute would silently drop prior
42106
+ * context (defensive against states that carried a base but lost their
42107
+ * summaries). The base is also clamped so a stale pointer (fork truncation,
42108
+ * trimmed legacy state) never slices past the end of the array.
42109
+ */
42110
+ private resolveWindowReplay;
42111
+ /**
42112
+ * Derive the message view sent to the model based on context mode and window
42113
+ * setting. This never mutates persisted marathon history; masking/offloading
42114
+ * is a send-time view over the full-fidelity ledger/history.
40656
42115
  */
40657
- private compactToolResults;
42116
+ private deriveToolContextMessages;
40658
42117
  private compactOneResult;
40659
42118
  private isMarathonArtifactPath;
40660
42119
  private isDiscoveryToolName;
@@ -40720,6 +42179,7 @@ declare class AgentsEndpoint {
40720
42179
  private resolveCompactStrategy;
40721
42180
  private estimateTextTokens;
40722
42181
  private estimateUnknownTokens;
42182
+ private extractDeclaredToolResultChars;
40723
42183
  private estimateMessageContentTokens;
40724
42184
  private estimateToolCallTokens;
40725
42185
  private estimateToolResultTokens;
@@ -40730,13 +42190,13 @@ declare class AgentsEndpoint {
40730
42190
  private loadBuiltinToolSchemas;
40731
42191
  private buildDefaultCompactInstructions;
40732
42192
  private resolveCompactInstructions;
42193
+ private extractArtifactReferencesFromMessages;
40733
42194
  private extractArtifactReferences;
40734
42195
  private buildContextBudgetBreakdown;
40735
42196
  private emitContextCompactionEvent;
40736
42197
  private emitContextNotice;
40737
42198
  private buildCompactHistoryMessagesWithLifecycle;
40738
42199
  private buildCompactHistoryMessages;
40739
- private isCompactHistoryMessageSet;
40740
42200
  /**
40741
42201
  * Generate a compact summary of prior work for continuation context.
40742
42202
  * Used when compact mode is enabled to keep token usage low.
@@ -41075,6 +42535,103 @@ declare class BillingEndpoint {
41075
42535
  */
41076
42536
  getSpendAnalytics(params?: BillingSpendAnalyticsParams): Promise<Record<string, unknown>>;
41077
42537
  }
42538
+ /** App manifest (`runtype.app.json`) — mirrors @runtypelabs/shared appManifestSchema. */
42539
+ interface AppManifest {
42540
+ name: string;
42541
+ description?: string;
42542
+ capabilities: {
42543
+ flows: string[];
42544
+ agents: string[];
42545
+ };
42546
+ data: Array<{
42547
+ namespace: string;
42548
+ access: 'read' | 'read-write';
42549
+ }>;
42550
+ auth: 'none' | 'optional' | 'required';
42551
+ }
42552
+ interface App {
42553
+ id: string;
42554
+ slug: string;
42555
+ shortId: string;
42556
+ hostname: string;
42557
+ /** Public origin the app serves from, e.g. https://retro-board-x7k2p9.runtype.run */
42558
+ url: string;
42559
+ name: string;
42560
+ description: string | null;
42561
+ activeVersionId: string | null;
42562
+ visibility: 'public' | 'unlisted';
42563
+ status: 'active' | 'suspended';
42564
+ clientTokenId: string | null;
42565
+ createdAt: string;
42566
+ updatedAt: string;
42567
+ }
42568
+ interface AppVersion {
42569
+ id: string;
42570
+ appId: string;
42571
+ versionNumber: number;
42572
+ bundleHash: string;
42573
+ manifest: AppManifest;
42574
+ sizeBytes: number;
42575
+ fileCount: number;
42576
+ status: 'uploaded' | 'active' | 'superseded';
42577
+ createdBy: string;
42578
+ createdAt: string;
42579
+ }
42580
+ interface CreateAppRequest {
42581
+ /** Lowercase letters, digits, hyphens; must start with a letter; max 40 chars. */
42582
+ slug: string;
42583
+ name: string;
42584
+ description?: string;
42585
+ visibility?: 'public' | 'unlisted';
42586
+ }
42587
+ interface UpdateAppRequest {
42588
+ name?: string;
42589
+ description?: string | null;
42590
+ visibility?: 'public' | 'unlisted';
42591
+ status?: 'active' | 'suspended';
42592
+ }
42593
+ /**
42594
+ * Apps endpoint handlers — Runtype Apps are hosted AI apps served at
42595
+ * {slug}-{shortId}.runtype.run. Deploy = upload a version (zip), then
42596
+ * activate (instant pointer flip); rollback = activate an older version.
42597
+ */
42598
+ declare class AppsEndpoint {
42599
+ private client;
42600
+ constructor(client: ApiClient);
42601
+ /** List apps for the authenticated owner, newest first. */
42602
+ list(): Promise<{
42603
+ data: App[];
42604
+ }>;
42605
+ /** Get an app by id, including its URL and active version pointer. */
42606
+ get(id: string): Promise<App>;
42607
+ /** Create an app. A client token scoped to the app origin is auto-provisioned. */
42608
+ create(data: CreateAppRequest): Promise<App>;
42609
+ /** Update name, description, visibility, or status (suspended serves 410). */
42610
+ update(id: string, data: UpdateAppRequest): Promise<App>;
42611
+ /** Delete an app, its versions, and its hosting. Irreversible. */
42612
+ delete(id: string): Promise<{
42613
+ success: boolean;
42614
+ }>;
42615
+ /** List an app's versions, newest first. */
42616
+ listVersions(id: string): Promise<{
42617
+ data: AppVersion[];
42618
+ }>;
42619
+ /** Upload a zipped bundle (raw application/zip body) as a new version. */
42620
+ uploadVersion(id: string, zipBytes: Uint8Array): Promise<AppVersion>;
42621
+ /**
42622
+ * Upload a bundle from in-memory file maps (the API zips server-side).
42623
+ * Text files in `files`, binary files base64-encoded in `filesBase64`.
42624
+ */
42625
+ uploadVersionFiles(id: string, data: {
42626
+ files: Record<string, string>;
42627
+ filesBase64?: Record<string, string>;
42628
+ }): Promise<AppVersion>;
42629
+ /** Activate an uploaded version (deploy or rollback). */
42630
+ activate(id: string, versionId: string): Promise<{
42631
+ app: App;
42632
+ version: AppVersion;
42633
+ }>;
42634
+ }
41078
42635
 
41079
42636
  /**
41080
42637
  * @layer sdk
@@ -41154,6 +42711,7 @@ declare class RuntypeClient implements ApiClient {
41154
42711
  clientTokens: ClientTokensEndpoint;
41155
42712
  agents: AgentsEndpoint;
41156
42713
  secrets: SecretsEndpoint;
42714
+ apps: AppsEndpoint;
41157
42715
  schedules: SchedulesEndpoint;
41158
42716
  surfaces: SurfacesEndpoint;
41159
42717
  conversations: ConversationsEndpoint;
@@ -41211,6 +42769,10 @@ declare class RuntypeClient implements ApiClient {
41211
42769
  * POST request with FormData support for file uploads
41212
42770
  */
41213
42771
  postFormData<T>(path: string, formData: FormData): Promise<T>;
42772
+ /**
42773
+ * POST request with a raw binary body (e.g. application/zip bundle uploads).
42774
+ */
42775
+ postBinary<T>(path: string, body: Uint8Array, contentType: string): Promise<T>;
41214
42776
  /**
41215
42777
  * Generic request that returns raw Response for streaming
41216
42778
  */
@@ -41259,6 +42821,50 @@ declare class RuntypeApiError extends Error {
41259
42821
  */
41260
42822
  declare function createClient(config?: ClientConfig): RuntypeClient;
41261
42823
 
42824
+ /**
42825
+ * Offload marker contract — the single source of truth for the reference
42826
+ * strings that replace large tool outputs in marathon send views.
42827
+ *
42828
+ * Two producers emit these markers:
42829
+ * - the SDK's hot-tail send-view offload (`AgentsEndpoint.offloadToolResult`)
42830
+ * - the CLI's ledger offload (`packages/cli/src/marathon/context-offload.ts`)
42831
+ *
42832
+ * Two consumers parse them back:
42833
+ * - `extractDeclaredToolResultChars` recovers TRUE output sizes for honest
42834
+ * token accounting (the compaction threshold must see real sizes, not
42835
+ * placeholder sizes — the original "double lossy compression" bug)
42836
+ * - the CLI session chunker re-expands ledger references to full payloads
42837
+ * before semantic indexing
42838
+ *
42839
+ * Because accounting and recall silently degrade when a producer's copy
42840
+ * drifts from a consumer's regex, both sides MUST build and parse through
42841
+ * this module. Do not inline these strings elsewhere.
42842
+ */
42843
+ declare const LEDGER_ARTIFACT_LINE_PREFIX = "Ledger artifact: ";
42844
+ /** SDK hot-tail send-view marker: large tool result replaced by a file pointer. */
42845
+ declare function buildSendViewOffloadMarker(details: {
42846
+ toolName: string;
42847
+ charLength: number;
42848
+ filePath: string;
42849
+ }): string;
42850
+ /** CLI ledger offload reference: content-addressed artifact recorded in the tree log. */
42851
+ declare function buildLedgerOffloadReference(details: {
42852
+ outputId: string;
42853
+ charLength: number;
42854
+ relativePath: string;
42855
+ preview: string;
42856
+ truncated: boolean;
42857
+ }): string;
42858
+ /**
42859
+ * Recover the declared true size from an offload marker. Returns undefined
42860
+ * for values that are not offload markers (or not strings).
42861
+ */
42862
+ declare function extractDeclaredToolResultChars(value: unknown): number | undefined;
42863
+ /** Parse the artifact/output id out of a ledger offload reference. */
42864
+ declare function parseOffloadedOutputId(value: string): string | undefined;
42865
+ /** Parse the tree-log-relative artifact path out of a ledger offload reference. */
42866
+ declare function parseLedgerArtifactRelativePath(value: string): string | undefined;
42867
+
41262
42868
  /**
41263
42869
  * SSE Stream Utilities for FlowBuilder
41264
42870
  *
@@ -42414,4 +44020,4 @@ declare function getLikelySupportingCandidatePaths(bestCandidatePath: string | u
42414
44020
  declare function getDefaultPlanPath(taskName: string): string;
42415
44021
  declare function sanitizeTaskSlug(taskName: string): string;
42416
44022
 
42417
- export { type Agent, type AgentApprovalCompleteEvent, type AgentApprovalStartEvent, type AgentCompleteEvent, type AgentErrorEvent, type AgentEvent, type AgentEventType, type AgentExecuteRequest, type AgentExecuteResponse, type AgentIterationCompleteEvent, type AgentIterationStartEvent, type AgentMediaEvent, type AgentMessage, type AgentPausedEvent, type AgentPingEvent, type AgentReflectionEvent, type AgentRuntimeToolDefinition, type AgentStartEvent, type AgentStreamCallbacks, type AgentStreamEvent, type AgentSubagentConfig, type AgentToolCompleteEvent, type AgentToolDeltaEvent, type AgentToolInputCompleteEvent, type AgentToolInputDeltaEvent, type AgentToolStartEvent, type AgentTurnCompleteEvent, type AgentTurnDeltaEvent, type AgentTurnStartEvent, type AgentVersionDetail, type AgentVersionListItem, type AgentVersionPublishResponse, AgentVersionsEndpoint, type AgentVersionsListResponse, AgentsEndpoint, AnalyticsEndpoint, type ApiClient, type ApiKey, ApiKeysEndpoint, type ApiResponse, type ApplyGeneratedProposalOptions, type ApplyGeneratedProposalResult, type AttachRuntimeToolsOptions, type BaseAgentEvent, BatchBuilder, type BatchClient, type BatchListParams, type BatchOptions, type BatchRequest, type BatchResult, type BatchScheduleConfig, type BatchStatus, BatchesNamespace, BillingEndpoint, type BillingSpendAnalyticsParams, type BindSkillInput, type BuiltInTool, type BulkEditCondition, type BulkEditRequest, type BulkEditResponse, type BulkEditResult, ChatEndpoint, ClientBatchBuilder, type ClientConfig, type ClientConversation, ClientEvalBuilder, ClientFlowBuilder, type ClientToken, type ClientTokenConfig, type ClientTokenEnvironment, type ClientTokenVersionPin, ClientTokensEndpoint, type ClientToolDefinition, type ClientWidgetTheme, type ConditionalStepConfig$1 as ConditionalStepConfig, type ContextErrorHandling, type ContextFallback, ContextTemplatesEndpoint, type Conversation, type ConversationListItem, type ConversationListParams, type ConversationMessage, type ConversationSource, ConversationsEndpoint, type ConversationsListResponse, type CreateApiKeyRequest, type CreateClientTokenRequest, type CreateClientTokenResponse, type CreateConversationRequest, type CreateFlowRequest, type CreateModelConfigRequest, type CreatePromptData, type CreatePromptRequest, type CreateProviderKeyRequest, type CreateRecordRequest, type CreateScheduleRequest, type CreateSecretRequest, type CreateToolRequest, type CustomMCPServer, type CustomMCPServerAuth, type CustomToolConfig, type DeployCfSandboxRequest, type DeployCfSandboxResponse, type DeploySandboxRequest, type DeploySandboxResponse, type DiscoveredModel, type DispatchClient, DispatchEndpoint, type DispatchEnvironment, type DispatchEvent, type DispatchOptions$1 as DispatchOptions, type DispatchRequest, type ErrorHandlingMode, EvalBuilder, type EvalClient, EvalEndpoint, type EvalListParams, type EvalOptions, type EvalRecord, type EvalRequest, type EvalResult, type EvalRunConfig, EvalRunner, type EvalStatus, EvalsNamespace, type ExecuteToolRequest, type ExecuteToolResponse, type ExternalAgentContext, type ExternalToolConfig, type FallbackFailEvent, type FallbackStartEvent, type FallbackSuccessEvent, type FallbackTrigger, type FallbackTriggerType, type FallbacksExhaustedEvent, type FallbacksInitiatedEvent, type FetchGitHubStepConfig$1 as FetchGitHubStepConfig, type FetchUrlStepConfig$1 as FetchUrlStepConfig, type FieldFormat, type FileContentPart, type Flow, type FlowAttachment, FlowBuilder, type FlowCompleteEvent, type FlowConfig$1 as FlowConfig, type FlowErrorEvent, type FlowFallback, type FlowListItem, type FlowPausedEvent, FlowResult, type FlowStartEvent, type FlowStep, type FlowStepDefinition, type FlowStepType, FlowStepsEndpoint, type FlowStreamEvent, type FlowSummary, type FlowToolConfig, type FlowValidationClient, type FlowValidationIssue, type FlowValidationResult, type FlowVersionDetail, type FlowVersionListItem, type FlowVersionPublishResponse, FlowVersionsEndpoint, type FlowVersionsListResponse, FlowsEndpoint, FlowsNamespace, type GenerateEmbeddingStepConfig$1 as GenerateEmbeddingStepConfig, type GeneratedRuntimeToolGateDecision, type GeneratedRuntimeToolGateOptions, type ImageContentPart, type Integration, type IntegrationTool, IntegrationsEndpoint, type IntegrationsListResponse, type JSONSchema, type JsonArray, type JsonObject, type JsonPrimitive, type JsonValue, type ListConversationsResponse, type ListParams, type LocalToolConfig, type LocalToolDefinition, type LocalToolExecutionCompleteEvent, type LocalToolExecutionLoopSnapshotSlice, type LocalToolExecutionStartEvent, type LogEntry, type LogQueryParams, type LogQueryResponse, type LogQueryResult, type LogStatsParams, type LogStatsResponse, type LogStatsResult, LogsEndpoint, type Message$1 as Message, type MessageContent, type MessageFallback, type Metadata, type ModelConfig, ModelConfigsEndpoint, type ModelFallback, type ModelOverride, type ModelUsageDetail, type ModelUsageQueryParams, type ModelUsageResponse, type ModelUsageSummary, type ModelUsageTimeSeries, type PaginationResponse, type Prompt$1 as Prompt, type PromptErrorHandling, type PromptFallback, type PromptListParams, type PromptRunOptions, PromptRunner, type PromptStepConfig$1 as PromptStepConfig, PromptsEndpoint, PromptsNamespace, type ProviderApiKey, type ProviderKeyModel, ProviderKeysEndpoint, type ReasoningConfig, type ReasoningContentPart, type ReasoningValue, type RecordConfig$1 as RecordConfig, type RecordFilter, type RecordFilterCondition, type RecordFilterGroup, type RecordFilterOperator, type RecordListItem, type RecordListParams, RecordsEndpoint, type RetrieveRecordStepConfig$1 as RetrieveRecordStepConfig, type RetryFallback, type RunTaskContextBudgetBreakdown, type RunTaskContextCompactionEvent, type RunTaskContextCompactionStrategy, type RunTaskContextNoticeEvent, type RunTaskContinuation, type RunTaskOnContextCompaction, type RunTaskOnContextNotice, type RunTaskOnSession, type RunTaskOptions, type RunTaskResult, type RunTaskResumeState, type RunTaskSessionSummary, type RunTaskState, type RunTaskStateSlice, type RunTaskStatus, type RunTaskToolTraceSlice, type RuntimeCustomToolConfig, type RuntimeExternalToolConfig, type RuntimeFlowToolConfig, type RuntimeLocalToolConfig, type RuntimeSubagentToolConfig, type RuntimeTool, type RuntimeToolConfig, Runtype, type AgentSkillBinding as RuntypeAgentSkillBinding, RuntypeApiError, RuntypeClient, type ConditionalStepConfig as RuntypeConditionalStepConfig, type RuntypeConfig, type FetchGitHubStepConfig as RuntypeFetchGitHubStepConfig, type FetchUrlStepConfig as RuntypeFetchUrlStepConfig, RuntypeFlowBuilder, type FlowConfig as RuntypeFlowConfig, type GenerateEmbeddingStepConfig as RuntypeGenerateEmbeddingStepConfig, type Message as RuntypeMessage, type ModelOverride$1 as RuntypeModelOverride, type Prompt as RuntypePrompt, type PromptStepConfig as RuntypePromptStepConfig, type RuntypeRecord, type RecordConfig as RuntypeRecordConfig, type RetrieveRecordStepConfig as RuntypeRetrieveRecordStepConfig, type SearchStepConfig as RuntypeSearchStepConfig, type SendEmailStepConfig as RuntypeSendEmailStepConfig, type SendEventStepConfig as RuntypeSendEventStepConfig, type SendStreamStepConfig as RuntypeSendStreamStepConfig, type SendTextStepConfig as RuntypeSendTextStepConfig, type SetVariableStepConfig as RuntypeSetVariableStepConfig, type Skill as RuntypeSkill, type SkillCapabilities as RuntypeSkillCapabilities, type SkillFrontmatter as RuntypeSkillFrontmatter, type SkillManifest as RuntypeSkillManifest, type SkillProposal as RuntypeSkillProposal, type SkillRuntypeExtensions as RuntypeSkillRuntypeExtensions, type SkillVersion as RuntypeSkillVersion, type TransformDataStepConfig as RuntypeTransformDataStepConfig, type UpsertFlowConfig as RuntypeUpsertFlowConfig, type UpsertRecordStepConfig as RuntypeUpsertRecordStepConfig, type VectorSearchStepConfig as RuntypeVectorSearchStepConfig, type WaitUntilStepConfig as RuntypeWaitUntilStepConfig, STEP_FIELD_REGISTRY, STEP_TYPE_TO_METHOD, type Schedule, type ScheduleExecutionOptions, type ScheduleListParams, type ScheduleMessage, type ScheduleMessageSet, type ScheduleMessages, type ScheduleMutationResponse, type ScheduleRun, type ScheduleRunNowResponse, type ScheduleStatusResponse, type ScheduleTarget, type ScheduleTrigger, SchedulesEndpoint, type SearchStepConfig$1 as SearchStepConfig, type Secret, type SecretCheckResponse, type SecretDeleteResponse, type SecretSetupUrlRequest, type SecretSetupUrlResponse, SecretsEndpoint, type SendEmailStepConfig$1 as SendEmailStepConfig, type SendEventStepConfig$1 as SendEventStepConfig, type SendStreamStepConfig$1 as SendStreamStepConfig, type SendTextStepConfig$1 as SendTextStepConfig, type SetVariableStepConfig$1 as SetVariableStepConfig, type SkillManifestInput, type SkillMarkdownInput, type SkillOrigin, type SkillProposalStatus, SkillProposalsNamespace, type SkillStatus, type SkillTrustLevel, type SkillVersionStatus, type SkillWithVersion, type SkillWriteInput, SkillsNamespace, type SlackInstallRequest, type StepCompleteEvent, type StepDeltaEvent, type StepFallback, type StepFieldMeta, type StepStartEvent, type StepWaitingLocalEvent, type StreamCallbacks, type StreamEvent, type StreamEventOf, type SubagentToolConfig, type Surface, type SurfaceListParams, SurfacesEndpoint, type TextContentPart, type Tool, type ToolConfig, type ToolWithValidation, type ToolsConfig, ToolsEndpoint, type TransformDataStepConfig$1 as TransformDataStepConfig, type UpdateClientTokenRequest, type UpdateConversationRequest, type UpdatePromptData, type UpdateProviderKeyRequest, type UpdateScheduleRequest, type UpdateSecretRequest, type UpdateToolRequest, type UpdatedFlow, type UpsertFlowConfig$1 as UpsertFlowConfig, type UpsertOptions, type UpsertRecordStepConfig$1 as UpsertRecordStepConfig, type UserProfile, UsersEndpoint, type VectorSearchStepConfig$1 as VectorSearchStepConfig, type VersionType, type WaitUntilStepConfig$1 as WaitUntilStepConfig, type WorkflowContext, type WorkflowDefinition, type WorkflowPhase, applyGeneratedRuntimeToolProposalToDispatchRequest, attachRuntimeToolsToDispatchRequest, buildGeneratedRuntimeToolGateOutput, createClient, createExternalTool, defaultWorkflow, deployWorkflow, evaluateGeneratedRuntimeToolProposal, gameWorkflow, getDefaultPlanPath, getLikelySupportingCandidatePaths, isDiscoveryToolName, isMarathonArtifactPath, isPreservationSensitiveTask, normalizeCandidatePath, parseFinalBuffer, parseSSEChunk, processStream, sanitizeTaskSlug, streamEvents };
44023
+ export { type Agent, type AgentApprovalCompleteEvent, type AgentApprovalStartEvent, type AgentCompleteEvent, type AgentDefinition, type AgentDefinitionConfig, AgentDriftError, AgentEnsureConflictError, type AgentErrorEvent, type AgentEvent, type AgentEventType, type AgentExecuteRequest, type AgentExecuteResponse, type AgentIterationCompleteEvent, type AgentIterationStartEvent, type AgentMediaEvent, type AgentMessage, type AgentPausedEvent, type AgentPingEvent, type AgentPullResult, type AgentReflectionEvent, type AgentRuntimeToolDefinition, type AgentStartEvent, type AgentStreamCallbacks, type AgentStreamEvent, type AgentSubagentConfig, type AgentToolCompleteEvent, type AgentToolDeltaEvent, type AgentToolInputCompleteEvent, type AgentToolInputDeltaEvent, type AgentToolStartEvent, type AgentTurnCompleteEvent, type AgentTurnDeltaEvent, type AgentTurnStartEvent, type AgentVersionDetail, type AgentVersionListItem, type AgentVersionPublishResponse, AgentVersionsEndpoint, type AgentVersionsListResponse, AgentsEndpoint, AgentsNamespace, AnalyticsEndpoint, type ApiClient, type ApiKey, ApiKeysEndpoint, type ApiResponse, type App, type AppManifest, type AppVersion, type ApplyGeneratedProposalOptions, type ApplyGeneratedProposalResult, AppsEndpoint, type AttachRuntimeToolsOptions, type BaseAgentEvent, BatchBuilder, type BatchClient, type BatchListParams, type BatchOptions, type BatchRequest, type BatchResult, type BatchScheduleConfig, type BatchStatus, BatchesNamespace, BillingEndpoint, type BillingSpendAnalyticsParams, type BindSkillInput, type BuiltInTool, type BulkEditCondition, type BulkEditRequest, type BulkEditResponse, type BulkEditResult, ChatEndpoint, ClientBatchBuilder, type ClientConfig, type ClientConversation, ClientEvalBuilder, ClientFlowBuilder, type ClientToken, type ClientTokenConfig, type ClientTokenEnvironment, type ClientTokenVersionPin, ClientTokensEndpoint, type ClientToolDefinition, type ClientWidgetTheme, type ConditionalStepConfig$1 as ConditionalStepConfig, type ContextErrorHandling, type ContextFallback, ContextTemplatesEndpoint, type Conversation, type ConversationListItem, type ConversationListParams, type ConversationMessage, type ConversationSource, ConversationsEndpoint, type ConversationsListResponse, type CreateApiKeyRequest, type CreateAppRequest, type CreateClientTokenRequest, type CreateClientTokenResponse, type CreateConversationRequest, type CreateFlowRequest, type CreateModelConfigRequest, type CreatePromptData, type CreatePromptRequest, type CreateProviderKeyRequest, type CreateRecordRequest, type CreateScheduleRequest, type CreateSecretRequest, type CreateToolRequest, type CustomMCPServer, type CustomMCPServerAuth, type CustomToolConfig, type DefineAgentInput, type DefineFlowInput, type DeployCfSandboxRequest, type DeployCfSandboxResponse, type DeploySandboxRequest, type DeploySandboxResponse, type DiscoveredModel, type DispatchClient, DispatchEndpoint, type DispatchEnvironment, type DispatchEvent, type DispatchOptions$1 as DispatchOptions, type DispatchRequest, type EnsureAgentConverged, type EnsureAgentOptions, type EnsureAgentPlan, type EnsureAgentResult, type EnsureFlowConverged, type EnsureFlowOptions, type EnsureFlowPlan, type EnsureFlowResult, type ErrorHandlingMode, EvalBuilder, type EvalClient, EvalEndpoint, type EvalListParams, type EvalOptions, type EvalRecord, type EvalRequest, type EvalResult, type EvalRunConfig, EvalRunner, type EvalStatus, EvalsNamespace, type ExecuteToolRequest, type ExecuteToolResponse, type ExternalAgentContext, type ExternalToolConfig, type FallbackFailEvent, type FallbackStartEvent, type FallbackSuccessEvent, type FallbackTrigger, type FallbackTriggerType, type FallbacksExhaustedEvent, type FallbacksInitiatedEvent, type FetchGitHubStepConfig$1 as FetchGitHubStepConfig, type FetchUrlStepConfig$1 as FetchUrlStepConfig, type FieldFormat, type FileContentPart, type Flow, type FlowAttachment, FlowBuilder, type FlowCompleteEvent, type FlowConfig$1 as FlowConfig, type FlowDefinition, type FlowDefinitionStep, FlowDriftError, FlowEnsureConflictError, type FlowErrorEvent, type FlowFallback, type FlowListItem, type FlowPausedEvent, type FlowPullResult, FlowResult, type FlowStartEvent, type FlowStep, type FlowStepDefinition, type FlowStepType, FlowStepsEndpoint, type FlowStreamEvent, type FlowSummary, type FlowToolConfig, type FlowValidationClient, type FlowValidationIssue, type FlowValidationResult, type FlowVersionDetail, type FlowVersionListItem, type FlowVersionPublishResponse, FlowVersionsEndpoint, type FlowVersionsListResponse, FlowsEndpoint, FlowsNamespace, type GenerateEmbeddingStepConfig$1 as GenerateEmbeddingStepConfig, type GeneratedRuntimeToolGateDecision, type GeneratedRuntimeToolGateOptions, type ImageContentPart, type Integration, type IntegrationTool, IntegrationsEndpoint, type IntegrationsListResponse, type JSONSchema, type JsonArray, type JsonObject, type JsonPrimitive, type JsonValue, LEDGER_ARTIFACT_LINE_PREFIX, type ListConversationsResponse, type ListParams, type LocalToolConfig, type LocalToolDefinition, type LocalToolExecutionCompleteEvent, type LocalToolExecutionLoopSnapshotSlice, type LocalToolExecutionStartEvent, type LogEntry, type LogQueryParams, type LogQueryResponse, type LogQueryResult, type LogStatsParams, type LogStatsResponse, type LogStatsResult, LogsEndpoint, type Message$1 as Message, type MessageContent, type MessageFallback, type Metadata, type ModelConfig, ModelConfigsEndpoint, type ModelFallback, type ModelOverride, type ModelUsageDetail, type ModelUsageQueryParams, type ModelUsageResponse, type ModelUsageSummary, type ModelUsageTimeSeries, type PaginationResponse, type Prompt$1 as Prompt, type PromptErrorHandling, type PromptFallback, type PromptListParams, type PromptRunOptions, PromptRunner, type PromptStepConfig$1 as PromptStepConfig, PromptsEndpoint, PromptsNamespace, type ProviderApiKey, type ProviderKeyModel, ProviderKeysEndpoint, type ReasoningConfig, type ReasoningContentPart, type ReasoningValue, type RecordConfig$1 as RecordConfig, type RecordFilter, type RecordFilterCondition, type RecordFilterGroup, type RecordFilterOperator, type RecordListItem, type RecordListParams, RecordsEndpoint, type RetrieveRecordStepConfig$1 as RetrieveRecordStepConfig, type RetryFallback, type RunTaskContextBudgetBreakdown, type RunTaskContextCompactionEvent, type RunTaskContextCompactionStrategy, type RunTaskContextNoticeEvent, type RunTaskContextSummaryEntry, type RunTaskContinuation, type RunTaskOnContextCompaction, type RunTaskOnContextNotice, type RunTaskOnSession, type RunTaskOptions, type RunTaskResult, type RunTaskResumeState, type RunTaskSessionSummary, type RunTaskState, type RunTaskStateSlice, type RunTaskStatus, type RunTaskToolTraceSlice, type RuntimeCustomToolConfig, type RuntimeExternalToolConfig, type RuntimeFlowToolConfig, type RuntimeLocalToolConfig, type RuntimeSubagentToolConfig, type RuntimeTool, type RuntimeToolConfig, Runtype, type AgentSkillBinding as RuntypeAgentSkillBinding, RuntypeApiError, RuntypeClient, type ConditionalStepConfig as RuntypeConditionalStepConfig, type RuntypeConfig, type FetchGitHubStepConfig as RuntypeFetchGitHubStepConfig, type FetchUrlStepConfig as RuntypeFetchUrlStepConfig, RuntypeFlowBuilder, type FlowConfig as RuntypeFlowConfig, type GenerateEmbeddingStepConfig as RuntypeGenerateEmbeddingStepConfig, type Message as RuntypeMessage, type ModelOverride$1 as RuntypeModelOverride, type Prompt as RuntypePrompt, type PromptStepConfig as RuntypePromptStepConfig, type RuntypeRecord, type RecordConfig as RuntypeRecordConfig, type RetrieveRecordStepConfig as RuntypeRetrieveRecordStepConfig, type SearchStepConfig as RuntypeSearchStepConfig, type SendEmailStepConfig as RuntypeSendEmailStepConfig, type SendEventStepConfig as RuntypeSendEventStepConfig, type SendStreamStepConfig as RuntypeSendStreamStepConfig, type SendTextStepConfig as RuntypeSendTextStepConfig, type SetVariableStepConfig as RuntypeSetVariableStepConfig, type Skill as RuntypeSkill, type SkillCapabilities as RuntypeSkillCapabilities, type SkillFrontmatter as RuntypeSkillFrontmatter, type SkillManifest as RuntypeSkillManifest, type SkillProposal as RuntypeSkillProposal, type SkillRuntypeExtensions as RuntypeSkillRuntypeExtensions, type SkillVersion as RuntypeSkillVersion, type TransformDataStepConfig as RuntypeTransformDataStepConfig, type UpsertFlowConfig as RuntypeUpsertFlowConfig, type UpsertRecordStepConfig as RuntypeUpsertRecordStepConfig, type VectorSearchStepConfig as RuntypeVectorSearchStepConfig, type WaitUntilStepConfig as RuntypeWaitUntilStepConfig, STEP_FIELD_REGISTRY, STEP_TYPE_TO_METHOD, type Schedule, type ScheduleExecutionOptions, type ScheduleListParams, type ScheduleMessage, type ScheduleMessageSet, type ScheduleMessages, type ScheduleMutationResponse, type ScheduleRun, type ScheduleRunNowResponse, type ScheduleStatusResponse, type ScheduleTarget, type ScheduleTrigger, SchedulesEndpoint, type SearchStepConfig$1 as SearchStepConfig, type Secret, type SecretCheckResponse, type SecretDeleteResponse, type SecretSetupUrlRequest, type SecretSetupUrlResponse, SecretsEndpoint, type SendEmailStepConfig$1 as SendEmailStepConfig, type SendEventStepConfig$1 as SendEventStepConfig, type SendStreamStepConfig$1 as SendStreamStepConfig, type SendTextStepConfig$1 as SendTextStepConfig, type SetVariableStepConfig$1 as SetVariableStepConfig, type SkillListPage, type SkillListPagination, type SkillListParams, type SkillManifestInput, type SkillMarkdownInput, type SkillOrigin, type SkillProposalStatus, SkillProposalsNamespace, type SkillStatus, type SkillTrustLevel, type SkillVersionStatus, type SkillWithVersion, type SkillWriteInput, SkillsNamespace, type SlackInstallRequest, type StepCompleteEvent, type StepDeltaEvent, type StepFallback, type StepFieldMeta, type StepStartEvent, type StepWaitingLocalEvent, type StreamCallbacks, type StreamEvent, type StreamEventOf, type SubagentToolConfig, type Surface, type SurfaceListParams, SurfacesEndpoint, type TextContentPart, type Tool, type ToolConfig, type ToolWithValidation, type ToolsConfig, ToolsEndpoint, type TransformDataStepConfig$1 as TransformDataStepConfig, type UpdateAppRequest, type UpdateClientTokenRequest, type UpdateConversationRequest, type UpdatePromptData, type UpdateProviderKeyRequest, type UpdateScheduleRequest, type UpdateSecretRequest, type UpdateToolRequest, type UpdatedFlow, type UpsertFlowConfig$1 as UpsertFlowConfig, type UpsertOptions, type UpsertRecordStepConfig$1 as UpsertRecordStepConfig, type UserProfile, UsersEndpoint, type VectorSearchStepConfig$1 as VectorSearchStepConfig, type VersionType, type WaitUntilStepConfig$1 as WaitUntilStepConfig, type WorkflowContext, type WorkflowDefinition, type WorkflowPhase, applyGeneratedRuntimeToolProposalToDispatchRequest, attachRuntimeToolsToDispatchRequest, buildGeneratedRuntimeToolGateOutput, buildLedgerOffloadReference, buildSendViewOffloadMarker, computeAgentContentHash, computeFlowContentHash, createClient, createExternalTool, defaultWorkflow, defineAgent, defineFlow, deployWorkflow, evaluateGeneratedRuntimeToolProposal, extractDeclaredToolResultChars, gameWorkflow, getDefaultPlanPath, getLikelySupportingCandidatePaths, isDiscoveryToolName, isMarathonArtifactPath, isPreservationSensitiveTask, normalizeAgentDefinition, normalizeCandidatePath, parseFinalBuffer, parseLedgerArtifactRelativePath, parseOffloadedOutputId, parseSSEChunk, processStream, sanitizeTaskSlug, streamEvents };