@yielded/agent-platform-cloudflare 0.1.0-beta.183 → 0.1.0-beta.185

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 (31) hide show
  1. package/dist/{BrowserCredentials-C5IWfi7f.d.mts → BrowserCredentials-C2rBhlUI.d.mts} +30 -5
  2. package/dist/BrowserCredentials.d.mts +2 -2
  3. package/dist/BrowserCredentials.mjs +28 -8
  4. package/dist/BrowserCredentials.mjs.map +1 -1
  5. package/dist/{BrowserSession-aovMjfL4.mjs → BrowserSession-CfivQ5JY.mjs} +150 -65
  6. package/dist/BrowserSession-CfivQ5JY.mjs.map +1 -0
  7. package/dist/{BrowserSession-Cojp7nth.d.mts → BrowserSession-mKnLSc3p.d.mts} +8 -2
  8. package/dist/BrowserSession.d.mts +1 -1
  9. package/dist/BrowserSession.mjs +2 -2
  10. package/dist/BrowserUse.d.mts +1 -1
  11. package/dist/BrowserUse.mjs +31 -4
  12. package/dist/BrowserUse.mjs.map +1 -1
  13. package/dist/{CloudflareThreadClient-DNsFhgVu.d.mts → CloudflareThreadClient-CmlojpjC.d.mts} +184 -184
  14. package/dist/CloudflareThreadClient.d.mts +1 -1
  15. package/dist/{InteractiveBrowser-BHNlwjZL.mjs → InteractiveBrowser-nukKxc87.mjs} +4 -45
  16. package/dist/InteractiveBrowser-nukKxc87.mjs.map +1 -0
  17. package/dist/InteractiveBrowser.mjs +1 -1
  18. package/dist/{ThreadObject-BVoyFKHN.d.mts → ThreadObject-Osn-FmcF.d.mts} +2 -2
  19. package/dist/ThreadObject.d.mts +1 -1
  20. package/dist/browser-failure-DECzRY3H.mjs +50 -0
  21. package/dist/browser-failure-DECzRY3H.mjs.map +1 -0
  22. package/dist/index.d.mts +4 -4
  23. package/dist/index.mjs +1 -1
  24. package/package.json +1 -1
  25. package/src/BrowserCredentials.ts +42 -9
  26. package/src/BrowserSession.ts +88 -8
  27. package/src/BrowserUse.ts +51 -4
  28. package/src/internal/browser-credentials.ts +205 -98
  29. package/src/internal/browser-failure.ts +3 -0
  30. package/dist/BrowserSession-aovMjfL4.mjs.map +0 -1
  31. package/dist/InteractiveBrowser-BHNlwjZL.mjs.map +0 -1
