@rikalabs/akter 0.1.0-alpha.0
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/CHANGELOG.md +15 -0
- package/LICENSE +202 -0
- package/NOTICE +8 -0
- package/README.md +116 -0
- package/dist/actor/codecs.d.ts +77 -0
- package/dist/actor/codecs.js +87 -0
- package/dist/actor/connections.d.ts +34 -0
- package/dist/actor/connections.js +145 -0
- package/dist/actor/definition.d.ts +893 -0
- package/dist/actor/definition.js +147 -0
- package/dist/actor/descriptor.d.ts +172 -0
- package/dist/actor/descriptor.js +367 -0
- package/dist/actor/handles.d.ts +77 -0
- package/dist/actor/handles.js +265 -0
- package/dist/actor/jobs.d.ts +10 -0
- package/dist/actor/jobs.js +137 -0
- package/dist/actor/layers.d.ts +41 -0
- package/dist/actor/layers.js +177 -0
- package/dist/actor/reads.d.ts +47 -0
- package/dist/actor/reads.js +224 -0
- package/dist/actor/served.d.ts +120 -0
- package/dist/actor/served.js +72 -0
- package/dist/actor/turns.d.ts +13 -0
- package/dist/actor/turns.js +332 -0
- package/dist/actor/workflows.d.ts +16 -0
- package/dist/actor/workflows.js +37 -0
- package/dist/client/calls.d.ts +47 -0
- package/dist/client/calls.js +425 -0
- package/dist/client/clock.d.ts +56 -0
- package/dist/client/clock.js +119 -0
- package/dist/client/fleet-page.d.ts +15 -0
- package/dist/client/fleet-page.js +13 -0
- package/dist/client/fleet.d.ts +29 -0
- package/dist/client/fleet.js +51 -0
- package/dist/client/index.d.ts +17 -0
- package/dist/client/index.js +6 -0
- package/dist/client/make.d.ts +157 -0
- package/dist/client/make.js +221 -0
- package/dist/client/offline/queue.d.ts +118 -0
- package/dist/client/offline/queue.js +292 -0
- package/dist/client/offline/store.d.ts +74 -0
- package/dist/client/offline/store.js +78 -0
- package/dist/client/optimistic.d.ts +57 -0
- package/dist/client/optimistic.js +136 -0
- package/dist/client/report.d.ts +2 -0
- package/dist/client/report.js +8 -0
- package/dist/client/sessions/connection.d.ts +118 -0
- package/dist/client/sessions/connection.js +162 -0
- package/dist/client/sessions/feed.d.ts +42 -0
- package/dist/client/sessions/feed.js +43 -0
- package/dist/client/sessions/sse.d.ts +47 -0
- package/dist/client/sessions/sse.js +112 -0
- package/dist/client/sessions/stream.d.ts +28 -0
- package/dist/client/sessions/stream.js +35 -0
- package/dist/client/sessions/watch.d.ts +34 -0
- package/dist/client/sessions/watch.js +40 -0
- package/dist/client/transport.d.ts +37 -0
- package/dist/client/transport.js +66 -0
- package/dist/contexts/command.d.ts +132 -0
- package/dist/contexts/command.js +20 -0
- package/dist/contexts/connection.d.ts +68 -0
- package/dist/contexts/connection.js +0 -0
- package/dist/contexts/job.d.ts +49 -0
- package/dist/contexts/job.js +0 -0
- package/dist/contexts/workflow.d.ts +147 -0
- package/dist/contexts/workflow.js +22 -0
- package/dist/errors/actor.d.ts +200 -0
- package/dist/errors/actor.js +271 -0
- package/dist/errors/content.d.ts +19 -0
- package/dist/errors/content.js +14 -0
- package/dist/errors/database.d.ts +22 -0
- package/dist/errors/database.js +23 -0
- package/dist/errors/events.d.ts +17 -0
- package/dist/errors/events.js +14 -0
- package/dist/errors/subscription.d.ts +12 -0
- package/dist/errors/subscription.js +8 -0
- package/dist/errors/workflow.d.ts +28 -0
- package/dist/errors/workflow.js +17 -0
- package/dist/handles/actors.d.ts +17 -0
- package/dist/handles/actors.js +7 -0
- package/dist/handles/content.d.ts +59 -0
- package/dist/handles/content.js +36 -0
- package/dist/handles/intents.d.ts +164 -0
- package/dist/handles/intents.js +214 -0
- package/dist/handles/run.d.ts +31 -0
- package/dist/handles/run.js +21 -0
- package/dist/handles/workflow.d.ts +27 -0
- package/dist/handles/workflow.js +23 -0
- package/dist/identity/caller.d.ts +105 -0
- package/dist/identity/caller.js +68 -0
- package/dist/identity/child.d.ts +18 -0
- package/dist/identity/child.js +39 -0
- package/dist/identity/command.d.ts +19 -0
- package/dist/identity/command.js +21 -0
- package/dist/identity/connection.d.ts +24 -0
- package/dist/identity/connection.js +29 -0
- package/dist/identity/content.d.ts +18 -0
- package/dist/identity/content.js +12 -0
- package/dist/identity/digest.d.ts +4 -0
- package/dist/identity/digest.js +5 -0
- package/dist/identity/execution.d.ts +32 -0
- package/dist/identity/execution.js +63 -0
- package/dist/identity/mint.d.ts +51 -0
- package/dist/identity/mint.js +76 -0
- package/dist/identity/version.d.ts +2 -0
- package/dist/identity/version.js +3 -0
- package/dist/index.d.ts +159 -0
- package/dist/index.js +97 -0
- package/dist/members/blob.d.ts +43 -0
- package/dist/members/blob.js +29 -0
- package/dist/members/command.d.ts +109 -0
- package/dist/members/command.js +61 -0
- package/dist/members/connection.d.ts +55 -0
- package/dist/members/connection.js +49 -0
- package/dist/members/event.d.ts +36 -0
- package/dist/members/event.js +24 -0
- package/dist/members/job.d.ts +157 -0
- package/dist/members/job.js +67 -0
- package/dist/members/payload.d.ts +93 -0
- package/dist/members/payload.js +145 -0
- package/dist/members/reducer.d.ts +64 -0
- package/dist/members/reducer.js +27 -0
- package/dist/members/stream.d.ts +36 -0
- package/dist/members/stream.js +14 -0
- package/dist/members/subscription.d.ts +182 -0
- package/dist/members/subscription.js +91 -0
- package/dist/members/workflow.d.ts +99 -0
- package/dist/members/workflow.js +2 -0
- package/dist/policies/access.d.ts +35 -0
- package/dist/policies/access.js +6 -0
- package/dist/policies/command.d.ts +127 -0
- package/dist/policies/command.js +45 -0
- package/dist/policies/job.d.ts +28 -0
- package/dist/policies/job.js +60 -0
- package/dist/policies/schedules.d.ts +33 -0
- package/dist/policies/schedules.js +131 -0
- package/dist/protocol/frames.d.ts +66 -0
- package/dist/protocol/frames.js +55 -0
- package/dist/protocol/inspection.d.ts +807 -0
- package/dist/protocol/inspection.js +243 -0
- package/dist/protocol/wire.d.ts +184 -0
- package/dist/protocol/wire.js +150 -0
- package/dist/runtime/actors.d.ts +155 -0
- package/dist/runtime/actors.js +4 -0
- package/dist/runtime/admission.d.ts +34 -0
- package/dist/runtime/admission.js +72 -0
- package/dist/runtime/adoption/backfill.d.ts +27 -0
- package/dist/runtime/adoption/backfill.js +144 -0
- package/dist/runtime/adoption/enforce.d.ts +55 -0
- package/dist/runtime/adoption/enforce.js +241 -0
- package/dist/runtime/adoption/observe.d.ts +43 -0
- package/dist/runtime/adoption/observe.js +139 -0
- package/dist/runtime/adoption/plan.d.ts +45 -0
- package/dist/runtime/adoption/plan.js +192 -0
- package/dist/runtime/adoption/startup.d.ts +32 -0
- package/dist/runtime/adoption/startup.js +76 -0
- package/dist/runtime/adoption/status.d.ts +23 -0
- package/dist/runtime/adoption/status.js +47 -0
- package/dist/runtime/adoption/target.d.ts +33 -0
- package/dist/runtime/adoption/target.js +49 -0
- package/dist/runtime/connections/holder.d.ts +221 -0
- package/dist/runtime/connections/holder.js +816 -0
- package/dist/runtime/connections/owner.d.ts +263 -0
- package/dist/runtime/connections/owner.js +896 -0
- package/dist/runtime/connections/protocol.d.ts +441 -0
- package/dist/runtime/connections/protocol.js +222 -0
- package/dist/runtime/connections/reads.d.ts +24 -0
- package/dist/runtime/connections/reads.js +19 -0
- package/dist/runtime/connections/streams.d.ts +62 -0
- package/dist/runtime/connections/streams.js +128 -0
- package/dist/runtime/connections/transport.d.ts +40 -0
- package/dist/runtime/connections/transport.js +68 -0
- package/dist/runtime/connections/watch.d.ts +52 -0
- package/dist/runtime/connections/watch.js +159 -0
- package/dist/runtime/content/grant.d.ts +34 -0
- package/dist/runtime/content/grant.js +58 -0
- package/dist/runtime/content/store.d.ts +63 -0
- package/dist/runtime/content/store.js +294 -0
- package/dist/runtime/cron/key.d.ts +2 -0
- package/dist/runtime/cron/key.js +2 -0
- package/dist/runtime/cron/schedule.d.ts +69 -0
- package/dist/runtime/cron/schedule.js +144 -0
- package/dist/runtime/database/bounded.d.ts +43 -0
- package/dist/runtime/database/bounded.js +108 -0
- package/dist/runtime/database/connection.d.ts +8 -0
- package/dist/runtime/database/connection.js +18 -0
- package/dist/runtime/database/coordination.d.ts +19 -0
- package/dist/runtime/database/coordination.js +72 -0
- package/dist/runtime/database/flock.d.ts +10 -0
- package/dist/runtime/database/flock.js +60 -0
- package/dist/runtime/database/gate.d.ts +26 -0
- package/dist/runtime/database/gate.js +54 -0
- package/dist/runtime/database/keepalive.d.ts +11 -0
- package/dist/runtime/database/keepalive.js +22 -0
- package/dist/runtime/database/migrations.d.ts +177 -0
- package/dist/runtime/database/migrations.js +1018 -0
- package/dist/runtime/database/neki/migrations.d.ts +31 -0
- package/dist/runtime/database/neki/migrations.js +276 -0
- package/dist/runtime/database/neki/session.d.ts +23 -0
- package/dist/runtime/database/neki/session.js +31 -0
- package/dist/runtime/database/pglite.d.ts +21 -0
- package/dist/runtime/database/pglite.js +74 -0
- package/dist/runtime/database/replica.d.ts +41 -0
- package/dist/runtime/database/replica.js +51 -0
- package/dist/runtime/database/shards.d.ts +21 -0
- package/dist/runtime/database/shards.js +37 -0
- package/dist/runtime/database/snapshot.d.ts +7 -0
- package/dist/runtime/database/snapshot.js +7 -0
- package/dist/runtime/database/tenancy.d.ts +69 -0
- package/dist/runtime/database/tenancy.js +145 -0
- package/dist/runtime/database/transient.d.ts +10 -0
- package/dist/runtime/database/transient.js +25 -0
- package/dist/runtime/drain.d.ts +132 -0
- package/dist/runtime/drain.js +109 -0
- package/dist/runtime/entity/mailbox.d.ts +86 -0
- package/dist/runtime/entity/mailbox.js +121 -0
- package/dist/runtime/entity/register.d.ts +424 -0
- package/dist/runtime/entity/register.js +669 -0
- package/dist/runtime/events/append.d.ts +192 -0
- package/dist/runtime/events/append.js +128 -0
- package/dist/runtime/events/cursor.d.ts +2 -0
- package/dist/runtime/events/cursor.js +5 -0
- package/dist/runtime/events/replay.d.ts +20 -0
- package/dist/runtime/events/replay.js +45 -0
- package/dist/runtime/feeds.d.ts +26 -0
- package/dist/runtime/feeds.js +100 -0
- package/dist/runtime/fleet/checks.d.ts +17 -0
- package/dist/runtime/fleet/checks.js +106 -0
- package/dist/runtime/fleet/maintainer.d.ts +38 -0
- package/dist/runtime/fleet/maintainer.js +383 -0
- package/dist/runtime/fleet/pgoutput.d.ts +41 -0
- package/dist/runtime/fleet/pgoutput.js +102 -0
- package/dist/runtime/fleet/setup.d.ts +36 -0
- package/dist/runtime/fleet/setup.js +58 -0
- package/dist/runtime/fleet/subscribe.d.ts +42 -0
- package/dist/runtime/fleet/subscribe.js +147 -0
- package/dist/runtime/index.d.ts +66 -0
- package/dist/runtime/index.js +37 -0
- package/dist/runtime/inspector/http.d.ts +19 -0
- package/dist/runtime/inspector/http.js +36 -0
- package/dist/runtime/inspector/layer.d.ts +46 -0
- package/dist/runtime/inspector/layer.js +180 -0
- package/dist/runtime/inspector/queries.d.ts +711 -0
- package/dist/runtime/inspector/queries.js +494 -0
- package/dist/runtime/jobs/attempt.d.ts +254 -0
- package/dist/runtime/jobs/attempt.js +413 -0
- package/dist/runtime/jobs/isolation.d.ts +20 -0
- package/dist/runtime/jobs/isolation.js +10 -0
- package/dist/runtime/jobs/progress.d.ts +95 -0
- package/dist/runtime/jobs/progress.js +144 -0
- package/dist/runtime/layer.d.ts +260 -0
- package/dist/runtime/layer.js +876 -0
- package/dist/runtime/members.d.ts +381 -0
- package/dist/runtime/members.js +8 -0
- package/dist/runtime/operators/audit.d.ts +64 -0
- package/dist/runtime/operators/audit.js +56 -0
- package/dist/runtime/operators/auth.d.ts +29 -0
- package/dist/runtime/operators/auth.js +42 -0
- package/dist/runtime/operators/export.d.ts +68 -0
- package/dist/runtime/operators/export.js +137 -0
- package/dist/runtime/operators/grants.d.ts +45 -0
- package/dist/runtime/operators/grants.js +40 -0
- package/dist/runtime/operators/repair.d.ts +206 -0
- package/dist/runtime/operators/repair.js +226 -0
- package/dist/runtime/operators/routes.d.ts +35 -0
- package/dist/runtime/operators/routes.js +190 -0
- package/dist/runtime/operators/seed.d.ts +123 -0
- package/dist/runtime/operators/seed.js +123 -0
- package/dist/runtime/payloads/versions.d.ts +65 -0
- package/dist/runtime/payloads/versions.js +240 -0
- package/dist/runtime/peering/authority.d.ts +42 -0
- package/dist/runtime/peering/authority.js +132 -0
- package/dist/runtime/peering/credentials.d.ts +21 -0
- package/dist/runtime/peering/credentials.js +13 -0
- package/dist/runtime/peering/transport.d.ts +51 -0
- package/dist/runtime/peering/transport.js +175 -0
- package/dist/runtime/queries.d.ts +18 -0
- package/dist/runtime/queries.js +169 -0
- package/dist/runtime/readiness.d.ts +36 -0
- package/dist/runtime/readiness.js +44 -0
- package/dist/runtime/registration.d.ts +58 -0
- package/dist/runtime/registration.js +186 -0
- package/dist/runtime/request.d.ts +158 -0
- package/dist/runtime/request.js +102 -0
- package/dist/runtime/retry.d.ts +8 -0
- package/dist/runtime/retry.js +11 -0
- package/dist/runtime/runner.d.ts +93 -0
- package/dist/runtime/runner.js +122 -0
- package/dist/runtime/storage/codec.d.ts +39 -0
- package/dist/runtime/storage/codec.js +41 -0
- package/dist/runtime/storage/generation.d.ts +69 -0
- package/dist/runtime/storage/generation.js +49 -0
- package/dist/runtime/storage/placements.d.ts +15 -0
- package/dist/runtime/storage/placements.js +38 -0
- package/dist/runtime/storage/platform.d.ts +6 -0
- package/dist/runtime/storage/platform.js +9 -0
- package/dist/runtime/storage/retention.d.ts +73 -0
- package/dist/runtime/storage/retention.js +158 -0
- package/dist/runtime/subscriptions/identity.d.ts +31 -0
- package/dist/runtime/subscriptions/identity.js +45 -0
- package/dist/runtime/subscriptions/relay.d.ts +175 -0
- package/dist/runtime/subscriptions/relay.js +763 -0
- package/dist/runtime/subscriptions/storage.d.ts +40 -0
- package/dist/runtime/subscriptions/storage.js +98 -0
- package/dist/runtime/sweeps.d.ts +39 -0
- package/dist/runtime/sweeps.js +54 -0
- package/dist/runtime/telemetry/defects.d.ts +57 -0
- package/dist/runtime/telemetry/defects.js +43 -0
- package/dist/runtime/telemetry/metrics.d.ts +52 -0
- package/dist/runtime/telemetry/metrics.js +138 -0
- package/dist/runtime/telemetry/routes.d.ts +19 -0
- package/dist/runtime/telemetry/routes.js +18 -0
- package/dist/runtime/telemetry/sampler.d.ts +26 -0
- package/dist/runtime/telemetry/sampler.js +101 -0
- package/dist/runtime/telemetry/spans.d.ts +38 -0
- package/dist/runtime/telemetry/spans.js +44 -0
- package/dist/runtime/telemetry/usage.d.ts +52 -0
- package/dist/runtime/telemetry/usage.js +30 -0
- package/dist/runtime/topology/admission.d.ts +13 -0
- package/dist/runtime/topology/admission.js +36 -0
- package/dist/runtime/topology/locks.d.ts +56 -0
- package/dist/runtime/topology/locks.js +81 -0
- package/dist/runtime/topology/messages.d.ts +15 -0
- package/dist/runtime/topology/messages.js +32 -0
- package/dist/runtime/turn/admission.d.ts +22 -0
- package/dist/runtime/turn/admission.js +41 -0
- package/dist/runtime/turn/blobs.d.ts +38 -0
- package/dist/runtime/turn/blobs.js +215 -0
- package/dist/runtime/turn/execute.d.ts +208 -0
- package/dist/runtime/turn/execute.js +972 -0
- package/dist/runtime/turn/group.d.ts +165 -0
- package/dist/runtime/turn/group.js +326 -0
- package/dist/runtime/turn/hooks.d.ts +44 -0
- package/dist/runtime/turn/hooks.js +28 -0
- package/dist/runtime/turn/outbox.d.ts +159 -0
- package/dist/runtime/turn/outbox.js +269 -0
- package/dist/runtime/turn/pipeline.d.ts +68 -0
- package/dist/runtime/turn/pipeline.js +83 -0
- package/dist/runtime/turn/receipt.d.ts +81 -0
- package/dist/runtime/turn/receipt.js +32 -0
- package/dist/runtime/turn/relay.d.ts +179 -0
- package/dist/runtime/turn/relay.js +685 -0
- package/dist/runtime/turn/rows.d.ts +43 -0
- package/dist/runtime/turn/rows.js +592 -0
- package/dist/runtime/workflows/compatibility.d.ts +125 -0
- package/dist/runtime/workflows/compatibility.js +285 -0
- package/dist/runtime/workflows/engine.d.ts +107 -0
- package/dist/runtime/workflows/engine.js +826 -0
- package/dist/runtime/workflows/manifest.d.ts +34 -0
- package/dist/runtime/workflows/manifest.js +39 -0
- package/dist/runtime/workflows/steps.d.ts +33 -0
- package/dist/runtime/workflows/steps.js +152 -0
- package/dist/serve/api.d.ts +99 -0
- package/dist/serve/api.js +403 -0
- package/dist/serve/assertion/binding.d.ts +41 -0
- package/dist/serve/assertion/binding.js +92 -0
- package/dist/serve/assertion/verify.d.ts +93 -0
- package/dist/serve/assertion/verify.js +189 -0
- package/dist/serve/auth.d.ts +200 -0
- package/dist/serve/auth.js +92 -0
- package/dist/serve/clock.d.ts +10 -0
- package/dist/serve/clock.js +25 -0
- package/dist/serve/jwt.d.ts +65 -0
- package/dist/serve/jwt.js +202 -0
- package/dist/serve/layer.d.ts +98 -0
- package/dist/serve/layer.js +809 -0
- package/dist/serve/mcp/endpoint.d.ts +39 -0
- package/dist/serve/mcp/endpoint.js +187 -0
- package/dist/serve/mcp/tools.d.ts +37 -0
- package/dist/serve/mcp/tools.js +125 -0
- package/dist/serve/origin.d.ts +6 -0
- package/dist/serve/origin.js +21 -0
- package/dist/serve/sessions/feed.d.ts +79 -0
- package/dist/serve/sessions/feed.js +115 -0
- package/dist/serve/sessions/socket.d.ts +56 -0
- package/dist/serve/sessions/socket.js +212 -0
- package/dist/serve/sessions/sse.d.ts +27 -0
- package/dist/serve/sessions/sse.js +26 -0
- package/dist/serve/sessions/stream.d.ts +9 -0
- package/dist/serve/sessions/stream.js +9 -0
- package/dist/serve/sessions/watch.d.ts +12 -0
- package/dist/serve/sessions/watch.js +11 -0
- package/dist/serve/wire.d.ts +16 -0
- package/dist/serve/wire.js +50 -0
- package/dist/state/blob.d.ts +71 -0
- package/dist/state/blob.js +0 -0
- package/dist/state/migration.d.ts +53 -0
- package/dist/state/migration.js +29 -0
- package/dist/tables/fleet.d.ts +170 -0
- package/dist/tables/fleet.js +214 -0
- package/dist/tables/owned.d.ts +250 -0
- package/dist/tables/owned.js +233 -0
- package/dist/testing/actor-test.d.ts +360 -0
- package/dist/testing/actor-test.js +337 -0
- package/dist/testing/cluster.d.ts +93 -0
- package/dist/testing/cluster.js +296 -0
- package/dist/testing/conformance/access.d.ts +5 -0
- package/dist/testing/conformance/access.js +531 -0
- package/dist/testing/conformance/admission.d.ts +11 -0
- package/dist/testing/conformance/admission.js +182 -0
- package/dist/testing/conformance/adoption.d.ts +2 -0
- package/dist/testing/conformance/adoption.js +1019 -0
- package/dist/testing/conformance/assertions.d.ts +202 -0
- package/dist/testing/conformance/assertions.js +849 -0
- package/dist/testing/conformance/batches.d.ts +41 -0
- package/dist/testing/conformance/batches.js +388 -0
- package/dist/testing/conformance/blobs.d.ts +14 -0
- package/dist/testing/conformance/blobs.js +405 -0
- package/dist/testing/conformance/capacity.d.ts +8 -0
- package/dist/testing/conformance/capacity.js +433 -0
- package/dist/testing/conformance/client.d.ts +5 -0
- package/dist/testing/conformance/client.js +719 -0
- package/dist/testing/conformance/cold-serve.d.ts +16 -0
- package/dist/testing/conformance/cold-serve.js +254 -0
- package/dist/testing/conformance/connections/actors.d.ts +1143 -0
- package/dist/testing/conformance/connections/actors.js +180 -0
- package/dist/testing/conformance/connections/harness.d.ts +1754 -0
- package/dist/testing/conformance/connections/harness.js +142 -0
- package/dist/testing/conformance/connections/holders.d.ts +4 -0
- package/dist/testing/conformance/connections/holders.js +165 -0
- package/dist/testing/conformance/connections/lifecycle.d.ts +4 -0
- package/dist/testing/conformance/connections/lifecycle.js +113 -0
- package/dist/testing/conformance/connections/limits.d.ts +4 -0
- package/dist/testing/conformance/connections/limits.js +127 -0
- package/dist/testing/conformance/connections/reauthorization.d.ts +4 -0
- package/dist/testing/conformance/connections/reauthorization.js +170 -0
- package/dist/testing/conformance/connections/resync.d.ts +4 -0
- package/dist/testing/conformance/connections/resync.js +360 -0
- package/dist/testing/conformance/connections/takeover.d.ts +4 -0
- package/dist/testing/conformance/connections/takeover.js +287 -0
- package/dist/testing/conformance/connections.d.ts +4 -0
- package/dist/testing/conformance/connections.js +15 -0
- package/dist/testing/conformance/content-blobs.d.ts +16 -0
- package/dist/testing/conformance/content-blobs.js +534 -0
- package/dist/testing/conformance/counter.d.ts +16 -0
- package/dist/testing/conformance/counter.js +813 -0
- package/dist/testing/conformance/cron.d.ts +5 -0
- package/dist/testing/conformance/cron.js +665 -0
- package/dist/testing/conformance/drain.d.ts +26 -0
- package/dist/testing/conformance/drain.js +540 -0
- package/dist/testing/conformance/effect-control.d.ts +38 -0
- package/dist/testing/conformance/effect-control.js +1059 -0
- package/dist/testing/conformance/effects.d.ts +23 -0
- package/dist/testing/conformance/effects.js +432 -0
- package/dist/testing/conformance/events.d.ts +28 -0
- package/dist/testing/conformance/events.js +335 -0
- package/dist/testing/conformance/export.d.ts +2 -0
- package/dist/testing/conformance/export.js +368 -0
- package/dist/testing/conformance/fleet.d.ts +444 -0
- package/dist/testing/conformance/fleet.js +1009 -0
- package/dist/testing/conformance/groups.d.ts +7 -0
- package/dist/testing/conformance/groups.js +353 -0
- package/dist/testing/conformance/heap.d.ts +3 -0
- package/dist/testing/conformance/heap.js +149 -0
- package/dist/testing/conformance/http.d.ts +2809 -0
- package/dist/testing/conformance/http.js +1234 -0
- package/dist/testing/conformance/inspection-views.d.ts +8 -0
- package/dist/testing/conformance/inspection-views.js +272 -0
- package/dist/testing/conformance/inspector.d.ts +7 -0
- package/dist/testing/conformance/inspector.js +650 -0
- package/dist/testing/conformance/mint.d.ts +58 -0
- package/dist/testing/conformance/mint.js +692 -0
- package/dist/testing/conformance/multi-runner.d.ts +8 -0
- package/dist/testing/conformance/multi-runner.js +403 -0
- package/dist/testing/conformance/neki/plan.d.ts +19 -0
- package/dist/testing/conformance/neki/plan.js +30 -0
- package/dist/testing/conformance/observability.d.ts +3 -0
- package/dist/testing/conformance/observability.js +343 -0
- package/dist/testing/conformance/offline.d.ts +4 -0
- package/dist/testing/conformance/offline.js +474 -0
- package/dist/testing/conformance/operator-harness.d.ts +57 -0
- package/dist/testing/conformance/operator-harness.js +78 -0
- package/dist/testing/conformance/operator.d.ts +3 -0
- package/dist/testing/conformance/operator.js +379 -0
- package/dist/testing/conformance/outbox-cross-shard.d.ts +14 -0
- package/dist/testing/conformance/outbox-cross-shard.js +160 -0
- package/dist/testing/conformance/outbox.d.ts +36 -0
- package/dist/testing/conformance/outbox.js +437 -0
- package/dist/testing/conformance/payload-migrations.d.ts +3 -0
- package/dist/testing/conformance/payload-migrations.js +612 -0
- package/dist/testing/conformance/pipeline.d.ts +3 -0
- package/dist/testing/conformance/pipeline.js +1040 -0
- package/dist/testing/conformance/placement.d.ts +22 -0
- package/dist/testing/conformance/placement.js +539 -0
- package/dist/testing/conformance/platform.d.ts +40 -0
- package/dist/testing/conformance/platform.js +101 -0
- package/dist/testing/conformance/progress.d.ts +39 -0
- package/dist/testing/conformance/progress.js +666 -0
- package/dist/testing/conformance/properties.d.ts +6 -0
- package/dist/testing/conformance/properties.js +295 -0
- package/dist/testing/conformance/protocols.d.ts +4 -0
- package/dist/testing/conformance/protocols.js +618 -0
- package/dist/testing/conformance/provider/advertise.d.ts +21 -0
- package/dist/testing/conformance/provider/advertise.js +44 -0
- package/dist/testing/conformance/read-your-writes.d.ts +20 -0
- package/dist/testing/conformance/read-your-writes.js +192 -0
- package/dist/testing/conformance/reducers.d.ts +8 -0
- package/dist/testing/conformance/reducers.js +258 -0
- package/dist/testing/conformance/relay.d.ts +42 -0
- package/dist/testing/conformance/relay.js +1115 -0
- package/dist/testing/conformance/restore.d.ts +43 -0
- package/dist/testing/conformance/restore.js +341 -0
- package/dist/testing/conformance/retention.d.ts +14 -0
- package/dist/testing/conformance/retention.js +463 -0
- package/dist/testing/conformance/rls.d.ts +24 -0
- package/dist/testing/conformance/rls.js +576 -0
- package/dist/testing/conformance/simulation.d.ts +31 -0
- package/dist/testing/conformance/simulation.js +167 -0
- package/dist/testing/conformance/single-shard.d.ts +2 -0
- package/dist/testing/conformance/single-shard.js +125 -0
- package/dist/testing/conformance/singleton.d.ts +3 -0
- package/dist/testing/conformance/singleton.js +293 -0
- package/dist/testing/conformance/statements.d.ts +60 -0
- package/dist/testing/conformance/statements.js +108 -0
- package/dist/testing/conformance/streams.d.ts +7 -0
- package/dist/testing/conformance/streams.js +280 -0
- package/dist/testing/conformance/subscriptions/access.d.ts +4 -0
- package/dist/testing/conformance/subscriptions/access.js +98 -0
- package/dist/testing/conformance/subscriptions/actors.d.ts +4910 -0
- package/dist/testing/conformance/subscriptions/actors.js +372 -0
- package/dist/testing/conformance/subscriptions/cluster.d.ts +4 -0
- package/dist/testing/conformance/subscriptions/cluster.js +89 -0
- package/dist/testing/conformance/subscriptions/delivery.d.ts +4 -0
- package/dist/testing/conformance/subscriptions/delivery.js +253 -0
- package/dist/testing/conformance/subscriptions/deploys.d.ts +4 -0
- package/dist/testing/conformance/subscriptions/deploys.js +162 -0
- package/dist/testing/conformance/subscriptions/epochs.d.ts +4 -0
- package/dist/testing/conformance/subscriptions/epochs.js +169 -0
- package/dist/testing/conformance/subscriptions/failures.d.ts +4 -0
- package/dist/testing/conformance/subscriptions/failures.js +108 -0
- package/dist/testing/conformance/subscriptions/feeds.d.ts +4 -0
- package/dist/testing/conformance/subscriptions/feeds.js +218 -0
- package/dist/testing/conformance/subscriptions/harness.d.ts +124 -0
- package/dist/testing/conformance/subscriptions/harness.js +143 -0
- package/dist/testing/conformance/subscriptions/operator.d.ts +4 -0
- package/dist/testing/conformance/subscriptions/operator.js +128 -0
- package/dist/testing/conformance/subscriptions/retention.d.ts +4 -0
- package/dist/testing/conformance/subscriptions/retention.js +288 -0
- package/dist/testing/conformance/subscriptions/routing.d.ts +4 -0
- package/dist/testing/conformance/subscriptions/routing.js +179 -0
- package/dist/testing/conformance/subscriptions.d.ts +4 -0
- package/dist/testing/conformance/subscriptions.js +19 -0
- package/dist/testing/conformance/tables.d.ts +125 -0
- package/dist/testing/conformance/tables.js +664 -0
- package/dist/testing/conformance/transports/actors.d.ts +1907 -0
- package/dist/testing/conformance/transports/actors.js +163 -0
- package/dist/testing/conformance/transports/client.d.ts +3 -0
- package/dist/testing/conformance/transports/client.js +237 -0
- package/dist/testing/conformance/transports/feeds.d.ts +3 -0
- package/dist/testing/conformance/transports/feeds.js +232 -0
- package/dist/testing/conformance/transports/harness.d.ts +93 -0
- package/dist/testing/conformance/transports/harness.js +84 -0
- package/dist/testing/conformance/transports/streams.d.ts +3 -0
- package/dist/testing/conformance/transports/streams.js +96 -0
- package/dist/testing/conformance/transports/websocket.d.ts +3 -0
- package/dist/testing/conformance/transports/websocket.js +384 -0
- package/dist/testing/conformance/transports/wire.d.ts +141 -0
- package/dist/testing/conformance/transports/wire.js +204 -0
- package/dist/testing/conformance/transports.d.ts +3 -0
- package/dist/testing/conformance/transports.js +11 -0
- package/dist/testing/conformance/watch.d.ts +59 -0
- package/dist/testing/conformance/watch.js +879 -0
- package/dist/testing/conformance/workflow-engine.d.ts +97 -0
- package/dist/testing/conformance/workflow-engine.js +253 -0
- package/dist/testing/conformance/workflow-versions.d.ts +3 -0
- package/dist/testing/conformance/workflow-versions.js +545 -0
- package/dist/testing/conformance/workflows/access.d.ts +4 -0
- package/dist/testing/conformance/workflows/access.js +147 -0
- package/dist/testing/conformance/workflows/actors.d.ts +2317 -0
- package/dist/testing/conformance/workflows/actors.js +305 -0
- package/dist/testing/conformance/workflows/basics.d.ts +4 -0
- package/dist/testing/conformance/workflows/basics.js +144 -0
- package/dist/testing/conformance/workflows/engine.d.ts +4 -0
- package/dist/testing/conformance/workflows/engine.js +80 -0
- package/dist/testing/conformance/workflows/guards.d.ts +4 -0
- package/dist/testing/conformance/workflows/guards.js +172 -0
- package/dist/testing/conformance/workflows/harness.d.ts +14 -0
- package/dist/testing/conformance/workflows/harness.js +44 -0
- package/dist/testing/conformance/workflows/recovery.d.ts +4 -0
- package/dist/testing/conformance/workflows/recovery.js +181 -0
- package/dist/testing/conformance/workflows/starts.d.ts +4 -0
- package/dist/testing/conformance/workflows/starts.js +57 -0
- package/dist/testing/conformance/workflows/suspension.d.ts +4 -0
- package/dist/testing/conformance/workflows/suspension.js +106 -0
- package/dist/testing/conformance/workflows/waits.d.ts +4 -0
- package/dist/testing/conformance/workflows/waits.js +284 -0
- package/dist/testing/conformance/workflows.d.ts +4 -0
- package/dist/testing/conformance/workflows.js +19 -0
- package/dist/testing/conformance.d.ts +330 -0
- package/dist/testing/conformance.js +364 -0
- package/dist/testing/database.d.ts +31 -0
- package/dist/testing/database.js +70 -0
- package/dist/testing/foundation.d.ts +41 -0
- package/dist/testing/foundation.js +517 -0
- package/dist/testing/index.d.ts +20 -0
- package/dist/testing/index.js +12 -0
- package/dist/testing/property.d.ts +40 -0
- package/dist/testing/property.js +95 -0
- package/dist/testing/simulate-cluster.d.ts +112 -0
- package/dist/testing/simulate-cluster.js +257 -0
- package/dist/testing/simulate.d.ts +90 -0
- package/dist/testing/simulate.js +127 -0
- package/package.json +1 -0
|
@@ -0,0 +1,441 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import { Entity } from "effect/cluster";
|
|
3
|
+
import { Rpc } from "effect/rpc";
|
|
4
|
+
import { ActorError, SessionEnded } from "../../errors/actor.ts";
|
|
5
|
+
/**
|
|
6
|
+
* The framework connection member an event feed opens. It has no handler, and
|
|
7
|
+
* `$` can't start a declared member's tag, so it never collides with one.
|
|
8
|
+
*/
|
|
9
|
+
export declare const FEED_MEMBER = "$feed";
|
|
10
|
+
/** The prefix of the framework connection member a query watch opens; the watched query's tag follows. */
|
|
11
|
+
export declare const WATCH_PREFIX = "$watch:";
|
|
12
|
+
/** The framework connection member that watches `query`. `$` can't start a declared member's tag, so it never collides with one. */
|
|
13
|
+
export declare const watchMember: (query: string) => string;
|
|
14
|
+
/** Whether `member` is a framework watch connection. */
|
|
15
|
+
export declare const isWatchMember: (member: string) => boolean;
|
|
16
|
+
/** The query a framework watch member watches. */
|
|
17
|
+
export declare const watchedQuery: (member: string) => string;
|
|
18
|
+
/** What one commit wrote: whether it changed state, and the event classes, tables, and blobs it wrote. */
|
|
19
|
+
export declare const WriteSet: Schema.Struct<{
|
|
20
|
+
readonly state: Schema.Boolean;
|
|
21
|
+
readonly events: Schema.$Array<Schema.String>;
|
|
22
|
+
readonly tables: Schema.$Array<Schema.String>;
|
|
23
|
+
readonly blobs: Schema.$Array<Schema.String>;
|
|
24
|
+
}>;
|
|
25
|
+
/** What one commit wrote. */
|
|
26
|
+
export type WriteSet = typeof WriteSet.Type;
|
|
27
|
+
/** The frame an owner broadcasts to an actor's watches after each commit: the commit's version and its write set. */
|
|
28
|
+
export declare const Committed: Schema.Struct<{
|
|
29
|
+
readonly version: Schema.String;
|
|
30
|
+
readonly writes: Schema.Struct<{
|
|
31
|
+
readonly state: Schema.Boolean;
|
|
32
|
+
readonly events: Schema.$Array<Schema.String>;
|
|
33
|
+
readonly tables: Schema.$Array<Schema.String>;
|
|
34
|
+
readonly blobs: Schema.$Array<Schema.String>;
|
|
35
|
+
}>;
|
|
36
|
+
}>;
|
|
37
|
+
/** A decoded `Committed` frame. */
|
|
38
|
+
export type Committed = typeof Committed.Type;
|
|
39
|
+
/** One committed feed event as its owner broadcasts it; `value` is the stored encoding. */
|
|
40
|
+
export declare const FeedFrame: Schema.Struct<{
|
|
41
|
+
readonly tag: Schema.String;
|
|
42
|
+
readonly value: Schema.String;
|
|
43
|
+
readonly commandId: Schema.String;
|
|
44
|
+
readonly timestampMs: Schema.Finite;
|
|
45
|
+
}>;
|
|
46
|
+
/** A committed feed event as a holder receives it. */
|
|
47
|
+
export type FeedFrame = typeof FeedFrame.Type;
|
|
48
|
+
/** What an owner sends a holder over its ordered channel. */
|
|
49
|
+
export declare const HolderItem: Schema.TaggedUnion<{
|
|
50
|
+
readonly End: Schema.TaggedStruct<"End", {
|
|
51
|
+
readonly connectionId: Schema.String;
|
|
52
|
+
readonly ended: typeof SessionEnded;
|
|
53
|
+
}>;
|
|
54
|
+
readonly Flushed: Schema.TaggedStruct<"Flushed", {
|
|
55
|
+
readonly through: Schema.String;
|
|
56
|
+
}>;
|
|
57
|
+
readonly Frame: Schema.TaggedStruct<"Frame", {
|
|
58
|
+
readonly member: Schema.String;
|
|
59
|
+
readonly to: Schema.$Array<Schema.String>;
|
|
60
|
+
readonly frame: Schema.String;
|
|
61
|
+
readonly event: Schema.optional<Schema.String>;
|
|
62
|
+
readonly stamp: Schema.Boolean;
|
|
63
|
+
readonly replay: Schema.optional<Schema.Boolean>;
|
|
64
|
+
}>;
|
|
65
|
+
readonly Progress: Schema.TaggedStruct<"Progress", {
|
|
66
|
+
readonly member: Schema.String;
|
|
67
|
+
readonly to: Schema.$Array<Schema.String>;
|
|
68
|
+
readonly job: Schema.String;
|
|
69
|
+
readonly jobId: Schema.String;
|
|
70
|
+
readonly attempt: Schema.Finite;
|
|
71
|
+
readonly seq: Schema.Finite;
|
|
72
|
+
readonly frame: Schema.String;
|
|
73
|
+
}>;
|
|
74
|
+
readonly ProgressEnd: Schema.TaggedStruct<"ProgressEnd", {
|
|
75
|
+
readonly jobId: Schema.String;
|
|
76
|
+
}>;
|
|
77
|
+
readonly Seal: Schema.TaggedStruct<"Seal", {}>;
|
|
78
|
+
}>;
|
|
79
|
+
/** One item of an ordered owner-to-holder message. */
|
|
80
|
+
export type HolderItem = typeof HolderItem.Type;
|
|
81
|
+
/** What a client of an open connection receives. */
|
|
82
|
+
export declare const ClientMessage: Schema.TaggedUnion<{
|
|
83
|
+
readonly Frame: Schema.TaggedStruct<"Frame", {
|
|
84
|
+
readonly frame: Schema.String;
|
|
85
|
+
readonly cursor: Schema.optional<Schema.String>;
|
|
86
|
+
readonly event: Schema.optional<Schema.String>;
|
|
87
|
+
}>;
|
|
88
|
+
readonly Progress: Schema.TaggedStruct<"Progress", {
|
|
89
|
+
readonly job: Schema.String;
|
|
90
|
+
readonly jobId: Schema.String;
|
|
91
|
+
readonly attempt: Schema.Finite;
|
|
92
|
+
readonly seq: Schema.Finite;
|
|
93
|
+
readonly frame: Schema.String;
|
|
94
|
+
}>;
|
|
95
|
+
readonly Resync: Schema.TaggedStruct<"Resync", {
|
|
96
|
+
readonly after: Schema.UndefinedOr<Schema.String>;
|
|
97
|
+
readonly reason: Schema.Literal<"OwnerLost">;
|
|
98
|
+
readonly deadlineMs: Schema.Finite;
|
|
99
|
+
}>;
|
|
100
|
+
readonly ResyncReplayed: Schema.TaggedStruct<"ResyncReplayed", {}>;
|
|
101
|
+
}>;
|
|
102
|
+
/** A message a client of an open connection receives. */
|
|
103
|
+
export type ClientMessage = typeof ClientMessage.Type;
|
|
104
|
+
/** One ordered owner message to a holder: `seq` numbers it within its generation and `through` is the owner position it covers. */
|
|
105
|
+
export declare const Deliver: Schema.Struct<{
|
|
106
|
+
readonly epoch: Schema.String;
|
|
107
|
+
readonly owner: Schema.String;
|
|
108
|
+
readonly ownerEpoch: Schema.String;
|
|
109
|
+
readonly ref: Schema.Struct<{
|
|
110
|
+
readonly tenant: Schema.NonEmptyString;
|
|
111
|
+
readonly actor: Schema.NonEmptyString;
|
|
112
|
+
readonly id: Schema.NonEmptyString;
|
|
113
|
+
}>;
|
|
114
|
+
readonly generation: Schema.String;
|
|
115
|
+
readonly seq: Schema.Finite;
|
|
116
|
+
readonly through: Schema.String;
|
|
117
|
+
readonly items: Schema.$Array<Schema.TaggedUnion<{
|
|
118
|
+
readonly End: Schema.TaggedStruct<"End", {
|
|
119
|
+
readonly connectionId: Schema.String;
|
|
120
|
+
readonly ended: typeof SessionEnded;
|
|
121
|
+
}>;
|
|
122
|
+
readonly Flushed: Schema.TaggedStruct<"Flushed", {
|
|
123
|
+
readonly through: Schema.String;
|
|
124
|
+
}>;
|
|
125
|
+
readonly Frame: Schema.TaggedStruct<"Frame", {
|
|
126
|
+
readonly member: Schema.String;
|
|
127
|
+
readonly to: Schema.$Array<Schema.String>;
|
|
128
|
+
readonly frame: Schema.String;
|
|
129
|
+
readonly event: Schema.optional<Schema.String>;
|
|
130
|
+
readonly stamp: Schema.Boolean;
|
|
131
|
+
readonly replay: Schema.optional<Schema.Boolean>;
|
|
132
|
+
}>;
|
|
133
|
+
readonly Progress: Schema.TaggedStruct<"Progress", {
|
|
134
|
+
readonly member: Schema.String;
|
|
135
|
+
readonly to: Schema.$Array<Schema.String>;
|
|
136
|
+
readonly job: Schema.String;
|
|
137
|
+
readonly jobId: Schema.String;
|
|
138
|
+
readonly attempt: Schema.Finite;
|
|
139
|
+
readonly seq: Schema.Finite;
|
|
140
|
+
readonly frame: Schema.String;
|
|
141
|
+
}>;
|
|
142
|
+
readonly ProgressEnd: Schema.TaggedStruct<"ProgressEnd", {
|
|
143
|
+
readonly jobId: Schema.String;
|
|
144
|
+
}>;
|
|
145
|
+
readonly Seal: Schema.TaggedStruct<"Seal", {}>;
|
|
146
|
+
}>>;
|
|
147
|
+
}>;
|
|
148
|
+
/** A decoded `Deliver`. */
|
|
149
|
+
export type Deliver = typeof Deliver.Type;
|
|
150
|
+
/** A holder's acknowledgment: `wrongEpoch` when it is not the holder the owner addressed, and the ids of addressed connections it does not hold. */
|
|
151
|
+
export declare const Delivered: Schema.Struct<{
|
|
152
|
+
readonly wrongEpoch: Schema.Boolean;
|
|
153
|
+
readonly unknown: Schema.$Array<Schema.String>;
|
|
154
|
+
}>;
|
|
155
|
+
/** A decoded `Delivered`. */
|
|
156
|
+
export type Delivered = typeof Delivered.Type;
|
|
157
|
+
/**
|
|
158
|
+
* A runner's holder shard group, which only that runner is assigned. Cluster
|
|
159
|
+
* stores shard ids in 50 characters, so the group is a hash of the address.
|
|
160
|
+
*/
|
|
161
|
+
export declare const holderGroup: (address: {
|
|
162
|
+
readonly host: string;
|
|
163
|
+
readonly port: number;
|
|
164
|
+
}) => string;
|
|
165
|
+
/** The entity id addressing one holder incarnation, from its runner identity and epoch. */
|
|
166
|
+
export declare const holderEntityId: (address: {
|
|
167
|
+
readonly holder: string;
|
|
168
|
+
readonly epoch: string;
|
|
169
|
+
}) => string;
|
|
170
|
+
/** The framework entity through which owners on other runners reach this runner's holder. */
|
|
171
|
+
export declare const HolderEntity: Entity.Entity<"akter/Holder", Rpc.Rpc<"Deliver", Schema.Struct<{
|
|
172
|
+
readonly epoch: Schema.String;
|
|
173
|
+
readonly owner: Schema.String;
|
|
174
|
+
readonly ownerEpoch: Schema.String;
|
|
175
|
+
readonly ref: Schema.Struct<{
|
|
176
|
+
readonly tenant: Schema.NonEmptyString;
|
|
177
|
+
readonly actor: Schema.NonEmptyString;
|
|
178
|
+
readonly id: Schema.NonEmptyString;
|
|
179
|
+
}>;
|
|
180
|
+
readonly generation: Schema.String;
|
|
181
|
+
readonly seq: Schema.Finite;
|
|
182
|
+
readonly through: Schema.String;
|
|
183
|
+
readonly items: Schema.$Array<Schema.TaggedUnion<{
|
|
184
|
+
readonly End: Schema.TaggedStruct<"End", {
|
|
185
|
+
readonly connectionId: Schema.String;
|
|
186
|
+
readonly ended: typeof SessionEnded;
|
|
187
|
+
}>;
|
|
188
|
+
readonly Flushed: Schema.TaggedStruct<"Flushed", {
|
|
189
|
+
readonly through: Schema.String;
|
|
190
|
+
}>;
|
|
191
|
+
readonly Frame: Schema.TaggedStruct<"Frame", {
|
|
192
|
+
readonly member: Schema.String;
|
|
193
|
+
readonly to: Schema.$Array<Schema.String>;
|
|
194
|
+
readonly frame: Schema.String;
|
|
195
|
+
readonly event: Schema.optional<Schema.String>;
|
|
196
|
+
readonly stamp: Schema.Boolean;
|
|
197
|
+
readonly replay: Schema.optional<Schema.Boolean>;
|
|
198
|
+
}>;
|
|
199
|
+
readonly Progress: Schema.TaggedStruct<"Progress", {
|
|
200
|
+
readonly member: Schema.String;
|
|
201
|
+
readonly to: Schema.$Array<Schema.String>;
|
|
202
|
+
readonly job: Schema.String;
|
|
203
|
+
readonly jobId: Schema.String;
|
|
204
|
+
readonly attempt: Schema.Finite;
|
|
205
|
+
readonly seq: Schema.Finite;
|
|
206
|
+
readonly frame: Schema.String;
|
|
207
|
+
}>;
|
|
208
|
+
readonly ProgressEnd: Schema.TaggedStruct<"ProgressEnd", {
|
|
209
|
+
readonly jobId: Schema.String;
|
|
210
|
+
}>;
|
|
211
|
+
readonly Seal: Schema.TaggedStruct<"Seal", {}>;
|
|
212
|
+
}>>;
|
|
213
|
+
}>, Schema.Struct<{
|
|
214
|
+
readonly wrongEpoch: Schema.Boolean;
|
|
215
|
+
readonly unknown: Schema.$Array<Schema.String>;
|
|
216
|
+
}>, Schema.Never, never, never> | Rpc.Rpc<"Ping", Schema.Struct<{
|
|
217
|
+
epoch: Schema.String;
|
|
218
|
+
}>, Schema.Boolean, Schema.Never, never, never>>;
|
|
219
|
+
/** The fields that locate one connection: its actor, id, holder, and holder epoch. */
|
|
220
|
+
export declare const ConnectionAddress: {
|
|
221
|
+
ref: Schema.Struct<{
|
|
222
|
+
readonly tenant: Schema.NonEmptyString;
|
|
223
|
+
readonly actor: Schema.NonEmptyString;
|
|
224
|
+
readonly id: Schema.NonEmptyString;
|
|
225
|
+
}>;
|
|
226
|
+
connectionId: Schema.String;
|
|
227
|
+
holder: Schema.String;
|
|
228
|
+
holderEpoch: Schema.String;
|
|
229
|
+
};
|
|
230
|
+
/** The owner's answer to an open: the baseline it fixed, or the handler's declared failure. */
|
|
231
|
+
export declare const Opened: Schema.TaggedUnion<{
|
|
232
|
+
readonly Failed: Schema.TaggedStruct<"Failed", {
|
|
233
|
+
readonly value: Schema.String;
|
|
234
|
+
}>;
|
|
235
|
+
readonly Opened: Schema.TaggedStruct<"Opened", {
|
|
236
|
+
readonly generation: Schema.String;
|
|
237
|
+
readonly owner: Schema.String;
|
|
238
|
+
readonly ownerEpoch: Schema.String;
|
|
239
|
+
readonly baseline: Schema.String;
|
|
240
|
+
readonly recovered: Schema.optional<Schema.Boolean>;
|
|
241
|
+
}>;
|
|
242
|
+
}>;
|
|
243
|
+
/** The owner's answer to an acknowledgment: accepted, or the session ended. */
|
|
244
|
+
export declare const Acked: Schema.TaggedUnion<{
|
|
245
|
+
readonly Acked: Schema.TaggedStruct<"Acked", {
|
|
246
|
+
generation: Schema.String;
|
|
247
|
+
owner: Schema.String;
|
|
248
|
+
ownerEpoch: Schema.String;
|
|
249
|
+
}>;
|
|
250
|
+
readonly Closed: Schema.TaggedStruct<"Closed", {
|
|
251
|
+
readonly ended: typeof SessionEnded;
|
|
252
|
+
}>;
|
|
253
|
+
}>;
|
|
254
|
+
/** The owner's answer to a finished resync replay: accepted, or the session ended. */
|
|
255
|
+
export declare const Replayed: Schema.TaggedUnion<{
|
|
256
|
+
readonly Closed: Schema.TaggedStruct<"Closed", {
|
|
257
|
+
readonly ended: typeof SessionEnded;
|
|
258
|
+
}>;
|
|
259
|
+
readonly Replayed: Schema.TaggedStruct<"Replayed", {
|
|
260
|
+
generation: Schema.String;
|
|
261
|
+
owner: Schema.String;
|
|
262
|
+
ownerEpoch: Schema.String;
|
|
263
|
+
}>;
|
|
264
|
+
}>;
|
|
265
|
+
/** What a stream subscription receives from the owner, after which the owner's errors follow. */
|
|
266
|
+
export declare const StreamItem: Schema.TaggedUnion<{
|
|
267
|
+
readonly Done: Schema.TaggedStruct<"Done", {}>;
|
|
268
|
+
readonly Element: Schema.TaggedStruct<"Element", {
|
|
269
|
+
readonly value: Schema.String;
|
|
270
|
+
}>;
|
|
271
|
+
readonly Started: Schema.TaggedStruct<"Started", {
|
|
272
|
+
readonly owner: Schema.String;
|
|
273
|
+
readonly ownerEpoch: Schema.String;
|
|
274
|
+
}>;
|
|
275
|
+
}>;
|
|
276
|
+
/** A decoded `StreamItem`. */
|
|
277
|
+
export type StreamItem = typeof StreamItem.Type;
|
|
278
|
+
/** A stream handler's declared failure, encoded. */
|
|
279
|
+
export declare const StreamFailed: Schema.TaggedStruct<"StreamFailed", {
|
|
280
|
+
readonly value: Schema.String;
|
|
281
|
+
}>;
|
|
282
|
+
/**
|
|
283
|
+
* Messages a holder or a stream subscriber sends an actor's owner; they
|
|
284
|
+
* bypass the command mailbox. A subscription is interruptible, so a
|
|
285
|
+
* subscriber that stops ends the handler on the owner.
|
|
286
|
+
*/
|
|
287
|
+
export declare const connectionsEntity: (name: string) => Entity.Entity<`${string}/Connections`, Rpc.Rpc<"Close", Schema.Struct<{
|
|
288
|
+
ref: Schema.Struct<{
|
|
289
|
+
readonly tenant: Schema.NonEmptyString;
|
|
290
|
+
readonly actor: Schema.NonEmptyString;
|
|
291
|
+
readonly id: Schema.NonEmptyString;
|
|
292
|
+
}>;
|
|
293
|
+
connectionId: Schema.String;
|
|
294
|
+
holder: Schema.String;
|
|
295
|
+
holderEpoch: Schema.String;
|
|
296
|
+
cause: typeof SessionEnded;
|
|
297
|
+
}>, Schema.Void, typeof ActorError, never, never> | Rpc.Rpc<"Frame", Schema.Struct<{
|
|
298
|
+
ref: Schema.Struct<{
|
|
299
|
+
readonly tenant: Schema.NonEmptyString;
|
|
300
|
+
readonly actor: Schema.NonEmptyString;
|
|
301
|
+
readonly id: Schema.NonEmptyString;
|
|
302
|
+
}>;
|
|
303
|
+
connectionId: Schema.String;
|
|
304
|
+
holder: Schema.String;
|
|
305
|
+
holderEpoch: Schema.String;
|
|
306
|
+
seq: Schema.Finite;
|
|
307
|
+
frame: Schema.String;
|
|
308
|
+
authorizedUntil: Schema.Finite;
|
|
309
|
+
commands: Schema.Struct<{
|
|
310
|
+
readonly secret: Schema.String;
|
|
311
|
+
readonly seq: Schema.Finite;
|
|
312
|
+
readonly issuedAt: Schema.Finite;
|
|
313
|
+
readonly expiresAt: Schema.Finite;
|
|
314
|
+
}>;
|
|
315
|
+
}>, Schema.TaggedUnion<{
|
|
316
|
+
readonly Acked: Schema.TaggedStruct<"Acked", {
|
|
317
|
+
generation: Schema.String;
|
|
318
|
+
owner: Schema.String;
|
|
319
|
+
ownerEpoch: Schema.String;
|
|
320
|
+
}>;
|
|
321
|
+
readonly Closed: Schema.TaggedStruct<"Closed", {
|
|
322
|
+
readonly ended: typeof SessionEnded;
|
|
323
|
+
}>;
|
|
324
|
+
}>, typeof ActorError, never, never> | Rpc.Rpc<"Open", Schema.Struct<{
|
|
325
|
+
ref: Schema.Struct<{
|
|
326
|
+
readonly tenant: Schema.NonEmptyString;
|
|
327
|
+
readonly actor: Schema.NonEmptyString;
|
|
328
|
+
readonly id: Schema.NonEmptyString;
|
|
329
|
+
}>;
|
|
330
|
+
connectionId: Schema.String;
|
|
331
|
+
holder: Schema.String;
|
|
332
|
+
holderEpoch: Schema.String;
|
|
333
|
+
member: Schema.String;
|
|
334
|
+
caller: Schema.toTaggedUnion<"_tag", readonly [Schema.TaggedStruct<"User", {
|
|
335
|
+
readonly subject: Schema.NonEmptyString;
|
|
336
|
+
}>, Schema.TaggedStruct<"Anonymous", {}>, Schema.TaggedStruct<"System", {
|
|
337
|
+
readonly source: Schema.Literals<readonly ["process", "actor", "timer", "cron", "workflow", "job", "subscription"]>;
|
|
338
|
+
readonly ref: Schema.optional<Schema.Struct<{
|
|
339
|
+
readonly tenant: Schema.NonEmptyString;
|
|
340
|
+
readonly actor: Schema.NonEmptyString;
|
|
341
|
+
readonly id: Schema.NonEmptyString;
|
|
342
|
+
}>>;
|
|
343
|
+
readonly onBehalfOf: Schema.optional<Schema.Struct<{
|
|
344
|
+
readonly subject: Schema.NonEmptyString;
|
|
345
|
+
}>>;
|
|
346
|
+
readonly mint: Schema.optional<Schema.Struct<{
|
|
347
|
+
readonly commandId: Schema.String;
|
|
348
|
+
readonly ordinal: Schema.Int;
|
|
349
|
+
}>>;
|
|
350
|
+
}>]>;
|
|
351
|
+
params: Schema.String;
|
|
352
|
+
commands: Schema.Struct<{
|
|
353
|
+
readonly secret: Schema.String;
|
|
354
|
+
readonly seq: Schema.Finite;
|
|
355
|
+
readonly issuedAt: Schema.Finite;
|
|
356
|
+
readonly expiresAt: Schema.Finite;
|
|
357
|
+
}>;
|
|
358
|
+
}>, Schema.TaggedUnion<{
|
|
359
|
+
readonly Failed: Schema.TaggedStruct<"Failed", {
|
|
360
|
+
readonly value: Schema.String;
|
|
361
|
+
}>;
|
|
362
|
+
readonly Opened: Schema.TaggedStruct<"Opened", {
|
|
363
|
+
readonly generation: Schema.String;
|
|
364
|
+
readonly owner: Schema.String;
|
|
365
|
+
readonly ownerEpoch: Schema.String;
|
|
366
|
+
readonly baseline: Schema.String;
|
|
367
|
+
readonly recovered: Schema.optional<Schema.Boolean>;
|
|
368
|
+
}>;
|
|
369
|
+
}>, typeof ActorError, never, never> | Rpc.Rpc<"Progress", Schema.Struct<{
|
|
370
|
+
ref: Schema.Struct<{
|
|
371
|
+
readonly tenant: Schema.NonEmptyString;
|
|
372
|
+
readonly actor: Schema.NonEmptyString;
|
|
373
|
+
readonly id: Schema.NonEmptyString;
|
|
374
|
+
}>;
|
|
375
|
+
jobId: Schema.String;
|
|
376
|
+
job: Schema.String;
|
|
377
|
+
attempt: Schema.Finite;
|
|
378
|
+
seq: Schema.Finite;
|
|
379
|
+
leaseUntil: Schema.Finite;
|
|
380
|
+
frame: Schema.String;
|
|
381
|
+
}>, Schema.Void, Schema.Never, never, never> | Rpc.Rpc<"ProgressClosed", Schema.Struct<{
|
|
382
|
+
ref: Schema.Struct<{
|
|
383
|
+
readonly tenant: Schema.NonEmptyString;
|
|
384
|
+
readonly actor: Schema.NonEmptyString;
|
|
385
|
+
readonly id: Schema.NonEmptyString;
|
|
386
|
+
}>;
|
|
387
|
+
jobId: Schema.String;
|
|
388
|
+
attempt: Schema.Finite;
|
|
389
|
+
}>, Schema.Void, Schema.Never, never, never> | Rpc.Rpc<"Resync", Schema.Struct<{
|
|
390
|
+
ref: Schema.Struct<{
|
|
391
|
+
readonly tenant: Schema.NonEmptyString;
|
|
392
|
+
readonly actor: Schema.NonEmptyString;
|
|
393
|
+
readonly id: Schema.NonEmptyString;
|
|
394
|
+
}>;
|
|
395
|
+
connectionId: Schema.String;
|
|
396
|
+
holder: Schema.String;
|
|
397
|
+
holderEpoch: Schema.String;
|
|
398
|
+
after: Schema.optional<Schema.String>;
|
|
399
|
+
authorizedUntil: Schema.Finite;
|
|
400
|
+
}>, Schema.TaggedUnion<{
|
|
401
|
+
readonly Closed: Schema.TaggedStruct<"Closed", {
|
|
402
|
+
readonly ended: typeof SessionEnded;
|
|
403
|
+
}>;
|
|
404
|
+
readonly Replayed: Schema.TaggedStruct<"Replayed", {
|
|
405
|
+
generation: Schema.String;
|
|
406
|
+
owner: Schema.String;
|
|
407
|
+
ownerEpoch: Schema.String;
|
|
408
|
+
}>;
|
|
409
|
+
}>, typeof ActorError, never, never> | Rpc.Rpc<"Subscribe", Schema.Struct<{
|
|
410
|
+
member: Schema.String;
|
|
411
|
+
caller: Schema.toTaggedUnion<"_tag", readonly [Schema.TaggedStruct<"User", {
|
|
412
|
+
readonly subject: Schema.NonEmptyString;
|
|
413
|
+
}>, Schema.TaggedStruct<"Anonymous", {}>, Schema.TaggedStruct<"System", {
|
|
414
|
+
readonly source: Schema.Literals<readonly ["process", "actor", "timer", "cron", "workflow", "job", "subscription"]>;
|
|
415
|
+
readonly ref: Schema.optional<Schema.Struct<{
|
|
416
|
+
readonly tenant: Schema.NonEmptyString;
|
|
417
|
+
readonly actor: Schema.NonEmptyString;
|
|
418
|
+
readonly id: Schema.NonEmptyString;
|
|
419
|
+
}>>;
|
|
420
|
+
readonly onBehalfOf: Schema.optional<Schema.Struct<{
|
|
421
|
+
readonly subject: Schema.NonEmptyString;
|
|
422
|
+
}>>;
|
|
423
|
+
readonly mint: Schema.optional<Schema.Struct<{
|
|
424
|
+
readonly commandId: Schema.String;
|
|
425
|
+
readonly ordinal: Schema.Int;
|
|
426
|
+
}>>;
|
|
427
|
+
}>]>;
|
|
428
|
+
input: Schema.String;
|
|
429
|
+
authorizedUntil: Schema.Finite;
|
|
430
|
+
}>, import("effect/rpc/RpcSchema").Stream<Schema.TaggedUnion<{
|
|
431
|
+
readonly Done: Schema.TaggedStruct<"Done", {}>;
|
|
432
|
+
readonly Element: Schema.TaggedStruct<"Element", {
|
|
433
|
+
readonly value: Schema.String;
|
|
434
|
+
}>;
|
|
435
|
+
readonly Started: Schema.TaggedStruct<"Started", {
|
|
436
|
+
readonly owner: Schema.String;
|
|
437
|
+
readonly ownerEpoch: Schema.String;
|
|
438
|
+
}>;
|
|
439
|
+
}>, Schema.Union<readonly [typeof ActorError, Schema.TaggedStruct<"StreamFailed", {
|
|
440
|
+
readonly value: Schema.String;
|
|
441
|
+
}>]>>, Schema.Never, never, never>>;
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import { ClusterSchema, Entity } from "effect/cluster";
|
|
3
|
+
import { Rpc } from "effect/rpc";
|
|
4
|
+
import { ActorError, SessionEnded } from "../../errors/actor.js";
|
|
5
|
+
import { ActorRef, Caller } from "../../identity/caller.js";
|
|
6
|
+
import { hash64 } from "../storage/platform.js";
|
|
7
|
+
/**
|
|
8
|
+
* The framework connection member an event feed opens. It has no handler, and
|
|
9
|
+
* `$` can't start a declared member's tag, so it never collides with one.
|
|
10
|
+
*/
|
|
11
|
+
export const FEED_MEMBER = "$feed";
|
|
12
|
+
/** The prefix of the framework connection member a query watch opens; the watched query's tag follows. */
|
|
13
|
+
export const WATCH_PREFIX = "$watch:";
|
|
14
|
+
/** The framework connection member that watches `query`. `$` can't start a declared member's tag, so it never collides with one. */
|
|
15
|
+
export const watchMember = (query) => `${WATCH_PREFIX}${query}`;
|
|
16
|
+
/** Whether `member` is a framework watch connection. */
|
|
17
|
+
export const isWatchMember = (member) => member.startsWith(WATCH_PREFIX);
|
|
18
|
+
/** The query a framework watch member watches. */
|
|
19
|
+
export const watchedQuery = (member) => member.slice(WATCH_PREFIX.length);
|
|
20
|
+
/** What one commit wrote: whether it changed state, and the event classes, tables, and blobs it wrote. */
|
|
21
|
+
export const WriteSet = Schema.Struct({
|
|
22
|
+
state: Schema.Boolean,
|
|
23
|
+
events: Schema.Array(Schema.String),
|
|
24
|
+
tables: Schema.Array(Schema.String),
|
|
25
|
+
blobs: Schema.Array(Schema.String),
|
|
26
|
+
});
|
|
27
|
+
/** The frame an owner broadcasts to an actor's watches after each commit: the commit's version and its write set. */
|
|
28
|
+
export const Committed = Schema.Struct({ version: Schema.String, writes: WriteSet });
|
|
29
|
+
/** One committed feed event as its owner broadcasts it; `value` is the stored encoding. */
|
|
30
|
+
export const FeedFrame = Schema.Struct({
|
|
31
|
+
tag: Schema.String,
|
|
32
|
+
value: Schema.String,
|
|
33
|
+
commandId: Schema.String,
|
|
34
|
+
timestampMs: Schema.Finite,
|
|
35
|
+
});
|
|
36
|
+
/** What an owner sends a holder over its ordered channel. */
|
|
37
|
+
export const HolderItem = Schema.TaggedUnion({
|
|
38
|
+
Frame: {
|
|
39
|
+
member: Schema.String,
|
|
40
|
+
to: Schema.Array(Schema.String),
|
|
41
|
+
frame: Schema.String,
|
|
42
|
+
event: Schema.optional(Schema.String),
|
|
43
|
+
stamp: Schema.Boolean,
|
|
44
|
+
replay: Schema.optional(Schema.Boolean),
|
|
45
|
+
},
|
|
46
|
+
Flushed: { through: Schema.String },
|
|
47
|
+
End: { connectionId: Schema.String, ended: SessionEnded },
|
|
48
|
+
Seal: {},
|
|
49
|
+
/** Executor progress: replaces an undelivered frame of the same job, never closes a session. */
|
|
50
|
+
Progress: {
|
|
51
|
+
member: Schema.String,
|
|
52
|
+
to: Schema.Array(Schema.String),
|
|
53
|
+
job: Schema.String,
|
|
54
|
+
jobId: Schema.String,
|
|
55
|
+
attempt: Schema.Finite,
|
|
56
|
+
seq: Schema.Finite,
|
|
57
|
+
frame: Schema.String,
|
|
58
|
+
},
|
|
59
|
+
/** The job's route or settle committed: undelivered progress of it is discarded. */
|
|
60
|
+
ProgressEnd: { jobId: Schema.String },
|
|
61
|
+
});
|
|
62
|
+
/** What a client of an open connection receives. */
|
|
63
|
+
export const ClientMessage = Schema.TaggedUnion({
|
|
64
|
+
Frame: {
|
|
65
|
+
frame: Schema.String,
|
|
66
|
+
cursor: Schema.optional(Schema.String),
|
|
67
|
+
event: Schema.optional(Schema.String),
|
|
68
|
+
},
|
|
69
|
+
Resync: {
|
|
70
|
+
after: Schema.UndefinedOr(Schema.String),
|
|
71
|
+
reason: Schema.Literal("OwnerLost"),
|
|
72
|
+
deadlineMs: Schema.Finite,
|
|
73
|
+
},
|
|
74
|
+
ResyncReplayed: {},
|
|
75
|
+
Progress: {
|
|
76
|
+
job: Schema.String,
|
|
77
|
+
jobId: Schema.String,
|
|
78
|
+
attempt: Schema.Finite,
|
|
79
|
+
seq: Schema.Finite,
|
|
80
|
+
frame: Schema.String,
|
|
81
|
+
},
|
|
82
|
+
});
|
|
83
|
+
/** One ordered owner message to a holder: `seq` numbers it within its generation and `through` is the owner position it covers. */
|
|
84
|
+
export const Deliver = Schema.Struct({
|
|
85
|
+
epoch: Schema.String,
|
|
86
|
+
owner: Schema.String,
|
|
87
|
+
ownerEpoch: Schema.String,
|
|
88
|
+
ref: ActorRef,
|
|
89
|
+
generation: Schema.String,
|
|
90
|
+
seq: Schema.Finite,
|
|
91
|
+
through: Schema.String,
|
|
92
|
+
items: Schema.Array(HolderItem),
|
|
93
|
+
});
|
|
94
|
+
/** A holder's acknowledgment: `wrongEpoch` when it is not the holder the owner addressed, and the ids of addressed connections it does not hold. */
|
|
95
|
+
export const Delivered = Schema.Struct({
|
|
96
|
+
wrongEpoch: Schema.Boolean,
|
|
97
|
+
unknown: Schema.Array(Schema.String),
|
|
98
|
+
});
|
|
99
|
+
const HOLDER_SEPARATOR = "|";
|
|
100
|
+
/**
|
|
101
|
+
* A runner's holder shard group, which only that runner is assigned. Cluster
|
|
102
|
+
* stores shard ids in 50 characters, so the group is a hash of the address.
|
|
103
|
+
*/
|
|
104
|
+
export const holderGroup = (address) => `h${BigInt.asUintN(64, hash64(`${address.host}:${address.port}`)).toString(36)}`;
|
|
105
|
+
/** The entity id addressing one holder incarnation, from its runner identity and epoch. */
|
|
106
|
+
export const holderEntityId = (address) => `${address.holder}${HOLDER_SEPARATOR}${address.epoch}`;
|
|
107
|
+
/** The framework entity through which owners on other runners reach this runner's holder. */
|
|
108
|
+
export const HolderEntity = Entity.make("akter/Holder", [
|
|
109
|
+
Rpc.make("Deliver", { payload: Deliver, success: Delivered }),
|
|
110
|
+
Rpc.make("Ping", { payload: { epoch: Schema.String }, success: Schema.Boolean }),
|
|
111
|
+
]).annotate(ClusterSchema.ShardGroup, (entityId) => entityId.split(HOLDER_SEPARATOR)[0]);
|
|
112
|
+
/** The fields that locate one connection: its actor, id, holder, and holder epoch. */
|
|
113
|
+
export const ConnectionAddress = {
|
|
114
|
+
ref: ActorRef,
|
|
115
|
+
connectionId: Schema.String,
|
|
116
|
+
holder: Schema.String,
|
|
117
|
+
holderEpoch: Schema.String,
|
|
118
|
+
};
|
|
119
|
+
const Commands = Schema.Struct({
|
|
120
|
+
secret: Schema.String,
|
|
121
|
+
seq: Schema.Finite,
|
|
122
|
+
issuedAt: Schema.Finite,
|
|
123
|
+
expiresAt: Schema.Finite,
|
|
124
|
+
});
|
|
125
|
+
/** The activation that answered: its fencing generation and its runner's holder identity. */
|
|
126
|
+
const OwnerIdentity = {
|
|
127
|
+
generation: Schema.String,
|
|
128
|
+
owner: Schema.String,
|
|
129
|
+
ownerEpoch: Schema.String,
|
|
130
|
+
};
|
|
131
|
+
/** The owner's answer to an open: the baseline it fixed, or the handler's declared failure. */
|
|
132
|
+
export const Opened = Schema.TaggedUnion({
|
|
133
|
+
Opened: { ...OwnerIdentity, baseline: Schema.String, recovered: Schema.optional(Schema.Boolean) },
|
|
134
|
+
Failed: { value: Schema.String },
|
|
135
|
+
});
|
|
136
|
+
/** The owner's answer to an acknowledgment: accepted, or the session ended. */
|
|
137
|
+
export const Acked = Schema.TaggedUnion({
|
|
138
|
+
Acked: OwnerIdentity,
|
|
139
|
+
Closed: { ended: SessionEnded },
|
|
140
|
+
});
|
|
141
|
+
/** The owner's answer to a finished resync replay: accepted, or the session ended. */
|
|
142
|
+
export const Replayed = Schema.TaggedUnion({
|
|
143
|
+
Replayed: OwnerIdentity,
|
|
144
|
+
Closed: { ended: SessionEnded },
|
|
145
|
+
});
|
|
146
|
+
/** What a stream subscription receives from the owner, after which the owner's errors follow. */
|
|
147
|
+
export const StreamItem = Schema.TaggedUnion({
|
|
148
|
+
/** The activation that runs the handler; a second one means the request was sent again. */
|
|
149
|
+
Started: { owner: Schema.String, ownerEpoch: Schema.String },
|
|
150
|
+
Element: { value: Schema.String },
|
|
151
|
+
/** The handler's stream ended by itself. */
|
|
152
|
+
Done: {},
|
|
153
|
+
});
|
|
154
|
+
/** A stream handler's declared failure, encoded. */
|
|
155
|
+
export const StreamFailed = Schema.TaggedStruct("StreamFailed", { value: Schema.String });
|
|
156
|
+
/**
|
|
157
|
+
* Messages a holder or a stream subscriber sends an actor's owner; they
|
|
158
|
+
* bypass the command mailbox. A subscription is interruptible, so a
|
|
159
|
+
* subscriber that stops ends the handler on the owner.
|
|
160
|
+
*/
|
|
161
|
+
export const connectionsEntity = (name) => Entity.make(`${name}/Connections`, [
|
|
162
|
+
Rpc.make("Open", {
|
|
163
|
+
payload: {
|
|
164
|
+
...ConnectionAddress,
|
|
165
|
+
member: Schema.String,
|
|
166
|
+
caller: Caller,
|
|
167
|
+
params: Schema.String,
|
|
168
|
+
commands: Commands,
|
|
169
|
+
},
|
|
170
|
+
success: Opened,
|
|
171
|
+
error: ActorError,
|
|
172
|
+
}).annotate(ClusterSchema.Uninterruptible, true),
|
|
173
|
+
Rpc.make("Frame", {
|
|
174
|
+
payload: {
|
|
175
|
+
...ConnectionAddress,
|
|
176
|
+
seq: Schema.Finite,
|
|
177
|
+
frame: Schema.String,
|
|
178
|
+
authorizedUntil: Schema.Finite,
|
|
179
|
+
commands: Commands,
|
|
180
|
+
},
|
|
181
|
+
success: Acked,
|
|
182
|
+
error: ActorError,
|
|
183
|
+
}).annotate(ClusterSchema.Uninterruptible, true),
|
|
184
|
+
Rpc.make("Close", {
|
|
185
|
+
payload: { ...ConnectionAddress, cause: SessionEnded },
|
|
186
|
+
error: ActorError,
|
|
187
|
+
}).annotate(ClusterSchema.Uninterruptible, true),
|
|
188
|
+
Rpc.make("Resync", {
|
|
189
|
+
payload: {
|
|
190
|
+
...ConnectionAddress,
|
|
191
|
+
after: Schema.optional(Schema.String),
|
|
192
|
+
authorizedUntil: Schema.Finite,
|
|
193
|
+
},
|
|
194
|
+
success: Replayed,
|
|
195
|
+
error: ActorError,
|
|
196
|
+
}).annotate(ClusterSchema.Uninterruptible, true),
|
|
197
|
+
Rpc.make("Progress", {
|
|
198
|
+
payload: {
|
|
199
|
+
ref: ActorRef,
|
|
200
|
+
jobId: Schema.String,
|
|
201
|
+
job: Schema.String,
|
|
202
|
+
attempt: Schema.Finite,
|
|
203
|
+
seq: Schema.Finite,
|
|
204
|
+
leaseUntil: Schema.Finite,
|
|
205
|
+
frame: Schema.String,
|
|
206
|
+
},
|
|
207
|
+
}).annotate(ClusterSchema.Uninterruptible, true),
|
|
208
|
+
Rpc.make("ProgressClosed", {
|
|
209
|
+
payload: { ref: ActorRef, jobId: Schema.String, attempt: Schema.Finite },
|
|
210
|
+
}).annotate(ClusterSchema.Uninterruptible, true),
|
|
211
|
+
Rpc.make("Subscribe", {
|
|
212
|
+
payload: {
|
|
213
|
+
member: Schema.String,
|
|
214
|
+
caller: Caller,
|
|
215
|
+
input: Schema.String,
|
|
216
|
+
authorizedUntil: Schema.Finite,
|
|
217
|
+
},
|
|
218
|
+
success: StreamItem,
|
|
219
|
+
error: Schema.Union([ActorError, StreamFailed]),
|
|
220
|
+
stream: true,
|
|
221
|
+
}),
|
|
222
|
+
]);
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { WriteSet } from "./protocol.ts";
|
|
2
|
+
/**
|
|
3
|
+
* What one rerun of a watched query read, as the recorder saw it: whether it
|
|
4
|
+
* touched `state` (all keyed state counts as one), and the event classes,
|
|
5
|
+
* tables, and blobs it named. `group` and `caller` note reads the commit signal
|
|
6
|
+
* cannot cover or that make the result depend on who asked.
|
|
7
|
+
*/
|
|
8
|
+
export interface ReadSet {
|
|
9
|
+
state: boolean;
|
|
10
|
+
readonly events: Set<string>;
|
|
11
|
+
readonly tables: Set<string>;
|
|
12
|
+
readonly blobs: Set<string>;
|
|
13
|
+
group: boolean;
|
|
14
|
+
caller: boolean;
|
|
15
|
+
}
|
|
16
|
+
/** A read set that has recorded nothing. */
|
|
17
|
+
export declare const emptyReadSet: () => ReadSet;
|
|
18
|
+
/** Whether a commit that wrote `writes` may have changed the result of a query that read `reads`. */
|
|
19
|
+
export declare const invalidates: {
|
|
20
|
+
(reads: ReadSet): (writes: WriteSet) => boolean;
|
|
21
|
+
(writes: WriteSet, reads: ReadSet): boolean;
|
|
22
|
+
};
|
|
23
|
+
/** The read that makes a query unwatchable, named for the refusal; undefined when every read is supported. */
|
|
24
|
+
export declare const unsupportedRead: (reads: ReadSet) => "The query reads its placement group, which has no commit signal per actor" | undefined;
|