@effect-agent/platform-cloudflare 0.1.0-beta.83 → 0.1.0-beta.85
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/Alarm.mjs +1 -1
- package/dist/Alarm.mjs.map +1 -1
- package/dist/BrowserRestCrawl.mjs +1 -1
- package/dist/BrowserRestCrawl.mjs.map +1 -1
- package/dist/CloudflareBindings.d.mts +6 -3
- package/dist/CloudflareBindings.mjs +14 -2
- package/dist/CloudflareBindings.mjs.map +1 -1
- package/dist/CloudflareMemory.d.mts +1 -1
- package/dist/CloudflareMemory.mjs +16 -9
- package/dist/CloudflareMemory.mjs.map +1 -1
- package/dist/CloudflareScheduling.mjs +15 -8
- package/dist/CloudflareScheduling.mjs.map +1 -1
- package/dist/CloudflareSubscriptions.mjs +12 -6
- package/dist/CloudflareSubscriptions.mjs.map +1 -1
- package/dist/CloudflareThreadClient.d.mts +256 -46
- package/dist/CloudflareThreadClient.mjs +11 -15
- package/dist/CloudflareThreadClient.mjs.map +1 -1
- package/dist/InteractiveBrowser.mjs +15 -15
- package/dist/InteractiveBrowser.mjs.map +1 -1
- package/dist/ProtectedBrowser.mjs +12 -12
- package/dist/ProtectedBrowser.mjs.map +1 -1
- package/dist/{ThreadObject-rVo6_oel.d.mts → ThreadObject-DZMkwIBh.d.mts} +29 -33
- package/dist/{ThreadObject-BpwkEc5E.mjs → ThreadObject-gyx8Qq03.mjs} +8 -9
- package/dist/ThreadObject-gyx8Qq03.mjs.map +1 -0
- package/dist/ThreadObject.d.mts +1 -1
- package/dist/ThreadObject.mjs +1 -1
- package/dist/WakeScheduler.mjs +7 -10
- package/dist/WakeScheduler.mjs.map +1 -1
- package/dist/{browser-session-lifecycle-CUbVfEgP.mjs → browser-session-lifecycle-CmbQABHC.mjs} +5 -5
- package/dist/browser-session-lifecycle-CmbQABHC.mjs.map +1 -0
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
- package/src/Alarm.ts +6 -6
- package/src/BrowserRestCrawl.ts +1 -1
- package/src/CloudflareBindings.ts +20 -1
- package/src/CloudflareMemory.ts +25 -11
- package/src/CloudflareScheduling.ts +23 -9
- package/src/CloudflareSubscriptions.ts +18 -18
- package/src/CloudflareThreadClient.ts +14 -12
- package/src/InteractiveBrowser.ts +19 -22
- package/src/WakeScheduler.ts +12 -6
- package/src/internal/browser-session-lifecycle.ts +8 -8
- package/src/internal/message-delivery.ts +5 -6
- package/src/internal/transport.ts +8 -6
- package/src/protected-browser/binding.ts +1 -1
- package/src/protected-browser/policy.ts +29 -31
- package/dist/ThreadObject-BpwkEc5E.mjs.map +0 -1
- package/dist/browser-session-lifecycle-CUbVfEgP.mjs.map +0 -1
|
@@ -80,6 +80,7 @@ declare const SubmitRequest_base: Schema.Class<SubmitRequest, Schema.Struct<{
|
|
|
80
80
|
readonly createdAtMillis: Schema.Natural;
|
|
81
81
|
readonly expiresAtMillis: Schema.Natural;
|
|
82
82
|
readonly reporting: Schema.optionalKey<Schema.Struct<{
|
|
83
|
+
readonly mode: Schema.optionalKey<Schema.Literal<"standard">>;
|
|
83
84
|
readonly sourceDigests: typeof DefinitionDigests;
|
|
84
85
|
readonly destinationDelegationId: Schema.optionalKey<Schema.brand<Schema.NonEmptyString, "@effect-agent/core/DelegationId">>;
|
|
85
86
|
}>>;
|
|
@@ -89,8 +90,9 @@ declare const SubmitRequest_base: Schema.Class<SubmitRequest, Schema.Struct<{
|
|
|
89
90
|
readonly createdAtMillis: Schema.Natural;
|
|
90
91
|
readonly sourceSubmissionId: Schema.optionalKey<Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SubmissionId">>;
|
|
91
92
|
readonly deliveryPrincipal: Schema.optionalKey<Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/Principal">>;
|
|
93
|
+
readonly reportKind: Schema.optionalKey<Schema.Literal<"update">>;
|
|
92
94
|
}>>;
|
|
93
|
-
readonly messageAdmission: Schema.optionalKey<Schema.Struct<{
|
|
95
|
+
readonly messageAdmission: Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
|
|
94
96
|
readonly schemaVersion: Schema.Literal<1>;
|
|
95
97
|
readonly message: Schema.Struct<{
|
|
96
98
|
readonly ownerThreadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
|
|
@@ -109,7 +111,48 @@ declare const SubmitRequest_base: Schema.Class<SubmitRequest, Schema.Struct<{
|
|
|
109
111
|
readonly ownerThreadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
|
|
110
112
|
readonly messageId: Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/IdempotencyKey">;
|
|
111
113
|
}>>;
|
|
112
|
-
}
|
|
114
|
+
}>, Schema.Union<readonly [Schema.Struct<{
|
|
115
|
+
readonly _tag: Schema.Literal<"WorkerCompletion">;
|
|
116
|
+
readonly budgetExhausted: Schema.Boolean;
|
|
117
|
+
readonly schemaVersion: Schema.Literal<1>;
|
|
118
|
+
readonly report: Schema.Union<readonly [Schema.Struct<{
|
|
119
|
+
readonly _tag: Schema.Literal<"Settled">;
|
|
120
|
+
readonly worker: Schema.Struct<{
|
|
121
|
+
readonly schemaVersion: Schema.Literal<1>;
|
|
122
|
+
readonly delegationId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/DelegationId">;
|
|
123
|
+
readonly targetAgentId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/AgentId">;
|
|
124
|
+
readonly threadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
|
|
125
|
+
}>;
|
|
126
|
+
readonly receipt: typeof Receipt;
|
|
127
|
+
readonly runId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/RunId">;
|
|
128
|
+
readonly settlementId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SettlementId">;
|
|
129
|
+
readonly outcome: Schema.Literal<"completed">;
|
|
130
|
+
readonly result: Schema.Union<readonly [Schema.Codec<Schema.Json, Schema.Json, never, never>]>;
|
|
131
|
+
}>, Schema.Struct<{
|
|
132
|
+
readonly _tag: Schema.Literal<"Settled">;
|
|
133
|
+
readonly worker: Schema.Struct<{
|
|
134
|
+
readonly schemaVersion: Schema.Literal<1>;
|
|
135
|
+
readonly delegationId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/DelegationId">;
|
|
136
|
+
readonly targetAgentId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/AgentId">;
|
|
137
|
+
readonly threadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
|
|
138
|
+
}>;
|
|
139
|
+
readonly receipt: typeof Receipt;
|
|
140
|
+
readonly runId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/RunId">;
|
|
141
|
+
readonly settlementId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SettlementId">;
|
|
142
|
+
readonly outcome: Schema.Literals<readonly ["failed", "aborted"]>;
|
|
143
|
+
readonly failure: typeof import("@effect-agent/core/SubagentContract").SubagentExecutionFailure;
|
|
144
|
+
}>]>;
|
|
145
|
+
}>, Schema.Struct<{
|
|
146
|
+
readonly _tag: Schema.Literal<"WorkerUpdate">;
|
|
147
|
+
readonly schemaVersion: Schema.Literal<1>;
|
|
148
|
+
readonly worker: Schema.Struct<{
|
|
149
|
+
readonly schemaVersion: Schema.Literal<1>;
|
|
150
|
+
readonly delegationId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/DelegationId">;
|
|
151
|
+
readonly targetAgentId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/AgentId">;
|
|
152
|
+
readonly threadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
|
|
153
|
+
}>;
|
|
154
|
+
readonly update: typeof import("@effect-agent/core/AgentUpdates").Update;
|
|
155
|
+
}>]>]>>;
|
|
113
156
|
readonly definitions: typeof DefinitionDigests;
|
|
114
157
|
readonly inputPayload: Schema.declare<Schema.Json, Schema.Json>;
|
|
115
158
|
}>, {}>;
|
|
@@ -257,6 +300,7 @@ declare const encodeSubmitRequest: (input: SubmitRequest, options?: import("effe
|
|
|
257
300
|
readonly createdAtMillis: number;
|
|
258
301
|
readonly expiresAtMillis: number;
|
|
259
302
|
readonly reporting?: {
|
|
303
|
+
readonly mode?: "standard" | undefined;
|
|
260
304
|
readonly sourceDigests: {
|
|
261
305
|
readonly agent: string;
|
|
262
306
|
readonly model: string;
|
|
@@ -270,6 +314,7 @@ declare const encodeSubmitRequest: (input: SubmitRequest, options?: import("effe
|
|
|
270
314
|
readonly createdAtMillis: number;
|
|
271
315
|
readonly sourceSubmissionId?: string | undefined;
|
|
272
316
|
readonly deliveryPrincipal?: string | undefined;
|
|
317
|
+
readonly reportKind?: "update" | undefined;
|
|
273
318
|
} | undefined;
|
|
274
319
|
readonly messageAdmission?: {
|
|
275
320
|
readonly schemaVersion: 1;
|
|
@@ -290,6 +335,75 @@ declare const encodeSubmitRequest: (input: SubmitRequest, options?: import("effe
|
|
|
290
335
|
readonly ownerThreadId: string;
|
|
291
336
|
readonly messageId: string;
|
|
292
337
|
} | undefined;
|
|
338
|
+
} | {
|
|
339
|
+
readonly _tag: "WorkerCompletion";
|
|
340
|
+
readonly budgetExhausted: boolean;
|
|
341
|
+
readonly schemaVersion: 1;
|
|
342
|
+
readonly report: {
|
|
343
|
+
readonly _tag: "Settled";
|
|
344
|
+
readonly worker: {
|
|
345
|
+
readonly schemaVersion: 1;
|
|
346
|
+
readonly delegationId: string;
|
|
347
|
+
readonly targetAgentId: string;
|
|
348
|
+
readonly threadId: string;
|
|
349
|
+
};
|
|
350
|
+
readonly receipt: {
|
|
351
|
+
readonly receiptId: string;
|
|
352
|
+
readonly submissionId: string;
|
|
353
|
+
readonly threadId: string;
|
|
354
|
+
readonly queueSequence: number;
|
|
355
|
+
};
|
|
356
|
+
readonly runId: string;
|
|
357
|
+
readonly settlementId: string;
|
|
358
|
+
readonly outcome: "completed";
|
|
359
|
+
readonly result: Schema.Json;
|
|
360
|
+
} | {
|
|
361
|
+
readonly _tag: "Settled";
|
|
362
|
+
readonly worker: {
|
|
363
|
+
readonly schemaVersion: 1;
|
|
364
|
+
readonly delegationId: string;
|
|
365
|
+
readonly targetAgentId: string;
|
|
366
|
+
readonly threadId: string;
|
|
367
|
+
};
|
|
368
|
+
readonly receipt: {
|
|
369
|
+
readonly receiptId: string;
|
|
370
|
+
readonly submissionId: string;
|
|
371
|
+
readonly threadId: string;
|
|
372
|
+
readonly queueSequence: number;
|
|
373
|
+
};
|
|
374
|
+
readonly runId: string;
|
|
375
|
+
readonly settlementId: string;
|
|
376
|
+
readonly outcome: "aborted" | "failed";
|
|
377
|
+
readonly failure: {
|
|
378
|
+
readonly _tag: "SubagentExecutionFailure";
|
|
379
|
+
readonly delegationId: string;
|
|
380
|
+
readonly targetAgentId: string;
|
|
381
|
+
readonly classification: "child-aborted" | "child-compatibility" | "child-failed" | "declaration-unavailable" | "establishment-denied";
|
|
382
|
+
readonly childThreadId?: string | undefined;
|
|
383
|
+
readonly childSubmissionId?: string | undefined;
|
|
384
|
+
readonly childRunId?: string | undefined;
|
|
385
|
+
readonly errorTag: string;
|
|
386
|
+
readonly message: string;
|
|
387
|
+
};
|
|
388
|
+
};
|
|
389
|
+
} | {
|
|
390
|
+
readonly _tag: "WorkerUpdate";
|
|
391
|
+
readonly schemaVersion: 1;
|
|
392
|
+
readonly worker: {
|
|
393
|
+
readonly schemaVersion: 1;
|
|
394
|
+
readonly delegationId: string;
|
|
395
|
+
readonly targetAgentId: string;
|
|
396
|
+
readonly threadId: string;
|
|
397
|
+
};
|
|
398
|
+
readonly update: {
|
|
399
|
+
readonly schemaVersion: 1;
|
|
400
|
+
readonly agentId: string;
|
|
401
|
+
readonly threadId: string;
|
|
402
|
+
readonly runId: string;
|
|
403
|
+
readonly updateId: string;
|
|
404
|
+
readonly sequence: number;
|
|
405
|
+
readonly value: Schema.Json;
|
|
406
|
+
};
|
|
293
407
|
} | undefined;
|
|
294
408
|
readonly definitions: {
|
|
295
409
|
readonly agent: string;
|
|
@@ -482,11 +596,6 @@ declare const encodeHostResponse: (input: AbortRecorded | ApprovalRecorded | Hos
|
|
|
482
596
|
readonly createdAt: string;
|
|
483
597
|
readonly deploymentId: string;
|
|
484
598
|
readonly payload: {
|
|
485
|
-
readonly _tag: "AbortRequested";
|
|
486
|
-
readonly submissionId: string;
|
|
487
|
-
readonly author: string;
|
|
488
|
-
readonly reason: string;
|
|
489
|
-
} | {
|
|
490
599
|
readonly _tag: "ThreadCreated";
|
|
491
600
|
readonly agentId: string;
|
|
492
601
|
readonly definitions: {
|
|
@@ -519,6 +628,75 @@ declare const encodeHostResponse: (input: AbortRecorded | ApprovalRecorded | Hos
|
|
|
519
628
|
readonly ownerThreadId: string;
|
|
520
629
|
readonly messageId: string;
|
|
521
630
|
} | undefined;
|
|
631
|
+
} | {
|
|
632
|
+
readonly _tag: "WorkerCompletion";
|
|
633
|
+
readonly budgetExhausted: boolean;
|
|
634
|
+
readonly schemaVersion: 1;
|
|
635
|
+
readonly report: {
|
|
636
|
+
readonly _tag: "Settled";
|
|
637
|
+
readonly worker: {
|
|
638
|
+
readonly schemaVersion: 1;
|
|
639
|
+
readonly delegationId: string;
|
|
640
|
+
readonly targetAgentId: string;
|
|
641
|
+
readonly threadId: string;
|
|
642
|
+
};
|
|
643
|
+
readonly receipt: {
|
|
644
|
+
readonly receiptId: string;
|
|
645
|
+
readonly submissionId: string;
|
|
646
|
+
readonly threadId: string;
|
|
647
|
+
readonly queueSequence: number;
|
|
648
|
+
};
|
|
649
|
+
readonly runId: string;
|
|
650
|
+
readonly settlementId: string;
|
|
651
|
+
readonly outcome: "completed";
|
|
652
|
+
readonly result: Schema.Json;
|
|
653
|
+
} | {
|
|
654
|
+
readonly _tag: "Settled";
|
|
655
|
+
readonly worker: {
|
|
656
|
+
readonly schemaVersion: 1;
|
|
657
|
+
readonly delegationId: string;
|
|
658
|
+
readonly targetAgentId: string;
|
|
659
|
+
readonly threadId: string;
|
|
660
|
+
};
|
|
661
|
+
readonly receipt: {
|
|
662
|
+
readonly receiptId: string;
|
|
663
|
+
readonly submissionId: string;
|
|
664
|
+
readonly threadId: string;
|
|
665
|
+
readonly queueSequence: number;
|
|
666
|
+
};
|
|
667
|
+
readonly runId: string;
|
|
668
|
+
readonly settlementId: string;
|
|
669
|
+
readonly outcome: "aborted" | "failed";
|
|
670
|
+
readonly failure: {
|
|
671
|
+
readonly _tag: "SubagentExecutionFailure";
|
|
672
|
+
readonly delegationId: string;
|
|
673
|
+
readonly targetAgentId: string;
|
|
674
|
+
readonly classification: "child-aborted" | "child-compatibility" | "child-failed" | "declaration-unavailable" | "establishment-denied";
|
|
675
|
+
readonly childThreadId?: string | undefined;
|
|
676
|
+
readonly childSubmissionId?: string | undefined;
|
|
677
|
+
readonly childRunId?: string | undefined;
|
|
678
|
+
readonly errorTag: string;
|
|
679
|
+
readonly message: string;
|
|
680
|
+
};
|
|
681
|
+
};
|
|
682
|
+
} | {
|
|
683
|
+
readonly _tag: "WorkerUpdate";
|
|
684
|
+
readonly schemaVersion: 1;
|
|
685
|
+
readonly worker: {
|
|
686
|
+
readonly schemaVersion: 1;
|
|
687
|
+
readonly delegationId: string;
|
|
688
|
+
readonly targetAgentId: string;
|
|
689
|
+
readonly threadId: string;
|
|
690
|
+
};
|
|
691
|
+
readonly update: {
|
|
692
|
+
readonly schemaVersion: 1;
|
|
693
|
+
readonly agentId: string;
|
|
694
|
+
readonly threadId: string;
|
|
695
|
+
readonly runId: string;
|
|
696
|
+
readonly updateId: string;
|
|
697
|
+
readonly sequence: number;
|
|
698
|
+
readonly value: Schema.Json;
|
|
699
|
+
};
|
|
522
700
|
} | undefined;
|
|
523
701
|
} | {
|
|
524
702
|
readonly _tag: "RunStarted";
|
|
@@ -661,6 +839,11 @@ declare const encodeHostResponse: (input: AbortRecorded | ApprovalRecorded | Hos
|
|
|
661
839
|
readonly runDisposition?: Schema.Json | undefined;
|
|
662
840
|
readonly finishReason?: "budget-exhausted" | undefined;
|
|
663
841
|
readonly exhausted?: "tokens" | "tool-calls" | "turns" | undefined;
|
|
842
|
+
} | {
|
|
843
|
+
readonly _tag: "AbortRequested";
|
|
844
|
+
readonly submissionId: string;
|
|
845
|
+
readonly author: string;
|
|
846
|
+
readonly reason: string;
|
|
664
847
|
} | {
|
|
665
848
|
readonly _tag: "SubmissionSettled";
|
|
666
849
|
readonly submissionId: string;
|
|
@@ -936,6 +1119,7 @@ declare const encodeHostResponse: (input: AbortRecorded | ApprovalRecorded | Hos
|
|
|
936
1119
|
readonly createdAtMillis: number;
|
|
937
1120
|
readonly expiresAtMillis: number;
|
|
938
1121
|
readonly reporting?: {
|
|
1122
|
+
readonly mode?: "standard" | undefined;
|
|
939
1123
|
readonly sourceDigests: {
|
|
940
1124
|
readonly agent: string;
|
|
941
1125
|
readonly model: string;
|
|
@@ -949,6 +1133,7 @@ declare const encodeHostResponse: (input: AbortRecorded | ApprovalRecorded | Hos
|
|
|
949
1133
|
readonly createdAtMillis: number;
|
|
950
1134
|
readonly sourceSubmissionId?: string | undefined;
|
|
951
1135
|
readonly deliveryPrincipal?: string | undefined;
|
|
1136
|
+
readonly reportKind?: "update" | undefined;
|
|
952
1137
|
};
|
|
953
1138
|
readonly inputDigest: string;
|
|
954
1139
|
} | {
|
|
@@ -1012,6 +1197,7 @@ declare const encodeHostResponse: (input: AbortRecorded | ApprovalRecorded | Hos
|
|
|
1012
1197
|
readonly createdAtMillis: number;
|
|
1013
1198
|
readonly expiresAtMillis: number;
|
|
1014
1199
|
readonly reporting?: {
|
|
1200
|
+
readonly mode?: "standard" | undefined;
|
|
1015
1201
|
readonly sourceDigests: {
|
|
1016
1202
|
readonly agent: string;
|
|
1017
1203
|
readonly model: string;
|
|
@@ -1035,6 +1221,30 @@ declare const encodeHostResponse: (input: AbortRecorded | ApprovalRecorded | Hos
|
|
|
1035
1221
|
readonly envelope: Schema.Json;
|
|
1036
1222
|
readonly createdAtMillis: number;
|
|
1037
1223
|
readonly deadlineAtMillis: number;
|
|
1224
|
+
readonly predecessor?: string | undefined;
|
|
1225
|
+
} | {
|
|
1226
|
+
readonly _tag: "AgentUpdateEmitted";
|
|
1227
|
+
readonly update: {
|
|
1228
|
+
readonly schemaVersion: 1;
|
|
1229
|
+
readonly agentId: string;
|
|
1230
|
+
readonly threadId: string;
|
|
1231
|
+
readonly runId: string;
|
|
1232
|
+
readonly updateId: string;
|
|
1233
|
+
readonly sequence: number;
|
|
1234
|
+
readonly value: Schema.Json;
|
|
1235
|
+
};
|
|
1236
|
+
readonly definitions: {
|
|
1237
|
+
readonly agent: string;
|
|
1238
|
+
readonly model: string;
|
|
1239
|
+
readonly tools: string;
|
|
1240
|
+
};
|
|
1241
|
+
readonly delivery?: {
|
|
1242
|
+
readonly messageId: string;
|
|
1243
|
+
readonly envelope: Schema.Json;
|
|
1244
|
+
readonly createdAtMillis: number;
|
|
1245
|
+
readonly deadlineAtMillis: number;
|
|
1246
|
+
readonly predecessor?: string | undefined;
|
|
1247
|
+
} | undefined;
|
|
1038
1248
|
} | {
|
|
1039
1249
|
readonly _tag: "WorkerReportRefused";
|
|
1040
1250
|
readonly runId: string;
|
|
@@ -1138,37 +1348,10 @@ declare const encodeHostResponse: (input: AbortRecorded | ApprovalRecorded | Hos
|
|
|
1138
1348
|
} | {
|
|
1139
1349
|
readonly _tag: "HostFailed";
|
|
1140
1350
|
readonly failure: {
|
|
1141
|
-
readonly _tag: "AdmissionConflict";
|
|
1142
|
-
readonly threadId: string;
|
|
1143
|
-
readonly principal: string;
|
|
1144
|
-
readonly idempotencyKey: string;
|
|
1145
|
-
readonly existingInputDigest: string;
|
|
1146
|
-
readonly attemptedInputDigest: string;
|
|
1147
|
-
} | {
|
|
1148
|
-
readonly _tag: "AdmissionPolicyError";
|
|
1149
|
-
readonly reason: "occupied" | "refused" | "unavailable";
|
|
1150
|
-
readonly code: string;
|
|
1151
|
-
} | {
|
|
1152
|
-
readonly _tag: "SettlementConflict";
|
|
1153
|
-
readonly submissionId: string;
|
|
1154
|
-
readonly existingOutcome: "aborted" | "completed" | "failed";
|
|
1155
|
-
} | {
|
|
1156
|
-
readonly _tag: "JoinedToHost";
|
|
1157
|
-
readonly submissionId: string;
|
|
1158
|
-
readonly hostSubmissionId: string;
|
|
1159
|
-
} | {
|
|
1160
1351
|
readonly _tag: "LedgerError";
|
|
1161
1352
|
readonly operation: string;
|
|
1162
1353
|
readonly message: string;
|
|
1163
1354
|
readonly cause?: Schema.Json | undefined;
|
|
1164
|
-
} | {
|
|
1165
|
-
readonly _tag: "ThreadStoreError";
|
|
1166
|
-
readonly operation: string;
|
|
1167
|
-
readonly message: string;
|
|
1168
|
-
readonly cause?: Schema.Json | undefined;
|
|
1169
|
-
} | {
|
|
1170
|
-
readonly _tag: "ThreadNotMaterialized";
|
|
1171
|
-
readonly threadId: string;
|
|
1172
1355
|
} | {
|
|
1173
1356
|
readonly _tag: "AppendConflict";
|
|
1174
1357
|
readonly threadId: string;
|
|
@@ -1182,13 +1365,30 @@ declare const encodeHostResponse: (input: AbortRecorded | ApprovalRecorded | Hos
|
|
|
1182
1365
|
readonly actualEpoch: number;
|
|
1183
1366
|
readonly attemptedEpoch: number;
|
|
1184
1367
|
} | {
|
|
1185
|
-
readonly _tag: "
|
|
1368
|
+
readonly _tag: "ThreadNotMaterialized";
|
|
1369
|
+
readonly threadId: string;
|
|
1370
|
+
} | {
|
|
1371
|
+
readonly _tag: "ThreadStoreError";
|
|
1186
1372
|
readonly operation: string;
|
|
1187
1373
|
readonly message: string;
|
|
1188
1374
|
readonly cause?: Schema.Json | undefined;
|
|
1189
1375
|
} | {
|
|
1190
|
-
readonly _tag: "
|
|
1191
|
-
readonly
|
|
1376
|
+
readonly _tag: "OperationDenied";
|
|
1377
|
+
readonly operation: "abort" | "awaitSettlement" | "explain" | "observe" | "resolveApproval" | "resolveUnknown" | "retry" | "scanObligations" | "verify" | "wake";
|
|
1378
|
+
readonly reason: string;
|
|
1379
|
+
readonly threadId?: string | undefined;
|
|
1380
|
+
readonly submissionId?: string | undefined;
|
|
1381
|
+
} | {
|
|
1382
|
+
readonly _tag: "AdmissionConflict";
|
|
1383
|
+
readonly threadId: string;
|
|
1384
|
+
readonly principal: string;
|
|
1385
|
+
readonly idempotencyKey: string;
|
|
1386
|
+
readonly existingInputDigest: string;
|
|
1387
|
+
readonly attemptedInputDigest: string;
|
|
1388
|
+
} | {
|
|
1389
|
+
readonly _tag: "AdmissionPolicyError";
|
|
1390
|
+
readonly reason: "occupied" | "refused" | "unavailable";
|
|
1391
|
+
readonly code: string;
|
|
1192
1392
|
} | {
|
|
1193
1393
|
readonly _tag: "AgentInputError";
|
|
1194
1394
|
readonly message: string;
|
|
@@ -1196,6 +1396,25 @@ declare const encodeHostResponse: (input: AbortRecorded | ApprovalRecorded | Hos
|
|
|
1196
1396
|
readonly _tag: "DigestError";
|
|
1197
1397
|
readonly message: string;
|
|
1198
1398
|
readonly cause?: Schema.Json | undefined;
|
|
1399
|
+
} | {
|
|
1400
|
+
readonly _tag: "DurableRuntimeFailpointError";
|
|
1401
|
+
readonly location: "abort:after-intent" | "approval:after-request-append" | "approval:after-suspend" | "checkpoint:after-save" | "checkpoint:before-save" | "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-start-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:after-reserve" | "tools:after-prepared-append" | "tools:before-prepared-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-subtree-append" | "worker:before-completion-append" | "worker:before-origin-append" | "worker:before-report-append" | "worker:before-report-delivery" | "worker:before-source-append" | "worker:before-subtree-append";
|
|
1402
|
+
} | {
|
|
1403
|
+
readonly _tag: "SettlementConflict";
|
|
1404
|
+
readonly submissionId: string;
|
|
1405
|
+
readonly existingOutcome: "aborted" | "completed" | "failed";
|
|
1406
|
+
} | {
|
|
1407
|
+
readonly _tag: "JoinedToHost";
|
|
1408
|
+
readonly submissionId: string;
|
|
1409
|
+
readonly hostSubmissionId: string;
|
|
1410
|
+
} | {
|
|
1411
|
+
readonly _tag: "HostProtocolError";
|
|
1412
|
+
readonly message: string;
|
|
1413
|
+
} | {
|
|
1414
|
+
readonly _tag: "DurableAlarmError";
|
|
1415
|
+
readonly operation: string;
|
|
1416
|
+
readonly message: string;
|
|
1417
|
+
readonly cause?: Schema.Json | undefined;
|
|
1199
1418
|
} | {
|
|
1200
1419
|
readonly _tag: "ApprovalConflict";
|
|
1201
1420
|
readonly submissionId: string;
|
|
@@ -1205,20 +1424,11 @@ declare const encodeHostResponse: (input: AbortRecorded | ApprovalRecorded | Hos
|
|
|
1205
1424
|
readonly _tag: "UnknownResolutionConflict";
|
|
1206
1425
|
readonly submissionId: string;
|
|
1207
1426
|
readonly toolCallId: string;
|
|
1208
|
-
} | {
|
|
1209
|
-
readonly _tag: "DurableRuntimeFailpointError";
|
|
1210
|
-
readonly location: "abort:after-intent" | "approval:after-request-append" | "approval:after-suspend" | "checkpoint:after-save" | "checkpoint:before-save" | "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-start-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:after-reserve" | "tools:after-prepared-append" | "tools:before-prepared-append" | "turn:after-canonical-append" | "turn:after-response-append" | "turn:after-results-append" | "worker:after-completion-append" | "worker:after-origin-append" | "worker:after-report-append" | "worker:after-report-delivery" | "worker:after-source-append" | "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-subtree-append";
|
|
1211
1427
|
} | {
|
|
1212
1428
|
readonly _tag: "AdmissionLimitExceeded";
|
|
1213
1429
|
readonly limit: "database-bytes" | "input-bytes" | "queue-depth";
|
|
1214
1430
|
readonly actual: number;
|
|
1215
1431
|
readonly maximum: number;
|
|
1216
|
-
} | {
|
|
1217
|
-
readonly _tag: "OperationDenied";
|
|
1218
|
-
readonly operation: "abort" | "awaitSettlement" | "explain" | "observe" | "resolveApproval" | "resolveUnknown" | "retry" | "scanObligations" | "verify" | "wake";
|
|
1219
|
-
readonly reason: string;
|
|
1220
|
-
readonly threadId?: string | undefined;
|
|
1221
|
-
readonly submissionId?: string | undefined;
|
|
1222
1432
|
};
|
|
1223
1433
|
}, Schema.SchemaError, never>;
|
|
1224
1434
|
declare const decodeHostResponse: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => Effect.Effect<AbortRecorded | ApprovalRecorded | HostFailed | ObservedPage | ProgressCancelled | ProgressObserved | SettlementReached | SubmissionStatusResponse | SubmitSucceeded | UnknownResolutionRecorded, Schema.SchemaError, never>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.mjs";
|
|
2
|
-
import { ThreadObjectNamespace } from "./CloudflareBindings.mjs";
|
|
2
|
+
import { ThreadObjectNamespace, callThreadObject } from "./CloudflareBindings.mjs";
|
|
3
3
|
import { AdmissionLimitExceeded } from "./CloudflareConfig.mjs";
|
|
4
4
|
import { r as safeCauseMessage, t as cloudflareFailureSignals } from "./boundary-BguazVkh.mjs";
|
|
5
5
|
import { DurableAlarmError } from "./Alarm.mjs";
|
|
@@ -11,7 +11,7 @@ import { CanonicalRecordEnvelope, CanonicalSequence, DefinitionDigests, Persiste
|
|
|
11
11
|
import { RpcTracing } from "effect-cf";
|
|
12
12
|
import { BrowserCrypto } from "@effect/platform-browser";
|
|
13
13
|
import { AgentInputError } from "@effect-agent/core/AgentError";
|
|
14
|
-
import {
|
|
14
|
+
import { InputMessage } from "@effect-agent/core/Messaging";
|
|
15
15
|
import { DigestError } from "@effect-agent/thread/Digest";
|
|
16
16
|
import { DurableRuntimeFailpointError } from "@effect-agent/thread/DurableFailpoint";
|
|
17
17
|
import { OperationDenied } from "@effect-agent/thread/OperationAuthorizer";
|
|
@@ -100,7 +100,7 @@ var SubmitRequest = class extends Schema.Class("@effect-agent/platform-cloudflar
|
|
|
100
100
|
admissionGroup: Schema.optionalKey(AdmissionGroup),
|
|
101
101
|
admissionFence: Schema.optionalKey(AdmissionFence),
|
|
102
102
|
workerAdmission: Schema.optionalKey(WorkerAdmission),
|
|
103
|
-
messageAdmission: Schema.optionalKey(
|
|
103
|
+
messageAdmission: Schema.optionalKey(InputMessage),
|
|
104
104
|
definitions: DefinitionDigests,
|
|
105
105
|
inputPayload: PersistedJson
|
|
106
106
|
}) {};
|
|
@@ -266,21 +266,17 @@ var CloudflareThreadClient = class CloudflareThreadClient extends Context.Servic
|
|
|
266
266
|
return CloudflareThreadClient.layer.pipe(Layer.provide([ThreadObjectNamespace.layer(options.namespace, options), BrowserCrypto.layer]));
|
|
267
267
|
}
|
|
268
268
|
static layer = Layer.effect(CloudflareThreadClient)(Effect.gen(function* () {
|
|
269
|
-
const
|
|
269
|
+
const namespace = yield* ThreadObjectNamespace;
|
|
270
|
+
const { rpcTracing } = namespace;
|
|
270
271
|
const crypto = yield* Crypto.Crypto;
|
|
271
272
|
const call = Effect.fn(function* (threadId, operation, encoded) {
|
|
272
273
|
const traceArgs = rpcTracing === void 0 ? [] : yield* RpcTracing.withRpcTraceContext([]);
|
|
273
|
-
const raw = yield*
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
message: boundHostDiagnostic(`${operation} did not reach the Thread Object: ${safeCauseMessage(cause, "the RPC failed without a diagnostic")}`),
|
|
280
|
-
cause,
|
|
281
|
-
...cloudflareFailureSignals(cause)
|
|
282
|
-
})
|
|
283
|
-
});
|
|
274
|
+
const raw = yield* callThreadObject(threadId, (stub) => stub[hostRpcMethods[operation]](encoded, ...traceArgs), (cause) => ThreadClientError.make({
|
|
275
|
+
threadId,
|
|
276
|
+
message: boundHostDiagnostic(`${operation} did not reach the Thread Object: ${safeCauseMessage(cause, "the RPC failed without a diagnostic")}`),
|
|
277
|
+
cause,
|
|
278
|
+
...cloudflareFailureSignals(cause)
|
|
279
|
+
})).pipe(Effect.provideService(ThreadObjectNamespace, namespace));
|
|
284
280
|
return yield* decodeHostResponse(raw).pipe(Effect.mapError((error) => HostProtocolError.make({ message: boundHostDiagnostic(`The ${operation} answer could not be decoded: ${error.message}`) })));
|
|
285
281
|
}, (effect, threadId, operation) => rpcTracing === void 0 ? Effect.withSpan(effect, "CloudflareThreadClient.call", { attributes: {
|
|
286
282
|
threadId,
|