@@ -400,6 +400,25 @@ declare const encodeSubmitRequest: (input: {
400
400
  readonly reportKind?: "update" | undefined;
401
401
  } | undefined;
402
402
  readonly messageAdmission?: {
403
+ readonly schemaVersion: 1;
404
+ readonly message: {
405
+ readonly ownerThreadId: string & import("effect/Brand").Brand<"@effect-agent/core/ThreadId">;
406
+ readonly messageId: string & import("effect/Brand").Brand<"@effect-agent/thread/IdempotencyKey">;
407
+ };
408
+ readonly peerName: string;
409
+ readonly sender: {
410
+ readonly threadId: string & import("effect/Brand").Brand<"@effect-agent/core/ThreadId">;
411
+ readonly agentId: string & import("effect/Brand").Brand<"@effect-agent/core/AgentId">;
412
+ };
413
+ readonly returnAddress: {
414
+ readonly threadId: string & import("effect/Brand").Brand<"@effect-agent/core/ThreadId">;
415
+ readonly agentId: string & import("effect/Brand").Brand<"@effect-agent/core/AgentId">;
416
+ };
417
+ readonly inReplyTo?: {
418
+ readonly ownerThreadId: string & import("effect/Brand").Brand<"@effect-agent/core/ThreadId">;
419
+ readonly messageId: string & import("effect/Brand").Brand<"@effect-agent/thread/IdempotencyKey">;
420
+ } | undefined;
421
+ } | {
403
422
  readonly _tag: "WorkerCompletion";
404
423
  readonly budgetExhausted: boolean;
405
424
  readonly schemaVersion: 1;
@@ -440,25 +459,6 @@ declare const encodeSubmitRequest: (input: {
440
459
  readonly threadId: string & import("effect/Brand").Brand<"@effect-agent/core/ThreadId">;
441
460
  };
442
461
  readonly update: import("@yielded/agent/agent-updates").Update;
443
- } | {
444
- readonly schemaVersion: 1;
445
- readonly message: {
446
- readonly ownerThreadId: string & import("effect/Brand").Brand<"@effect-agent/core/ThreadId">;
447
- readonly messageId: string & import("effect/Brand").Brand<"@effect-agent/thread/IdempotencyKey">;
448
- };
449
- readonly peerName: string;
450
- readonly sender: {
451
- readonly threadId: string & import("effect/Brand").Brand<"@effect-agent/core/ThreadId">;
452
- readonly agentId: string & import("effect/Brand").Brand<"@effect-agent/core/AgentId">;
453
- };
454
- readonly returnAddress: {
455
- readonly threadId: string & import("effect/Brand").Brand<"@effect-agent/core/ThreadId">;
456
- readonly agentId: string & import("effect/Brand").Brand<"@effect-agent/core/AgentId">;
457
- };
458
- readonly inReplyTo?: {
459
- readonly ownerThreadId: string & import("effect/Brand").Brand<"@effect-agent/core/ThreadId">;
460
- readonly messageId: string & import("effect/Brand").Brand<"@effect-agent/thread/IdempotencyKey">;
461
- } | undefined;
462
462
  } | undefined;
463
463
  readonly definitions: DefinitionDigests;
464
464
  readonly inputPayload: Schema.Json;
@@ -1000,6 +1000,100 @@ declare const encodeHostResponse: (input: AbortRecorded | ApprovalRecorded | Hos
1000
1000
  readonly createdAt: string;
1001
1001
  readonly deploymentId: string;
1002
1002
  readonly payload: {
1003
+ readonly _tag: "SubmissionSettled";
1004
+ readonly submissionId: string;
1005
+ readonly settlementId: string;
1006
+ readonly receiptId: string;
1007
+ readonly outcome: "aborted" | "completed" | "failed";
1008
+ readonly runId?: string | undefined;
1009
+ readonly historyRecordCount?: number | undefined;
1010
+ readonly result?: Schema.Json | undefined;
1011
+ readonly runDisposition?: Schema.Json | undefined;
1012
+ readonly finishReason?: "budget-exhausted" | undefined;
1013
+ readonly exhausted?: "tokens" | "tool-calls" | "turns" | undefined;
1014
+ readonly policyLimit?: "cost" | "duration" | "repeated-failures" | "tokens" | "tool-calls" | "turns" | "usage" | undefined;
1015
+ readonly usageSummary?: {
1016
+ readonly modelCalls: number;
1017
+ readonly inputTokens: {
1018
+ readonly total: number;
1019
+ readonly uncached: number;
1020
+ readonly cacheRead: number;
1021
+ readonly cacheWrite: number;
1022
+ };
1023
+ readonly outputTokens: {
1024
+ readonly total: number;
1025
+ readonly text: number;
1026
+ readonly reasoning: number;
1027
+ };
1028
+ readonly webSearchCalls?: number | undefined;
1029
+ readonly costMicrousd: number;
1030
+ readonly byModel: readonly {
1031
+ readonly provider: string;
1032
+ readonly model: string;
1033
+ readonly responseModel?: string | undefined;
1034
+ readonly serviceTier?: string | undefined;
1035
+ readonly pricingVersion?: string | undefined;
1036
+ readonly modelCalls: number;
1037
+ readonly inputTokens: {
1038
+ readonly total: number;
1039
+ readonly uncached: number;
1040
+ readonly cacheRead: number;
1041
+ readonly cacheWrite: number;
1042
+ };
1043
+ readonly outputTokens: {
1044
+ readonly total: number;
1045
+ readonly text: number;
1046
+ readonly reasoning: number;
1047
+ };
1048
+ readonly webSearchCalls?: number | undefined;
1049
+ readonly costMicrousd: number;
1050
+ }[];
1051
+ readonly usageStatus?: "complete" | "partial" | "unknown" | undefined;
1052
+ readonly pricingStatus?: "complete" | "partial" | "unknown" | undefined;
1053
+ readonly unobservedModelCalls?: number | undefined;
1054
+ } | undefined;
1055
+ readonly uncommittedModelUsage?: readonly {
1056
+ readonly provider: string;
1057
+ readonly model: string;
1058
+ readonly serviceTier?: string | undefined;
1059
+ readonly pricingVersion?: string | undefined;
1060
+ readonly response?: {
1061
+ readonly id?: string | undefined;
1062
+ readonly model?: string | undefined;
1063
+ } | undefined;
1064
+ readonly purpose?: "summary" | "turn" | undefined;
1065
+ readonly usageStatus?: "complete" | "partial" | "unknown" | undefined;
1066
+ readonly pricingStatus?: "estimated" | "unknown" | undefined;
1067
+ readonly inputTokens: {
1068
+ readonly total: number;
1069
+ readonly uncached: number;
1070
+ readonly cacheRead: number;
1071
+ readonly cacheWrite: number;
1072
+ };
1073
+ readonly outputTokens: {
1074
+ readonly total: number;
1075
+ readonly text: number;
1076
+ readonly reasoning: number;
1077
+ };
1078
+ readonly webSearchCalls?: number | undefined;
1079
+ readonly costMicrousd: number;
1080
+ }[] | undefined;
1081
+ } | {
1082
+ readonly _tag: "ThreadCreated";
1083
+ readonly agentId: string;
1084
+ readonly definitions: {
1085
+ readonly agent: string;
1086
+ readonly model: string;
1087
+ readonly tools: string;
1088
+ readonly replay?: {
1089
+ readonly agent: string;
1090
+ readonly agentBehavior?: string | undefined;
1091
+ readonly tools: {
1092
+ readonly [x: string]: string;
1093
+ };
1094
+ } | undefined;
1095
+ };
1096
+ } | {
1003
1097
  readonly _tag: "UserInputRecorded";
1004
1098
  readonly submissionId?: string | undefined;
1005
1099
  readonly kind: "follow-up" | "steering" | "user";
@@ -1094,6 +1188,25 @@ declare const encodeHostResponse: (input: AbortRecorded | ApprovalRecorded | Hos
1094
1188
  readonly value: Schema.Json;
1095
1189
  };
1096
1190
  } | undefined;
1191
+ } | {
1192
+ readonly _tag: "RunStarted";
1193
+ readonly runId: string;
1194
+ readonly policyAccountingVersion: 1;
1195
+ readonly maxDurationMillis: number;
1196
+ } | {
1197
+ readonly _tag: "RunDurationExhausted";
1198
+ readonly runId: string;
1199
+ } | {
1200
+ readonly _tag: "RunPolicyUsageReserved";
1201
+ readonly runId: string;
1202
+ readonly programmaticToolCalls: number;
1203
+ readonly finalizationUsed: boolean;
1204
+ } | {
1205
+ readonly _tag: "ModelCompleted";
1206
+ readonly runId: string;
1207
+ readonly output: Schema.Json;
1208
+ readonly messages?: Schema.Json | undefined;
1209
+ readonly history?: Schema.Json | undefined;
1097
1210
  } | {
1098
1211
  readonly _tag: "ModelResponseRecorded";
1099
1212
  readonly toolResultMaxBytes: number;
@@ -1160,48 +1273,6 @@ declare const encodeHostResponse: (input: AbortRecorded | ApprovalRecorded | Hos
1160
1273
  readonly inputTokens?: number | undefined;
1161
1274
  readonly outputTokens?: number | undefined;
1162
1275
  readonly costMicrousd?: number | undefined;
1163
- } | {
1164
- readonly _tag: "CompactionCreated";
1165
- readonly runId: string;
1166
- readonly turn: number;
1167
- readonly kind: "clear-tool-results" | "rollover" | "summarize";
1168
- readonly coversThrough: number;
1169
- readonly summary?: string | undefined;
1170
- readonly handoff?: string | undefined;
1171
- } | {
1172
- readonly _tag: "ThreadCreated";
1173
- readonly agentId: string;
1174
- readonly definitions: {
1175
- readonly agent: string;
1176
- readonly model: string;
1177
- readonly tools: string;
1178
- readonly replay?: {
1179
- readonly agent: string;
1180
- readonly agentBehavior?: string | undefined;
1181
- readonly tools: {
1182
- readonly [x: string]: string;
1183
- };
1184
- } | undefined;
1185
- };
1186
- } | {
1187
- readonly _tag: "RunStarted";
1188
- readonly runId: string;
1189
- readonly policyAccountingVersion: 1;
1190
- readonly maxDurationMillis: number;
1191
- } | {
1192
- readonly _tag: "RunDurationExhausted";
1193
- readonly runId: string;
1194
- } | {
1195
- readonly _tag: "RunPolicyUsageReserved";
1196
- readonly runId: string;
1197
- readonly programmaticToolCalls: number;
1198
- readonly finalizationUsed: boolean;
1199
- } | {
1200
- readonly _tag: "ModelCompleted";
1201
- readonly runId: string;
1202
- readonly output: Schema.Json;
1203
- readonly messages?: Schema.Json | undefined;
1204
- readonly history?: Schema.Json | undefined;
1205
1276
  } | {
1206
1277
  readonly _tag: "ToolCallSettled";
1207
1278
  readonly toolSelection?: {
@@ -1288,6 +1359,14 @@ declare const encodeHostResponse: (input: AbortRecorded | ApprovalRecorded | Hos
1288
1359
  readonly costMicrousd: number;
1289
1360
  }[];
1290
1361
  readonly unobservedModelCalls: number;
1362
+ } | {
1363
+ readonly _tag: "CompactionCreated";
1364
+ readonly runId: string;
1365
+ readonly turn: number;
1366
+ readonly kind: "clear-tool-results" | "rollover" | "summarize";
1367
+ readonly coversThrough: number;
1368
+ readonly summary?: string | undefined;
1369
+ readonly handoff?: string | undefined;
1291
1370
  } | {
1292
1371
  readonly _tag: "RunFailed";
1293
1372
  readonly runId: string;
@@ -1304,85 +1383,6 @@ declare const encodeHostResponse: (input: AbortRecorded | ApprovalRecorded | Hos
1304
1383
  readonly submissionId: string;
1305
1384
  readonly author: string;
1306
1385
  readonly reason: string;
1307
- } | {
1308
- readonly _tag: "SubmissionSettled";
1309
- readonly submissionId: string;
1310
- readonly settlementId: string;
1311
- readonly receiptId: string;
1312
- readonly outcome: "aborted" | "completed" | "failed";
1313
- readonly runId?: string | undefined;
1314
- readonly historyRecordCount?: number | undefined;
1315
- readonly result?: Schema.Json | undefined;
1316
- readonly runDisposition?: Schema.Json | undefined;
1317
- readonly finishReason?: "budget-exhausted" | undefined;
1318
- readonly exhausted?: "tokens" | "tool-calls" | "turns" | undefined;
1319
- readonly policyLimit?: "cost" | "duration" | "repeated-failures" | "tokens" | "tool-calls" | "turns" | "usage" | undefined;
1320
- readonly usageSummary?: {
1321
- readonly modelCalls: number;
1322
- readonly inputTokens: {
1323
- readonly total: number;
1324
- readonly uncached: number;
1325
- readonly cacheRead: number;
1326
- readonly cacheWrite: number;
1327
- };
1328
- readonly outputTokens: {
1329
- readonly total: number;
1330
- readonly text: number;
1331
- readonly reasoning: number;
1332
- };
1333
- readonly webSearchCalls?: number | undefined;
1334
- readonly costMicrousd: number;
1335
- readonly byModel: readonly {
1336
- readonly provider: string;
1337
- readonly model: string;
1338
- readonly responseModel?: string | undefined;
1339
- readonly serviceTier?: string | undefined;
1340
- readonly pricingVersion?: string | undefined;
1341
- readonly modelCalls: number;
1342
- readonly inputTokens: {
1343
- readonly total: number;
1344
- readonly uncached: number;
1345
- readonly cacheRead: number;
1346
- readonly cacheWrite: number;
1347
- };
1348
- readonly outputTokens: {
1349
- readonly total: number;
1350
- readonly text: number;
1351
- readonly reasoning: number;
1352
- };
1353
- readonly webSearchCalls?: number | undefined;
1354
- readonly costMicrousd: number;
1355
- }[];
1356
- readonly usageStatus?: "complete" | "partial" | "unknown" | undefined;
1357
- readonly pricingStatus?: "complete" | "partial" | "unknown" | undefined;
1358
- readonly unobservedModelCalls?: number | undefined;
1359
- } | undefined;
1360
- readonly uncommittedModelUsage?: readonly {
1361
- readonly provider: string;
1362
- readonly model: string;
1363
- readonly serviceTier?: string | undefined;
1364
- readonly pricingVersion?: string | undefined;
1365
- readonly response?: {
1366
- readonly id?: string | undefined;
1367
- readonly model?: string | undefined;
1368
- } | undefined;
1369
- readonly purpose?: "summary" | "turn" | undefined;
1370
- readonly usageStatus?: "complete" | "partial" | "unknown" | undefined;
1371
- readonly pricingStatus?: "estimated" | "unknown" | undefined;
1372
- readonly inputTokens: {
1373
- readonly total: number;
1374
- readonly uncached: number;
1375
- readonly cacheRead: number;
1376
- readonly cacheWrite: number;
1377
- };
1378
- readonly outputTokens: {
1379
- readonly total: number;
1380
- readonly text: number;
1381
- readonly reasoning: number;
1382
- };
1383
- readonly webSearchCalls?: number | undefined;
1384
- readonly costMicrousd: number;
1385
- }[] | undefined;
1386
1386
  } | {
1387
1387
  readonly _tag: "SubagentRequested";
1388
1388
  readonly runId: string;
@@ -2027,26 +2027,20 @@ declare const encodeHostResponse: (input: AbortRecorded | ApprovalRecorded | Hos
2027
2027
  } | {
2028
2028
  readonly _tag: "HostFailed";
2029
2029
  readonly failure: {
2030
- readonly _tag: "ThreadNotMaterialized";
2031
- readonly threadId: string;
2032
- } | {
2033
- readonly _tag: "ThreadStoreError";
2030
+ readonly _tag: "DurableAlarmError";
2034
2031
  readonly operation: string;
2035
2032
  readonly message: string;
2036
2033
  readonly cause?: Schema.Json | undefined;
2037
- readonly diagnostic?: {
2038
- readonly causeTag: string;
2039
- readonly operation: string;
2040
- readonly decoder?: string | undefined;
2041
- readonly issueTag?: string | undefined;
2042
- readonly sequence?: number | undefined;
2043
- } | undefined;
2044
2034
  } | {
2045
- readonly _tag: "OwnershipLost";
2046
- readonly submissionId: string;
2035
+ readonly _tag: "HostProtocolError";
2036
+ readonly message: string;
2047
2037
  } | {
2048
- readonly _tag: "DurableRuntimeFailpointError";
2049
- readonly location: "abort:after-intent" | "approval:after-request-append" | "approval:after-suspend" | "claim:after-claim" | "compaction:after-canonical-append" | "compaction:before-canonical-append" | "input:after-canonical-append" | "join:after-canonical-append" | "join:after-claim" | "policy:after-reservation-append" | "policy:before-reservation-append" | "resolve:after-intent" | "run:after-duration-append" | "run:after-start-append" | "run:before-duration-append" | "run:before-start-append" | "step:after-step-append" | "subagent:after-admit" | "subagent:after-child-abort-intent" | "subagent:after-child-ready" | "subagent:after-join-append" | "subagent:after-release" | "subagent:after-release-pending" | "subagent:after-request-append" | "subagent:after-reserve" | "subagent:after-sibling-settle" | "subagent:after-start-append" | "subagent:after-suspend" | "subagent:before-join-append" | "submit:after-admit" | "submit:after-materialize" | "terminalize:after-canonical-append" | "terminalize:before-publication" | "tools:after-dispatch-fence" | "tools:after-unavailable-append" | "tools:before-dispatch-fence" | "tools:before-unavailable-append" | "turn:after-canonical-append" | "turn:after-response-append" | "turn:after-results-append" | "update:after-canonical-append" | "update:after-delivery-insert" | "update:before-canonical-append" | "update:before-delivery-insert" | "worker:after-completion-append" | "worker:after-origin-append" | "worker:after-report-append" | "worker:after-report-delivery" | "worker:after-source-append" | "worker:after-stop-append" | "worker:after-stop-seal" | "worker:after-subtree-append" | "worker:before-completion-append" | "worker:before-origin-append" | "worker:before-report-append" | "worker:before-report-delivery" | "worker:before-source-append" | "worker:before-stop-append" | "worker:before-stop-seal" | "worker:before-subtree-append";
2038
+ readonly _tag: "AgentInputError";
2039
+ readonly message: string;
2040
+ } | {
2041
+ readonly _tag: "DigestError";
2042
+ readonly message: string;
2043
+ readonly cause?: Schema.Json | undefined;
2050
2044
  } | {
2051
2045
  readonly _tag: "AdmissionConflict";
2052
2046
  readonly threadId: string;
@@ -2064,6 +2058,15 @@ declare const encodeHostResponse: (input: AbortRecorded | ApprovalRecorded | Hos
2064
2058
  readonly _tag: "SettlementConflict";
2065
2059
  readonly submissionId: string;
2066
2060
  readonly existingOutcome: "aborted" | "completed" | "failed";
2061
+ } | {
2062
+ readonly _tag: "ApprovalConflict";
2063
+ readonly submissionId: string;
2064
+ readonly toolCallId: string;
2065
+ readonly existingDecision: "approved" | "denied";
2066
+ } | {
2067
+ readonly _tag: "UnknownResolutionConflict";
2068
+ readonly submissionId: string;
2069
+ readonly toolCallId: string;
2067
2070
  } | {
2068
2071
  readonly _tag: "JoinedToHost";
2069
2072
  readonly submissionId: string;
@@ -2073,6 +2076,24 @@ declare const encodeHostResponse: (input: AbortRecorded | ApprovalRecorded | Hos
2073
2076
  readonly operation: string;
2074
2077
  readonly message: string;
2075
2078
  readonly cause?: import("@yielded/agent/failure-diagnostic").Diagnostic | undefined;
2079
+ } | {
2080
+ readonly _tag: "OwnershipLost";
2081
+ readonly submissionId: string;
2082
+ } | {
2083
+ readonly _tag: "ThreadStoreError";
2084
+ readonly operation: string;
2085
+ readonly message: string;
2086
+ readonly cause?: Schema.Json | undefined;
2087
+ readonly diagnostic?: {
2088
+ readonly causeTag: string;
2089
+ readonly operation: string;
2090
+ readonly decoder?: string | undefined;
2091
+ readonly issueTag?: string | undefined;
2092
+ readonly sequence?: number | undefined;
2093
+ } | undefined;
2094
+ } | {
2095
+ readonly _tag: "ThreadNotMaterialized";
2096
+ readonly threadId: string;
2076
2097
  } | {
2077
2098
  readonly _tag: "AppendConflict";
2078
2099
  readonly threadId: string;
@@ -2080,40 +2101,19 @@ declare const encodeHostResponse: (input: AbortRecorded | ApprovalRecorded | Hos
2080
2101
  readonly reason: "batch-content" | "record-identity" | "stale-command" | "tail";
2081
2102
  readonly actualTailSequence?: number | undefined;
2082
2103
  } | {
2083
- readonly _tag: "OperationDenied";
2084
- readonly operation: "abort" | "awaitSettlement" | "explain" | "observe" | "resolveApproval" | "resolveUnknown" | "retry" | "scanObligations" | "verify" | "wake";
2085
- readonly reason: string;
2086
- readonly threadId?: string | undefined;
2087
- readonly submissionId?: string | undefined;
2088
- } | {
2089
- readonly _tag: "DigestError";
2090
- readonly message: string;
2091
- readonly cause?: Schema.Json | undefined;
2092
- } | {
2093
- readonly _tag: "AgentInputError";
2094
- readonly message: string;
2104
+ readonly _tag: "DurableRuntimeFailpointError";
2105
+ readonly location: "abort:after-intent" | "approval:after-request-append" | "approval:after-suspend" | "claim:after-claim" | "compaction:after-canonical-append" | "compaction:before-canonical-append" | "input:after-canonical-append" | "join:after-canonical-append" | "join:after-claim" | "policy:after-reservation-append" | "policy:before-reservation-append" | "resolve:after-intent" | "run:after-duration-append" | "run:after-start-append" | "run:before-duration-append" | "run:before-start-append" | "step:after-step-append" | "subagent:after-admit" | "subagent:after-child-abort-intent" | "subagent:after-child-ready" | "subagent:after-join-append" | "subagent:after-release" | "subagent:after-release-pending" | "subagent:after-request-append" | "subagent:after-reserve" | "subagent:after-sibling-settle" | "subagent:after-start-append" | "subagent:after-suspend" | "subagent:before-join-append" | "submit:after-admit" | "submit:after-materialize" | "terminalize:after-canonical-append" | "terminalize:before-publication" | "tools:after-dispatch-fence" | "tools:after-unavailable-append" | "tools:before-dispatch-fence" | "tools:before-unavailable-append" | "turn:after-canonical-append" | "turn:after-response-append" | "turn:after-results-append" | "update:after-canonical-append" | "update:after-delivery-insert" | "update:before-canonical-append" | "update:before-delivery-insert" | "worker:after-completion-append" | "worker:after-origin-append" | "worker:after-report-append" | "worker:after-report-delivery" | "worker:after-source-append" | "worker:after-stop-append" | "worker:after-stop-seal" | "worker:after-subtree-append" | "worker:before-completion-append" | "worker:before-origin-append" | "worker:before-report-append" | "worker:before-report-delivery" | "worker:before-source-append" | "worker:before-stop-append" | "worker:before-stop-seal" | "worker:before-subtree-append";
2095
2106
  } | {
2096
2107
  readonly _tag: "AdmissionLimitExceeded";
2097
2108
  readonly limit: "database-bytes" | "input-bytes" | "queue-depth";
2098
2109
  readonly actual: number;
2099
2110
  readonly maximum: number;
2100
2111
  } | {
2101
- readonly _tag: "DurableAlarmError";
2102
- readonly operation: string;
2103
- readonly message: string;
2104
- readonly cause?: Schema.Json | undefined;
2105
- } | {
2106
- readonly _tag: "HostProtocolError";
2107
- readonly message: string;
2108
- } | {
2109
- readonly _tag: "ApprovalConflict";
2110
- readonly submissionId: string;
2111
- readonly toolCallId: string;
2112
- readonly existingDecision: "approved" | "denied";
2113
- } | {
2114
- readonly _tag: "UnknownResolutionConflict";
2115
- readonly submissionId: string;
2116
- readonly toolCallId: string;
2112
+ readonly _tag: "OperationDenied";
2113
+ readonly operation: "abort" | "awaitSettlement" | "explain" | "observe" | "resolveApproval" | "resolveUnknown" | "retry" | "scanObligations" | "verify" | "wake";
2114
+ readonly reason: string;
2115
+ readonly threadId?: string | undefined;
2116
+ readonly submissionId?: string | undefined;
2117
2117
  };
2118
2118
  }, Schema.SchemaError, never>;
2119
2119
  declare const decodeHostResponse: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => Effect.Effect<AbortRecorded | ApprovalRecorded | HostFailed | ObservedPage | ProgressCancelled | ProgressObserved | SettlementReached | SettlementRecordReached | SubmissionStatusResponse | SubmitSucceeded | UnknownResolutionRecorded, Schema.SchemaError, never>;
@@ -2208,4 +2208,4 @@ declare class CloudflareThreadClient extends CloudflareThreadClient_base {
2208
2208
  }
2209
2209
  //#endregion
2210
2210
  export { Observation as $, boundHostDiagnostic as A, decodeSubmitRequest as B, SettlementReached as C, SubmitSucceeded as D, SubmitRequest as E, decodeCancelProgressRequest as F, encodeAwaitSettlementRequest as G, encodeAbortCommand as H, decodeHostResponse as I, encodeObservePageRequest as J, encodeCancelProgressRequest as K, decodeLiveText as L, decodeApprovalDecisionCommand as M, decodeAwaitProgressRequest as N, ThreadClientError as O, decodeAwaitSettlementRequest as P, Frame as Q, decodeObservePageRequest as R, ProgressObserved as S, SubmissionStatusResponse as T, encodeApprovalDecisionCommand as U, decodeUnknownResolutionCommand as V, encodeAwaitProgressRequest as W, encodeSubmitRequest as X, encodeReceipt as Y, encodeUnknownResolutionCommand 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, encodeHostResponse 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, decodeReceipt as z };
2211
- //# sourceMappingURL=CloudflareThreadClient-DNsFhgVu.d.mts.map
2211
+ //# sourceMappingURL=CloudflareThreadClient-CmlojpjC.d.mts.map
@@ -1,2 +1,2 @@
1
- import { A as boundHostDiagnostic, B as decodeSubmitRequest, C as SettlementReached, D as SubmitSucceeded, E as SubmitRequest, F as decodeCancelProgressRequest, G as encodeAwaitSettlementRequest, H as encodeAbortCommand, I as decodeHostResponse, J as encodeObservePageRequest, K as encodeCancelProgressRequest, L as decodeLiveText, M as decodeApprovalDecisionCommand, N as decodeAwaitProgressRequest, O as ThreadClientError, P as decodeAwaitSettlementRequest, Q as Frame, R as decodeObservePageRequest, S as ProgressObserved, T as SubmissionStatusResponse, U as encodeApprovalDecisionCommand, V as decodeUnknownResolutionCommand, W as encodeAwaitProgressRequest, X as encodeSubmitRequest, Y as encodeReceipt, Z as encodeUnknownResolutionCommand, _ as HostProtocolError, a as CancelProgressRequest, b as ObservedPage, c as ClientAwaitFailure, d as ClientSubmitFailure, f as ClientUnknownFailure, g as HostFailure, h as HostFailed, i as AwaitSettlementRequest, j as decodeAbortCommand, k as UnknownResolutionRecorded, l as ClientObserveFailure, n as ApprovalRecorded, o as ClientAbortFailure, p as CloudflareThreadClient, q as encodeHostResponse, r as AwaitProgressRequest, s as ClientApprovalFailure, t as AbortRecorded, u as ClientProgressFailure, v as HostResponse, w as SettlementRecordReached, x as ProgressCancelled, y as ObservePageRequest, z as decodeReceipt } from "./CloudflareThreadClient-DNsFhgVu.mjs";
1
+ import { A as boundHostDiagnostic, B as decodeSubmitRequest, C as SettlementReached, D as SubmitSucceeded, E as SubmitRequest, F as decodeCancelProgressRequest, G as encodeAwaitSettlementRequest, H as encodeAbortCommand, I as decodeHostResponse, J as encodeObservePageRequest, K as encodeCancelProgressRequest, L as decodeLiveText, M as decodeApprovalDecisionCommand, N as decodeAwaitProgressRequest, O as ThreadClientError, P as decodeAwaitSettlementRequest, Q as Frame, R as decodeObservePageRequest, S as ProgressObserved, T as SubmissionStatusResponse, U as encodeApprovalDecisionCommand, V as decodeUnknownResolutionCommand, W as encodeAwaitProgressRequest, X as encodeSubmitRequest, Y as encodeReceipt, Z as encodeUnknownResolutionCommand, _ as HostProtocolError, a as CancelProgressRequest, b as ObservedPage, c as ClientAwaitFailure, d as ClientSubmitFailure, f as ClientUnknownFailure, g as HostFailure, h as HostFailed, i as AwaitSettlementRequest, j as decodeAbortCommand, k as UnknownResolutionRecorded, l as ClientObserveFailure, n as ApprovalRecorded, o as ClientAbortFailure, p as CloudflareThreadClient, q as encodeHostResponse, r as AwaitProgressRequest, s as ClientApprovalFailure, t as AbortRecorded, u as ClientProgressFailure, v as HostResponse, w as SettlementRecordReached, x as ProgressCancelled, y as ObservePageRequest, z as decodeReceipt } from "./CloudflareThreadClient-CmlojpjC.mjs";
2
2
  export { AbortRecorded, ApprovalRecorded, AwaitProgressRequest, AwaitSettlementRequest, CancelProgressRequest, ClientAbortFailure, ClientApprovalFailure, ClientAwaitFailure, ClientObserveFailure, ClientProgressFailure, ClientSubmitFailure, ClientUnknownFailure, CloudflareThreadClient, HostFailed, HostFailure, HostProtocolError, HostResponse, Frame as LiveTextFrame, ObservePageRequest, ObservedPage, ProgressCancelled, ProgressObserved, SettlementReached, SettlementRecordReached, SubmissionStatusResponse, SubmitRequest, SubmitSucceeded, ThreadClientError, UnknownResolutionRecorded, boundHostDiagnostic, decodeAbortCommand, decodeApprovalDecisionCommand, decodeAwaitProgressRequest, decodeAwaitSettlementRequest, decodeCancelProgressRequest, decodeHostResponse, decodeLiveText, decodeObservePageRequest, decodeReceipt, decodeSubmitRequest, decodeUnknownResolutionCommand, encodeAbortCommand, encodeApprovalDecisionCommand, encodeAwaitProgressRequest, encodeAwaitSettlementRequest, encodeCancelProgressRequest, encodeHostResponse, encodeObservePageRequest, encodeReceipt, encodeSubmitRequest, encodeUnknownResolutionCommand };
@@ -1,52 +1,11 @@
1
- import { Cause, Clock, Context, Data, Duration, Effect, ErrorReporter, Layer, Option, Predicate, Redacted, Schema, Scope, Semaphore, Stream } from "effect";
1
+ import { a as reportedBrowserError, i as reportBrowserCause, n as browserFailure, t as BrowserRunFailure } from "./browser-failure-DECzRY3H.mjs";
2
+ import { Cause, Clock, Context, Duration, Effect, Layer, Option, Redacted, Schema, Scope, Semaphore, Stream } from "effect";
2
3
  import { PageScreenshotResult } from "@yielded/agent/page-screenshot";
3
4
  import { SandboxImplementation } from "@yielded/agent/sandbox";
4
5
  import { FetchHttpClient, HttpClient, HttpClientRequest } from "effect/http";
5
6
  import { BrowserActionResult, BrowserExpectedTargetState, BrowserFileSelectionResult, BrowserNavigationResult, BrowserScreenshotRequest, BrowserScrollRequest, BrowserSelectFileRequest, BrowserTextResult, InteractiveBrowser, InteractiveBrowserActionError, InteractiveBrowserBusyError, InteractiveBrowserCapacityError, InteractiveBrowserExpiredError, InteractiveBrowserLimitError, InteractiveBrowserPolicy, InteractiveBrowserPolicyDeniedError, InteractiveBrowserProtocolError, InteractiveBrowserTargetUrl, InteractiveBrowserUnsupportedError } from "@yielded/agent/interactive-browser";
6
7
  import puppeteer, { ElementHandle } from "puppeteer-core/lib/esm/puppeteer/puppeteer-core-browser.js";
7
8
  import { Base64 } from "effect/encoding";
8
- //#region src/internal/browser-failure.ts
9
- /** Source-authored stages and classifications only; never retain SDK text or session capabilities. */
10
- var BrowserRunFailure = class extends Data.TaggedError("BrowserRunFailure") {
11
- [ErrorReporter.severity] = "Error";
12
- };
13
- /** A public projection of an already reported private failure must not produce another issue. */
14
- const reportedBrowserError = (error) => Object.assign(error, { [ErrorReporter.ignore]: true });
15
- const reasonSchema = Schema.Literals([
16
- "provider",
17
- "timeout",
18
- "malformed",
19
- "configuration",
20
- "authorization",
21
- "rate-limited",
22
- "pending"
23
- ]);
24
- const statusSchema = Schema.Int.check(Schema.isBetween({
25
- minimum: 100,
26
- maximum: 599
27
- }));
28
- const failureNames = /* @__PURE__ */ new Set([
29
- "TypeError",
30
- "RangeError",
31
- "SyntaxError",
32
- "TimeoutError",
33
- "SchemaError"
34
- ]);
35
- const browserFailure = (operation, cause) => cause instanceof BrowserRunFailure ? cause : new BrowserRunFailure({
36
- operation,
37
- reason: Predicate.isObject(cause) && "reason" in cause && Schema.is(reasonSchema)(cause.reason) ? cause.reason : "provider",
38
- ...Predicate.isObject(cause) && "status" in cause && Schema.is(statusSchema)(cause.status) ? { status: cause.status } : {},
39
- ...Predicate.isObject(cause) && "cause" in cause && cause.cause instanceof BrowserRunFailure ? { cause: cause.cause } : Predicate.isObject(cause) && "name" in cause && typeof cause.name === "string" && failureNames.has(cause.name) ? { cause: { name: cause.name } } : {}
40
- });
41
- /** Keep mixed defects and interruptions distinct while discarding all foreign diagnostic content. */
42
- const reportBrowserCause = (operation, cause) => ErrorReporter.report(Cause.fromReasons(cause.reasons.filter((reason) => !Cause.isFailReason(reason) || !ErrorReporter.isIgnored(reason.error)).map((reason) => {
43
- switch (reason._tag) {
44
- case "Fail": return Cause.makeFailReason(browserFailure(operation, reason.error));
45
- case "Die": return Cause.makeDieReason(browserFailure(operation, reason.defect));
46
- case "Interrupt": return reason;
47
- }
48
- })));
49
- //#endregion
50
9
  //#region src/internal/browser-binding.ts
51
10
  const Acquired = Schema.Struct({ sessionId: Schema.String.check(Schema.isUUID()) });
52
11
  const VersionReply = Schema.fromJsonString(Schema.Struct({
@@ -1937,6 +1896,6 @@ const CloudflareInteractiveBrowser = {
1937
1896
  hostLayer: (options) => browserRunInteractiveHostLayer().pipe(Layer.provide(interactiveBindingLayer(options)))
1938
1897
  };
1939
1898
  //#endregion
1940
- export { reportedBrowserError as C, reportBrowserCause as S, BrowserRunCleanupError as _, BrowserRunInteractiveCheckpoint as a, BrowserRunFailure as b, BrowserRunLiveViewResult as c, BrowserRunViewport as d, CloudflareInteractiveBrowser as f, isBrowserRunUndispatchedActionError as g, browserRunInteractiveLayer as h, BrowserRunInteractiveBinding as i, BrowserRunPageIdentity as l, browserRunInteractiveImplementation as m, BrowserRunHandoffResult as n, BrowserRunInteractiveHost as o, browserRunInteractiveHostLayer as p, BrowserRunHandoffState as r, BrowserRunLiveViewRequest as s, BrowserRunHandoffRequest as t, BrowserRunPageObservation as u, BrowserRunSessionLifecycle as v, browserFailure as x, BrowserRunBinding as y };
1899
+ export { BrowserRunCleanupError as _, BrowserRunInteractiveCheckpoint as a, BrowserRunLiveViewResult as c, BrowserRunViewport as d, CloudflareInteractiveBrowser as f, isBrowserRunUndispatchedActionError as g, browserRunInteractiveLayer as h, BrowserRunInteractiveBinding as i, BrowserRunPageIdentity as l, browserRunInteractiveImplementation as m, BrowserRunHandoffResult as n, BrowserRunInteractiveHost as o, browserRunInteractiveHostLayer as p, BrowserRunHandoffState as r, BrowserRunLiveViewRequest as s, BrowserRunHandoffRequest as t, BrowserRunPageObservation as u, BrowserRunSessionLifecycle as v, BrowserRunBinding as y };
1941
1900
 
1942
- //# sourceMappingURL=InteractiveBrowser-BHNlwjZL.mjs.map
1901
+ //# sourceMappingURL=InteractiveBrowser-nukKxc87.mjs.map