@runtypelabs/sdk 4.8.1 → 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;
@@ -3016,7 +3370,818 @@ interface paths {
3016
3370
  patch?: never;
3017
3371
  trace?: never;
3018
3372
  };
3019
- "/v1/analytics/record-results": {
3373
+ "/v1/analytics/record-results": {
3374
+ parameters: {
3375
+ query?: never;
3376
+ header?: never;
3377
+ path?: never;
3378
+ cookie?: never;
3379
+ };
3380
+ /**
3381
+ * Get record results
3382
+ * @description Get all record results for the current user with filtering and pagination. When a `days` parameter is provided, returns aggregated daily execution analytics instead of paginated results.
3383
+ */
3384
+ get: {
3385
+ parameters: {
3386
+ query?: {
3387
+ days?: string;
3388
+ page?: string;
3389
+ limit?: string;
3390
+ status?: string;
3391
+ cursor?: string;
3392
+ };
3393
+ header?: never;
3394
+ path?: never;
3395
+ cookie?: never;
3396
+ };
3397
+ requestBody?: never;
3398
+ responses: {
3399
+ /** @description Record results or aggregated daily analytics */
3400
+ 200: {
3401
+ headers: {
3402
+ [name: string]: unknown;
3403
+ };
3404
+ content: {
3405
+ "application/json": {
3406
+ dailyExecutions: {
3407
+ date: string;
3408
+ failedExecutions: number | string;
3409
+ flowsFailure: number | string;
3410
+ flowsSuccess: number | string;
3411
+ promptsFailure: number | string;
3412
+ promptsSuccess: number | string;
3413
+ successfulExecutions: number | string;
3414
+ totalExecutions: number | string;
3415
+ }[];
3416
+ period: {
3417
+ days: number;
3418
+ endDate: string;
3419
+ startDate: string;
3420
+ };
3421
+ summary: {
3422
+ failedExecutions: number;
3423
+ flowExecutions: number;
3424
+ promptExecutions: number;
3425
+ successRate: number;
3426
+ successfulExecutions: number;
3427
+ totalExecutions: number;
3428
+ };
3429
+ } | {
3430
+ data: {
3431
+ pagination: {
3432
+ hasNextPage: boolean;
3433
+ hasPrevPage: boolean;
3434
+ limit: number;
3435
+ nextCursor: string | null;
3436
+ page: number;
3437
+ total: number;
3438
+ totalPages: number;
3439
+ };
3440
+ results: {
3441
+ completionTokens: number | null;
3442
+ createdAt: string;
3443
+ estimatedCost: string | null;
3444
+ executionTimeMs: number | null;
3445
+ flowId: string | null;
3446
+ flowName: string | null;
3447
+ id: string;
3448
+ modelUsed: string | null;
3449
+ promptId: string | null;
3450
+ promptName: string | null;
3451
+ promptResponseFormat: string | null;
3452
+ promptText: string | null;
3453
+ promptTokens: number | null;
3454
+ recordId: string;
3455
+ recordName: string;
3456
+ recordType: string;
3457
+ result: string | null;
3458
+ status: string;
3459
+ totalTokens: number | null;
3460
+ }[];
3461
+ };
3462
+ /** @enum {boolean} */
3463
+ success: true;
3464
+ };
3465
+ };
3466
+ };
3467
+ /** @description Validation error */
3468
+ 400: {
3469
+ headers: {
3470
+ [name: string]: unknown;
3471
+ };
3472
+ content: {
3473
+ "application/json": components["schemas"]["Error"];
3474
+ };
3475
+ };
3476
+ /** @description Unauthorized */
3477
+ 401: {
3478
+ headers: {
3479
+ [name: string]: unknown;
3480
+ };
3481
+ content: {
3482
+ "application/json": components["schemas"]["Error"];
3483
+ };
3484
+ };
3485
+ /** @description Insufficient permissions */
3486
+ 403: {
3487
+ headers: {
3488
+ [name: string]: unknown;
3489
+ };
3490
+ content: {
3491
+ "application/json": components["schemas"]["Error"];
3492
+ };
3493
+ };
3494
+ /** @description Internal server error */
3495
+ 500: {
3496
+ headers: {
3497
+ [name: string]: unknown;
3498
+ };
3499
+ content: {
3500
+ "application/json": components["schemas"]["Error"];
3501
+ };
3502
+ };
3503
+ };
3504
+ };
3505
+ put?: never;
3506
+ post?: never;
3507
+ delete?: never;
3508
+ options?: never;
3509
+ head?: never;
3510
+ patch?: never;
3511
+ trace?: never;
3512
+ };
3513
+ "/v1/analytics/stats": {
3514
+ parameters: {
3515
+ query?: never;
3516
+ header?: never;
3517
+ path?: never;
3518
+ cookie?: never;
3519
+ };
3520
+ /**
3521
+ * Get analytics stats
3522
+ * @description Get user analytics stats (records, prompts, flows, executions, evals, agents, products count). Supports optional `from` and `to` date filters.
3523
+ */
3524
+ get: {
3525
+ parameters: {
3526
+ query?: {
3527
+ from?: string;
3528
+ to?: string;
3529
+ };
3530
+ header?: never;
3531
+ path?: never;
3532
+ cookie?: never;
3533
+ };
3534
+ requestBody?: never;
3535
+ responses: {
3536
+ /** @description Analytics stats */
3537
+ 200: {
3538
+ headers: {
3539
+ [name: string]: unknown;
3540
+ };
3541
+ content: {
3542
+ "application/json": {
3543
+ data: {
3544
+ totalAgents: number;
3545
+ totalEvals: number;
3546
+ totalExecutions: number;
3547
+ totalFlows: number;
3548
+ totalProducts: number;
3549
+ totalPrompts: number;
3550
+ totalRecords: number;
3551
+ };
3552
+ filters: {
3553
+ from: string | null;
3554
+ to: string | null;
3555
+ };
3556
+ generatedAt: string;
3557
+ };
3558
+ };
3559
+ };
3560
+ /** @description Unauthorized */
3561
+ 401: {
3562
+ headers: {
3563
+ [name: string]: unknown;
3564
+ };
3565
+ content: {
3566
+ "application/json": components["schemas"]["Error"];
3567
+ };
3568
+ };
3569
+ /** @description Insufficient permissions */
3570
+ 403: {
3571
+ headers: {
3572
+ [name: string]: unknown;
3573
+ };
3574
+ content: {
3575
+ "application/json": components["schemas"]["Error"];
3576
+ };
3577
+ };
3578
+ /** @description Internal server error */
3579
+ 500: {
3580
+ headers: {
3581
+ [name: string]: unknown;
3582
+ };
3583
+ content: {
3584
+ "application/json": components["schemas"]["Error"];
3585
+ };
3586
+ };
3587
+ };
3588
+ };
3589
+ put?: never;
3590
+ post?: never;
3591
+ delete?: never;
3592
+ options?: never;
3593
+ head?: never;
3594
+ patch?: never;
3595
+ trace?: never;
3596
+ };
3597
+ "/v1/apps": {
3598
+ parameters: {
3599
+ query?: never;
3600
+ header?: never;
3601
+ path?: never;
3602
+ cookie?: never;
3603
+ };
3604
+ /**
3605
+ * List apps
3606
+ * @description List apps for the authenticated owner, newest first.
3607
+ */
3608
+ get: {
3609
+ parameters: {
3610
+ query?: never;
3611
+ header?: never;
3612
+ path?: never;
3613
+ cookie?: never;
3614
+ };
3615
+ requestBody?: never;
3616
+ responses: {
3617
+ /** @description Apps */
3618
+ 200: {
3619
+ headers: {
3620
+ [name: string]: unknown;
3621
+ };
3622
+ content: {
3623
+ "application/json": {
3624
+ data: {
3625
+ activeVersionId: string | null;
3626
+ clientTokenId: string | null;
3627
+ createdAt: string;
3628
+ description: string | null;
3629
+ hostname: string;
3630
+ id: string;
3631
+ name: string;
3632
+ shortId: string;
3633
+ slug: string;
3634
+ /** @enum {string} */
3635
+ status: "active" | "suspended";
3636
+ updatedAt: string;
3637
+ url: string;
3638
+ /** @enum {string} */
3639
+ visibility: "public" | "unlisted";
3640
+ }[];
3641
+ };
3642
+ };
3643
+ };
3644
+ /** @description Unauthorized */
3645
+ 401: {
3646
+ headers: {
3647
+ [name: string]: unknown;
3648
+ };
3649
+ content: {
3650
+ "application/json": components["schemas"]["Error"];
3651
+ };
3652
+ };
3653
+ /** @description Insufficient permissions */
3654
+ 403: {
3655
+ headers: {
3656
+ [name: string]: unknown;
3657
+ };
3658
+ content: {
3659
+ "application/json": components["schemas"]["Error"];
3660
+ };
3661
+ };
3662
+ /** @description Internal server error */
3663
+ 500: {
3664
+ headers: {
3665
+ [name: string]: unknown;
3666
+ };
3667
+ content: {
3668
+ "application/json": components["schemas"]["Error"];
3669
+ };
3670
+ };
3671
+ };
3672
+ };
3673
+ put?: never;
3674
+ /**
3675
+ * Create an app
3676
+ * @description Create an app. The hostname is {slug}-{shortId}.runtype.run; a client token scoped to that origin is auto-provisioned. Upload a version and activate it to start serving.
3677
+ */
3678
+ post: {
3679
+ parameters: {
3680
+ query?: never;
3681
+ header?: never;
3682
+ path?: never;
3683
+ cookie?: never;
3684
+ };
3685
+ requestBody: {
3686
+ content: {
3687
+ "application/json": {
3688
+ description?: string;
3689
+ name: string;
3690
+ /** @description Hostname slug: lowercase letters, digits, and hyphens; must start with a letter. The app serves at {slug}-{shortId}.runtype.run. */
3691
+ slug: string;
3692
+ /**
3693
+ * @default unlisted
3694
+ * @enum {string}
3695
+ */
3696
+ visibility?: "public" | "unlisted";
3697
+ };
3698
+ };
3699
+ };
3700
+ responses: {
3701
+ /** @description App created */
3702
+ 201: {
3703
+ headers: {
3704
+ [name: string]: unknown;
3705
+ };
3706
+ content: {
3707
+ "application/json": {
3708
+ activeVersionId: string | null;
3709
+ clientTokenId: string | null;
3710
+ createdAt: string;
3711
+ description: string | null;
3712
+ hostname: string;
3713
+ id: string;
3714
+ name: string;
3715
+ shortId: string;
3716
+ slug: string;
3717
+ /** @enum {string} */
3718
+ status: "active" | "suspended";
3719
+ updatedAt: string;
3720
+ url: string;
3721
+ /** @enum {string} */
3722
+ visibility: "public" | "unlisted";
3723
+ };
3724
+ };
3725
+ };
3726
+ /** @description Invalid input */
3727
+ 400: {
3728
+ headers: {
3729
+ [name: string]: unknown;
3730
+ };
3731
+ content: {
3732
+ "application/json": components["schemas"]["Error"];
3733
+ };
3734
+ };
3735
+ /** @description Unauthorized */
3736
+ 401: {
3737
+ headers: {
3738
+ [name: string]: unknown;
3739
+ };
3740
+ content: {
3741
+ "application/json": components["schemas"]["Error"];
3742
+ };
3743
+ };
3744
+ /** @description Plan limit reached */
3745
+ 402: {
3746
+ headers: {
3747
+ [name: string]: unknown;
3748
+ };
3749
+ content: {
3750
+ "application/json": components["schemas"]["Error"];
3751
+ };
3752
+ };
3753
+ /** @description Insufficient permissions */
3754
+ 403: {
3755
+ headers: {
3756
+ [name: string]: unknown;
3757
+ };
3758
+ content: {
3759
+ "application/json": components["schemas"]["Error"];
3760
+ };
3761
+ };
3762
+ /** @description Internal server error */
3763
+ 500: {
3764
+ headers: {
3765
+ [name: string]: unknown;
3766
+ };
3767
+ content: {
3768
+ "application/json": components["schemas"]["Error"];
3769
+ };
3770
+ };
3771
+ };
3772
+ };
3773
+ delete?: never;
3774
+ options?: never;
3775
+ head?: never;
3776
+ patch?: never;
3777
+ trace?: never;
3778
+ };
3779
+ "/v1/apps/{id}": {
3780
+ parameters: {
3781
+ query?: never;
3782
+ header?: never;
3783
+ path?: never;
3784
+ cookie?: never;
3785
+ };
3786
+ /** Get an app */
3787
+ get: {
3788
+ parameters: {
3789
+ query?: never;
3790
+ header?: never;
3791
+ path: {
3792
+ id: string;
3793
+ };
3794
+ cookie?: never;
3795
+ };
3796
+ requestBody?: never;
3797
+ responses: {
3798
+ /** @description App */
3799
+ 200: {
3800
+ headers: {
3801
+ [name: string]: unknown;
3802
+ };
3803
+ content: {
3804
+ "application/json": {
3805
+ activeVersionId: string | null;
3806
+ clientTokenId: string | null;
3807
+ createdAt: string;
3808
+ description: string | null;
3809
+ hostname: string;
3810
+ id: string;
3811
+ name: string;
3812
+ shortId: string;
3813
+ slug: string;
3814
+ /** @enum {string} */
3815
+ status: "active" | "suspended";
3816
+ updatedAt: string;
3817
+ url: string;
3818
+ /** @enum {string} */
3819
+ visibility: "public" | "unlisted";
3820
+ };
3821
+ };
3822
+ };
3823
+ /** @description Invalid id */
3824
+ 400: {
3825
+ headers: {
3826
+ [name: string]: unknown;
3827
+ };
3828
+ content: {
3829
+ "application/json": components["schemas"]["Error"];
3830
+ };
3831
+ };
3832
+ /** @description Unauthorized */
3833
+ 401: {
3834
+ headers: {
3835
+ [name: string]: unknown;
3836
+ };
3837
+ content: {
3838
+ "application/json": components["schemas"]["Error"];
3839
+ };
3840
+ };
3841
+ /** @description Insufficient permissions */
3842
+ 403: {
3843
+ headers: {
3844
+ [name: string]: unknown;
3845
+ };
3846
+ content: {
3847
+ "application/json": components["schemas"]["Error"];
3848
+ };
3849
+ };
3850
+ /** @description Not found */
3851
+ 404: {
3852
+ headers: {
3853
+ [name: string]: unknown;
3854
+ };
3855
+ content: {
3856
+ "application/json": components["schemas"]["Error"];
3857
+ };
3858
+ };
3859
+ };
3860
+ };
3861
+ put?: never;
3862
+ post?: never;
3863
+ /**
3864
+ * Delete an app
3865
+ * @description Delete an app, its versions, and its routing. Stored bundle files are cleaned up in the background; the auto-provisioned client token is deactivated.
3866
+ */
3867
+ delete: {
3868
+ parameters: {
3869
+ query?: never;
3870
+ header?: never;
3871
+ path: {
3872
+ id: string;
3873
+ };
3874
+ cookie?: never;
3875
+ };
3876
+ requestBody?: never;
3877
+ responses: {
3878
+ /** @description Deleted */
3879
+ 200: {
3880
+ headers: {
3881
+ [name: string]: unknown;
3882
+ };
3883
+ content: {
3884
+ "application/json": {
3885
+ success: boolean;
3886
+ };
3887
+ };
3888
+ };
3889
+ /** @description Invalid id */
3890
+ 400: {
3891
+ headers: {
3892
+ [name: string]: unknown;
3893
+ };
3894
+ content: {
3895
+ "application/json": components["schemas"]["Error"];
3896
+ };
3897
+ };
3898
+ /** @description Unauthorized */
3899
+ 401: {
3900
+ headers: {
3901
+ [name: string]: unknown;
3902
+ };
3903
+ content: {
3904
+ "application/json": components["schemas"]["Error"];
3905
+ };
3906
+ };
3907
+ /** @description Insufficient permissions */
3908
+ 403: {
3909
+ headers: {
3910
+ [name: string]: unknown;
3911
+ };
3912
+ content: {
3913
+ "application/json": components["schemas"]["Error"];
3914
+ };
3915
+ };
3916
+ /** @description Not found */
3917
+ 404: {
3918
+ headers: {
3919
+ [name: string]: unknown;
3920
+ };
3921
+ content: {
3922
+ "application/json": components["schemas"]["Error"];
3923
+ };
3924
+ };
3925
+ /** @description Internal server error */
3926
+ 500: {
3927
+ headers: {
3928
+ [name: string]: unknown;
3929
+ };
3930
+ content: {
3931
+ "application/json": components["schemas"]["Error"];
3932
+ };
3933
+ };
3934
+ };
3935
+ };
3936
+ options?: never;
3937
+ head?: never;
3938
+ /**
3939
+ * Update an app
3940
+ * @description Update name, description, visibility, or status. Setting status to suspended makes the edge serve 410 for the app.
3941
+ */
3942
+ patch: {
3943
+ parameters: {
3944
+ query?: never;
3945
+ header?: never;
3946
+ path: {
3947
+ id: string;
3948
+ };
3949
+ cookie?: never;
3950
+ };
3951
+ requestBody: {
3952
+ content: {
3953
+ "application/json": {
3954
+ description?: string | null;
3955
+ name?: string;
3956
+ /** @enum {string} */
3957
+ status?: "active" | "suspended";
3958
+ /** @enum {string} */
3959
+ visibility?: "public" | "unlisted";
3960
+ };
3961
+ };
3962
+ };
3963
+ responses: {
3964
+ /** @description Updated app */
3965
+ 200: {
3966
+ headers: {
3967
+ [name: string]: unknown;
3968
+ };
3969
+ content: {
3970
+ "application/json": {
3971
+ activeVersionId: string | null;
3972
+ clientTokenId: string | null;
3973
+ createdAt: string;
3974
+ description: string | null;
3975
+ hostname: string;
3976
+ id: string;
3977
+ name: string;
3978
+ shortId: string;
3979
+ slug: string;
3980
+ /** @enum {string} */
3981
+ status: "active" | "suspended";
3982
+ updatedAt: string;
3983
+ url: string;
3984
+ /** @enum {string} */
3985
+ visibility: "public" | "unlisted";
3986
+ };
3987
+ };
3988
+ };
3989
+ /** @description Invalid input */
3990
+ 400: {
3991
+ headers: {
3992
+ [name: string]: unknown;
3993
+ };
3994
+ content: {
3995
+ "application/json": components["schemas"]["Error"];
3996
+ };
3997
+ };
3998
+ /** @description Unauthorized */
3999
+ 401: {
4000
+ headers: {
4001
+ [name: string]: unknown;
4002
+ };
4003
+ content: {
4004
+ "application/json": components["schemas"]["Error"];
4005
+ };
4006
+ };
4007
+ /** @description Plan limit reached */
4008
+ 402: {
4009
+ headers: {
4010
+ [name: string]: unknown;
4011
+ };
4012
+ content: {
4013
+ "application/json": components["schemas"]["Error"];
4014
+ };
4015
+ };
4016
+ /** @description Insufficient permissions */
4017
+ 403: {
4018
+ headers: {
4019
+ [name: string]: unknown;
4020
+ };
4021
+ content: {
4022
+ "application/json": components["schemas"]["Error"];
4023
+ };
4024
+ };
4025
+ /** @description Not found */
4026
+ 404: {
4027
+ headers: {
4028
+ [name: string]: unknown;
4029
+ };
4030
+ content: {
4031
+ "application/json": components["schemas"]["Error"];
4032
+ };
4033
+ };
4034
+ /** @description Internal server error */
4035
+ 500: {
4036
+ headers: {
4037
+ [name: string]: unknown;
4038
+ };
4039
+ content: {
4040
+ "application/json": components["schemas"]["Error"];
4041
+ };
4042
+ };
4043
+ };
4044
+ };
4045
+ trace?: never;
4046
+ };
4047
+ "/v1/apps/{id}/activate": {
4048
+ parameters: {
4049
+ query?: never;
4050
+ header?: never;
4051
+ path?: never;
4052
+ cookie?: never;
4053
+ };
4054
+ get?: never;
4055
+ put?: never;
4056
+ /**
4057
+ * Activate an app version
4058
+ * @description Flip the active-version pointer to the given version (deploy or rollback). Syncs the app client token to the manifest capabilities and updates edge routing.
4059
+ */
4060
+ post: {
4061
+ parameters: {
4062
+ query?: never;
4063
+ header?: never;
4064
+ path: {
4065
+ id: string;
4066
+ };
4067
+ cookie?: never;
4068
+ };
4069
+ requestBody: {
4070
+ content: {
4071
+ "application/json": {
4072
+ versionId: string;
4073
+ };
4074
+ };
4075
+ };
4076
+ responses: {
4077
+ /** @description Activated */
4078
+ 200: {
4079
+ headers: {
4080
+ [name: string]: unknown;
4081
+ };
4082
+ content: {
4083
+ "application/json": {
4084
+ app: {
4085
+ activeVersionId: string | null;
4086
+ clientTokenId: string | null;
4087
+ createdAt: string;
4088
+ description: string | null;
4089
+ hostname: string;
4090
+ id: string;
4091
+ name: string;
4092
+ shortId: string;
4093
+ slug: string;
4094
+ /** @enum {string} */
4095
+ status: "active" | "suspended";
4096
+ updatedAt: string;
4097
+ url: string;
4098
+ /** @enum {string} */
4099
+ visibility: "public" | "unlisted";
4100
+ };
4101
+ version: {
4102
+ appId: string;
4103
+ bundleHash: string;
4104
+ createdAt: string;
4105
+ createdBy: string;
4106
+ fileCount: number;
4107
+ id: string;
4108
+ manifest: {
4109
+ /** @enum {string} */
4110
+ auth: "none" | "optional" | "required";
4111
+ capabilities: {
4112
+ agents: string[];
4113
+ flows: string[];
4114
+ };
4115
+ data: {
4116
+ /** @enum {string} */
4117
+ access: "read" | "read-write";
4118
+ namespace: string;
4119
+ }[];
4120
+ description?: string;
4121
+ name: string;
4122
+ };
4123
+ sizeBytes: number;
4124
+ /** @enum {string} */
4125
+ status: "uploaded" | "active" | "superseded";
4126
+ versionNumber: number;
4127
+ };
4128
+ };
4129
+ };
4130
+ };
4131
+ /** @description Invalid input */
4132
+ 400: {
4133
+ headers: {
4134
+ [name: string]: unknown;
4135
+ };
4136
+ content: {
4137
+ "application/json": components["schemas"]["Error"];
4138
+ };
4139
+ };
4140
+ /** @description Unauthorized */
4141
+ 401: {
4142
+ headers: {
4143
+ [name: string]: unknown;
4144
+ };
4145
+ content: {
4146
+ "application/json": components["schemas"]["Error"];
4147
+ };
4148
+ };
4149
+ /** @description Insufficient permissions */
4150
+ 403: {
4151
+ headers: {
4152
+ [name: string]: unknown;
4153
+ };
4154
+ content: {
4155
+ "application/json": components["schemas"]["Error"];
4156
+ };
4157
+ };
4158
+ /** @description Not found */
4159
+ 404: {
4160
+ headers: {
4161
+ [name: string]: unknown;
4162
+ };
4163
+ content: {
4164
+ "application/json": components["schemas"]["Error"];
4165
+ };
4166
+ };
4167
+ /** @description Internal server error */
4168
+ 500: {
4169
+ headers: {
4170
+ [name: string]: unknown;
4171
+ };
4172
+ content: {
4173
+ "application/json": components["schemas"]["Error"];
4174
+ };
4175
+ };
4176
+ };
4177
+ };
4178
+ delete?: never;
4179
+ options?: never;
4180
+ head?: never;
4181
+ patch?: never;
4182
+ trace?: never;
4183
+ };
4184
+ "/v1/apps/{id}/versions": {
3020
4185
  parameters: {
3021
4186
  query?: never;
3022
4187
  header?: never;
@@ -3024,93 +4189,58 @@ interface paths {
3024
4189
  cookie?: never;
3025
4190
  };
3026
4191
  /**
3027
- * Get record results
3028
- * @description Get all record results for the current user with filtering and pagination. When a `days` parameter is provided, returns aggregated daily execution analytics instead of paginated results.
4192
+ * List an app's versions
4193
+ * @description List all versions of an app, newest first.
3029
4194
  */
3030
4195
  get: {
3031
4196
  parameters: {
3032
- query?: {
3033
- days?: string;
3034
- page?: string;
3035
- limit?: string;
3036
- status?: string;
3037
- cursor?: string;
3038
- };
4197
+ query?: never;
3039
4198
  header?: never;
3040
- path?: never;
4199
+ path: {
4200
+ id: string;
4201
+ };
3041
4202
  cookie?: never;
3042
4203
  };
3043
4204
  requestBody?: never;
3044
4205
  responses: {
3045
- /** @description Record results or aggregated daily analytics */
4206
+ /** @description Versions */
3046
4207
  200: {
3047
4208
  headers: {
3048
4209
  [name: string]: unknown;
3049
4210
  };
3050
4211
  content: {
3051
4212
  "application/json": {
3052
- dailyExecutions: {
3053
- date: string;
3054
- failedExecutions: number | string;
3055
- flowsFailure: number | string;
3056
- flowsSuccess: number | string;
3057
- promptsFailure: number | string;
3058
- promptsSuccess: number | string;
3059
- successfulExecutions: number | string;
3060
- totalExecutions: number | string;
3061
- }[];
3062
- period: {
3063
- days: number;
3064
- endDate: string;
3065
- startDate: string;
3066
- };
3067
- summary: {
3068
- failedExecutions: number;
3069
- flowExecutions: number;
3070
- promptExecutions: number;
3071
- successRate: number;
3072
- successfulExecutions: number;
3073
- totalExecutions: number;
3074
- };
3075
- } | {
3076
4213
  data: {
3077
- pagination: {
3078
- hasNextPage: boolean;
3079
- hasPrevPage: boolean;
3080
- limit: number;
3081
- nextCursor: string | null;
3082
- page: number;
3083
- total: number;
3084
- totalPages: number;
4214
+ appId: string;
4215
+ bundleHash: string;
4216
+ createdAt: string;
4217
+ createdBy: string;
4218
+ fileCount: number;
4219
+ id: string;
4220
+ manifest: {
4221
+ /** @enum {string} */
4222
+ auth: "none" | "optional" | "required";
4223
+ capabilities: {
4224
+ agents: string[];
4225
+ flows: string[];
4226
+ };
4227
+ data: {
4228
+ /** @enum {string} */
4229
+ access: "read" | "read-write";
4230
+ namespace: string;
4231
+ }[];
4232
+ description?: string;
4233
+ name: string;
3085
4234
  };
3086
- results: {
3087
- completionTokens: number | null;
3088
- createdAt: string;
3089
- estimatedCost: string | null;
3090
- executionTimeMs: number | null;
3091
- flowId: string | null;
3092
- flowName: string | null;
3093
- id: string;
3094
- modelUsed: string | null;
3095
- promptId: string | null;
3096
- promptName: string | null;
3097
- promptResponseFormat: string | null;
3098
- promptText: string | null;
3099
- promptTokens: number | null;
3100
- recordId: string;
3101
- recordName: string;
3102
- recordType: string;
3103
- result: string | null;
3104
- status: string;
3105
- totalTokens: number | null;
3106
- }[];
3107
- };
3108
- /** @enum {boolean} */
3109
- success: true;
4235
+ sizeBytes: number;
4236
+ /** @enum {string} */
4237
+ status: "uploaded" | "active" | "superseded";
4238
+ versionNumber: number;
4239
+ }[];
3110
4240
  };
3111
4241
  };
3112
4242
  };
3113
- /** @description Validation error */
4243
+ /** @description Invalid id */
3114
4244
  400: {
3115
4245
  headers: {
3116
4246
  [name: string]: unknown;
@@ -3137,8 +4267,8 @@ interface paths {
3137
4267
  "application/json": components["schemas"]["Error"];
3138
4268
  };
3139
4269
  };
3140
- /** @description Internal server error */
3141
- 500: {
4270
+ /** @description Not found */
4271
+ 404: {
3142
4272
  headers: {
3143
4273
  [name: string]: unknown;
3144
4274
  };
@@ -3149,60 +4279,80 @@ interface paths {
3149
4279
  };
3150
4280
  };
3151
4281
  put?: never;
3152
- post?: never;
3153
- delete?: never;
3154
- options?: never;
3155
- head?: never;
3156
- patch?: never;
3157
- trace?: never;
3158
- };
3159
- "/v1/analytics/stats": {
3160
- parameters: {
3161
- query?: never;
3162
- header?: never;
3163
- path?: never;
3164
- cookie?: never;
3165
- };
3166
4282
  /**
3167
- * Get analytics stats
3168
- * @description Get user analytics stats (records, prompts, flows, executions, evals, agents, products count). Supports optional `from` and `to` date filters.
4283
+ * Upload an app version
4284
+ * @description Upload a zip bundle as a new version. The bundle must contain index.html and runtype.app.json at the root. Uploading does not change what is served; call activate to deploy.
3169
4285
  */
3170
- get: {
4286
+ post: {
3171
4287
  parameters: {
3172
- query?: {
3173
- from?: string;
3174
- to?: string;
3175
- };
4288
+ query?: never;
3176
4289
  header?: never;
3177
- path?: never;
4290
+ path: {
4291
+ id: string;
4292
+ };
3178
4293
  cookie?: never;
3179
4294
  };
3180
- requestBody?: never;
4295
+ /** @description The app bundle: either a raw zip archive (application/zip) or JSON file maps (application/json) that the API zips server-side. */
4296
+ requestBody: {
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
+ };
4308
+ "application/zip": string;
4309
+ };
4310
+ };
3181
4311
  responses: {
3182
- /** @description Analytics stats */
3183
- 200: {
4312
+ /** @description Version uploaded */
4313
+ 201: {
3184
4314
  headers: {
3185
4315
  [name: string]: unknown;
3186
4316
  };
3187
4317
  content: {
3188
4318
  "application/json": {
3189
- data: {
3190
- totalAgents: number;
3191
- totalEvals: number;
3192
- totalExecutions: number;
3193
- totalFlows: number;
3194
- totalProducts: number;
3195
- totalPrompts: number;
3196
- totalRecords: number;
3197
- };
3198
- filters: {
3199
- from: string | null;
3200
- to: string | null;
4319
+ appId: string;
4320
+ bundleHash: string;
4321
+ createdAt: string;
4322
+ createdBy: string;
4323
+ fileCount: number;
4324
+ id: string;
4325
+ manifest: {
4326
+ /** @enum {string} */
4327
+ auth: "none" | "optional" | "required";
4328
+ capabilities: {
4329
+ agents: string[];
4330
+ flows: string[];
4331
+ };
4332
+ data: {
4333
+ /** @enum {string} */
4334
+ access: "read" | "read-write";
4335
+ namespace: string;
4336
+ }[];
4337
+ description?: string;
4338
+ name: string;
3201
4339
  };
3202
- generatedAt: string;
4340
+ sizeBytes: number;
4341
+ /** @enum {string} */
4342
+ status: "uploaded" | "active" | "superseded";
4343
+ versionNumber: number;
3203
4344
  };
3204
4345
  };
3205
4346
  };
4347
+ /** @description Invalid bundle */
4348
+ 400: {
4349
+ headers: {
4350
+ [name: string]: unknown;
4351
+ };
4352
+ content: {
4353
+ "application/json": components["schemas"]["Error"];
4354
+ };
4355
+ };
3206
4356
  /** @description Unauthorized */
3207
4357
  401: {
3208
4358
  headers: {
@@ -3212,6 +4362,15 @@ interface paths {
3212
4362
  "application/json": components["schemas"]["Error"];
3213
4363
  };
3214
4364
  };
4365
+ /** @description Plan limit reached */
4366
+ 402: {
4367
+ headers: {
4368
+ [name: string]: unknown;
4369
+ };
4370
+ content: {
4371
+ "application/json": components["schemas"]["Error"];
4372
+ };
4373
+ };
3215
4374
  /** @description Insufficient permissions */
3216
4375
  403: {
3217
4376
  headers: {
@@ -3221,6 +4380,24 @@ interface paths {
3221
4380
  "application/json": components["schemas"]["Error"];
3222
4381
  };
3223
4382
  };
4383
+ /** @description Not found */
4384
+ 404: {
4385
+ headers: {
4386
+ [name: string]: unknown;
4387
+ };
4388
+ content: {
4389
+ "application/json": components["schemas"]["Error"];
4390
+ };
4391
+ };
4392
+ /** @description Manifest uses reserved features */
4393
+ 422: {
4394
+ headers: {
4395
+ [name: string]: unknown;
4396
+ };
4397
+ content: {
4398
+ "application/json": components["schemas"]["Error"];
4399
+ };
4400
+ };
3224
4401
  /** @description Internal server error */
3225
4402
  500: {
3226
4403
  headers: {
@@ -3230,10 +4407,17 @@ interface paths {
3230
4407
  "application/json": components["schemas"]["Error"];
3231
4408
  };
3232
4409
  };
4410
+ /** @description App storage not configured */
4411
+ 503: {
4412
+ headers: {
4413
+ [name: string]: unknown;
4414
+ };
4415
+ content: {
4416
+ "application/json": components["schemas"]["Error"];
4417
+ };
4418
+ };
3233
4419
  };
3234
4420
  };
3235
- put?: never;
3236
- post?: never;
3237
4421
  delete?: never;
3238
4422
  options?: never;
3239
4423
  head?: never;
@@ -3428,7 +4612,7 @@ interface paths {
3428
4612
  };
3429
4613
  /**
3430
4614
  * Get current user info
3431
- * @description Get the current user and organization info from the Clerk session.
4615
+ * @description Get the current user and organization info for the authenticated caller (Clerk session or API key).
3432
4616
  */
3433
4617
  get: {
3434
4618
  parameters: {
@@ -9337,8 +10521,134 @@ interface paths {
9337
10521
  };
9338
10522
  put?: never;
9339
10523
  /**
9340
- * Create flow
9341
- * @description Create a new flow with step definitions.
10524
+ * Create flow
10525
+ * @description Create a new flow with step definitions.
10526
+ */
10527
+ post: {
10528
+ parameters: {
10529
+ query?: never;
10530
+ header?: never;
10531
+ path?: never;
10532
+ cookie?: never;
10533
+ };
10534
+ requestBody?: {
10535
+ content: {
10536
+ "application/json": {
10537
+ flowSteps?: {
10538
+ config?: unknown;
10539
+ /** @default true */
10540
+ enabled?: boolean;
10541
+ id?: string;
10542
+ name: string;
10543
+ order?: number;
10544
+ /** @enum {string} */
10545
+ type: "prompt" | "crawl" | "fetch-url" | "retrieve-record" | "fetch-github" | "api-call" | "transform-data" | "template" | "conditional" | "set-variable" | "upsert-record" | "send-email" | "send-text" | "send-event" | "send-stream" | "update-record" | "search" | "generate-embedding" | "vector-search" | "tool-call" | "wait-until" | "paginate-api" | "store-vector" | "execute-agent" | "store-asset" | "generate-pdf" | "save-memory" | "recall-memory" | "memory-summary";
10546
+ when?: string;
10547
+ }[];
10548
+ name: string;
10549
+ steps?: {
10550
+ config?: unknown;
10551
+ /** @default true */
10552
+ enabled?: boolean;
10553
+ id?: string;
10554
+ name: string;
10555
+ order?: number;
10556
+ /** @enum {string} */
10557
+ type: "prompt" | "crawl" | "fetch-url" | "retrieve-record" | "fetch-github" | "api-call" | "transform-data" | "template" | "conditional" | "set-variable" | "upsert-record" | "send-email" | "send-text" | "send-event" | "send-stream" | "update-record" | "search" | "generate-embedding" | "vector-search" | "tool-call" | "wait-until" | "paginate-api" | "store-vector" | "execute-agent" | "store-asset" | "generate-pdf" | "save-memory" | "recall-memory" | "memory-summary";
10558
+ when?: string;
10559
+ }[];
10560
+ };
10561
+ };
10562
+ };
10563
+ responses: {
10564
+ /** @description Created flow */
10565
+ 201: {
10566
+ headers: {
10567
+ [name: string]: unknown;
10568
+ };
10569
+ content: {
10570
+ "application/json": {
10571
+ createdAt: string;
10572
+ dashboardUrl?: string;
10573
+ flowSteps: {
10574
+ config?: {
10575
+ [key: string]: unknown;
10576
+ };
10577
+ enabled?: boolean;
10578
+ id: string;
10579
+ name?: string;
10580
+ order?: number;
10581
+ type: string;
10582
+ }[];
10583
+ id: string;
10584
+ lastRunAt?: string | null;
10585
+ name: string;
10586
+ organizationId: string | null;
10587
+ sampleMetadata?: {
10588
+ [key: string]: unknown;
10589
+ };
10590
+ stepCount?: number;
10591
+ updatedAt: string;
10592
+ userId: string;
10593
+ };
10594
+ };
10595
+ };
10596
+ /** @description Validation error */
10597
+ 400: {
10598
+ headers: {
10599
+ [name: string]: unknown;
10600
+ };
10601
+ content: {
10602
+ "application/json": components["schemas"]["Error"];
10603
+ };
10604
+ };
10605
+ /** @description Unauthorized */
10606
+ 401: {
10607
+ headers: {
10608
+ [name: string]: unknown;
10609
+ };
10610
+ content: {
10611
+ "application/json": components["schemas"]["Error"];
10612
+ };
10613
+ };
10614
+ /** @description Insufficient permissions */
10615
+ 403: {
10616
+ headers: {
10617
+ [name: string]: unknown;
10618
+ };
10619
+ content: {
10620
+ "application/json": components["schemas"]["Error"];
10621
+ };
10622
+ };
10623
+ /** @description Internal server error */
10624
+ 500: {
10625
+ headers: {
10626
+ [name: string]: unknown;
10627
+ };
10628
+ content: {
10629
+ "application/json": components["schemas"]["Error"];
10630
+ };
10631
+ };
10632
+ };
10633
+ };
10634
+ delete?: never;
10635
+ options?: never;
10636
+ head?: never;
10637
+ patch?: never;
10638
+ trace?: never;
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.
9342
10652
  */
9343
10653
  post: {
9344
10654
  parameters: {
@@ -9350,63 +10660,38 @@ interface paths {
9350
10660
  requestBody?: {
9351
10661
  content: {
9352
10662
  "application/json": {
9353
- flowSteps?: {
9354
- config?: unknown;
9355
- /** @default true */
9356
- enabled?: boolean;
9357
- id?: string;
10663
+ contentHash?: string;
10664
+ definition?: {
9358
10665
  name: string;
9359
- order?: number;
9360
- /** @enum {string} */
9361
- type: "prompt" | "crawl" | "fetch-url" | "retrieve-record" | "fetch-github" | "api-call" | "transform-data" | "template" | "conditional" | "set-variable" | "upsert-record" | "send-email" | "send-text" | "send-event" | "send-stream" | "update-record" | "search" | "generate-embedding" | "vector-search" | "tool-call" | "wait-until" | "paginate-api" | "store-vector" | "execute-agent" | "store-asset" | "generate-pdf" | "save-memory" | "recall-memory" | "memory-summary";
9362
- when?: string;
9363
- }[];
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;
9364
10679
  name: string;
9365
- steps?: {
9366
- config?: unknown;
9367
- /** @default true */
9368
- enabled?: boolean;
9369
- id?: string;
9370
- name: string;
9371
- order?: number;
9372
- /** @enum {string} */
9373
- type: "prompt" | "crawl" | "fetch-url" | "retrieve-record" | "fetch-github" | "api-call" | "transform-data" | "template" | "conditional" | "set-variable" | "upsert-record" | "send-email" | "send-text" | "send-event" | "send-stream" | "update-record" | "search" | "generate-embedding" | "vector-search" | "tool-call" | "wait-until" | "paginate-api" | "store-vector" | "execute-agent" | "store-asset" | "generate-pdf" | "save-memory" | "recall-memory" | "memory-summary";
9374
- when?: string;
9375
- }[];
10680
+ /** @enum {string} */
10681
+ onConflict?: "error" | "overwrite";
10682
+ /** @enum {string} */
10683
+ release?: "none" | "publish";
9376
10684
  };
9377
10685
  };
9378
10686
  };
9379
10687
  responses: {
9380
- /** @description Created flow */
9381
- 201: {
10688
+ /** @description Converge result: unchanged | created | updated | definitionRequired (hash miss — retry with the full definition) | plan (dryRun) */
10689
+ 200: {
9382
10690
  headers: {
9383
10691
  [name: string]: unknown;
9384
10692
  };
9385
10693
  content: {
9386
- "application/json": {
9387
- createdAt: string;
9388
- dashboardUrl?: string;
9389
- flowSteps: {
9390
- config?: {
9391
- [key: string]: unknown;
9392
- };
9393
- enabled?: boolean;
9394
- id: string;
9395
- name?: string;
9396
- order?: number;
9397
- type: string;
9398
- }[];
9399
- id: string;
9400
- lastRunAt?: string | null;
9401
- name: string;
9402
- organizationId: string | null;
9403
- sampleMetadata?: {
9404
- [key: string]: unknown;
9405
- };
9406
- stepCount?: number;
9407
- updatedAt: string;
9408
- userId: string;
9409
- };
10694
+ "application/json": components["schemas"]["FlowEnsureResponse"];
9410
10695
  };
9411
10696
  };
9412
10697
  /** @description Validation error */
@@ -9436,6 +10721,99 @@ interface paths {
9436
10721
  "application/json": components["schemas"]["Error"];
9437
10722
  };
9438
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
+ };
9439
10817
  /** @description Internal server error */
9440
10818
  500: {
9441
10819
  headers: {
@@ -9447,6 +10825,8 @@ interface paths {
9447
10825
  };
9448
10826
  };
9449
10827
  };
10828
+ put?: never;
10829
+ post?: never;
9450
10830
  delete?: never;
9451
10831
  options?: never;
9452
10832
  head?: never;
@@ -16910,6 +18290,12 @@ interface paths {
16910
18290
  supported: boolean;
16911
18291
  supportsReasoningSummary?: boolean;
16912
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;
16913
18299
  tags: string[];
16914
18300
  uiCategory?: string;
16915
18301
  uiPriority?: number;
@@ -29286,9 +30672,7 @@ interface paths {
29286
30672
  };
29287
30673
  content: {
29288
30674
  "application/json": {
29289
- data: {
29290
- [key: string]: unknown;
29291
- }[];
30675
+ data: components["schemas"]["EnrichedSkillProposal"][];
29292
30676
  };
29293
30677
  };
29294
30678
  };
@@ -29351,7 +30735,7 @@ interface paths {
29351
30735
  };
29352
30736
  content: {
29353
30737
  "application/json": {
29354
- [key: string]: unknown;
30738
+ proposal: components["schemas"]["SkillProposal"];
29355
30739
  };
29356
30740
  };
29357
30741
  };
@@ -29424,7 +30808,7 @@ interface paths {
29424
30808
  };
29425
30809
  content: {
29426
30810
  "application/json": {
29427
- [key: string]: unknown;
30811
+ proposal: components["schemas"]["SkillProposal"];
29428
30812
  };
29429
30813
  };
29430
30814
  };
@@ -29463,12 +30847,16 @@ interface paths {
29463
30847
  };
29464
30848
  /**
29465
30849
  * List skills
29466
- * @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).
29467
30851
  */
29468
30852
  get: {
29469
30853
  parameters: {
29470
30854
  query?: {
29471
30855
  status?: "draft" | "active" | "archived";
30856
+ limit?: string;
30857
+ cursor?: string;
30858
+ direction?: string;
30859
+ includeCount?: string;
29472
30860
  };
29473
30861
  header?: never;
29474
30862
  path?: never;
@@ -29476,7 +30864,7 @@ interface paths {
29476
30864
  };
29477
30865
  requestBody?: never;
29478
30866
  responses: {
29479
- /** @description Skills */
30867
+ /** @description Paginated list of skills */
29480
30868
  200: {
29481
30869
  headers: {
29482
30870
  [name: string]: unknown;
@@ -29486,9 +30874,19 @@ interface paths {
29486
30874
  data: {
29487
30875
  [key: string]: unknown;
29488
30876
  }[];
30877
+ pagination: components["schemas"]["Pagination"];
29489
30878
  };
29490
30879
  };
29491
30880
  };
30881
+ /** @description Invalid parameters */
30882
+ 400: {
30883
+ headers: {
30884
+ [name: string]: unknown;
30885
+ };
30886
+ content: {
30887
+ "application/json": components["schemas"]["Error"];
30888
+ };
30889
+ };
29492
30890
  /** @description Unauthorized */
29493
30891
  401: {
29494
30892
  headers: {
@@ -32644,6 +34042,205 @@ interface components {
32644
34042
  timestamp?: string;
32645
34043
  };
32646
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
+ };
32647
34244
  AgentSSEEvent: {
32648
34245
  agentId: string;
32649
34246
  agentName: string;
@@ -33686,6 +35283,34 @@ interface components {
33686
35283
  } & {
33687
35284
  [key: string]: unknown;
33688
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
+ };
33689
35314
  Error: {
33690
35315
  details?: {
33691
35316
  /** @description Stable Runtype validation code (e.g. MISSING_REQUIRED_FIELD, INVALID_ENUM). */
@@ -33698,6 +35323,62 @@ interface components {
33698
35323
  }[];
33699
35324
  error: string;
33700
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
+ };
33701
35382
  FlowSSEEvent: {
33702
35383
  executionContext?: {
33703
35384
  [key: string]: unknown;
@@ -34083,6 +35764,18 @@ interface components {
34083
35764
  op: "eq" | "neq" | "gt" | "gte" | "lt" | "lte" | "between" | "contains" | "startsWith" | "endsWith" | "in" | "notIn" | "isSet" | "isNotSet" | "isTrue" | "isFalse" | "withinLastDays" | "olderThanDays";
34084
35765
  value?: unknown;
34085
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
+ };
34086
35779
  UpdateUserProfileResponse: {
34087
35780
  email?: string;
34088
35781
  firstName?: string;
@@ -35412,6 +37105,9 @@ interface ModelConfig {
35412
37105
  supportsStreaming?: boolean;
35413
37106
  supportedResponseFormats?: string[];
35414
37107
  supportsSearch?: boolean;
37108
+ supportsVision?: boolean;
37109
+ supportsToolUse?: boolean;
37110
+ supportsReasoning?: boolean;
35415
37111
  isEnabled: boolean;
35416
37112
  isDefault: boolean;
35417
37113
  settings: JsonObject;
@@ -36264,6 +37960,151 @@ interface BillingSpendAnalyticsParams {
36264
37960
  days?: number;
36265
37961
  }
36266
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
+
36267
38108
  /**
36268
38109
  * FlowsNamespace - Static namespace for flow operations
36269
38110
  *
@@ -36325,8 +38166,11 @@ declare class FlowsNamespace {
36325
38166
  /**
36326
38167
  * Create or update a flow by name (upsert mode)
36327
38168
  *
36328
- * The recommended pattern for code-first flow management.
36329
- * 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).
36330
38174
  *
36331
38175
  * @example
36332
38176
  * ```typescript
@@ -36339,6 +38183,29 @@ declare class FlowsNamespace {
36339
38183
  * ```
36340
38184
  */
36341
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>;
36342
38209
  /**
36343
38210
  * Create a virtual flow (one-off, not saved)
36344
38211
  *
@@ -37338,6 +39205,58 @@ interface SkillProposal {
37338
39205
  reviewedAt: string | null;
37339
39206
  rejectionReason: string | null;
37340
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>;
37341
39260
  }
37342
39261
  /**
37343
39262
  * Create/update a skill from a raw SKILL.md document. The frontmatter +
@@ -37375,6 +39294,37 @@ interface SkillWithVersion {
37375
39294
  skill: Skill;
37376
39295
  version: SkillVersion;
37377
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
+ }
37378
39328
  /**
37379
39329
  * The admin review queue for agent-authored skill proposals. This is the human
37380
39330
  * review surface for the deployed-agent data plane — listing, approving, and
@@ -37436,15 +39386,26 @@ declare class SkillsNamespace {
37436
39386
  create(input: SkillWriteInput): Promise<SkillWithVersion>;
37437
39387
  /**
37438
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.
37439
39391
  *
37440
39392
  * @example
37441
39393
  * ```typescript
37442
39394
  * const active = await Runtype.skills.list({ status: 'active' })
37443
39395
  * ```
37444
39396
  */
37445
- list(params?: {
37446
- status?: SkillStatus;
37447
- }): 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>;
37448
39409
  /**
37449
39410
  * Get a skill and its full version history.
37450
39411
  *
@@ -37509,6 +39470,246 @@ declare class SkillsNamespace {
37509
39470
  listBindings(agentId: string): Promise<AgentSkillBinding[]>;
37510
39471
  }
37511
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
+
37512
39713
  /**
37513
39714
  * Runtype - The unified SDK client for building and executing flows, batches, evals, and prompts
37514
39715
  *
@@ -37760,6 +39961,30 @@ declare class Runtype {
37760
39961
  * ```
37761
39962
  */
37762
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;
37763
39988
  }
37764
39989
 
37765
39990
  /**
@@ -38111,6 +40336,7 @@ interface ApiClient {
38111
40336
  patch<T>(path: string, data?: any): Promise<T>;
38112
40337
  delete<T>(path: string, data?: any): Promise<T>;
38113
40338
  postFormData<T>(path: string, formData: FormData): Promise<T>;
40339
+ postBinary<T>(path: string, body: Uint8Array, contentType: string): Promise<T>;
38114
40340
  requestStream(path: string, options?: RequestInit): Promise<Response>;
38115
40341
  }
38116
40342
  /**
@@ -39355,6 +41581,20 @@ interface LocalToolExecutionLoopSnapshot {
39355
41581
  }
39356
41582
  interface ExecuteWithLocalToolsOptions {
39357
41583
  onLocalToolResult?: (snapshot: LocalToolExecutionLoopSnapshot) => AgentCompleteEvent | null | undefined;
41584
+ /**
41585
+ * Polled after each local tool execution. Returning true ends the session
41586
+ * early (synthetic `agent_complete`) so queued user steering can be
41587
+ * delivered at the next session boundary instead of after the full session.
41588
+ */
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;
39358
41598
  }
39359
41599
  /**
39360
41600
  * Status of a long-task agent run
@@ -39417,6 +41657,14 @@ interface RunTaskSessionSummary {
39417
41657
  /** ISO timestamp when this session completed */
39418
41658
  completedAt: string;
39419
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
+ }
39420
41668
  /**
39421
41669
  * Accumulated state for a long-task agent run.
39422
41670
  * This is both the in-memory state and the record metadata shape.
@@ -39495,10 +41743,19 @@ interface RunTaskState {
39495
41743
  lastCompletionRejectionReason?: string;
39496
41744
  /** Number of consecutive sessions with no tool actions (for stall detection) */
39497
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;
39498
41755
  /** Arbitrary bag for workflow-specific data */
39499
41756
  workflowState?: Record<string, unknown>;
39500
41757
  }
39501
- 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'>;
39502
41759
  /**
39503
41760
  * Callback invoked after each session completes.
39504
41761
  * Return `false` to stop the loop early.
@@ -39513,6 +41770,12 @@ interface RunTaskContextBudgetBreakdown {
39513
41770
  summaryTokens?: number;
39514
41771
  reservedOutputTokens?: number;
39515
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;
39516
41779
  estimatedInputTokens: number;
39517
41780
  }
39518
41781
  interface RunTaskContextCompactionEvent {
@@ -39610,6 +41873,29 @@ interface RunTaskOptions {
39610
41873
  workflow?: WorkflowDefinition;
39611
41874
  /** IDs of built-in tools to enable for the agent (e.g., "exa", "firecrawl", "dalle") */
39612
41875
  toolIds?: string[];
41876
+ /**
41877
+ * Mid-run steering queue: called at every session boundary; returned
41878
+ * messages are DRAINED and injected as user steering at the start of the
41879
+ * next session's context. Pair with `hasQueuedUserMessages` to also end
41880
+ * in-flight sessions early at the next local-tool pause.
41881
+ */
41882
+ getQueuedUserMessages?: () => string[] | undefined;
41883
+ /**
41884
+ * Non-draining peek at the steering queue. When it returns true after a
41885
+ * local tool executes, the current session ends early (synthetic
41886
+ * `agent_complete`) so the queued steering is delivered within seconds
41887
+ * instead of after the session completes.
41888
+ */
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;
39613
41899
  }
39614
41900
  /**
39615
41901
  * Final result returned by `agents.runTask()`
@@ -39731,7 +42017,9 @@ declare class AgentsEndpoint {
39731
42017
  * // ...
39732
42018
  * ```
39733
42019
  */
39734
- executeStream(id: string, data: AgentExecuteRequest): Promise<Response>;
42020
+ executeStream(id: string, data: AgentExecuteRequest, init?: {
42021
+ signal?: AbortSignal;
42022
+ }): Promise<Response>;
39735
42023
  /**
39736
42024
  * Execute an agent with streaming and callbacks
39737
42025
  *
@@ -39811,10 +42099,21 @@ declare class AgentsEndpoint {
39811
42099
  private normalizeCandidatePath;
39812
42100
  private dedupeNormalizedCandidatePaths;
39813
42101
  /**
39814
- * Compact old tool results based on context mode and window setting.
39815
- * 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.
39816
42115
  */
39817
- private compactToolResults;
42116
+ private deriveToolContextMessages;
39818
42117
  private compactOneResult;
39819
42118
  private isMarathonArtifactPath;
39820
42119
  private isDiscoveryToolName;
@@ -39880,6 +42179,7 @@ declare class AgentsEndpoint {
39880
42179
  private resolveCompactStrategy;
39881
42180
  private estimateTextTokens;
39882
42181
  private estimateUnknownTokens;
42182
+ private extractDeclaredToolResultChars;
39883
42183
  private estimateMessageContentTokens;
39884
42184
  private estimateToolCallTokens;
39885
42185
  private estimateToolResultTokens;
@@ -39890,13 +42190,13 @@ declare class AgentsEndpoint {
39890
42190
  private loadBuiltinToolSchemas;
39891
42191
  private buildDefaultCompactInstructions;
39892
42192
  private resolveCompactInstructions;
42193
+ private extractArtifactReferencesFromMessages;
39893
42194
  private extractArtifactReferences;
39894
42195
  private buildContextBudgetBreakdown;
39895
42196
  private emitContextCompactionEvent;
39896
42197
  private emitContextNotice;
39897
42198
  private buildCompactHistoryMessagesWithLifecycle;
39898
42199
  private buildCompactHistoryMessages;
39899
- private isCompactHistoryMessageSet;
39900
42200
  /**
39901
42201
  * Generate a compact summary of prior work for continuation context.
39902
42202
  * Used when compact mode is enabled to keep token usage low.
@@ -40235,6 +42535,103 @@ declare class BillingEndpoint {
40235
42535
  */
40236
42536
  getSpendAnalytics(params?: BillingSpendAnalyticsParams): Promise<Record<string, unknown>>;
40237
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
+ }
40238
42635
 
40239
42636
  /**
40240
42637
  * @layer sdk
@@ -40314,6 +42711,7 @@ declare class RuntypeClient implements ApiClient {
40314
42711
  clientTokens: ClientTokensEndpoint;
40315
42712
  agents: AgentsEndpoint;
40316
42713
  secrets: SecretsEndpoint;
42714
+ apps: AppsEndpoint;
40317
42715
  schedules: SchedulesEndpoint;
40318
42716
  surfaces: SurfacesEndpoint;
40319
42717
  conversations: ConversationsEndpoint;
@@ -40371,6 +42769,10 @@ declare class RuntypeClient implements ApiClient {
40371
42769
  * POST request with FormData support for file uploads
40372
42770
  */
40373
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>;
40374
42776
  /**
40375
42777
  * Generic request that returns raw Response for streaming
40376
42778
  */
@@ -40419,6 +42821,50 @@ declare class RuntypeApiError extends Error {
40419
42821
  */
40420
42822
  declare function createClient(config?: ClientConfig): RuntypeClient;
40421
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
+
40422
42868
  /**
40423
42869
  * SSE Stream Utilities for FlowBuilder
40424
42870
  *
@@ -41574,4 +44020,4 @@ declare function getLikelySupportingCandidatePaths(bestCandidatePath: string | u
41574
44020
  declare function getDefaultPlanPath(taskName: string): string;
41575
44021
  declare function sanitizeTaskSlug(taskName: string): string;
41576
44022
 
41577
- 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 };