@yielded/agent-platform-cloudflare 0.1.0-beta.173 → 0.1.0-beta.174

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.
Files changed (70) hide show
  1. package/dist/{Alarm-BMEAZo3p.mjs → Alarm-4J9B8Fg8.mjs} +54 -32
  2. package/dist/Alarm-4J9B8Fg8.mjs.map +1 -0
  3. package/dist/Alarm.mjs +1 -1
  4. package/dist/BrowserRestCapture.mjs.map +1 -1
  5. package/dist/BrowserRestCrawl.mjs.map +1 -1
  6. package/dist/{BrowserSession-Bx0V1-6_.d.mts → BrowserSession-Cojp7nth.d.mts} +3 -2
  7. package/dist/{BrowserSession-BfNmyayH.mjs → BrowserSession-aovMjfL4.mjs} +14 -14
  8. package/dist/BrowserSession-aovMjfL4.mjs.map +1 -0
  9. package/dist/BrowserSession.d.mts +1 -1
  10. package/dist/BrowserSession.mjs +2 -2
  11. package/dist/BrowserUse.d.mts +40 -64
  12. package/dist/BrowserUse.mjs +223 -2
  13. package/dist/BrowserUse.mjs.map +1 -0
  14. package/dist/CloudflareBrowser-Vt8qTdYW.mjs.map +1 -1
  15. package/dist/CloudflareCodeMode.mjs.map +1 -1
  16. package/dist/CloudflareScheduling.mjs +9 -9
  17. package/dist/CloudflareScheduling.mjs.map +1 -1
  18. package/dist/CloudflareSubscriptions.mjs +15 -15
  19. package/dist/CloudflareSubscriptions.mjs.map +1 -1
  20. package/dist/{CloudflareThreadClient-DgZVrZzF.mjs → CloudflareThreadClient-DU548EEj.mjs} +42 -39
  21. package/dist/CloudflareThreadClient-DU548EEj.mjs.map +1 -0
  22. package/dist/{CloudflareThreadClient-HO_3rkM7.d.mts → CloudflareThreadClient-lTm6baDP.d.mts} +362 -362
  23. package/dist/CloudflareThreadClient.d.mts +1 -1
  24. package/dist/CloudflareThreadClient.mjs +1 -1
  25. package/dist/{InteractiveBrowser-LdKzQeLR.mjs → InteractiveBrowser-BHNlwjZL.mjs} +40 -31
  26. package/dist/InteractiveBrowser-BHNlwjZL.mjs.map +1 -0
  27. package/dist/InteractiveBrowser.mjs +1 -1
  28. package/dist/{ThreadObject-CRbLbdXM.d.mts → ThreadObject-BLYgzcdT.d.mts} +15 -15
  29. package/dist/{ThreadObject-CGIaz6Jv.mjs → ThreadObject-C2LF3btz.mjs} +13 -14
  30. package/dist/ThreadObject-C2LF3btz.mjs.map +1 -0
  31. package/dist/ThreadObject.d.mts +1 -1
  32. package/dist/ThreadObject.mjs +1 -1
  33. package/dist/WakeScheduler.d.mts +1 -1
  34. package/dist/WakeScheduler.mjs +8 -3
  35. package/dist/WakeScheduler.mjs.map +1 -1
  36. package/dist/index.d.mts +3 -3
  37. package/dist/index.mjs +5 -5
  38. package/dist/{prepared-admission-CSdzFM_v.mjs → prepared-admission-BoUPHSNQ.mjs} +2 -2
  39. package/dist/{prepared-admission-CSdzFM_v.mjs.map → prepared-admission-BoUPHSNQ.mjs.map} +1 -1
  40. package/package.json +1 -1
  41. package/src/Alarm.ts +82 -39
  42. package/src/BrowserRestCapture.ts +1 -0
  43. package/src/BrowserRestCrawl.ts +1 -0
  44. package/src/BrowserSession.ts +3 -2
  45. package/src/BrowserUse.ts +287 -1504
  46. package/src/CloudflareCodeMode.ts +6 -0
  47. package/src/CloudflareScheduling.ts +103 -103
  48. package/src/CloudflareSubscriptions.ts +192 -199
  49. package/src/CloudflareThreadClient.ts +256 -268
  50. package/src/InteractiveBrowser.ts +43 -17
  51. package/src/ThreadObject.ts +35 -24
  52. package/src/WakeScheduler.ts +12 -9
  53. package/src/internal/browser-binding.ts +8 -0
  54. package/src/internal/browser-credentials.ts +18 -13
  55. package/src/internal/browser-file-selection.ts +13 -2
  56. package/src/internal/browser-quick-action.ts +1 -0
  57. package/src/internal/browser-session-lifecycle.ts +32 -36
  58. package/src/internal/due-queue.ts +38 -19
  59. package/src/internal/layers.ts +53 -53
  60. package/dist/Alarm-BMEAZo3p.mjs.map +0 -1
  61. package/dist/BrowserSession-BfNmyayH.mjs.map +0 -1
  62. package/dist/BrowserUse-Bc2JdLW2.mjs +0 -1528
  63. package/dist/BrowserUse-Bc2JdLW2.mjs.map +0 -1
  64. package/dist/CloudflareThreadClient-DgZVrZzF.mjs.map +0 -1
  65. package/dist/InteractiveBrowser-LdKzQeLR.mjs.map +0 -1
  66. package/dist/ThreadObject-CGIaz6Jv.mjs.map +0 -1
  67. package/dist/page-function-CmUCcyNP.mjs +0 -11
  68. package/dist/page-function-CmUCcyNP.mjs.map +0 -1
  69. package/src/internal/browser-dom.ts +0 -886
  70. package/src/internal/browser-jev-dom.ts +0 -362
