@effect-agent/platform-cloudflare 0.1.0-beta.85 → 0.1.0-beta.87

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 (77) hide show
  1. package/dist/Alarm.d.mts +9 -5
  2. package/dist/Alarm.mjs +10 -10
  3. package/dist/Alarm.mjs.map +1 -1
  4. package/dist/BrowserRestCapture.d.mts +3 -3
  5. package/dist/BrowserRestCapture.mjs +3 -3
  6. package/dist/BrowserRestCapture.mjs.map +1 -1
  7. package/dist/BrowserRestCrawl.d.mts +2 -2
  8. package/dist/BrowserRestCrawl.mjs +2 -2
  9. package/dist/BrowserRestCrawl.mjs.map +1 -1
  10. package/dist/CloudflareBindings.d.mts +2 -2
  11. package/dist/CloudflareBindings.mjs +2 -2
  12. package/dist/CloudflareBindings.mjs.map +1 -1
  13. package/dist/{CloudflareBrowser-D4YqaTAl.mjs → CloudflareBrowser-DV6kya1H.mjs} +4 -4
  14. package/dist/CloudflareBrowser-DV6kya1H.mjs.map +1 -0
  15. package/dist/{CloudflareBrowser-DJq53niJ.d.mts → CloudflareBrowser-Doe1M7R5.d.mts} +4 -4
  16. package/dist/CloudflareBrowser.d.mts +1 -1
  17. package/dist/CloudflareBrowser.mjs +1 -1
  18. package/dist/CloudflareCodeMode.d.mts +2 -2
  19. package/dist/CloudflareCodeMode.mjs +2 -2
  20. package/dist/CloudflareCodeMode.mjs.map +1 -1
  21. package/dist/CloudflareConfig.mjs +3 -3
  22. package/dist/CloudflareConfig.mjs.map +1 -1
  23. package/dist/CloudflareMemory.d.mts +26 -26
  24. package/dist/CloudflareMemory.mjs +11 -11
  25. package/dist/CloudflareMemory.mjs.map +1 -1
  26. package/dist/CloudflareScheduling.d.mts +3 -3
  27. package/dist/CloudflareScheduling.mjs +9 -9
  28. package/dist/CloudflareScheduling.mjs.map +1 -1
  29. package/dist/CloudflareSubscriptions.d.mts +5 -5
  30. package/dist/CloudflareSubscriptions.mjs +8 -8
  31. package/dist/CloudflareSubscriptions.mjs.map +1 -1
  32. package/dist/CloudflareThreadClient.d.mts +17 -17
  33. package/dist/CloudflareThreadClient.mjs +11 -11
  34. package/dist/CloudflareThreadClient.mjs.map +1 -1
  35. package/dist/InteractiveBrowser.d.mts +2 -2
  36. package/dist/InteractiveBrowser.mjs +3 -3
  37. package/dist/InteractiveBrowser.mjs.map +1 -1
  38. package/dist/ProtectedBrowser.d.mts +2 -2
  39. package/dist/ProtectedBrowser.mjs +2 -2
  40. package/dist/ProtectedBrowser.mjs.map +1 -1
  41. package/dist/{ThreadObject-DZMkwIBh.d.mts → ThreadObject-BMNq8kuv.d.mts} +71 -71
  42. package/dist/{ThreadObject-gyx8Qq03.mjs → ThreadObject-DvRG0dDz.mjs} +27 -27
  43. package/dist/ThreadObject-DvRG0dDz.mjs.map +1 -0
  44. package/dist/ThreadObject.d.mts +1 -1
  45. package/dist/ThreadObject.mjs +1 -1
  46. package/dist/WakeScheduler.d.mts +1 -1
  47. package/dist/WakeScheduler.mjs +2 -2
  48. package/dist/WakeScheduler.mjs.map +1 -1
  49. package/dist/index.d.mts +2 -2
  50. package/dist/index.mjs +2 -2
  51. package/dist/{prepared-admission-DSi55W-7.mjs → prepared-admission-DU0_T-ev.mjs} +7 -7
  52. package/dist/prepared-admission-DU0_T-ev.mjs.map +1 -0
  53. package/package.json +1 -1
  54. package/src/Alarm.ts +24 -18
  55. package/src/BrowserRestCapture.ts +3 -3
  56. package/src/BrowserRestCrawl.ts +12 -12
  57. package/src/CloudflareBindings.ts +2 -2
  58. package/src/CloudflareCodeMode.ts +4 -4
  59. package/src/CloudflareConfig.ts +3 -3
  60. package/src/CloudflareMemory.ts +22 -22
  61. package/src/CloudflareScheduling.ts +11 -11
  62. package/src/CloudflareSubscriptions.ts +10 -14
  63. package/src/CloudflareThreadClient.ts +13 -13
  64. package/src/InteractiveBrowser.ts +15 -15
  65. package/src/ThreadObject.ts +14 -14
  66. package/src/WakeScheduler.ts +2 -2
  67. package/src/internal/browser-quick-action.ts +4 -4
  68. package/src/internal/layers.ts +47 -47
  69. package/src/internal/message-delivery.ts +11 -6
  70. package/src/internal/prepared-admission.ts +7 -7
  71. package/src/internal/transport.ts +1 -1
  72. package/src/protected-browser/binding.ts +2 -2
  73. package/src/protected-browser/native.ts +3 -3
  74. package/src/protected-browser/policy.ts +13 -13
  75. package/dist/CloudflareBrowser-D4YqaTAl.mjs.map +0 -1
  76. package/dist/ThreadObject-gyx8Qq03.mjs.map +0 -1
  77. package/dist/prepared-admission-DSi55W-7.mjs.map +0 -1
