@effect-agent/platform-cloudflare 0.1.0-beta.42 → 0.1.0-beta.44
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/browser-quick-action.mjs.map +1 -1
- package/dist/browser-rest-capture.mjs.map +1 -1
- package/dist/browser-rest-crawl.mjs.map +1 -1
- package/dist/browser-session-lifecycle-DqntvG-Y.d.mts +21 -0
- package/dist/browser-session-lifecycle-ZGgb3pnK.mjs +84 -0
- package/dist/browser-session-lifecycle-ZGgb3pnK.mjs.map +1 -0
- package/dist/index.d.mts +69 -56
- package/dist/index.mjs.map +1 -1
- package/dist/interactive-browser.d.mts +1 -18
- package/dist/interactive-browser.mjs +2 -81
- package/dist/interactive-browser.mjs.map +1 -1
- package/dist/prepared-admission-BKp_Upw2.mjs.map +1 -1
- package/dist/protected-browser.d.mts +62 -0
- package/dist/protected-browser.mjs +714 -0
- package/dist/protected-browser.mjs.map +1 -0
- package/dist/scheduling.mjs.map +1 -1
- package/dist/subscriptions.mjs.map +1 -1
- package/package.json +1 -81
- package/src/alarm.ts +41 -0
- package/src/bindings.ts +5 -0
- package/src/boundary.ts +4 -0
- package/src/browser-quick-action.ts +52 -0
- package/src/browser-rest-capture.ts +30 -0
- package/src/browser-rest-crawl.ts +43 -0
- package/src/browser-session-lifecycle.ts +18 -0
- package/src/client.ts +40 -0
- package/src/code-mode-executor.ts +50 -0
- package/src/interactive-browser.ts +176 -0
- package/src/layers.ts +10 -0
- package/src/memory.ts +42 -3
- package/src/prepared-admission.ts +1 -0
- package/src/progress-wait.ts +14 -0
- package/src/protected-browser/binding.ts +185 -0
- package/src/protected-browser/inspect-frame.ts +82 -0
- package/src/protected-browser/native.ts +384 -0
- package/src/protected-browser/policy.ts +594 -0
- package/src/protected-browser.ts +2 -0
- package/src/scheduling.ts +34 -0
- package/src/subscriptions.ts +50 -0
- package/src/thread-object.ts +55 -1
- package/src/transport.ts +1 -0
- package/src/wake-scheduler.ts +1 -0
package/dist/index.d.mts
CHANGED
|
@@ -350,6 +350,19 @@ declare const layerConfig: (options: CloudflareDurableRuntimeOptions) => Layer.L
|
|
|
350
350
|
* Use Layer.unwrap for registration values that need effectful application setup.
|
|
351
351
|
*/
|
|
352
352
|
declare const layer: <const Entries extends ReadonlyArray<AgentRegistration>>(registrations: Entries) => Layer.Layer<CloudflareDurableRuntimeServices, DigestError | DoStorageInitializationError, DurableObjectContext | ThreadObjectNamespace | Exclude<[Entries[number]] extends [never] ? never : Entries[number] extends (infer T) ? T extends Entries[number] ? T extends {
|
|
353
|
+
readonly attemptLayer: (context: import("@effect-agent/thread").AgentAttemptContext) => Layer.Layer<infer Provides, never, infer Requires>;
|
|
354
|
+
} ? Requires | Exclude<T extends (infer T_1) ? T_1 extends T ? T_1 extends {
|
|
355
|
+
readonly agent: infer A extends import("@effect-agent/thread").ExecutableAgentBinding;
|
|
356
|
+
} ? import("@effect-agent/thread").DurableWorkerRequirements<A> : T_1 extends {
|
|
357
|
+
readonly agent: infer D extends import("@effect-agent/core").Definition<Schema.Top, Schema.Top, unknown, import("effect/unstable/ai/Toolkit").Any, import("@effect-agent/core").RunDispositionDeclaration<never, Schema.Top> | undefined, unknown> & {
|
|
358
|
+
readonly instructions: import("@effect-agent/core").InstructionSource<never, unknown, unknown>;
|
|
359
|
+
readonly inputPrompt?: import("@effect-agent/core").InputPromptSource<never, unknown, unknown> | undefined;
|
|
360
|
+
};
|
|
361
|
+
readonly model: infer M extends import("@effect-agent/thread").ExecutableAgentBinding["model"];
|
|
362
|
+
} ? import("@effect-agent/thread").DurableWorkerRequirements<{
|
|
363
|
+
readonly definition: D;
|
|
364
|
+
readonly model: M;
|
|
365
|
+
}> : never : never : never, Provides> : T extends {
|
|
353
366
|
readonly agent: infer A extends import("@effect-agent/thread").ExecutableAgentBinding;
|
|
354
367
|
} ? import("@effect-agent/thread").DurableWorkerRequirements<A> : T extends {
|
|
355
368
|
readonly agent: infer D extends import("@effect-agent/core").Definition<Schema.Top, Schema.Top, unknown, import("effect/unstable/ai/Toolkit").Any, import("@effect-agent/core").RunDispositionDeclaration<never, Schema.Top> | undefined, unknown> & {
|
|
@@ -521,13 +534,13 @@ declare const encodeUnknownResolutionCommand: (input: UnknownResolutionCommand,
|
|
|
521
534
|
readonly author: string;
|
|
522
535
|
readonly reason: string;
|
|
523
536
|
readonly resolution: {
|
|
524
|
-
readonly _tag: "SafeToRetry";
|
|
525
|
-
} | {
|
|
526
537
|
readonly _tag: "CompletedWithResult";
|
|
527
538
|
readonly result: Schema.Json;
|
|
528
539
|
readonly isFailure: boolean;
|
|
529
540
|
} | {
|
|
530
541
|
readonly _tag: "NeverHappened";
|
|
542
|
+
} | {
|
|
543
|
+
readonly _tag: "SafeToRetry";
|
|
531
544
|
} | {
|
|
532
545
|
readonly _tag: "AbortSubmission";
|
|
533
546
|
};
|
|
@@ -602,11 +615,6 @@ declare const encodeHostResponse: (input: AbortRecorded | ApprovalRecorded | Hos
|
|
|
602
615
|
readonly createdAt: string;
|
|
603
616
|
readonly deploymentId: string;
|
|
604
617
|
readonly payload: {
|
|
605
|
-
readonly _tag: "AbortRequested";
|
|
606
|
-
readonly submissionId: string;
|
|
607
|
-
readonly author: string;
|
|
608
|
-
readonly reason: string;
|
|
609
|
-
} | {
|
|
610
618
|
readonly _tag: "ThreadCreated";
|
|
611
619
|
readonly agentId: string;
|
|
612
620
|
readonly definitions: {
|
|
@@ -743,6 +751,11 @@ declare const encodeHostResponse: (input: AbortRecorded | ApprovalRecorded | Hos
|
|
|
743
751
|
readonly runDisposition?: Schema.Json | undefined;
|
|
744
752
|
readonly finishReason?: "budget-exhausted" | undefined;
|
|
745
753
|
readonly exhausted?: "tokens" | "tool-calls" | "turns" | undefined;
|
|
754
|
+
} | {
|
|
755
|
+
readonly _tag: "AbortRequested";
|
|
756
|
+
readonly submissionId: string;
|
|
757
|
+
readonly author: string;
|
|
758
|
+
readonly reason: string;
|
|
746
759
|
} | {
|
|
747
760
|
readonly _tag: "SubmissionSettled";
|
|
748
761
|
readonly submissionId: string;
|
|
@@ -913,13 +926,13 @@ declare const encodeHostResponse: (input: AbortRecorded | ApprovalRecorded | Hos
|
|
|
913
926
|
readonly author: string;
|
|
914
927
|
readonly reason: string;
|
|
915
928
|
readonly resolution: {
|
|
916
|
-
readonly _tag: "SafeToRetry";
|
|
917
|
-
} | {
|
|
918
929
|
readonly _tag: "CompletedWithResult";
|
|
919
930
|
readonly result: Schema.Json;
|
|
920
931
|
readonly isFailure: boolean;
|
|
921
932
|
} | {
|
|
922
933
|
readonly _tag: "NeverHappened";
|
|
934
|
+
} | {
|
|
935
|
+
readonly _tag: "SafeToRetry";
|
|
923
936
|
} | {
|
|
924
937
|
readonly _tag: "AbortSubmission";
|
|
925
938
|
};
|
|
@@ -929,8 +942,13 @@ declare const encodeHostResponse: (input: AbortRecorded | ApprovalRecorded | Hos
|
|
|
929
942
|
} | {
|
|
930
943
|
readonly _tag: "HostFailed";
|
|
931
944
|
readonly failure: {
|
|
932
|
-
readonly _tag: "
|
|
933
|
-
readonly
|
|
945
|
+
readonly _tag: "HostProtocolError";
|
|
946
|
+
readonly message: string;
|
|
947
|
+
} | {
|
|
948
|
+
readonly _tag: "AgentInputError";
|
|
949
|
+
readonly message: string;
|
|
950
|
+
} | {
|
|
951
|
+
readonly _tag: "DigestError";
|
|
934
952
|
readonly message: string;
|
|
935
953
|
readonly cause?: Schema.Json | undefined;
|
|
936
954
|
} | {
|
|
@@ -944,6 +962,15 @@ declare const encodeHostResponse: (input: AbortRecorded | ApprovalRecorded | Hos
|
|
|
944
962
|
readonly _tag: "SettlementConflict";
|
|
945
963
|
readonly submissionId: string;
|
|
946
964
|
readonly existingOutcome: "aborted" | "completed" | "failed";
|
|
965
|
+
} | {
|
|
966
|
+
readonly _tag: "ApprovalConflict";
|
|
967
|
+
readonly submissionId: string;
|
|
968
|
+
readonly toolCallId: string;
|
|
969
|
+
readonly existingDecision: "approved" | "denied";
|
|
970
|
+
} | {
|
|
971
|
+
readonly _tag: "UnknownResolutionConflict";
|
|
972
|
+
readonly submissionId: string;
|
|
973
|
+
readonly toolCallId: string;
|
|
947
974
|
} | {
|
|
948
975
|
readonly _tag: "JoinedToHost";
|
|
949
976
|
readonly submissionId: string;
|
|
@@ -973,25 +1000,6 @@ declare const encodeHostResponse: (input: AbortRecorded | ApprovalRecorded | Hos
|
|
|
973
1000
|
readonly threadId: string;
|
|
974
1001
|
readonly actualEpoch: number;
|
|
975
1002
|
readonly attemptedEpoch: number;
|
|
976
|
-
} | {
|
|
977
|
-
readonly _tag: "HostProtocolError";
|
|
978
|
-
readonly message: string;
|
|
979
|
-
} | {
|
|
980
|
-
readonly _tag: "AgentInputError";
|
|
981
|
-
readonly message: string;
|
|
982
|
-
} | {
|
|
983
|
-
readonly _tag: "DigestError";
|
|
984
|
-
readonly message: string;
|
|
985
|
-
readonly cause?: Schema.Json | undefined;
|
|
986
|
-
} | {
|
|
987
|
-
readonly _tag: "ApprovalConflict";
|
|
988
|
-
readonly submissionId: string;
|
|
989
|
-
readonly toolCallId: string;
|
|
990
|
-
readonly existingDecision: "approved" | "denied";
|
|
991
|
-
} | {
|
|
992
|
-
readonly _tag: "UnknownResolutionConflict";
|
|
993
|
-
readonly submissionId: string;
|
|
994
|
-
readonly toolCallId: string;
|
|
995
1003
|
} | {
|
|
996
1004
|
readonly _tag: "DurableRuntimeFailpointError";
|
|
997
1005
|
readonly location: "abort:after-intent" | "approval:after-request-append" | "approval:after-suspend" | "claim:after-claim" | "compaction:after-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" | "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";
|
|
@@ -1000,6 +1008,11 @@ declare const encodeHostResponse: (input: AbortRecorded | ApprovalRecorded | Hos
|
|
|
1000
1008
|
readonly limit: "database-bytes" | "input-bytes" | "queue-depth";
|
|
1001
1009
|
readonly actual: number;
|
|
1002
1010
|
readonly maximum: number;
|
|
1011
|
+
} | {
|
|
1012
|
+
readonly _tag: "DurableAlarmError";
|
|
1013
|
+
readonly operation: string;
|
|
1014
|
+
readonly message: string;
|
|
1015
|
+
readonly cause?: Schema.Json | undefined;
|
|
1003
1016
|
} | {
|
|
1004
1017
|
readonly _tag: "OperationDenied";
|
|
1005
1018
|
readonly operation: "abort" | "awaitSettlement" | "explain" | "observe" | "resolveApproval" | "resolveUnknown" | "retry" | "scanObligations" | "verify" | "wake";
|
|
@@ -1550,38 +1563,14 @@ declare const encodeAdminResponse: (input: AdminFailed | ExplainedRecovery | Obl
|
|
|
1550
1563
|
} | {
|
|
1551
1564
|
readonly _tag: "AdminFailed";
|
|
1552
1565
|
readonly failure: {
|
|
1553
|
-
readonly _tag: "
|
|
1554
|
-
readonly operation: "abort" | "awaitSettlement" | "explain" | "observe" | "resolveApproval" | "resolveUnknown" | "retry" | "scanObligations" | "verify" | "wake";
|
|
1555
|
-
readonly reason: string;
|
|
1556
|
-
readonly threadId?: string | undefined;
|
|
1557
|
-
readonly submissionId?: string | undefined;
|
|
1558
|
-
} | {
|
|
1559
|
-
readonly _tag: "RetryRefused";
|
|
1566
|
+
readonly _tag: "SettlementConflict";
|
|
1560
1567
|
readonly submissionId: string;
|
|
1561
|
-
readonly
|
|
1562
|
-
readonly decisionTag: string;
|
|
1563
|
-
readonly message: string;
|
|
1568
|
+
readonly existingOutcome: "aborted" | "completed" | "failed";
|
|
1564
1569
|
} | {
|
|
1565
1570
|
readonly _tag: "LedgerError";
|
|
1566
1571
|
readonly operation: string;
|
|
1567
1572
|
readonly message: string;
|
|
1568
1573
|
readonly cause?: Schema.Json | undefined;
|
|
1569
|
-
} | {
|
|
1570
|
-
readonly _tag: "RunJournalError";
|
|
1571
|
-
readonly message: string;
|
|
1572
|
-
readonly cause?: Schema.Json | undefined;
|
|
1573
|
-
} | {
|
|
1574
|
-
readonly _tag: "DigestError";
|
|
1575
|
-
readonly message: string;
|
|
1576
|
-
readonly cause?: Schema.Json | undefined;
|
|
1577
|
-
} | {
|
|
1578
|
-
readonly _tag: "OwnershipLost";
|
|
1579
|
-
readonly submissionId: string;
|
|
1580
|
-
readonly actualEpoch: number;
|
|
1581
|
-
} | {
|
|
1582
|
-
readonly _tag: "SettlementConflict";
|
|
1583
|
-
readonly submissionId: string;
|
|
1584
|
-
readonly existingOutcome: "aborted" | "completed" | "failed";
|
|
1585
1574
|
} | {
|
|
1586
1575
|
readonly _tag: "ThreadStoreError";
|
|
1587
1576
|
readonly operation: string;
|
|
@@ -1602,6 +1591,30 @@ declare const encodeAdminResponse: (input: AdminFailed | ExplainedRecovery | Obl
|
|
|
1602
1591
|
readonly threadId: string;
|
|
1603
1592
|
readonly actualEpoch: number;
|
|
1604
1593
|
readonly attemptedEpoch: number;
|
|
1594
|
+
} | {
|
|
1595
|
+
readonly _tag: "OperationDenied";
|
|
1596
|
+
readonly operation: "abort" | "awaitSettlement" | "explain" | "observe" | "resolveApproval" | "resolveUnknown" | "retry" | "scanObligations" | "verify" | "wake";
|
|
1597
|
+
readonly reason: string;
|
|
1598
|
+
readonly threadId?: string | undefined;
|
|
1599
|
+
readonly submissionId?: string | undefined;
|
|
1600
|
+
} | {
|
|
1601
|
+
readonly _tag: "RetryRefused";
|
|
1602
|
+
readonly submissionId: string;
|
|
1603
|
+
readonly refusal: "await-approval-decision" | "await-unknown-resolution" | "settled";
|
|
1604
|
+
readonly decisionTag: string;
|
|
1605
|
+
readonly message: string;
|
|
1606
|
+
} | {
|
|
1607
|
+
readonly _tag: "RunJournalError";
|
|
1608
|
+
readonly message: string;
|
|
1609
|
+
readonly cause?: Schema.Json | undefined;
|
|
1610
|
+
} | {
|
|
1611
|
+
readonly _tag: "DigestError";
|
|
1612
|
+
readonly message: string;
|
|
1613
|
+
readonly cause?: Schema.Json | undefined;
|
|
1614
|
+
} | {
|
|
1615
|
+
readonly _tag: "OwnershipLost";
|
|
1616
|
+
readonly submissionId: string;
|
|
1617
|
+
readonly actualEpoch: number;
|
|
1605
1618
|
} | {
|
|
1606
1619
|
readonly _tag: "DurableRuntimeFailpointError";
|
|
1607
1620
|
readonly location: "abort:after-intent" | "approval:after-request-append" | "approval:after-suspend" | "claim:after-claim" | "compaction:after-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" | "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";
|