@@ -599,13 +599,13 @@ declare const encodeUnknownResolutionCommand: (input: UnknownResolutionCommand,
599
599
  readonly author: string;
600
600
  readonly reason: string;
601
601
  readonly resolution: {
602
- readonly _tag: "SafeToRetry";
603
- } | {
604
602
  readonly _tag: "CompletedWithResult";
605
603
  readonly result: Schema.Json;
606
604
  readonly isFailure: boolean;
607
605
  } | {
608
606
  readonly _tag: "NeverHappened";
607
+ } | {
608
+ readonly _tag: "SafeToRetry";
609
609
  } | {
610
610
  readonly _tag: "AbortSubmission";
611
611
  };
@@ -1024,56 +1024,17 @@ declare const encodeHostResponse: (input: AbortRecorded | ApprovalRecorded | Hos
1024
1024
  readonly summary?: string | undefined;
1025
1025
  readonly handoff?: string | undefined;
1026
1026
  } | {
1027
- readonly _tag: "ThreadCreated";
1028
- readonly agentId: string;
1029
- readonly definitions: {
1030
- readonly agent: string;
1031
- readonly model: string;
1032
- readonly tools: string;
1033
- readonly replay?: {
1034
- readonly agent: string;
1035
- readonly agentBehavior?: string | undefined;
1036
- readonly tools: {
1037
- readonly [x: string]: string;
1038
- };
1039
- } | undefined;
1040
- };
1041
- } | {
1042
- readonly _tag: "RunStarted";
1043
- readonly runId: string;
1044
- readonly policyAccountingVersion: 1;
1045
- readonly maxDurationMillis: number;
1046
- } | {
1047
- readonly _tag: "RunDurationExhausted";
1048
- readonly runId: string;
1049
- } | {
1050
- readonly _tag: "RunPolicyUsageReserved";
1051
- readonly runId: string;
1052
- readonly programmaticToolCalls: number;
1053
- readonly finalizationUsed: boolean;
1054
- } | {
1055
- readonly _tag: "ModelCompleted";
1056
- readonly runId: string;
1057
- readonly output: Schema.Json;
1058
- readonly messages?: Schema.Json | undefined;
1059
- readonly history?: Schema.Json | undefined;
1060
- } | {
1061
- readonly _tag: "ToolCallSettled";
1062
- readonly toolSelection?: {
1063
- readonly toolNames: readonly string[];
1064
- } | undefined;
1065
- readonly runId: string;
1066
- readonly toolCallId: string;
1067
- readonly toolName: string;
1068
- readonly result: Schema.Json;
1069
- readonly isFailure: boolean;
1070
- readonly budgetRejected?: true | undefined;
1027
+ readonly _tag: "AbortRequested";
1028
+ readonly submissionId: string;
1029
+ readonly author: string;
1030
+ readonly reason: string;
1071
1031
  } | {
1072
- readonly _tag: "ToolCallUnknown";
1032
+ readonly _tag: "ToolApprovalDecided";
1073
1033
  readonly runId: string;
1074
1034
  readonly turn: number;
1075
1035
  readonly toolCallId: string;
1076
- readonly toolName: string;
1036
+ readonly decision: "approved" | "denied";
1037
+ readonly resolver: string;
1077
1038
  readonly reason: string;
1078
1039
  } | {
1079
1040
  readonly _tag: "ToolCallResolved";
@@ -1083,12 +1044,40 @@ declare const encodeHostResponse: (input: AbortRecorded | ApprovalRecorded | Hos
1083
1044
  readonly author: string;
1084
1045
  readonly reason: string;
1085
1046
  } | {
1086
- readonly _tag: "ToolStepSettled";
1047
+ readonly _tag: "RunStarted";
1087
1048
  readonly runId: string;
1088
- readonly toolCallId: string;
1089
- readonly stepName: string;
1090
- readonly output: Schema.Json;
1091
- readonly outputDigest: string;
1049
+ readonly policyAccountingVersion: 1;
1050
+ readonly maxDurationMillis: number;
1051
+ } | {
1052
+ readonly _tag: "AgentUpdateEmitted";
1053
+ readonly update: {
1054
+ readonly schemaVersion: 1;
1055
+ readonly agentId: string;
1056
+ readonly threadId: string;
1057
+ readonly runId: string;
1058
+ readonly updateId: string;
1059
+ readonly sequence: number;
1060
+ readonly value: Schema.Json;
1061
+ };
1062
+ readonly definitions: {
1063
+ readonly agent: string;
1064
+ readonly model: string;
1065
+ readonly tools: string;
1066
+ readonly replay?: {
1067
+ readonly agent: string;
1068
+ readonly agentBehavior?: string | undefined;
1069
+ readonly tools: {
1070
+ readonly [x: string]: string;
1071
+ };
1072
+ } | undefined;
1073
+ };
1074
+ readonly delivery?: {
1075
+ readonly messageId: string;
1076
+ readonly envelope: Schema.Json;
1077
+ readonly createdAtMillis: number;
1078
+ readonly deadlineAtMillis: number;
1079
+ readonly predecessor?: string | undefined;
1080
+ } | undefined;
1092
1081
  } | {
1093
1082
  readonly _tag: "ToolApprovalRequested";
1094
1083
  readonly runId: string;
@@ -1099,66 +1088,246 @@ declare const encodeHostResponse: (input: AbortRecorded | ApprovalRecorded | Hos
1099
1088
  readonly parametersDigest: string;
1100
1089
  readonly blocksInitialDispatch: boolean;
1101
1090
  } | {
1102
- readonly _tag: "ToolApprovalDecided";
1103
- readonly runId: string;
1104
- readonly turn: number;
1105
- readonly toolCallId: string;
1106
- readonly decision: "approved" | "denied";
1107
- readonly resolver: string;
1108
- readonly reason: string;
1091
+ readonly _tag: "WorkerInputCompleted";
1092
+ readonly messageId: string;
1093
+ readonly workerThreadId: string;
1094
+ readonly submissionId: string;
1095
+ readonly receiptId: string;
1096
+ readonly settlementId: string;
1097
+ readonly completedAtMillis: number;
1098
+ readonly effectsResolved?: true | undefined;
1109
1099
  } | {
1110
- readonly _tag: "ModelResponseInterrupted";
1111
- readonly runId: string;
1100
+ readonly _tag: "WorkerInputRequested";
1101
+ readonly admission: {
1102
+ readonly origin: {
1103
+ readonly worker: {
1104
+ readonly schemaVersion: 1;
1105
+ readonly delegationId: string;
1106
+ readonly targetAgentId: string;
1107
+ readonly threadId: string;
1108
+ };
1109
+ readonly source: {
1110
+ readonly _tag: "tool";
1111
+ readonly agentId: string;
1112
+ readonly threadId: string;
1113
+ readonly runId: string;
1114
+ readonly toolCallId: string;
1115
+ } | {
1116
+ readonly _tag: "programmatic";
1117
+ readonly agentId: string;
1118
+ readonly threadId: string;
1119
+ };
1120
+ readonly continuationOf?: {
1121
+ readonly worker: {
1122
+ readonly schemaVersion: 1;
1123
+ readonly delegationId: string;
1124
+ readonly targetAgentId: string;
1125
+ readonly threadId: string;
1126
+ };
1127
+ readonly receipt: {
1128
+ readonly receiptId: string;
1129
+ readonly submissionId: string;
1130
+ readonly threadId: string;
1131
+ readonly queueSequence: number;
1132
+ };
1133
+ readonly settlementId: string;
1134
+ } | undefined;
1135
+ readonly budgetScope: "source-subtree" | "worker-run";
1136
+ readonly lifecycle?: "assignment" | undefined;
1137
+ readonly targetDigests: {
1138
+ readonly agent: string;
1139
+ readonly model: string;
1140
+ readonly tools: string;
1141
+ readonly replay?: {
1142
+ readonly agent: string;
1143
+ readonly agentBehavior?: string | undefined;
1144
+ readonly tools: {
1145
+ readonly [x: string]: string;
1146
+ };
1147
+ } | undefined;
1148
+ };
1149
+ readonly policy: Schema.Json;
1150
+ readonly budget: {
1151
+ readonly caps: {
1152
+ readonly maxTotalChildInvocations?: number | undefined;
1153
+ readonly maxConcurrentChildren?: number | undefined;
1154
+ readonly maxTurns?: number | undefined;
1155
+ readonly maxToolCalls?: number | undefined;
1156
+ readonly maxDurationMillis?: number | undefined;
1157
+ readonly maxInputTokens?: number | undefined;
1158
+ readonly maxOutputTokens?: number | undefined;
1159
+ readonly maxCostMicrousd?: number | undefined;
1160
+ readonly maxResultBytes?: number | undefined;
1161
+ };
1162
+ readonly allocation: {
1163
+ readonly turns: number;
1164
+ readonly toolCalls: number;
1165
+ readonly durationMillis: number;
1166
+ readonly inputTokens: number;
1167
+ readonly outputTokens: number;
1168
+ readonly costMicrousd: number;
1169
+ readonly resultBytes: number;
1170
+ };
1171
+ readonly descendantInvocations?: number | undefined;
1172
+ };
1173
+ readonly grant: {
1174
+ readonly allowedToolNames: readonly string[];
1175
+ readonly maxDepth: number;
1176
+ readonly childLifetimes?: readonly ("attached" | "background")[] | undefined;
1177
+ };
1178
+ readonly depth: number;
1179
+ readonly toolCallAllowance?: number | undefined;
1180
+ readonly firstMessageId: string;
1181
+ readonly createdAtMillis: number;
1182
+ readonly expiresAtMillis: number;
1183
+ readonly reporting?: {
1184
+ readonly mode?: "standard" | undefined;
1185
+ readonly sourceDigests: {
1186
+ readonly agent: string;
1187
+ readonly model: string;
1188
+ readonly tools: string;
1189
+ readonly replay?: {
1190
+ readonly agent: string;
1191
+ readonly agentBehavior?: string | undefined;
1192
+ readonly tools: {
1193
+ readonly [x: string]: string;
1194
+ };
1195
+ } | undefined;
1196
+ };
1197
+ readonly destinationDelegationId?: string | undefined;
1198
+ readonly returnAddress?: {
1199
+ readonly input: Schema.Json;
1200
+ readonly principal: string;
1201
+ readonly policy: Schema.Json;
1202
+ readonly depth: number;
1203
+ readonly grant?: {
1204
+ readonly allowedToolNames: readonly string[];
1205
+ readonly maxDepth: number;
1206
+ readonly childLifetimes?: readonly ("attached" | "background")[] | undefined;
1207
+ } | undefined;
1208
+ readonly workerAdmission?: Schema.Json | undefined;
1209
+ } | undefined;
1210
+ } | undefined;
1211
+ };
1212
+ readonly executionRunId: string | null;
1213
+ readonly messageId: string;
1214
+ readonly parameters: Schema.Json;
1215
+ readonly createdAtMillis: number;
1216
+ readonly sourceSubmissionId?: string | undefined;
1217
+ readonly deliveryPrincipal?: string | undefined;
1218
+ readonly reportKind?: "update" | undefined;
1219
+ };
1220
+ readonly inputDigest: string;
1112
1221
  } | {
1113
- readonly _tag: "ModelCallAborted";
1222
+ readonly _tag: "WorkerStopRequested";
1223
+ readonly command: {
1224
+ readonly worker: {
1225
+ readonly schemaVersion: 1;
1226
+ readonly delegationId: string;
1227
+ readonly targetAgentId: string;
1228
+ readonly threadId: string;
1229
+ };
1230
+ readonly idempotencyKey: string;
1231
+ };
1232
+ readonly principal: string;
1233
+ readonly sourceSubmissionId?: string | undefined;
1234
+ } | {
1235
+ readonly _tag: "SubagentRequested";
1114
1236
  readonly runId: string;
1115
1237
  readonly turnId: string;
1116
1238
  readonly turn: number;
1117
- readonly restart: number;
1118
- readonly reason: "joined-input";
1119
- readonly modelUsage: readonly {
1120
- readonly provider: string;
1121
- readonly model: string;
1122
- readonly serviceTier?: string | undefined;
1123
- readonly pricingVersion?: string | undefined;
1124
- readonly response?: {
1125
- readonly id?: string | undefined;
1126
- readonly model?: string | undefined;
1239
+ readonly toolCallId: string;
1240
+ readonly delegationId: string;
1241
+ readonly targetAgentId: string;
1242
+ readonly targetDigests: {
1243
+ readonly agent: string;
1244
+ readonly model: string;
1245
+ readonly tools: string;
1246
+ readonly replay?: {
1247
+ readonly agent: string;
1248
+ readonly agentBehavior?: string | undefined;
1249
+ readonly tools: {
1250
+ readonly [x: string]: string;
1251
+ };
1127
1252
  } | undefined;
1128
- readonly purpose?: "summary" | "turn" | undefined;
1129
- readonly usageStatus?: "complete" | "partial" | "unknown" | undefined;
1130
- readonly pricingStatus?: "estimated" | "unknown" | undefined;
1131
- readonly inputTokens: {
1132
- readonly total: number;
1133
- readonly uncached: number;
1134
- readonly cacheRead: number;
1135
- readonly cacheWrite: number;
1253
+ };
1254
+ readonly childInput: Schema.Json;
1255
+ readonly childInputDigest: string;
1256
+ readonly grantDigest: string;
1257
+ readonly reservationId: string;
1258
+ readonly reservationDigest: string;
1259
+ readonly childThreadId: string;
1260
+ readonly childPrincipal: string;
1261
+ readonly childIdempotencyKey: string;
1262
+ readonly toolCallAllowance?: number | undefined;
1263
+ readonly policy?: Schema.Json | undefined;
1264
+ readonly budget?: {
1265
+ readonly caps: {
1266
+ readonly maxTotalChildInvocations?: number | undefined;
1267
+ readonly maxConcurrentChildren?: number | undefined;
1268
+ readonly maxTurns?: number | undefined;
1269
+ readonly maxToolCalls?: number | undefined;
1270
+ readonly maxDurationMillis?: number | undefined;
1271
+ readonly maxInputTokens?: number | undefined;
1272
+ readonly maxOutputTokens?: number | undefined;
1273
+ readonly maxCostMicrousd?: number | undefined;
1274
+ readonly maxResultBytes?: number | undefined;
1136
1275
  };
1137
- readonly outputTokens: {
1138
- readonly total: number;
1139
- readonly text: number;
1140
- readonly reasoning: number;
1276
+ readonly allocation: {
1277
+ readonly turns: number;
1278
+ readonly toolCalls: number;
1279
+ readonly durationMillis: number;
1280
+ readonly inputTokens: number;
1281
+ readonly outputTokens: number;
1282
+ readonly costMicrousd: number;
1283
+ readonly resultBytes: number;
1141
1284
  };
1142
- readonly webSearchCalls?: number | undefined;
1143
- readonly costMicrousd: number;
1144
- }[];
1145
- readonly unobservedModelCalls: number;
1285
+ readonly descendantInvocations?: number | undefined;
1286
+ } | undefined;
1287
+ readonly grant?: {
1288
+ readonly allowedToolNames: readonly string[];
1289
+ readonly maxDepth: number;
1290
+ readonly childLifetimes?: readonly ("attached" | "background")[] | undefined;
1291
+ } | undefined;
1292
+ readonly depth?: number | undefined;
1146
1293
  } | {
1147
- readonly _tag: "RunFailed";
1294
+ readonly _tag: "SubagentStarted";
1148
1295
  readonly runId: string;
1149
- readonly failure: Schema.Json;
1296
+ readonly toolCallId: string;
1297
+ readonly childThreadId: string;
1298
+ readonly childSubmissionId: string;
1299
+ readonly childReceiptId: string;
1300
+ readonly childRunId: string;
1150
1301
  } | {
1151
- readonly _tag: "RunCompleted";
1302
+ readonly _tag: "SubagentJoined";
1152
1303
  readonly runId: string;
1153
- readonly output: Schema.Json;
1154
- readonly runDisposition?: Schema.Json | undefined;
1155
- readonly finishReason?: "budget-exhausted" | undefined;
1156
- readonly exhausted?: "tokens" | "tool-calls" | "turns" | undefined;
1157
- } | {
1158
- readonly _tag: "AbortRequested";
1159
- readonly submissionId: string;
1160
- readonly author: string;
1161
- readonly reason: string;
1304
+ readonly toolCallId: string;
1305
+ readonly childSubmissionId: string;
1306
+ readonly childSettlementId: string;
1307
+ readonly childOutcome: "aborted" | "completed" | "failed";
1308
+ readonly usageSummary: Schema.Json;
1309
+ readonly usage?: {
1310
+ readonly modelCalls: number;
1311
+ readonly inputTokens: number;
1312
+ readonly outputTokens: number;
1313
+ readonly webSearchCalls?: number | undefined;
1314
+ readonly costMicrousd: number;
1315
+ readonly usageStatus?: "complete" | "partial" | "unknown" | undefined;
1316
+ readonly pricingStatus?: "complete" | "partial" | "unknown" | undefined;
1317
+ readonly unobservedModelCalls?: number | undefined;
1318
+ } | undefined;
1319
+ readonly delegatedUsage?: {
1320
+ readonly modelCalls: number;
1321
+ readonly inputTokens: number;
1322
+ readonly outputTokens: number;
1323
+ readonly webSearchCalls?: number | undefined;
1324
+ readonly costMicrousd: number;
1325
+ readonly usageStatus?: "complete" | "partial" | "unknown" | undefined;
1326
+ readonly pricingStatus?: "complete" | "partial" | "unknown" | undefined;
1327
+ readonly unobservedModelCalls?: number | undefined;
1328
+ } | undefined;
1329
+ readonly reservationId: string;
1330
+ readonly finalAccounting: Schema.Json;
1162
1331
  } | {
1163
1332
  readonly _tag: "SubmissionSettled";
1164
1333
  readonly submissionId: string;
@@ -1239,14 +1408,9 @@ declare const encodeHostResponse: (input: AbortRecorded | ApprovalRecorded | Hos
1239
1408
  readonly costMicrousd: number;
1240
1409
  }[] | undefined;
1241
1410
  } | {
1242
- readonly _tag: "SubagentRequested";
1243
- readonly runId: string;
1244
- readonly turnId: string;
1245
- readonly turn: number;
1246
- readonly toolCallId: string;
1247
- readonly delegationId: string;
1248
- readonly targetAgentId: string;
1249
- readonly targetDigests: {
1411
+ readonly _tag: "ThreadCreated";
1412
+ readonly agentId: string;
1413
+ readonly definitions: {
1250
1414
  readonly agent: string;
1251
1415
  readonly model: string;
1252
1416
  readonly tools: string;
@@ -1258,83 +1422,93 @@ declare const encodeHostResponse: (input: AbortRecorded | ApprovalRecorded | Hos
1258
1422
  };
1259
1423
  } | undefined;
1260
1424
  };
1261
- readonly childInput: Schema.Json;
1262
- readonly childInputDigest: string;
1263
- readonly grantDigest: string;
1264
- readonly reservationId: string;
1265
- readonly reservationDigest: string;
1266
- readonly childThreadId: string;
1267
- readonly childPrincipal: string;
1268
- readonly childIdempotencyKey: string;
1269
- readonly toolCallAllowance?: number | undefined;
1270
- readonly policy?: Schema.Json | undefined;
1271
- readonly budget?: {
1272
- readonly caps: {
1273
- readonly maxTotalChildInvocations?: number | undefined;
1274
- readonly maxConcurrentChildren?: number | undefined;
1275
- readonly maxTurns?: number | undefined;
1276
- readonly maxToolCalls?: number | undefined;
1277
- readonly maxDurationMillis?: number | undefined;
1278
- readonly maxInputTokens?: number | undefined;
1279
- readonly maxOutputTokens?: number | undefined;
1280
- readonly maxCostMicrousd?: number | undefined;
1281
- readonly maxResultBytes?: number | undefined;
1282
- };
1283
- readonly allocation: {
1284
- readonly turns: number;
1285
- readonly toolCalls: number;
1286
- readonly durationMillis: number;
1287
- readonly inputTokens: number;
1288
- readonly outputTokens: number;
1289
- readonly costMicrousd: number;
1290
- readonly resultBytes: number;
1291
- };
1292
- readonly descendantInvocations?: number | undefined;
1293
- } | undefined;
1294
- readonly grant?: {
1295
- readonly allowedToolNames: readonly string[];
1296
- readonly maxDepth: number;
1297
- readonly childLifetimes?: readonly ("attached" | "background")[] | undefined;
1425
+ } | {
1426
+ readonly _tag: "RunDurationExhausted";
1427
+ readonly runId: string;
1428
+ } | {
1429
+ readonly _tag: "RunPolicyUsageReserved";
1430
+ readonly runId: string;
1431
+ readonly programmaticToolCalls: number;
1432
+ readonly finalizationUsed: boolean;
1433
+ } | {
1434
+ readonly _tag: "ModelCompleted";
1435
+ readonly runId: string;
1436
+ readonly output: Schema.Json;
1437
+ readonly messages?: Schema.Json | undefined;
1438
+ readonly history?: Schema.Json | undefined;
1439
+ } | {
1440
+ readonly _tag: "ToolCallSettled";
1441
+ readonly toolSelection?: {
1442
+ readonly toolNames: readonly string[];
1298
1443
  } | undefined;
1299
- readonly depth?: number | undefined;
1444
+ readonly runId: string;
1445
+ readonly toolCallId: string;
1446
+ readonly toolName: string;
1447
+ readonly result: Schema.Json;
1448
+ readonly isFailure: boolean;
1449
+ readonly budgetRejected?: true | undefined;
1300
1450
  } | {
1301
- readonly _tag: "SubagentStarted";
1451
+ readonly _tag: "ToolCallUnknown";
1302
1452
  readonly runId: string;
1453
+ readonly turn: number;
1303
1454
  readonly toolCallId: string;
1304
- readonly childThreadId: string;
1305
- readonly childSubmissionId: string;
1306
- readonly childReceiptId: string;
1307
- readonly childRunId: string;
1455
+ readonly toolName: string;
1456
+ readonly reason: string;
1308
1457
  } | {
1309
- readonly _tag: "SubagentJoined";
1458
+ readonly _tag: "ToolStepSettled";
1310
1459
  readonly runId: string;
1311
1460
  readonly toolCallId: string;
1312
- readonly childSubmissionId: string;
1313
- readonly childSettlementId: string;
1314
- readonly childOutcome: "aborted" | "completed" | "failed";
1315
- readonly usageSummary: Schema.Json;
1316
- readonly usage?: {
1317
- readonly modelCalls: number;
1318
- readonly inputTokens: number;
1319
- readonly outputTokens: number;
1320
- readonly webSearchCalls?: number | undefined;
1321
- readonly costMicrousd: number;
1461
+ readonly stepName: string;
1462
+ readonly output: Schema.Json;
1463
+ readonly outputDigest: string;
1464
+ } | {
1465
+ readonly _tag: "ModelResponseInterrupted";
1466
+ readonly runId: string;
1467
+ } | {
1468
+ readonly _tag: "ModelCallAborted";
1469
+ readonly runId: string;
1470
+ readonly turnId: string;
1471
+ readonly turn: number;
1472
+ readonly restart: number;
1473
+ readonly reason: "joined-input";
1474
+ readonly modelUsage: readonly {
1475
+ readonly provider: string;
1476
+ readonly model: string;
1477
+ readonly serviceTier?: string | undefined;
1478
+ readonly pricingVersion?: string | undefined;
1479
+ readonly response?: {
1480
+ readonly id?: string | undefined;
1481
+ readonly model?: string | undefined;
1482
+ } | undefined;
1483
+ readonly purpose?: "summary" | "turn" | undefined;
1322
1484
  readonly usageStatus?: "complete" | "partial" | "unknown" | undefined;
1323
- readonly pricingStatus?: "complete" | "partial" | "unknown" | undefined;
1324
- readonly unobservedModelCalls?: number | undefined;
1325
- } | undefined;
1326
- readonly delegatedUsage?: {
1327
- readonly modelCalls: number;
1328
- readonly inputTokens: number;
1329
- readonly outputTokens: number;
1485
+ readonly pricingStatus?: "estimated" | "unknown" | undefined;
1486
+ readonly inputTokens: {
1487
+ readonly total: number;
1488
+ readonly uncached: number;
1489
+ readonly cacheRead: number;
1490
+ readonly cacheWrite: number;
1491
+ };
1492
+ readonly outputTokens: {
1493
+ readonly total: number;
1494
+ readonly text: number;
1495
+ readonly reasoning: number;
1496
+ };
1330
1497
  readonly webSearchCalls?: number | undefined;
1331
1498
  readonly costMicrousd: number;
1332
- readonly usageStatus?: "complete" | "partial" | "unknown" | undefined;
1333
- readonly pricingStatus?: "complete" | "partial" | "unknown" | undefined;
1334
- readonly unobservedModelCalls?: number | undefined;
1335
- } | undefined;
1336
- readonly reservationId: string;
1337
- readonly finalAccounting: Schema.Json;
1499
+ }[];
1500
+ readonly unobservedModelCalls: number;
1501
+ } | {
1502
+ readonly _tag: "RunFailed";
1503
+ readonly runId: string;
1504
+ readonly failure: Schema.Json;
1505
+ } | {
1506
+ readonly _tag: "RunCompleted";
1507
+ readonly runId: string;
1508
+ readonly output: Schema.Json;
1509
+ readonly runDisposition?: Schema.Json | undefined;
1510
+ readonly finishReason?: "budget-exhausted" | undefined;
1511
+ readonly exhausted?: "tokens" | "tool-calls" | "turns" | undefined;
1338
1512
  } | {
1339
1513
  readonly _tag: "SubagentLineageRecorded";
1340
1514
  readonly parentLink: {
@@ -1390,141 +1564,6 @@ declare const encodeHostResponse: (input: AbortRecorded | ApprovalRecorded | Hos
1390
1564
  readonly maxDepth: number;
1391
1565
  readonly childLifetimes?: readonly ("attached" | "background")[] | undefined;
1392
1566
  } | undefined;
1393
- } | {
1394
- readonly _tag: "WorkerInputRequested";
1395
- readonly admission: {
1396
- readonly origin: {
1397
- readonly worker: {
1398
- readonly schemaVersion: 1;
1399
- readonly delegationId: string;
1400
- readonly targetAgentId: string;
1401
- readonly threadId: string;
1402
- };
1403
- readonly source: {
1404
- readonly _tag: "tool";
1405
- readonly agentId: string;
1406
- readonly threadId: string;
1407
- readonly runId: string;
1408
- readonly toolCallId: string;
1409
- } | {
1410
- readonly _tag: "programmatic";
1411
- readonly agentId: string;
1412
- readonly threadId: string;
1413
- };
1414
- readonly continuationOf?: {
1415
- readonly worker: {
1416
- readonly schemaVersion: 1;
1417
- readonly delegationId: string;
1418
- readonly targetAgentId: string;
1419
- readonly threadId: string;
1420
- };
1421
- readonly receipt: {
1422
- readonly receiptId: string;
1423
- readonly submissionId: string;
1424
- readonly threadId: string;
1425
- readonly queueSequence: number;
1426
- };
1427
- readonly settlementId: string;
1428
- } | undefined;
1429
- readonly budgetScope: "source-subtree" | "worker-run";
1430
- readonly lifecycle?: "assignment" | undefined;
1431
- readonly targetDigests: {
1432
- readonly agent: string;
1433
- readonly model: string;
1434
- readonly tools: string;
1435
- readonly replay?: {
1436
- readonly agent: string;
1437
- readonly agentBehavior?: string | undefined;
1438
- readonly tools: {
1439
- readonly [x: string]: string;
1440
- };
1441
- } | undefined;
1442
- };
1443
- readonly policy: Schema.Json;
1444
- readonly budget: {
1445
- readonly caps: {
1446
- readonly maxTotalChildInvocations?: number | undefined;
1447
- readonly maxConcurrentChildren?: number | undefined;
1448
- readonly maxTurns?: number | undefined;
1449
- readonly maxToolCalls?: number | undefined;
1450
- readonly maxDurationMillis?: number | undefined;
1451
- readonly maxInputTokens?: number | undefined;
1452
- readonly maxOutputTokens?: number | undefined;
1453
- readonly maxCostMicrousd?: number | undefined;
1454
- readonly maxResultBytes?: number | undefined;
1455
- };
1456
- readonly allocation: {
1457
- readonly turns: number;
1458
- readonly toolCalls: number;
1459
- readonly durationMillis: number;
1460
- readonly inputTokens: number;
1461
- readonly outputTokens: number;
1462
- readonly costMicrousd: number;
1463
- readonly resultBytes: number;
1464
- };
1465
- readonly descendantInvocations?: number | undefined;
1466
- };
1467
- readonly grant: {
1468
- readonly allowedToolNames: readonly string[];
1469
- readonly maxDepth: number;
1470
- readonly childLifetimes?: readonly ("attached" | "background")[] | undefined;
1471
- };
1472
- readonly depth: number;
1473
- readonly toolCallAllowance?: number | undefined;
1474
- readonly firstMessageId: string;
1475
- readonly createdAtMillis: number;
1476
- readonly expiresAtMillis: number;
1477
- readonly reporting?: {
1478
- readonly mode?: "standard" | undefined;
1479
- readonly sourceDigests: {
1480
- readonly agent: string;
1481
- readonly model: string;
1482
- readonly tools: string;
1483
- readonly replay?: {
1484
- readonly agent: string;
1485
- readonly agentBehavior?: string | undefined;
1486
- readonly tools: {
1487
- readonly [x: string]: string;
1488
- };
1489
- } | undefined;
1490
- };
1491
- readonly destinationDelegationId?: string | undefined;
1492
- readonly returnAddress?: {
1493
- readonly input: Schema.Json;
1494
- readonly principal: string;
1495
- readonly policy: Schema.Json;
1496
- readonly depth: number;
1497
- readonly grant?: {
1498
- readonly allowedToolNames: readonly string[];
1499
- readonly maxDepth: number;
1500
- readonly childLifetimes?: readonly ("attached" | "background")[] | undefined;
1501
- } | undefined;
1502
- readonly workerAdmission?: Schema.Json | undefined;
1503
- } | undefined;
1504
- } | undefined;
1505
- };
1506
- readonly executionRunId: string | null;
1507
- readonly messageId: string;
1508
- readonly parameters: Schema.Json;
1509
- readonly createdAtMillis: number;
1510
- readonly sourceSubmissionId?: string | undefined;
1511
- readonly deliveryPrincipal?: string | undefined;
1512
- readonly reportKind?: "update" | undefined;
1513
- };
1514
- readonly inputDigest: string;
1515
- } | {
1516
- readonly _tag: "WorkerStopRequested";
1517
- readonly command: {
1518
- readonly worker: {
1519
- readonly schemaVersion: 1;
1520
- readonly delegationId: string;
1521
- readonly targetAgentId: string;
1522
- readonly threadId: string;
1523
- };
1524
- readonly idempotencyKey: string;
1525
- };
1526
- readonly principal: string;
1527
- readonly sourceSubmissionId?: string | undefined;
1528
1567
  } | {
1529
1568
  readonly _tag: "WorkHandoffCompleted";
1530
1569
  readonly preparationId: string;
@@ -1641,15 +1680,6 @@ declare const encodeHostResponse: (input: AbortRecorded | ApprovalRecorded | Hos
1641
1680
  } | undefined;
1642
1681
  } | undefined;
1643
1682
  };
1644
- } | {
1645
- readonly _tag: "WorkerInputCompleted";
1646
- readonly messageId: string;
1647
- readonly workerThreadId: string;
1648
- readonly submissionId: string;
1649
- readonly receiptId: string;
1650
- readonly settlementId: string;
1651
- readonly completedAtMillis: number;
1652
- readonly effectsResolved?: true | undefined;
1653
1683
  } | {
1654
1684
  readonly _tag: "WorkerInputRefused";
1655
1685
  readonly messageId: string;
@@ -1678,36 +1708,6 @@ declare const encodeHostResponse: (input: AbortRecorded | ApprovalRecorded | Hos
1678
1708
  readonly createdAtMillis: number;
1679
1709
  readonly deadlineAtMillis: number;
1680
1710
  readonly predecessor?: string | undefined;
1681
- } | {
1682
- readonly _tag: "AgentUpdateEmitted";
1683
- readonly update: {
1684
- readonly schemaVersion: 1;
1685
- readonly agentId: string;
1686
- readonly threadId: string;
1687
- readonly runId: string;
1688
- readonly updateId: string;
1689
- readonly sequence: number;
1690
- readonly value: Schema.Json;
1691
- };
1692
- readonly definitions: {
1693
- readonly agent: string;
1694
- readonly model: string;
1695
- readonly tools: string;
1696
- readonly replay?: {
1697
- readonly agent: string;
1698
- readonly agentBehavior?: string | undefined;
1699
- readonly tools: {
1700
- readonly [x: string]: string;
1701
- };
1702
- } | undefined;
1703
- };
1704
- readonly delivery?: {
1705
- readonly messageId: string;
1706
- readonly envelope: Schema.Json;
1707
- readonly createdAtMillis: number;
1708
- readonly deadlineAtMillis: number;
1709
- readonly predecessor?: string | undefined;
1710
- } | undefined;
1711
1711
  } | {
1712
1712
  readonly _tag: "WorkerReportRefused";
1713
1713
  readonly runId: string;
@@ -1866,13 +1866,13 @@ declare const encodeHostResponse: (input: AbortRecorded | ApprovalRecorded | Hos
1866
1866
  readonly author: string;
1867
1867
  readonly reason: string;
1868
1868
  readonly resolution: {
1869
- readonly _tag: "SafeToRetry";
1870
- } | {
1871
1869
  readonly _tag: "CompletedWithResult";
1872
1870
  readonly result: Schema.Json;
1873
1871
  readonly isFailure: boolean;
1874
1872
  } | {
1875
1873
  readonly _tag: "NeverHappened";
1874
+ } | {
1875
+ readonly _tag: "SafeToRetry";
1876
1876
  } | {
1877
1877
  readonly _tag: "AbortSubmission";
1878
1878
  };
@@ -1882,10 +1882,13 @@ declare const encodeHostResponse: (input: AbortRecorded | ApprovalRecorded | Hos
1882
1882
  } | {
1883
1883
  readonly _tag: "HostFailed";
1884
1884
  readonly failure: {
1885
- readonly _tag: "LedgerError";
1885
+ readonly _tag: "DurableAlarmError";
1886
1886
  readonly operation: string;
1887
1887
  readonly message: string;
1888
- readonly cause?: import("@yielded/agent/failure-diagnostic").Diagnostic | undefined;
1888
+ readonly cause?: Schema.Json | undefined;
1889
+ } | {
1890
+ readonly _tag: "ThreadNotMaterialized";
1891
+ readonly threadId: string;
1889
1892
  } | {
1890
1893
  readonly _tag: "ThreadStoreError";
1891
1894
  readonly operation: string;
@@ -1899,8 +1902,10 @@ declare const encodeHostResponse: (input: AbortRecorded | ApprovalRecorded | Hos
1899
1902
  readonly sequence?: number | undefined;
1900
1903
  } | undefined;
1901
1904
  } | {
1902
- readonly _tag: "ThreadNotMaterialized";
1903
- readonly threadId: string;
1905
+ readonly _tag: "LedgerError";
1906
+ readonly operation: string;
1907
+ readonly message: string;
1908
+ readonly cause?: import("@yielded/agent/failure-diagnostic").Diagnostic | undefined;
1904
1909
  } | {
1905
1910
  readonly _tag: "AppendConflict";
1906
1911
  readonly threadId: string;
@@ -1948,11 +1953,6 @@ declare const encodeHostResponse: (input: AbortRecorded | ApprovalRecorded | Hos
1948
1953
  readonly limit: "database-bytes" | "input-bytes" | "queue-depth";
1949
1954
  readonly actual: number;
1950
1955
  readonly maximum: number;
1951
- } | {
1952
- readonly _tag: "DurableAlarmError";
1953
- readonly operation: string;
1954
- readonly message: string;
1955
- readonly cause?: Schema.Json | undefined;
1956
1956
  } | {
1957
1957
  readonly _tag: "HostProtocolError";
1958
1958
  readonly message: string;
@@ -2052,4 +2052,4 @@ declare class CloudflareThreadClient extends CloudflareThreadClient_base {
2052
2052
  }
2053
2053
  //#endregion
2054
2054
  export { boundHostDiagnostic as A, decodeUnknownResolutionCommand as B, SettlementReached as C, SubmitSucceeded as D, SubmitRequest as E, decodeCancelProgressRequest as F, encodeCancelProgressRequest as G, encodeApprovalDecisionCommand as H, decodeHostResponse as I, encodeReceipt as J, encodeHostResponse as K, decodeObservePageRequest as L, decodeApprovalDecisionCommand as M, decodeAwaitProgressRequest as N, ThreadClientError as O, decodeAwaitSettlementRequest as P, decodeReceipt as R, ProgressObserved as S, SubmissionStatusResponse as T, encodeAwaitProgressRequest as U, encodeAbortCommand as V, encodeAwaitSettlementRequest as W, encodeUnknownResolutionCommand as X, encodeSubmitRequest as Y, Frame as Z, HostProtocolError as _, CancelProgressRequest as a, ObservedPage as b, ClientAwaitFailure as c, ClientSubmitFailure as d, ClientUnknownFailure as f, HostFailure as g, HostFailed as h, AwaitSettlementRequest as i, decodeAbortCommand as j, UnknownResolutionRecorded as k, ClientObserveFailure as l, CloudflareThreadClient_d_exports as m, ApprovalRecorded as n, ClientAbortFailure as o, CloudflareThreadClient as p, encodeObservePageRequest as q, AwaitProgressRequest as r, ClientApprovalFailure as s, AbortRecorded as t, ClientProgressFailure as u, HostResponse as v, SettlementRecordReached as w, ProgressCancelled as x, ObservePageRequest as y, decodeSubmitRequest as z };
2055
- //# sourceMappingURL=CloudflareThreadClient-HO_3rkM7.d.mts.map
2055
+ //# sourceMappingURL=CloudflareThreadClient-lTm6baDP.d.mts.map