@@ -1,3 +1,5 @@
1
+ import { RpcTarget } from "cloudflare:workers";
2
+ import { Clock, Duration, Effect, Exit, Fiber, Layer, Option, Queue, Schema } from "effect";
1
3
  import {
2
4
  CodeExecutionHost,
3
5
  CodeExecutionResourceUse,
@@ -16,10 +18,8 @@ import {
16
18
  CodeSourceError,
17
19
  type CodeExecutorExecute,
18
20
  type CodeExecutionRequest,
19
- } from "@effect-agent/sandbox/CodeExecutor";
20
- import { SandboxImplementation } from "@effect-agent/sandbox/Sandbox";
21
- import { RpcTarget } from "cloudflare:workers";
22
- import { Clock, Duration, Effect, Exit, Fiber, Layer, Option, Queue, Schema } from "effect";
21
+ } from "effect-agent/code-executor";
22
+ import { SandboxImplementation } from "effect-agent/sandbox";
23
23
 
24
24
  import { safeCauseDiagnostic, safeCauseMessage } from "./internal/boundary.ts";
25
25
 
@@ -1,7 +1,7 @@
1
- import { DEFAULT_MAX_STORED_VALUE_BYTES } from "@effect-agent/storage-cloudflare/DoStorageConfig";
2
- import { DeploymentId } from "@effect-agent/thread/Records";
3
- import { DEFAULT_OWNERSHIP_LEASE_DURATION } from "@effect-agent/thread/SubmissionLedger";
1
+ import { DEFAULT_MAX_STORED_VALUE_BYTES } from "@effect-agent/storage-cloudflare/do-storage-config";
4
2
  import { Context, Duration, Schema } from "effect";
3
+ import { DeploymentId } from "effect-agent/records";
4
+ import { DEFAULT_OWNERSHIP_LEASE_DURATION } from "effect-agent/submission-ledger";
5
5
 
6
6
  /**
7
7
  * Schema-validated configuration for the Cloudflare durable runtime (deployment spec §4:
@@ -1,27 +1,8 @@
1
- import * as Memory from "@effect-agent/core/Memory";
2
- import * as MemoryNamespace from "@effect-agent/core/MemoryNamespace";
3
- import { MemoryNamespaceAddress } from "@effect-agent/core/MemoryNamespace";
4
- import { type MemoryLookup, MemoryRecallLimits } from "@effect-agent/core/MemoryReference";
5
- import { MemoryAccess } from "@effect-agent/core/MemoryRevalidation";
6
- import {
7
- type MemoryReader,
8
- type MemoryWrite,
9
- MemoryKey,
10
- MemoryDocument,
11
- MemoryMutationFailpoint,
12
- MemoryStorageError,
13
- MemoryWriter,
14
- } from "@effect-agent/core/MemoryStore";
15
- import {
16
- type MemoryIndexSearch,
17
- type SemanticMemoryProfile,
18
- } from "@effect-agent/core/SemanticMemoryIndex";
19
- import { type SemanticCandidateLimits } from "@effect-agent/core/SemanticMemoryRevalidation";
20
1
  import {
21
2
  type DoMemoryStorageLimits,
22
3
  defaultDoMemoryStorageLimits,
23
4
  doMemoryStoreLayerWithFailpoints,
24
- } from "@effect-agent/storage-cloudflare/DoMemoryStore";
5
+ } from "@effect-agent/storage-cloudflare/do-memory-store";
25
6
  import {
26
7
  type MemoryOwnerAuthorizer,
27
8
  decodeMemoryWire,
@@ -34,9 +15,28 @@ import {
34
15
  MemoryRpcError,
35
16
  MemoryRpcLimits,
36
17
  type MemoryOwnerFailure,
37
- } from "@effect-agent/storage-cloudflare/MemoryProtocol";
38
- import { Principal } from "@effect-agent/thread/SubmissionLedger";
18
+ } from "@effect-agent/storage-cloudflare/memory-protocol";
39
19
  import { Clock, Context, Effect, Layer, Schema } from "effect";
20
+ import * as Memory from "effect-agent/memory";
21
+ import * as MemoryNamespace from "effect-agent/memory-namespace";
22
+ import { MemoryNamespaceAddress } from "effect-agent/memory-namespace";
23
+ import { type MemoryLookup, MemoryRecallLimits } from "effect-agent/memory-reference";
24
+ import { MemoryAccess } from "effect-agent/memory-revalidation";
25
+ import {
26
+ type MemoryReader,
27
+ type MemoryWrite,
28
+ MemoryKey,
29
+ MemoryDocument,
30
+ MemoryMutationFailpoint,
31
+ MemoryStorageError,
32
+ MemoryWriter,
33
+ } from "effect-agent/memory-store";
34
+ import {
35
+ type MemoryIndexSearch,
36
+ type SemanticMemoryProfile,
37
+ } from "effect-agent/semantic-memory-index";
38
+ import { type SemanticCandidateLimits } from "effect-agent/semantic-memory-revalidation";
39
+ import { Principal } from "effect-agent/submission-ledger";
40
40
  import {
41
41
  DurableObject as EffectCfDurableObject,
42
42
  DurableObjectState,
@@ -1,11 +1,14 @@
1
- import { AgentId } from "@effect-agent/core/Identifiers";
2
1
  import {
3
2
  DoScheduleAlarmControl,
4
3
  DoScheduleTransaction,
5
4
  scheduleStoreLayer,
6
- } from "@effect-agent/storage-cloudflare/DoScheduleStore";
7
- import { type DurableSubmitAgent } from "@effect-agent/thread/DurableAgentRuntime";
8
- import { DefinitionDigests, PersistedJson } from "@effect-agent/thread/Records";
5
+ } from "@effect-agent/storage-cloudflare/do-schedule-store";
6
+ import { BrowserCrypto } from "@effect/platform-browser";
7
+ import { SqliteClient } from "@effect/sql-sqlite-do";
8
+ import { Clock, Context, DateTime, Effect, Layer, Schema } from "effect";
9
+ import { type DurableSubmitAgent } from "effect-agent/durable-agent-runtime";
10
+ import { AgentId } from "effect-agent/identifiers";
11
+ import { DefinitionDigests, PersistedJson } from "effect-agent/records";
9
12
  import {
10
13
  ScheduleAuthorizationError,
11
14
  type ScheduleAuthorizer,
@@ -25,18 +28,15 @@ import {
25
28
  ScheduleTimingRequest,
26
29
  ScheduleValidationError,
27
30
  defaultSchedulingLimits,
28
- } from "@effect-agent/thread/Schedule";
29
- import { scheduleOwnerKey } from "@effect-agent/thread/ScheduleTransition";
31
+ } from "effect-agent/schedule";
32
+ import { scheduleOwnerKey } from "effect-agent/schedule-transition";
30
33
  import {
31
34
  Scheduling,
32
35
  ScheduleDriver,
33
36
  type ScheduleManagementFailure,
34
37
  ScheduleWakeNoop,
35
- } from "@effect-agent/thread/Scheduling";
36
- import { AdmissionFence } from "@effect-agent/thread/SubmissionLedger";
37
- import { BrowserCrypto } from "@effect/platform-browser";
38
- import { SqliteClient } from "@effect/sql-sqlite-do";
39
- import { Clock, Context, DateTime, Effect, Layer, Schema } from "effect";
38
+ } from "effect-agent/scheduling";
39
+ import { AdmissionFence } from "effect-agent/submission-ledger";
40
40
  import {
41
41
  DurableObject as EffectCfDurableObject,
42
42
  DurableObjectAlarm,
@@ -2,10 +2,13 @@ import {
2
2
  DoSubscriptionAlarmControl,
3
3
  DoSubscriptionTransaction,
4
4
  doSubscriptionStoreLayer,
5
- } from "@effect-agent/storage-cloudflare/DoSubscriptionStore";
6
- import { type EventSources } from "@effect-agent/thread/EventSource";
7
- import { PersistedJson } from "@effect-agent/thread/Records";
8
- import { Principal } from "@effect-agent/thread/SubmissionLedger";
5
+ } from "@effect-agent/storage-cloudflare/do-subscription-store";
6
+ import { BrowserCrypto } from "@effect/platform-browser";
7
+ import { SqliteClient } from "@effect/sql-sqlite-do";
8
+ import { Cause, Clock, Context, DateTime, Effect, Layer, Schema, type Scope } from "effect";
9
+ import { type EventSources } from "effect-agent/event-source";
10
+ import { PersistedJson } from "effect-agent/records";
11
+ import { Principal } from "effect-agent/submission-ledger";
9
12
  import {
10
13
  EventAcknowledgement,
11
14
  EventSourceVersion,
@@ -22,16 +25,9 @@ import {
22
25
  SubscriptionSnapshot,
23
26
  SubscriptionSourceError,
24
27
  defaultSubscriptionLimits,
25
- } from "@effect-agent/thread/Subscription";
26
- import { type SubscriptionInputBindings } from "@effect-agent/thread/SubscriptionInput";
27
- import {
28
- SubscriptionDriver,
29
- SubscriptionIntake,
30
- Subscriptions,
31
- } from "@effect-agent/thread/Subscriptions";
32
- import { BrowserCrypto } from "@effect/platform-browser";
33
- import { SqliteClient } from "@effect/sql-sqlite-do";
34
- import { Cause, Clock, Context, DateTime, Effect, Layer, Schema, type Scope } from "effect";
28
+ } from "effect-agent/subscription";
29
+ import { type SubscriptionInputBindings } from "effect-agent/subscription-input";
30
+ import { SubscriptionDriver, SubscriptionIntake, Subscriptions } from "effect-agent/subscriptions";
35
31
  import {
36
32
  DurableObject as EffectCfDurableObject,
37
33
  DurableObjectAlarm,
@@ -1,21 +1,23 @@
1
- import { AgentInputError } from "@effect-agent/core/AgentError";
2
- import { AgentId, type ThreadId } from "@effect-agent/core/Identifiers";
3
- import { InputMessage } from "@effect-agent/core/Messaging";
4
- import { DigestError } from "@effect-agent/thread/Digest";
1
+ import { BrowserCrypto } from "@effect/platform-browser";
2
+ import { Context, Crypto, Duration, Effect, Layer, Schema } from "effect";
3
+ import { AgentInputError } from "effect-agent/agent-error";
4
+ import { DigestError } from "effect-agent/digest";
5
5
  import {
6
6
  Receipt,
7
7
  type DurableSubmitAgent,
8
8
  type DurableSubmitOptions,
9
- } from "@effect-agent/thread/DurableAgentRuntime";
10
- import { DurableRuntimeFailpointError } from "@effect-agent/thread/DurableFailpoint";
11
- import { OperationDenied } from "@effect-agent/thread/OperationAuthorizer";
9
+ } from "effect-agent/durable-agent-runtime";
10
+ import { DurableRuntimeFailpointError } from "effect-agent/durable-failpoint";
11
+ import { AgentId, type ThreadId } from "effect-agent/identifiers";
12
+ import { InputMessage } from "effect-agent/messaging";
13
+ import { OperationDenied } from "effect-agent/operation-authorizer";
12
14
  import {
13
15
  CanonicalRecordEnvelope,
14
16
  CanonicalSequence,
15
17
  DefinitionDigests,
16
18
  PersistedJson,
17
19
  WorkerAdmission,
18
- } from "@effect-agent/thread/Records";
20
+ } from "effect-agent/records";
19
21
  import {
20
22
  AdmissionFence,
21
23
  AdmissionGroup,
@@ -35,16 +37,14 @@ import {
35
37
  UnknownResolutionCommand,
36
38
  UnknownResolutionConflict,
37
39
  UnknownResolutionIntent,
38
- } from "@effect-agent/thread/SubmissionLedger";
39
- import { SubmissionStatus } from "@effect-agent/thread/SubmissionStatus";
40
+ } from "effect-agent/submission-ledger";
41
+ import { SubmissionStatus } from "effect-agent/submission-status";
40
42
  import {
41
43
  AppendConflict,
42
44
  ThreadNotMaterialized,
43
45
  ThreadStoreError,
44
46
  FenceRejected,
45
- } from "@effect-agent/thread/ThreadStore";
46
- import { BrowserCrypto } from "@effect/platform-browser";
47
- import { Context, Crypto, Duration, Effect, Layer, Schema } from "effect";
47
+ } from "effect-agent/thread-store";
48
48
  import { RpcTracing } from "effect-cf";
49
49
 
50
50
  import { DurableAlarmError } from "./Alarm.ts";
@@ -7,6 +7,18 @@ import puppeteer, {
7
7
  type HTTPRequest,
8
8
  type Page,
9
9
  } from "@cloudflare/puppeteer";
10
+ import {
11
+ Context,
12
+ Clock,
13
+ Duration,
14
+ Effect,
15
+ Layer,
16
+ Redacted,
17
+ Ref,
18
+ Schema,
19
+ Semaphore,
20
+ type Scope,
21
+ } from "effect";
10
22
  import {
11
23
  BrowserActionResult,
12
24
  BrowserScreenshotRequest,
@@ -27,21 +39,9 @@ import {
27
39
  type BrowserHandle,
28
40
  type InteractiveBrowserError,
29
41
  type InteractiveBrowserNetworkPolicy,
30
- } from "@effect-agent/sandbox/InteractiveBrowser";
31
- import { PageScreenshotResult } from "@effect-agent/sandbox/PageScreenshot";
32
- import { SandboxImplementation } from "@effect-agent/sandbox/Sandbox";
33
- import {
34
- Context,
35
- Clock,
36
- Duration,
37
- Effect,
38
- Layer,
39
- Redacted,
40
- Ref,
41
- Schema,
42
- Semaphore,
43
- type Scope,
44
- } from "effect";
42
+ } from "effect-agent/interactive-browser";
43
+ import { PageScreenshotResult } from "effect-agent/page-screenshot";
44
+ import { SandboxImplementation } from "effect-agent/sandbox";
45
45
 
46
46
  import {
47
47
  BrowserRunSessionLifecycle,
@@ -1,5 +1,3 @@
1
- import { type AgentId, type ThreadId } from "@effect-agent/core/Identifiers";
2
- import { SubmissionId } from "@effect-agent/core/Identifiers";
3
1
  import {
4
2
  decodePortRequest,
5
3
  encodePortResponse,
@@ -9,7 +7,8 @@ import {
9
7
  PortSucceeded,
10
8
  type PortRequest,
11
9
  type PortResponse,
12
- } from "@effect-agent/storage-cloudflare/PortProtocol";
10
+ } from "@effect-agent/storage-cloudflare/port-protocol";
11
+ import { Effect, Layer, Option, Schema, Stream } from "effect";
13
12
  import {
14
13
  IntegrityReport,
15
14
  ObligationReport,
@@ -17,22 +16,24 @@ import {
17
16
  RecoveryExplanation,
18
17
  RetryCommand,
19
18
  RetryRefused,
20
- } from "@effect-agent/thread/Admin";
21
- import { DigestError } from "@effect-agent/thread/Digest";
19
+ } from "effect-agent/admin";
20
+ import { DigestError } from "effect-agent/digest";
22
21
  import {
23
22
  DurableAgentRuntime,
24
23
  DurableRuntimeConfig,
25
24
  RecoveryReport,
26
25
  type DurableSubmitAgent,
27
- } from "@effect-agent/thread/DurableAgentRuntime";
28
- import { DurableRuntimeFailpointError } from "@effect-agent/thread/DurableFailpoint";
26
+ } from "effect-agent/durable-agent-runtime";
27
+ import { DurableRuntimeFailpointError } from "effect-agent/durable-failpoint";
28
+ import { type AgentId, type ThreadId } from "effect-agent/identifiers";
29
+ import { SubmissionId } from "effect-agent/identifiers";
29
30
  import {
30
31
  OperationAuthorizationRequest,
31
32
  OperationAuthorizer,
32
33
  OperationDenied,
33
- } from "@effect-agent/thread/OperationAuthorizer";
34
- import { PersistedJson } from "@effect-agent/thread/Records";
35
- import { RunJournalError } from "@effect-agent/thread/RunJournal";
34
+ } from "effect-agent/operation-authorizer";
35
+ import { PersistedJson } from "effect-agent/records";
36
+ import { RunJournalError } from "effect-agent/run-journal";
36
37
  import {
37
38
  AdmissionPolicyError,
38
39
  LedgerError,
@@ -40,7 +41,7 @@ import {
40
41
  SettlementConflict,
41
42
  SubmissionLedger,
42
43
  SubmissionLookupByKey,
43
- } from "@effect-agent/thread/SubmissionLedger";
44
+ } from "effect-agent/submission-ledger";
44
45
  import {
45
46
  AppendConflict,
46
47
  ThreadNotMaterialized,
@@ -48,9 +49,8 @@ import {
48
49
  ThreadStore,
49
50
  ThreadStoreError,
50
51
  FenceRejected,
51
- } from "@effect-agent/thread/ThreadStore";
52
- import { WakeScheduler } from "@effect-agent/thread/WakeScheduler";
53
- import { Effect, Layer, Option, Schema, Stream } from "effect";
52
+ } from "effect-agent/thread-store";
53
+ import { WakeScheduler } from "effect-agent/wake-scheduler";
54
54
  import {
55
55
  DurableObject as EffectCfDurableObject,
56
56
  DurableObjectState as EffectCfDurableObjectState,
@@ -1,6 +1,6 @@
1
- import { type ThreadId } from "@effect-agent/core/Identifiers";
2
- import { makeWakeSubscriptionHub, WakeScheduler } from "@effect-agent/thread/WakeScheduler";
3
1
  import { Effect, Layer, PubSub, Schema, Stream } from "effect";
2
+ import { type ThreadId } from "effect-agent/identifiers";
3
+ import { makeWakeSubscriptionHub, WakeScheduler } from "effect-agent/wake-scheduler";
4
4
 
5
5
  import { DurableAlarmService } from "./Alarm.ts";
6
6
  import {
@@ -1,5 +1,6 @@
1
1
  /// <reference types="@cloudflare/workers-types" />
2
2
 
3
+ import { Context, Effect, Layer, Option, Schema } from "effect";
3
4
  import {
4
5
  PageCapture,
5
6
  PageCaptureInferenceUse,
@@ -21,7 +22,7 @@ import {
21
22
  type PageCaptureError,
22
23
  type PageCaptureOutput,
23
24
  type PageCaptureRequest,
24
- } from "@effect-agent/sandbox/PageCapture";
25
+ } from "effect-agent/page-capture";
25
26
  import {
26
27
  PageScreenshot,
27
28
  PageScreenshotOutputLimitError,
@@ -29,9 +30,8 @@ import {
29
30
  type PageScreenshotCapture,
30
31
  type PageScreenshotError,
31
32
  type PageScreenshotRequest,
32
- } from "@effect-agent/sandbox/PageScreenshot";
33
- import { SandboxImplementation } from "@effect-agent/sandbox/Sandbox";
34
- import { Context, Effect, Layer, Option, Schema } from "effect";
33
+ } from "effect-agent/page-screenshot";
34
+ import { SandboxImplementation } from "effect-agent/sandbox";
35
35
 
36
36
  /**
37
37
  * The Cloudflare Browser Run Quick Action `PageCapture` adapter (capability
@@ -1,82 +1,82 @@
1
- import { ThreadId, type SubmissionId } from "@effect-agent/core/Identifiers";
2
- import {
3
- type RunContextPreparation,
4
- type RunCostEstimator,
5
- type RunToolFailureObserver,
6
- } from "@effect-agent/engine/RunOptions";
7
- import {
8
- CurrentToolFailureObserver,
9
- RunContextPreparationPassthrough,
10
- RunToolAuthorization,
11
- toolFailureObserverLayer,
12
- } from "@effect-agent/engine/RunOptions";
13
- import { doMessageDeliveryStoreLayer } from "@effect-agent/storage-cloudflare/DoMessageDeliveryStore";
1
+ import { doMessageDeliveryStoreLayer } from "@effect-agent/storage-cloudflare/do-message-delivery-store";
14
2
  import {
15
3
  type DoStorageFailpointHandler,
16
4
  type DoStorageFailpoint,
17
- } from "@effect-agent/storage-cloudflare/DoStorageFailpoint";
18
- import { submissionLedgerLayer } from "@effect-agent/storage-cloudflare/DoSubmissionLedger";
5
+ } from "@effect-agent/storage-cloudflare/do-storage-failpoint";
6
+ import { submissionLedgerLayer } from "@effect-agent/storage-cloudflare/do-submission-ledger";
19
7
  import {
20
8
  threadStoreLayer,
21
9
  storageConfigLayer,
22
10
  storageFailpointLayer,
23
11
  type DoStorageInitializationError,
24
12
  type DoStorageOptions,
25
- } from "@effect-agent/storage-cloudflare/DoThreadStore";
26
- import { type PortRequest, type PortResponse } from "@effect-agent/storage-cloudflare/PortProtocol";
13
+ } from "@effect-agent/storage-cloudflare/do-thread-store";
14
+ import {
15
+ type PortRequest,
16
+ type PortResponse,
17
+ } from "@effect-agent/storage-cloudflare/port-protocol";
27
18
  import {
28
19
  executePortRequest,
29
20
  routedThreadStoreLayer,
30
21
  routedSubmissionLedgerLayer,
31
- } from "@effect-agent/storage-cloudflare/PortRouting";
22
+ } from "@effect-agent/storage-cloudflare/port-routing";
23
+ import { BrowserCrypto } from "@effect/platform-browser";
24
+ import { SqliteClient } from "@effect/sql-sqlite-do";
25
+ import {
26
+ type Crypto,
27
+ Cause,
28
+ Context,
29
+ Duration,
30
+ Effect,
31
+ Layer,
32
+ Schema,
33
+ Semaphore,
34
+ type Option,
35
+ } from "effect";
32
36
  import {
33
37
  compileRegistrations,
34
38
  type AgentRegistration,
35
39
  type ResolvedBinding,
36
- } from "@effect-agent/thread/AgentRegistration";
37
- import { type DigestError } from "@effect-agent/thread/Digest";
38
- import {
39
- DurableAgentRuntime,
40
- DurableRuntimeConfig,
41
- } from "@effect-agent/thread/DurableAgentRuntime";
40
+ } from "effect-agent/agent-registration";
41
+ import { type DigestError } from "effect-agent/digest";
42
+ import { DurableAgentRuntime, DurableRuntimeConfig } from "effect-agent/durable-agent-runtime";
42
43
  import {
43
44
  DurableRuntimeFailpoint,
44
45
  type DurableRuntimeFailpointHandler,
45
- } from "@effect-agent/thread/DurableFailpoint";
46
+ } from "effect-agent/durable-failpoint";
47
+ import { ThreadId, type SubmissionId } from "effect-agent/identifiers";
46
48
  import {
47
49
  type MessageDeliveryStore,
48
50
  MessageDeliveryDriver,
49
51
  type MessageDeliveryError,
50
- } from "@effect-agent/thread/MessageDelivery";
52
+ } from "effect-agent/message-delivery";
51
53
  import {
52
54
  operationAuthorizerLayer,
53
55
  type OperationAuthorizerService,
54
- } from "@effect-agent/thread/OperationAuthorizer";
55
- import { type PreparedInputAdmission } from "@effect-agent/thread/PreparedInputAdmission";
56
- import { ProducerId } from "@effect-agent/thread/Records";
56
+ } from "effect-agent/operation-authorizer";
57
+ import { type PreparedInputAdmission } from "effect-agent/prepared-input-admission";
58
+ import { ProducerId } from "effect-agent/records";
59
+ import {
60
+ type RunContextPreparation,
61
+ type RunCostEstimator,
62
+ type RunToolFailureObserver,
63
+ } from "effect-agent/run-options";
64
+ import {
65
+ CurrentToolFailureObserver,
66
+ RunContextPreparationPassthrough,
67
+ RunToolAuthorization,
68
+ toolFailureObserverLayer,
69
+ } from "effect-agent/run-options";
57
70
  import {
58
71
  LedgerError,
59
72
  SubmissionLedger,
60
73
  SubmissionLookupById,
61
74
  type SubmissionSnapshot,
62
- } from "@effect-agent/thread/SubmissionLedger";
63
- import { ThreadProjectionMaintenance } from "@effect-agent/thread/ThreadProjectionMaintenance";
64
- import { ThreadStoreError, ThreadStore } from "@effect-agent/thread/ThreadStore";
65
- import { ToolReconciler } from "@effect-agent/thread/ToolReconciler";
66
- import { type WakeScheduler } from "@effect-agent/thread/WakeScheduler";
67
- import { BrowserCrypto } from "@effect/platform-browser";
68
- import { SqliteClient } from "@effect/sql-sqlite-do";
69
- import {
70
- type Crypto,
71
- Cause,
72
- Context,
73
- Duration,
74
- Effect,
75
- Layer,
76
- Schema,
77
- Semaphore,
78
- type Option,
79
- } from "effect";
75
+ } from "effect-agent/submission-ledger";
76
+ import { ThreadProjectionMaintenance } from "effect-agent/thread-projection-maintenance";
77
+ import { ThreadStoreError, ThreadStore } from "effect-agent/thread-store";
78
+ import { ToolReconciler } from "effect-agent/tool-reconciler";
79
+ import { type WakeScheduler } from "effect-agent/wake-scheduler";
80
80
  import { SqlClient } from "effect/unstable/sql/SqlClient";
81
81
 
82
82
  import {
@@ -1,17 +1,17 @@
1
- import { type ThreadId } from "@effect-agent/core/Identifiers";
1
+ import { Clock, Context, Deferred, Effect, Layer, Option, Ref, Semaphore, Stream } from "effect";
2
+ import { type ThreadId } from "effect-agent/identifiers";
2
3
  import {
3
4
  MessageDeliveryDriver,
4
5
  MessageDeliveryError,
5
6
  MessageDeliveryStore,
6
- } from "@effect-agent/thread/MessageDelivery";
7
- import { WakeScheduler } from "@effect-agent/thread/WakeScheduler";
8
- import { Clock, Context, Deferred, Effect, Layer, Option, Ref, Semaphore, Stream } from "effect";
7
+ } from "effect-agent/message-delivery";
8
+ import { WakeScheduler } from "effect-agent/wake-scheduler";
9
9
 
10
10
  import { DurableAlarmError, ThreadMessageDelivery, ThreadMutationGate } from "../Alarm.ts";
11
11
  import { ThreadObjectPlacement } from "../CloudflareBindings.ts";
12
12
  import { CloudflareDurableRuntimeConfig } from "../CloudflareConfig.ts";
13
13
 
14
- /** Every externally requested write prearms the owning Object's maintenance generation. */
14
+ /** Every write prearms its owner; the delivery due index owns its recovery deadline. */
15
15
  export const guardedMessageDeliveryStoreLayer = Layer.effect(
16
16
  MessageDeliveryStore,
17
17
  Effect.gen(function* () {
@@ -36,7 +36,12 @@ export const guardedMessageDeliveryStoreLayer = Layer.effect(
36
36
 
37
37
  const mutate = <A, E>(body: Effect.Effect<A, E>) =>
38
38
  mutations
39
- .withMutation(cacheGate.withPermit(Ref.set(deadline, undefined).pipe(Effect.andThen(body))))
39
+ .withMutation(
40
+ cacheGate.withPermit(Ref.set(deadline, undefined).pipe(Effect.andThen(body))),
41
+ // A foreign receipt changing does not make the source ledger actionable. Keep the
42
+ // prearm and producer gate so eviction and a racing pass cannot lose delivery work.
43
+ { invalidatesRecovery: false },
44
+ )
40
45
  .pipe(
41
46
  Effect.catchTag("DurableAlarmError", () =>
42
47
  MessageDeliveryError.make({ reason: "storage", operation: "prearm message delivery" }),
@@ -1,16 +1,16 @@
1
- import { type AgentId } from "@effect-agent/core/Identifiers";
2
- import { type DurableSubmitAgent } from "@effect-agent/thread/DurableAgentRuntime";
3
- import { PreparedInputAdmission } from "@effect-agent/thread/PreparedInputAdmission";
4
- import { PersistedJson } from "@effect-agent/thread/Records";
1
+ import { Effect, Layer } from "effect";
2
+ import { type DurableSubmitAgent } from "effect-agent/durable-agent-runtime";
3
+ import { type AgentId } from "effect-agent/identifiers";
4
+ import { PreparedInputAdmission } from "effect-agent/prepared-input-admission";
5
+ import { PersistedJson } from "effect-agent/records";
5
6
  import {
6
7
  type ScheduledEnvelope,
7
8
  ScheduledInputAdmission,
8
9
  ScheduledInputRetryable,
9
10
  ScheduledInputRefused,
10
11
  ScheduleStorageError,
11
- } from "@effect-agent/thread/Schedule";
12
- import { type PreparedInput } from "@effect-agent/thread/Subscription";
13
- import { Effect, Layer } from "effect";
12
+ } from "effect-agent/schedule";
13
+ import { type PreparedInput } from "effect-agent/subscription";
14
14
 
15
15
  import { CloudflareThreadClient, type ThreadClientError } from "../CloudflareThreadClient.ts";
16
16
 
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  ThreadPortTransport,
3
3
  portTransportFailure,
4
- } from "@effect-agent/storage-cloudflare/PortRouting";
4
+ } from "@effect-agent/storage-cloudflare/port-routing";
5
5
  import { Effect, Layer } from "effect";
6
6
 
7
7
  import { callThreadObject, ThreadObjectNamespace } from "../CloudflareBindings.ts";
@@ -1,8 +1,8 @@
1
1
  /// <reference types="@cloudflare/workers-types" />
2
2
  import puppeteer, { type Browser } from "@cloudflare/puppeteer";
3
- import { type InteractiveBrowserPolicy } from "@effect-agent/sandbox/InteractiveBrowser";
4
- import { ProtectedBrowserError } from "@effect-agent/sandbox/ProtectedBrowser";
5
3
  import { Clock, Context, Crypto, Effect, Layer, Redacted, Schema, type Scope } from "effect";
4
+ import { type InteractiveBrowserPolicy } from "effect-agent/interactive-browser";
5
+ import { ProtectedBrowserError } from "effect-agent/protected-browser";
6
6
 
7
7
  import { BrowserRunSessionLifecycle } from "../internal/browser-session-lifecycle.ts";
8
8
  import { makeProtectedNativeTransport, ProtectedNativeSession } from "./native.ts";
@@ -1,12 +1,12 @@
1
1
  /// <reference types="@cloudflare/workers-types" />
2
2
  import type { Browser, Frame, JSHandle, Page } from "@cloudflare/puppeteer";
3
- import { type InteractiveBrowserPolicy } from "@effect-agent/sandbox/InteractiveBrowser";
3
+ import { Clock, Context, Crypto, Effect, Redacted, Schema, type Scope } from "effect";
4
+ import { type InteractiveBrowserPolicy } from "effect-agent/interactive-browser";
4
5
  import {
5
6
  CredentialOrigin,
6
7
  CredentialTarget,
7
8
  ProtectedBrowserControl,
8
- } from "@effect-agent/sandbox/ProtectedBrowser";
9
- import { Clock, Context, Crypto, Effect, Redacted, Schema, type Scope } from "effect";
9
+ } from "effect-agent/protected-browser";
10
10
 
11
11
  import { inspectFrame, maxAttributeLength } from "./inspect-frame.ts";
12
12
  import {
@@ -1,4 +1,15 @@
1
- import { InteractiveBrowserPolicy } from "@effect-agent/sandbox/InteractiveBrowser";
1
+ import {
2
+ Clock,
3
+ Context,
4
+ Crypto,
5
+ Effect,
6
+ Layer,
7
+ Redacted,
8
+ Schema,
9
+ Semaphore,
10
+ type Scope,
11
+ } from "effect";
12
+ import { InteractiveBrowserPolicy } from "effect-agent/interactive-browser";
2
13
  /// <reference types="@cloudflare/workers-types" />
3
14
  import {
4
15
  BrowserCredentialAccess,
@@ -27,18 +38,7 @@ import {
27
38
  type ProtectedBrowserAction,
28
39
  type ProtectedCleanup,
29
40
  type ProtectedObservationState,
30
- } from "@effect-agent/sandbox/ProtectedBrowser";
31
- import {
32
- Clock,
33
- Context,
34
- Crypto,
35
- Effect,
36
- Layer,
37
- Redacted,
38
- Schema,
39
- Semaphore,
40
- type Scope,
41
- } from "effect";
41
+ } from "effect-agent/protected-browser";
42
42
 
43
43
  export class ProtectedTransportError extends Schema.TaggedError<ProtectedTransportError>()(
44
44
  "ProtectedTransportError",