@akterjs/effect 0.0.0-stage → 0.1.1
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/LICENSE +201 -0
- package/README.md +43 -2
- package/dist/contract/actor/actor-already-exists.errors.d.mts +8 -0
- package/dist/contract/actor/actor-already-exists.errors.mjs +4 -0
- package/dist/contract/actor/actor-definition.pure.d.mts +21 -0
- package/dist/contract/actor/actor-definition.pure.mjs +106 -0
- package/dist/contract/actor/actor-erased.errors.d.mts +8 -0
- package/dist/contract/actor/actor-erased.errors.mjs +4 -0
- package/dist/contract/actor/actor-names.pure.d.mts +11 -0
- package/dist/contract/actor/actor-names.pure.mjs +51 -0
- package/dist/contract/actor/actor-not-created.errors.d.mts +8 -0
- package/dist/contract/actor/actor-not-created.errors.mjs +4 -0
- package/dist/contract/actor/actor-not-registered.errors.d.mts +8 -0
- package/dist/contract/actor/actor-not-registered.errors.mjs +4 -0
- package/dist/contract/actor/actor-registry.service.d.mts +16 -0
- package/dist/contract/actor/actor-registry.service.mjs +21 -0
- package/dist/contract/actor/actor.contract.d.mts +238 -0
- package/dist/contract/actor/actor.contract.mjs +1 -0
- package/dist/contract/actor/host-interface.pure.d.mts +23 -0
- package/dist/contract/actor/host-interface.pure.mjs +39 -0
- package/dist/contract/actor/reserved-member.errors.d.mts +9 -0
- package/dist/contract/actor/reserved-member.errors.mjs +7 -0
- package/dist/contract/akter.service.d.mts +75 -0
- package/dist/contract/akter.service.mjs +134 -0
- package/dist/contract/caller/authentication.api.d.mts +6 -0
- package/dist/contract/caller/authentication.api.mjs +5 -0
- package/dist/contract/caller/caller-admission.pure.d.mts +27 -0
- package/dist/contract/caller/caller-admission.pure.mjs +59 -0
- package/dist/contract/caller/caller-not-allowed.errors.d.mts +16 -0
- package/dist/contract/caller/caller-not-allowed.errors.mjs +18 -0
- package/dist/contract/caller/caller.schema.d.mts +7 -0
- package/dist/contract/caller/caller.schema.mjs +8 -0
- package/dist/contract/caller/current-caller.service.d.mts +7 -0
- package/dist/contract/caller/current-caller.service.mjs +4 -0
- package/dist/contract/caller/principal.schema.d.mts +13 -0
- package/dist/contract/caller/principal.schema.mjs +10 -0
- package/dist/contract/caller/unauthenticated.errors.d.mts +8 -0
- package/dist/contract/caller/unauthenticated.errors.mjs +4 -0
- package/dist/contract/client/actor-client.adapter.d.mts +42 -0
- package/dist/contract/client/actor-client.adapter.mjs +90 -0
- package/dist/contract/client/actor-client.contract.d.mts +30 -0
- package/dist/contract/client/actor-client.contract.mjs +1 -0
- package/dist/contract/client/actor-rpc.contract.d.mts +33 -0
- package/dist/contract/client/actor-rpc.contract.mjs +16 -0
- package/dist/contract/client/actor-unavailable.errors.d.mts +9 -0
- package/dist/contract/client/actor-unavailable.errors.mjs +7 -0
- package/dist/contract/client/client-failure.contract.d.mts +28 -0
- package/dist/contract/client/client-failure.contract.mjs +28 -0
- package/dist/contract/client/invalid-request.errors.d.mts +9 -0
- package/dist/contract/client/invalid-request.errors.mjs +7 -0
- package/dist/contract/client/storage-limit.errors.d.mts +16 -0
- package/dist/contract/client/storage-limit.errors.mjs +14 -0
- package/dist/contract/command/command-id-expired.errors.d.mts +11 -0
- package/dist/contract/command/command-id-expired.errors.mjs +9 -0
- package/dist/contract/command/command-id.schema.d.mts +3 -0
- package/dist/contract/command/command-id.schema.mjs +4 -0
- package/dist/contract/command/command.contract.d.mts +117 -0
- package/dist/contract/command/command.contract.mjs +111 -0
- package/dist/contract/command/outbox-id.pure.d.mts +9 -0
- package/dist/contract/command/outbox-id.pure.mjs +14 -0
- package/dist/contract/command/outbox.schema.d.mts +9 -0
- package/dist/contract/command/outbox.schema.mjs +10 -0
- package/dist/contract/command/timer.schema.d.mts +20 -0
- package/dist/contract/command/timer.schema.mjs +14 -0
- package/dist/contract/computer/checkpoint-expired.errors.d.mts +12 -0
- package/dist/contract/computer/checkpoint-expired.errors.mjs +8 -0
- package/dist/contract/computer/computer-client-failure.contract.d.mts +16 -0
- package/dist/contract/computer/computer-client-failure.contract.mjs +1 -0
- package/dist/contract/computer/computer-client.adapter.d.mts +21 -0
- package/dist/contract/computer/computer-client.adapter.mjs +70 -0
- package/dist/contract/computer/computer-client.contract.d.mts +56 -0
- package/dist/contract/computer/computer-client.contract.mjs +1 -0
- package/dist/contract/computer/computer-held.errors.d.mts +13 -0
- package/dist/contract/computer/computer-held.errors.mjs +11 -0
- package/dist/contract/computer/computer-limit.errors.d.mts +15 -0
- package/dist/contract/computer/computer-limit.errors.mjs +13 -0
- package/dist/contract/computer/computer-lost.errors.d.mts +12 -0
- package/dist/contract/computer/computer-lost.errors.mjs +8 -0
- package/dist/contract/computer/computer-not-found.errors.d.mts +9 -0
- package/dist/contract/computer/computer-not-found.errors.mjs +5 -0
- package/dist/contract/computer/computer.schema.d.mts +122 -0
- package/dist/contract/computer/computer.schema.mjs +117 -0
- package/dist/contract/computer/computers-unavailable.errors.d.mts +9 -0
- package/dist/contract/computer/computers-unavailable.errors.mjs +5 -0
- package/dist/contract/computer/files/computer-files.schema.d.mts +28 -0
- package/dist/contract/computer/files/computer-files.schema.mjs +24 -0
- package/dist/contract/computer/rpc/computer-rpc.contract.d.mts +108 -0
- package/dist/contract/computer/rpc/computer-rpc.contract.mjs +117 -0
- package/dist/contract/computer/step/computer-step.contract.d.mts +21 -0
- package/dist/contract/computer/step/computer-step.contract.mjs +89 -0
- package/dist/contract/computer/step/computer-step.schema.d.mts +69 -0
- package/dist/contract/computer/step/computer-step.schema.mjs +71 -0
- package/dist/contract/computer/step/step-failure.schema.d.mts +13 -0
- package/dist/contract/computer/step/step-failure.schema.mjs +24 -0
- package/dist/contract/computer/step/step-not-found.errors.d.mts +9 -0
- package/dist/contract/computer/step/step-not-found.errors.mjs +5 -0
- package/dist/contract/description/published-contract.pure.d.mts +51 -0
- package/dist/contract/description/published-contract.pure.mjs +75 -0
- package/dist/contract/file/access/file-access-denied.errors.d.mts +11 -0
- package/dist/contract/file/access/file-access-denied.errors.mjs +9 -0
- package/dist/contract/file/access/file-access.contract.d.mts +35 -0
- package/dist/contract/file/access/file-access.contract.mjs +32 -0
- package/dist/contract/file/actor-files.contract.d.mts +50 -0
- package/dist/contract/file/actor-files.contract.mjs +1 -0
- package/dist/contract/file/blob-transfer.errors.d.mts +9 -0
- package/dist/contract/file/blob-transfer.errors.mjs +7 -0
- package/dist/contract/file/file-client-failure.contract.d.mts +24 -0
- package/dist/contract/file/file-client-failure.contract.mjs +1 -0
- package/dist/contract/file/file-client.adapter.d.mts +17 -0
- package/dist/contract/file/file-client.adapter.mjs +21 -0
- package/dist/contract/file/file-client.contract.d.mts +14 -0
- package/dist/contract/file/file-client.contract.mjs +1 -0
- package/dist/contract/file/file-listing.pure.d.mts +6 -0
- package/dist/contract/file/file-listing.pure.mjs +18 -0
- package/dist/contract/file/file-not-found.errors.d.mts +8 -0
- package/dist/contract/file/file-not-found.errors.mjs +4 -0
- package/dist/contract/file/file-path.pure.d.mts +4 -0
- package/dist/contract/file/file-path.pure.mjs +38 -0
- package/dist/contract/file/files-unavailable.errors.d.mts +8 -0
- package/dist/contract/file/files-unavailable.errors.mjs +4 -0
- package/dist/contract/file/invalid-file-request.errors.d.mts +9 -0
- package/dist/contract/file/invalid-file-request.errors.mjs +7 -0
- package/dist/contract/file/rpc/file-rpc.contract.d.mts +88 -0
- package/dist/contract/file/rpc/file-rpc.contract.mjs +117 -0
- package/dist/contract/file/rpc/file-too-large.errors.d.mts +13 -0
- package/dist/contract/file/rpc/file-too-large.errors.mjs +11 -0
- package/dist/contract/file/rpc/rpc-file-clients.layer.d.mts +10 -0
- package/dist/contract/file/rpc/rpc-file-clients.layer.mjs +95 -0
- package/dist/contract/fork/fork-rpc.contract.d.mts +40 -0
- package/dist/contract/fork/fork-rpc.contract.mjs +26 -0
- package/dist/contract/history/actor-journal.service.d.mts +58 -0
- package/dist/contract/history/actor-journal.service.mjs +67 -0
- package/dist/contract/history/history-entry.pure.d.mts +79 -0
- package/dist/contract/history/history-entry.pure.mjs +95 -0
- package/dist/contract/hosted/handler-failed.errors.d.mts +16 -0
- package/dist/contract/hosted/handler-failed.errors.mjs +14 -0
- package/dist/contract/hosted/handler-failure.pure.d.mts +21 -0
- package/dist/contract/hosted/handler-failure.pure.mjs +86 -0
- package/dist/contract/hosted/hosted-actor.service.d.mts +23 -0
- package/dist/contract/hosted/hosted-actor.service.mjs +64 -0
- package/dist/contract/hosted/hosted-command.service.d.mts +20 -0
- package/dist/contract/hosted/hosted-command.service.mjs +88 -0
- package/dist/contract/hosted/hosted-create.service.d.mts +17 -0
- package/dist/contract/hosted/hosted-create.service.mjs +67 -0
- package/dist/contract/hosted/hosted-error.contract.d.mts +11 -0
- package/dist/contract/hosted/hosted-error.contract.mjs +1 -0
- package/dist/contract/hosted/hosted-failure.schema.d.mts +18 -0
- package/dist/contract/hosted/hosted-failure.schema.mjs +31 -0
- package/dist/contract/hosted/hosted-outcome.contract.d.mts +18 -0
- package/dist/contract/hosted/hosted-outcome.contract.mjs +1 -0
- package/dist/contract/hosted/hosted-query.service.d.mts +16 -0
- package/dist/contract/hosted/hosted-query.service.mjs +42 -0
- package/dist/contract/hosted/hosted-request.pure.d.mts +61 -0
- package/dist/contract/hosted/hosted-request.pure.mjs +91 -0
- package/dist/contract/job/job-id.pure.d.mts +11 -0
- package/dist/contract/job/job-id.pure.mjs +20 -0
- package/dist/contract/job/job-patches.contract.d.mts +32 -0
- package/dist/contract/job/job-patches.contract.mjs +45 -0
- package/dist/contract/job/job-signal.schema.d.mts +13 -0
- package/dist/contract/job/job-signal.schema.mjs +16 -0
- package/dist/contract/job/reserved-payload-field.errors.d.mts +10 -0
- package/dist/contract/job/reserved-payload-field.errors.mjs +8 -0
- package/dist/contract/job/started-job.schema.d.mts +7 -0
- package/dist/contract/job/started-job.schema.mjs +8 -0
- package/dist/contract/json-codec.pure.d.mts +7 -0
- package/dist/contract/json-codec.pure.mjs +14 -0
- package/dist/contract/room.contract.d.mts +75 -0
- package/dist/contract/room.contract.mjs +36 -0
- package/dist/contract/secret/actor-secrets.adapter.d.mts +33 -0
- package/dist/contract/secret/actor-secrets.adapter.mjs +38 -0
- package/dist/contract/secret/invalid-secret-name.errors.d.mts +10 -0
- package/dist/contract/secret/invalid-secret-name.errors.mjs +8 -0
- package/dist/contract/secret/secret-unavailable.errors.d.mts +11 -0
- package/dist/contract/secret/secret-unavailable.errors.mjs +10 -0
- package/dist/contract/secret/secret.schema.d.mts +25 -0
- package/dist/contract/secret/secret.schema.mjs +34 -0
- package/dist/contract/spend/billing-unavailable.errors.d.mts +12 -0
- package/dist/contract/spend/billing-unavailable.errors.mjs +8 -0
- package/dist/contract/spend/spend-cap-reached.errors.d.mts +17 -0
- package/dist/contract/spend/spend-cap-reached.errors.mjs +15 -0
- package/dist/contract/state/actor-state.pure.d.mts +38 -0
- package/dist/contract/state/actor-state.pure.mjs +153 -0
- package/dist/contract/state/actor-state.service.d.mts +45 -0
- package/dist/contract/state/actor-state.service.mjs +18 -0
- package/dist/contract/state/state-migration.pure.d.mts +11 -0
- package/dist/contract/state/state-migration.pure.mjs +23 -0
- package/dist/contract/state/state-read.pure.d.mts +12 -0
- package/dist/contract/state/state-read.pure.mjs +22 -0
- package/dist/contract/state/state-unreadable.errors.d.mts +9 -0
- package/dist/contract/state/state-unreadable.errors.mjs +7 -0
- package/dist/host/actor/actor-database.service.d.mts +46 -0
- package/dist/host/actor/actor-database.service.mjs +112 -0
- package/dist/host/actor/actor-exclusive.pure.d.mts +7 -0
- package/dist/host/actor/actor-exclusive.pure.mjs +16 -0
- package/dist/host/actor/actor-records.sql.d.mts +29 -0
- package/dist/host/actor/actor-records.sql.mjs +26 -0
- package/dist/host/actor/reserved-name.errors.d.mts +10 -0
- package/dist/host/actor/reserved-name.errors.mjs +8 -0
- package/dist/host/actor/reserved-names.pure.d.mts +15 -0
- package/dist/host/actor/reserved-names.pure.mjs +20 -0
- package/dist/host/actor/room.actor.d.mts +4 -0
- package/dist/host/actor/room.actor.mjs +36 -0
- package/dist/host/blob/blob-frames.pure.d.mts +7 -0
- package/dist/host/blob/blob-frames.pure.mjs +28 -0
- package/dist/host/blob/blob-grant.schema.d.mts +14 -0
- package/dist/host/blob/blob-grant.schema.mjs +15 -0
- package/dist/host/blob/blob-grants.service.d.mts +28 -0
- package/dist/host/blob/blob-grants.service.mjs +129 -0
- package/dist/host/blob/blob-keyring.service.d.mts +18 -0
- package/dist/host/blob/blob-keyring.service.mjs +4 -0
- package/dist/host/blob/blob-range.pure.d.mts +13 -0
- package/dist/host/blob/blob-range.pure.mjs +23 -0
- package/dist/host/blob/blob-sealing.contract.d.mts +37 -0
- package/dist/host/blob/blob-sealing.contract.mjs +1 -0
- package/dist/host/blob/blob-sealing.service.d.mts +11 -0
- package/dist/host/blob/blob-sealing.service.mjs +16 -0
- package/dist/host/blob/export/blob-archive.sql.d.mts +21 -0
- package/dist/host/blob/export/blob-archive.sql.mjs +75 -0
- package/dist/host/blob/export/blob-export-holds.sql.d.mts +49 -0
- package/dist/host/blob/export/blob-export-holds.sql.mjs +25 -0
- package/dist/host/blob/plain-blob-sealing.pure.d.mts +5 -0
- package/dist/host/blob/plain-blob-sealing.pure.mjs +55 -0
- package/dist/host/blob/reference/blob-catalog.sql.d.mts +40 -0
- package/dist/host/blob/reference/blob-catalog.sql.mjs +145 -0
- package/dist/host/blob/reference/blob-coordinator.pure.d.mts +10 -0
- package/dist/host/blob/reference/blob-coordinator.pure.mjs +153 -0
- package/dist/host/blob/reference/blob-file-page.sql.d.mts +13 -0
- package/dist/host/blob/reference/blob-file-page.sql.mjs +21 -0
- package/dist/host/blob/reference/blob-forks.sql.d.mts +21 -0
- package/dist/host/blob/reference/blob-forks.sql.mjs +40 -0
- package/dist/host/blob/reference/blob-lineage.sql.d.mts +14 -0
- package/dist/host/blob/reference/blob-lineage.sql.mjs +24 -0
- package/dist/host/blob/reference/blob-reads.pure.d.mts +15 -0
- package/dist/host/blob/reference/blob-reads.pure.mjs +97 -0
- package/dist/host/blob/reference/blob-receipts.sql.d.mts +71 -0
- package/dist/host/blob/reference/blob-receipts.sql.mjs +176 -0
- package/dist/host/blob/reference/blob-transfer-adopt.pure.d.mts +21 -0
- package/dist/host/blob/reference/blob-transfer-adopt.pure.mjs +68 -0
- package/dist/host/blob/reference/blob-transfer-fork.pure.d.mts +15 -0
- package/dist/host/blob/reference/blob-transfer-fork.pure.mjs +125 -0
- package/dist/host/blob/reference/blob-transfer-upkeep.pure.d.mts +18 -0
- package/dist/host/blob/reference/blob-transfer-upkeep.pure.mjs +54 -0
- package/dist/host/blob/reference/blob-transfer.pure.d.mts +85 -0
- package/dist/host/blob/reference/blob-transfer.pure.mjs +1 -0
- package/dist/host/blob/sealed-blob-sealing.pure.d.mts +10 -0
- package/dist/host/blob/sealed-blob-sealing.pure.mjs +130 -0
- package/dist/host/blob/stream/blob-directory.pure.d.mts +18 -0
- package/dist/host/blob/stream/blob-directory.pure.mjs +84 -0
- package/dist/host/blob/stream/blob-length.pure.d.mts +9 -0
- package/dist/host/blob/stream/blob-length.pure.mjs +19 -0
- package/dist/host/blob/stream/blob-writing.pure.d.mts +8 -0
- package/dist/host/blob/stream/blob-writing.pure.mjs +15 -0
- package/dist/host/command/batch/command-batch.sql.d.mts +61 -0
- package/dist/host/command/batch/command-batch.sql.mjs +100 -0
- package/dist/host/command/command-context.adapter.d.mts +47 -0
- package/dist/host/command/command-context.adapter.mjs +90 -0
- package/dist/host/command/command-id-age.pure.d.mts +13 -0
- package/dist/host/command/command-id-age.pure.mjs +31 -0
- package/dist/host/command/command-id-reuse.pure.d.mts +28 -0
- package/dist/host/command/command-id-reuse.pure.mjs +38 -0
- package/dist/host/command/command-id-reused.errors.d.mts +13 -0
- package/dist/host/command/command-id-reused.errors.mjs +11 -0
- package/dist/host/command/command-journal.sql.d.mts +84 -0
- package/dist/host/command/command-journal.sql.mjs +74 -0
- package/dist/host/command/command-rejected.errors.d.mts +8 -0
- package/dist/host/command/command-rejected.errors.mjs +4 -0
- package/dist/host/command/command-replay.service.d.mts +62 -0
- package/dist/host/command/command-replay.service.mjs +140 -0
- package/dist/host/command/command-reply.pure.d.mts +8 -0
- package/dist/host/command/command-reply.pure.mjs +12 -0
- package/dist/host/command/command-runner.service.d.mts +68 -0
- package/dist/host/command/command-runner.service.mjs +215 -0
- package/dist/host/command/files/command-file-inputs.sql.d.mts +51 -0
- package/dist/host/command/files/command-file-inputs.sql.mjs +59 -0
- package/dist/host/command/history-pruned.errors.d.mts +10 -0
- package/dist/host/command/history-pruned.errors.mjs +8 -0
- package/dist/host/command/replay/replay-cursor-stalled.errors.d.mts +9 -0
- package/dist/host/command/replay/replay-cursor-stalled.errors.mjs +7 -0
- package/dist/host/command/replay/replay-cursor.pure.d.mts +7 -0
- package/dist/host/command/replay/replay-cursor.pure.mjs +12 -0
- package/dist/host/computer/computer-steps.sql.d.mts +14 -0
- package/dist/host/computer/computer-steps.sql.mjs +76 -0
- package/dist/host/computer/job-computers.service.d.mts +20 -0
- package/dist/host/computer/job-computers.service.mjs +59 -0
- package/dist/host/computer/local-computer-files.layer.d.mts +11 -0
- package/dist/host/computer/local-computer-files.layer.mjs +69 -0
- package/dist/host/computer/local-computer-log.layer.d.mts +23 -0
- package/dist/host/computer/local-computer-log.layer.mjs +64 -0
- package/dist/host/computer/local-computer-records.layer.d.mts +190 -0
- package/dist/host/computer/local-computer-records.layer.mjs +99 -0
- package/dist/host/computer/local-computer.schema.d.mts +69 -0
- package/dist/host/computer/local-computer.schema.mjs +29 -0
- package/dist/host/computer/local-computers.adapter.d.mts +18 -0
- package/dist/host/computer/local-computers.adapter.mjs +248 -0
- package/dist/host/computer/local-step.layer.d.mts +30 -0
- package/dist/host/computer/local-step.layer.mjs +119 -0
- package/dist/host/file/actor-file-storage.sql.d.mts +15 -0
- package/dist/host/file/actor-file-storage.sql.mjs +82 -0
- package/dist/host/file/actor-files.sql.d.mts +9 -0
- package/dist/host/file/actor-files.sql.mjs +3 -0
- package/dist/host/file/blob-home-lock.pure.d.mts +8 -0
- package/dist/host/file/blob-home-lock.pure.mjs +10 -0
- package/dist/host/file/blob-home.sql.d.mts +19 -0
- package/dist/host/file/blob-home.sql.mjs +30 -0
- package/dist/host/file/local-blob-home.service.d.mts +16 -0
- package/dist/host/file/local-blob-home.service.mjs +43 -0
- package/dist/host/file/local-blob-owner.sql.d.mts +30 -0
- package/dist/host/file/local-blob-owner.sql.mjs +68 -0
- package/dist/host/file/local-file-upkeep.pure.d.mts +12 -0
- package/dist/host/file/local-file-upkeep.pure.mjs +41 -0
- package/dist/host/file/replay-file-storage.sql.d.mts +7 -0
- package/dist/host/file/replay-file-storage.sql.mjs +26 -0
- package/dist/host/fork/actor-fork.sql.d.mts +52 -0
- package/dist/host/fork/actor-fork.sql.mjs +42 -0
- package/dist/host/fork/fork-computers.adapter.d.mts +43 -0
- package/dist/host/fork/fork-computers.adapter.mjs +193 -0
- package/dist/host/hash/blob-hashing.service.d.mts +10 -0
- package/dist/host/hash/blob-hashing.service.mjs +4 -0
- package/dist/host/job/job-durables.sql.d.mts +44 -0
- package/dist/host/job/job-durables.sql.mjs +136 -0
- package/dist/host/job/job-engine.adapter.d.mts +33 -0
- package/dist/host/job/job-engine.adapter.mjs +258 -0
- package/dist/host/job/job-journal.sql.d.mts +85 -0
- package/dist/host/job/job-journal.sql.mjs +109 -0
- package/dist/host/job/job-results.service.d.mts +37 -0
- package/dist/host/job/job-results.service.mjs +63 -0
- package/dist/host/job/job-runs.pure.d.mts +103 -0
- package/dist/host/job/job-runs.pure.mjs +193 -0
- package/dist/host/job/undelivered-result.pure.d.mts +49 -0
- package/dist/host/job/undelivered-result.pure.mjs +147 -0
- package/dist/host/layout/actor-layout.sql.d.mts +8 -0
- package/dist/host/layout/actor-layout.sql.mjs +33 -0
- package/dist/host/layout/layout-version.errors.d.mts +10 -0
- package/dist/host/layout/layout-version.errors.mjs +8 -0
- package/dist/host/layout/layout-version.pure.d.mts +10 -0
- package/dist/host/layout/layout-version.pure.mjs +14 -0
- package/dist/host/migration/actor-migrations.service.d.mts +46 -0
- package/dist/host/migration/actor-migrations.service.mjs +143 -0
- package/dist/host/migration/migration-edited.errors.d.mts +9 -0
- package/dist/host/migration/migration-edited.errors.mjs +7 -0
- package/dist/host/migration/migration-failed.errors.d.mts +12 -0
- package/dist/host/migration/migration-failed.errors.mjs +10 -0
- package/dist/host/migration/migration-failure.pure.d.mts +9 -0
- package/dist/host/migration/migration-failure.pure.mjs +19 -0
- package/dist/host/migration/migration-hasher.adapter.d.mts +15 -0
- package/dist/host/migration/migration-hasher.adapter.mjs +40 -0
- package/dist/host/migration/migration-missing.errors.d.mts +9 -0
- package/dist/host/migration/migration-missing.errors.mjs +7 -0
- package/dist/host/migration/migration-plan.pure.d.mts +20 -0
- package/dist/host/migration/migration-plan.pure.mjs +32 -0
- package/dist/host/outbox/actor-outbox.sql.d.mts +33 -0
- package/dist/host/outbox/actor-outbox.sql.mjs +28 -0
- package/dist/host/outbox/outbox-acknowledgements.sql.d.mts +12 -0
- package/dist/host/outbox/outbox-acknowledgements.sql.mjs +47 -0
- package/dist/host/outbox/outbox-runner.service.d.mts +37 -0
- package/dist/host/outbox/outbox-runner.service.mjs +155 -0
- package/dist/host/query/query-policy.pure.d.mts +15 -0
- package/dist/host/query/query-policy.pure.mjs +12 -0
- package/dist/host/query/query-runner.service.d.mts +42 -0
- package/dist/host/query/query-runner.service.mjs +72 -0
- package/dist/host/sqlite/actor-connections.pure.d.mts +26 -0
- package/dist/host/sqlite/actor-connections.pure.mjs +4 -0
- package/dist/host/sqlite/sqlite-connection.adapter.d.mts +22 -0
- package/dist/host/sqlite/sqlite-connection.adapter.mjs +151 -0
- package/dist/host/sqlite/sqlite-driver.service.d.mts +33 -0
- package/dist/host/sqlite/sqlite-driver.service.mjs +88 -0
- package/dist/host/sqlite/sqlite-parameters.pure.d.mts +5 -0
- package/dist/host/sqlite/sqlite-parameters.pure.mjs +21 -0
- package/dist/host/sqlite/sqlite-reason.pure.d.mts +8 -0
- package/dist/host/sqlite/sqlite-reason.pure.mjs +13 -0
- package/dist/host/timer/actor-timers.sql.d.mts +32 -0
- package/dist/host/timer/actor-timers.sql.mjs +8 -0
- package/dist/host/timer/timer-runner.service.d.mts +26 -0
- package/dist/host/timer/timer-runner.service.mjs +68 -0
- package/dist/host/upkeep/actor-due.sql.d.mts +26 -0
- package/dist/host/upkeep/actor-due.sql.mjs +43 -0
- package/dist/host/upkeep/actor-upkeep.service.d.mts +55 -0
- package/dist/host/upkeep/actor-upkeep.service.mjs +218 -0
- package/dist/host/upkeep/execution-authority.pure.d.mts +19 -0
- package/dist/host/upkeep/execution-authority.pure.mjs +10 -0
- package/dist/runtime/akter-local.layer.d.mts +28 -0
- package/dist/runtime/akter-local.layer.mjs +24 -0
- package/dist/runtime/akter.layer.d.mts +91 -0
- package/dist/runtime/akter.layer.mjs +99 -0
- package/dist/runtime/blob-hashing.layer.d.mts +4 -0
- package/dist/runtime/blob-hashing.layer.mjs +15 -0
- package/dist/runtime/hosted-environment.layer.d.mts +34 -0
- package/dist/runtime/hosted-environment.layer.mjs +40 -0
- package/dist/runtime/http-server.layer.d.mts +9 -0
- package/dist/runtime/http-server.layer.mjs +15 -0
- package/dist/runtime/local-actor-engine.layer.d.mts +10 -0
- package/dist/runtime/local-actor-engine.layer.mjs +14 -0
- package/dist/runtime/local-engine.layer.d.mts +15 -0
- package/dist/runtime/local-engine.layer.mjs +14 -0
- package/dist/runtime/local-environments.layer.d.mts +24 -0
- package/dist/runtime/local-environments.layer.mjs +159 -0
- package/dist/runtime/local-file-clients.layer.d.mts +13 -0
- package/dist/runtime/local-file-clients.layer.mjs +78 -0
- package/dist/runtime/local-job-runtime.layer.d.mts +19 -0
- package/dist/runtime/local-job-runtime.layer.mjs +21 -0
- package/dist/serve/archive/archived-actors.layer.d.mts +17 -0
- package/dist/serve/archive/archived-actors.layer.mjs +84 -0
- package/dist/serve/archive/archived-store.layer.d.mts +12 -0
- package/dist/serve/archive/archived-store.layer.mjs +40 -0
- package/dist/serve/engine/actor-engine.layer.d.mts +8 -0
- package/dist/serve/engine/actor-engine.layer.mjs +30 -0
- package/dist/serve/engine/actor-fork.service.d.mts +63 -0
- package/dist/serve/engine/actor-fork.service.mjs +277 -0
- package/dist/serve/engine/actor-holding.pure.d.mts +7 -0
- package/dist/serve/engine/actor-holding.pure.mjs +9 -0
- package/dist/serve/engine/actor-host.service.d.mts +66 -0
- package/dist/serve/engine/actor-host.service.mjs +209 -0
- package/dist/serve/engine/actor-location.service.d.mts +38 -0
- package/dist/serve/engine/actor-location.service.mjs +109 -0
- package/dist/serve/engine/actor-residents.pure.d.mts +92 -0
- package/dist/serve/engine/actor-residents.pure.mjs +201 -0
- package/dist/serve/engine/actor-shard.pure.d.mts +4 -0
- package/dist/serve/engine/actor-shard.pure.mjs +8 -0
- package/dist/serve/engine/actor-state.pure.d.mts +17 -0
- package/dist/serve/engine/actor-state.pure.mjs +20 -0
- package/dist/serve/engine/actors-not-hosted.errors.d.mts +9 -0
- package/dist/serve/engine/actors-not-hosted.errors.mjs +7 -0
- package/dist/serve/engine/job-runtime.layer.d.mts +6 -0
- package/dist/serve/engine/job-runtime.layer.mjs +5 -0
- package/dist/serve/environment/environment-already-exists.errors.d.mts +10 -0
- package/dist/serve/environment/environment-already-exists.errors.mjs +9 -0
- package/dist/serve/environment/environment-in-use.errors.d.mts +10 -0
- package/dist/serve/environment/environment-in-use.errors.mjs +14 -0
- package/dist/serve/environment/environment-not-found.errors.d.mts +10 -0
- package/dist/serve/environment/environment-not-found.errors.mjs +9 -0
- package/dist/serve/environment/environment-records.sql.d.mts +92 -0
- package/dist/serve/environment/environment-records.sql.mjs +59 -0
- package/dist/serve/environment/environment-store.sql.d.mts +38 -0
- package/dist/serve/environment/environment-store.sql.mjs +78 -0
- package/dist/serve/environment/local-environment.schema.d.mts +38 -0
- package/dist/serve/environment/local-environment.schema.mjs +43 -0
- package/dist/serve/environment/local-environments.service.d.mts +44 -0
- package/dist/serve/environment/local-environments.service.mjs +196 -0
- package/dist/serve/environment/promotion-notice.pure.d.mts +22 -0
- package/dist/serve/environment/promotion-notice.pure.mjs +30 -0
- package/dist/serve/environment/snapshot-operations.sql.d.mts +32 -0
- package/dist/serve/environment/snapshot-operations.sql.mjs +131 -0
- package/dist/serve/environment/store-snapshot.sql.d.mts +32 -0
- package/dist/serve/environment/store-snapshot.sql.mjs +74 -0
- package/dist/serve/erasure/local-actor-erasure.service.d.mts +26 -0
- package/dist/serve/erasure/local-actor-erasure.service.mjs +102 -0
- package/dist/serve/history/actor-host-runners.service.d.mts +23 -0
- package/dist/serve/history/actor-host-runners.service.mjs +35 -0
- package/dist/serve/hosted/hosted-app-build.errors.d.mts +13 -0
- package/dist/serve/hosted/hosted-app-build.errors.mjs +9 -0
- package/dist/serve/hosted/hosted-app-checks.layer.d.mts +15 -0
- package/dist/serve/hosted/hosted-app-checks.layer.mjs +32 -0
- package/dist/serve/hosted/hosted-file-forward.layer.d.mts +22 -0
- package/dist/serve/hosted/hosted-file-forward.layer.mjs +42 -0
- package/dist/serve/hosted/hosted-file-rpcs.layer.d.mts +25 -0
- package/dist/serve/hosted/hosted-file-rpcs.layer.mjs +82 -0
- package/dist/serve/hosted/hosted-file-server.layer.d.mts +18 -0
- package/dist/serve/hosted/hosted-file-server.layer.mjs +33 -0
- package/dist/serve/hosted/hosted-files.layer.d.mts +32 -0
- package/dist/serve/hosted/hosted-files.layer.mjs +55 -0
- package/dist/serve/hosted/hosted-runtime.layer.d.mts +42 -0
- package/dist/serve/hosted/hosted-runtime.layer.mjs +48 -0
- package/dist/serve/hosted/hosted-runtime.service.d.mts +77 -0
- package/dist/serve/hosted/hosted-runtime.service.mjs +74 -0
- package/dist/serve/hosted/hosted-secrets.layer.d.mts +10 -0
- package/dist/serve/hosted/hosted-secrets.layer.mjs +28 -0
- package/dist/serve/http/loopback-host.pure.d.mts +11 -0
- package/dist/serve/http/loopback-host.pure.mjs +29 -0
- package/dist/serve/inspect/actor-inspection.schema.d.mts +119 -0
- package/dist/serve/inspect/actor-inspection.schema.mjs +75 -0
- package/dist/serve/inspect/actor-inspection.sql.d.mts +12 -0
- package/dist/serve/inspect/actor-inspection.sql.mjs +43 -0
- package/dist/serve/inspect/inspect.service.d.mts +24 -0
- package/dist/serve/inspect/inspect.service.mjs +92 -0
- package/dist/serve/inspect/inspector-page.pure.d.mts +2 -0
- package/dist/serve/inspect/inspector-page.pure.mjs +155 -0
- package/dist/serve/inspect/inspector-wal.pure.d.mts +3 -0
- package/dist/serve/inspect/inspector-wal.pure.mjs +19 -0
- package/dist/serve/inspect/inspector.handlers.d.mts +5 -0
- package/dist/serve/inspect/inspector.handlers.mjs +50 -0
- package/dist/serve/inspect/inspector.layer.d.mts +9 -0
- package/dist/serve/inspect/inspector.layer.mjs +14 -0
- package/dist/serve/live/live-reads.service.d.mts +44 -0
- package/dist/serve/live/live-reads.service.mjs +152 -0
- package/dist/serve/live/live-tables.sql.d.mts +35 -0
- package/dist/serve/live/live-tables.sql.mjs +66 -0
- package/dist/serve/live/state-reads.pure.d.mts +11 -0
- package/dist/serve/live/state-reads.pure.mjs +7 -0
- package/dist/serve/rpc/actor-rpc.handlers.d.mts +24 -0
- package/dist/serve/rpc/actor-rpc.handlers.mjs +142 -0
- package/dist/serve/rpc/akter-server.layer.d.mts +18 -0
- package/dist/serve/rpc/akter-server.layer.mjs +61 -0
- package/dist/serve/rpc/computer/computer-copy.layer.d.mts +22 -0
- package/dist/serve/rpc/computer/computer-copy.layer.mjs +70 -0
- package/dist/serve/rpc/computer/computer-rpc-access.pure.d.mts +29 -0
- package/dist/serve/rpc/computer/computer-rpc-access.pure.mjs +46 -0
- package/dist/serve/rpc/computer/computer-rpc.layer.d.mts +39 -0
- package/dist/serve/rpc/computer/computer-rpc.layer.mjs +84 -0
- package/dist/serve/rpc/computer/step-rpc.handlers.d.mts +23 -0
- package/dist/serve/rpc/computer/step-rpc.handlers.mjs +43 -0
- package/dist/serve/rpc/development-authentication.handlers.d.mts +7 -0
- package/dist/serve/rpc/development-authentication.handlers.mjs +19 -0
- package/dist/serve/rpc/development-guard.pure.d.mts +10 -0
- package/dist/serve/rpc/development-guard.pure.mjs +16 -0
- package/dist/serve/rpc/file/file-rpc-access.pure.d.mts +55 -0
- package/dist/serve/rpc/file/file-rpc-access.pure.mjs +67 -0
- package/dist/serve/rpc/file/file-rpc.layer.d.mts +53 -0
- package/dist/serve/rpc/file/file-rpc.layer.mjs +143 -0
- package/dist/serve/rpc/file/upload-sessions.pure.d.mts +45 -0
- package/dist/serve/rpc/file/upload-sessions.pure.mjs +187 -0
- package/dist/serve/rpc/in-process-client.layer.d.mts +13 -0
- package/dist/serve/rpc/in-process-client.layer.mjs +34 -0
- package/dist/serve/rpc/listener-not-loopback.errors.d.mts +9 -0
- package/dist/serve/rpc/listener-not-loopback.errors.mjs +7 -0
- package/dist/serve/rpc/ndjson-only.pure.d.mts +5 -0
- package/dist/serve/rpc/ndjson-only.pure.mjs +14 -0
- package/dist/serve/rpc/served-rpc.layer.d.mts +6 -0
- package/dist/serve/rpc/served-rpc.layer.mjs +19 -0
- package/dist/serve/store/actor-not-migrated.errors.d.mts +10 -0
- package/dist/serve/store/actor-not-migrated.errors.mjs +8 -0
- package/dist/serve/store/store-migrations.layer.d.mts +5 -0
- package/dist/serve/store/store-migrations.layer.mjs +18 -0
- package/dist/serve/store/store-migrations.service.d.mts +26 -0
- package/dist/serve/store/store-migrations.service.mjs +47 -0
- package/dist/serve/store/store-unreadable.errors.d.mts +9 -0
- package/dist/serve/store/store-unreadable.errors.mjs +7 -0
- package/dist/serve/verify/verify.layer.d.mts +16 -0
- package/dist/serve/verify/verify.layer.mjs +36 -0
- package/dist/testing/story-driver.service.d.mts +29 -0
- package/dist/testing/story-driver.service.mjs +126 -0
- package/dist/testing/story.layer.d.mts +21 -0
- package/dist/testing/story.layer.mjs +42 -0
- package/package.json +106 -3
- package/src/contract/actor/actor-already-exists.errors.ts +8 -0
- package/src/contract/actor/actor-definition.pure.ts +157 -0
- package/src/contract/actor/actor-erased.errors.ts +8 -0
- package/src/contract/actor/actor-names.pure.ts +64 -0
- package/src/contract/actor/actor-not-created.errors.ts +8 -0
- package/src/contract/actor/actor-not-registered.errors.ts +8 -0
- package/src/contract/actor/actor-registry.service.ts +35 -0
- package/src/contract/actor/actor.contract.ts +409 -0
- package/src/contract/actor/host-interface.pure.ts +60 -0
- package/src/contract/actor/reserved-member.errors.ts +9 -0
- package/src/contract/akter.service.ts +233 -0
- package/src/contract/caller/authentication.api.ts +9 -0
- package/src/contract/caller/caller-admission.pure.ts +90 -0
- package/src/contract/caller/caller-not-allowed.errors.ts +26 -0
- package/src/contract/caller/caller.schema.ts +7 -0
- package/src/contract/caller/current-caller.service.ts +7 -0
- package/src/contract/caller/principal.schema.ts +13 -0
- package/src/contract/caller/unauthenticated.errors.ts +8 -0
- package/src/contract/client/actor-client.adapter.ts +217 -0
- package/src/contract/client/actor-client.contract.ts +53 -0
- package/src/contract/client/actor-rpc.contract.ts +91 -0
- package/src/contract/client/actor-unavailable.errors.ts +9 -0
- package/src/contract/client/client-failure.contract.ts +53 -0
- package/src/contract/client/invalid-request.errors.ts +9 -0
- package/src/contract/client/storage-limit.errors.ts +16 -0
- package/src/contract/command/command-id-expired.errors.ts +11 -0
- package/src/contract/command/command-id.schema.ts +5 -0
- package/src/contract/command/command.contract.ts +334 -0
- package/src/contract/command/outbox-id.pure.ts +25 -0
- package/src/contract/command/outbox.schema.ts +11 -0
- package/src/contract/command/timer.schema.ts +21 -0
- package/src/contract/computer/checkpoint-expired.errors.ts +12 -0
- package/src/contract/computer/computer-client-failure.contract.ts +27 -0
- package/src/contract/computer/computer-client.adapter.ts +110 -0
- package/src/contract/computer/computer-client.contract.ts +75 -0
- package/src/contract/computer/computer-held.errors.ts +10 -0
- package/src/contract/computer/computer-limit.errors.ts +11 -0
- package/src/contract/computer/computer-lost.errors.ts +10 -0
- package/src/contract/computer/computer-not-found.errors.ts +9 -0
- package/src/contract/computer/computer.schema.ts +159 -0
- package/src/contract/computer/computers-unavailable.errors.ts +9 -0
- package/src/contract/computer/files/computer-files.schema.ts +31 -0
- package/src/contract/computer/rpc/computer-rpc.contract.ts +140 -0
- package/src/contract/computer/step/computer-step.contract.ts +126 -0
- package/src/contract/computer/step/computer-step.schema.ts +80 -0
- package/src/contract/computer/step/step-failure.schema.ts +26 -0
- package/src/contract/computer/step/step-not-found.errors.ts +7 -0
- package/src/contract/description/published-contract.pure.ts +187 -0
- package/src/contract/file/access/file-access-denied.errors.ts +11 -0
- package/src/contract/file/access/file-access.contract.ts +56 -0
- package/src/contract/file/actor-files.contract.ts +78 -0
- package/src/contract/file/blob-transfer.errors.ts +6 -0
- package/src/contract/file/file-client-failure.contract.ts +43 -0
- package/src/contract/file/file-client.adapter.ts +45 -0
- package/src/contract/file/file-client.contract.ts +24 -0
- package/src/contract/file/file-listing.pure.ts +30 -0
- package/src/contract/file/file-not-found.errors.ts +6 -0
- package/src/contract/file/file-path.pure.ts +37 -0
- package/src/contract/file/files-unavailable.errors.ts +8 -0
- package/src/contract/file/invalid-file-request.errors.ts +9 -0
- package/src/contract/file/rpc/file-rpc.contract.ts +148 -0
- package/src/contract/file/rpc/file-too-large.errors.ts +10 -0
- package/src/contract/file/rpc/rpc-file-clients.layer.ts +184 -0
- package/src/contract/fork/fork-rpc.contract.ts +44 -0
- package/src/contract/history/actor-journal.service.ts +195 -0
- package/src/contract/history/history-entry.pure.ts +282 -0
- package/src/contract/hosted/handler-failed.errors.ts +16 -0
- package/src/contract/hosted/handler-failure.pure.ts +161 -0
- package/src/contract/hosted/hosted-actor.service.ts +97 -0
- package/src/contract/hosted/hosted-command.service.ts +114 -0
- package/src/contract/hosted/hosted-create.service.ts +95 -0
- package/src/contract/hosted/hosted-error.contract.ts +22 -0
- package/src/contract/hosted/hosted-failure.schema.ts +32 -0
- package/src/contract/hosted/hosted-outcome.contract.ts +21 -0
- package/src/contract/hosted/hosted-query.service.ts +50 -0
- package/src/contract/hosted/hosted-request.pure.ts +185 -0
- package/src/contract/job/job-id.pure.ts +37 -0
- package/src/contract/job/job-patches.contract.ts +86 -0
- package/src/contract/job/job-signal.schema.ts +23 -0
- package/src/contract/job/reserved-payload-field.errors.ts +10 -0
- package/src/contract/job/started-job.schema.ts +9 -0
- package/src/contract/json-codec.pure.ts +27 -0
- package/src/contract/room.contract.ts +31 -0
- package/src/contract/secret/actor-secrets.adapter.ts +87 -0
- package/src/contract/secret/invalid-secret-name.errors.ts +10 -0
- package/src/contract/secret/secret-unavailable.errors.ts +13 -0
- package/src/contract/secret/secret.schema.ts +43 -0
- package/src/contract/spend/billing-unavailable.errors.ts +12 -0
- package/src/contract/spend/spend-cap-reached.errors.ts +17 -0
- package/src/contract/state/actor-state.pure.ts +192 -0
- package/src/contract/state/actor-state.service.ts +69 -0
- package/src/contract/state/state-migration.pure.ts +57 -0
- package/src/contract/state/state-read.pure.ts +40 -0
- package/src/contract/state/state-unreadable.errors.ts +9 -0
- package/src/host/actor/actor-database.service.ts +145 -0
- package/src/host/actor/actor-exclusive.pure.ts +32 -0
- package/src/host/actor/actor-records.sql.ts +78 -0
- package/src/host/actor/reserved-name.errors.ts +10 -0
- package/src/host/actor/reserved-names.pure.ts +40 -0
- package/src/host/actor/room.actor.ts +57 -0
- package/src/host/blob/blob-frames.pure.ts +52 -0
- package/src/host/blob/blob-grant.schema.ts +22 -0
- package/src/host/blob/blob-grants.service.ts +197 -0
- package/src/host/blob/blob-keyring.service.ts +25 -0
- package/src/host/blob/blob-range.pure.ts +33 -0
- package/src/host/blob/blob-sealing.contract.ts +46 -0
- package/src/host/blob/blob-sealing.service.ts +25 -0
- package/src/host/blob/export/blob-archive.sql.ts +153 -0
- package/src/host/blob/export/blob-export-holds.sql.ts +91 -0
- package/src/host/blob/plain-blob-sealing.pure.ts +70 -0
- package/src/host/blob/reference/blob-catalog.sql.ts +339 -0
- package/src/host/blob/reference/blob-coordinator.pure.ts +217 -0
- package/src/host/blob/reference/blob-file-page.sql.ts +48 -0
- package/src/host/blob/reference/blob-forks.sql.ts +125 -0
- package/src/host/blob/reference/blob-lineage.sql.ts +63 -0
- package/src/host/blob/reference/blob-reads.pure.ts +172 -0
- package/src/host/blob/reference/blob-receipts.sql.ts +375 -0
- package/src/host/blob/reference/blob-transfer-adopt.pure.ts +127 -0
- package/src/host/blob/reference/blob-transfer-fork.pure.ts +174 -0
- package/src/host/blob/reference/blob-transfer-upkeep.pure.ts +132 -0
- package/src/host/blob/reference/blob-transfer.pure.ts +127 -0
- package/src/host/blob/sealed-blob-sealing.pure.ts +163 -0
- package/src/host/blob/stream/blob-directory.pure.ts +177 -0
- package/src/host/blob/stream/blob-length.pure.ts +40 -0
- package/src/host/blob/stream/blob-writing.pure.ts +49 -0
- package/src/host/command/batch/command-batch.sql.ts +207 -0
- package/src/host/command/command-context.adapter.ts +134 -0
- package/src/host/command/command-id-age.pure.ts +54 -0
- package/src/host/command/command-id-reuse.pure.ts +90 -0
- package/src/host/command/command-id-reused.errors.ts +13 -0
- package/src/host/command/command-journal.sql.ts +232 -0
- package/src/host/command/command-rejected.errors.ts +8 -0
- package/src/host/command/command-replay.service.ts +223 -0
- package/src/host/command/command-reply.pure.ts +21 -0
- package/src/host/command/command-runner.service.ts +320 -0
- package/src/host/command/files/command-file-inputs.sql.ts +114 -0
- package/src/host/command/history-pruned.errors.ts +10 -0
- package/src/host/command/replay/replay-cursor-stalled.errors.ts +9 -0
- package/src/host/command/replay/replay-cursor.pure.ts +19 -0
- package/src/host/computer/computer-steps.sql.ts +120 -0
- package/src/host/computer/job-computers.service.ts +84 -0
- package/src/host/computer/local-computer-files.layer.ts +103 -0
- package/src/host/computer/local-computer-log.layer.ts +115 -0
- package/src/host/computer/local-computer-records.layer.ts +205 -0
- package/src/host/computer/local-computer.schema.ts +36 -0
- package/src/host/computer/local-computers.adapter.ts +379 -0
- package/src/host/computer/local-step.layer.ts +174 -0
- package/src/host/file/actor-file-storage.sql.ts +79 -0
- package/src/host/file/actor-files.sql.ts +15 -0
- package/src/host/file/blob-home-lock.pure.ts +23 -0
- package/src/host/file/blob-home.sql.ts +55 -0
- package/src/host/file/local-blob-home.service.ts +71 -0
- package/src/host/file/local-blob-owner.sql.ts +89 -0
- package/src/host/file/local-file-upkeep.pure.ts +77 -0
- package/src/host/file/replay-file-storage.sql.ts +43 -0
- package/src/host/fork/actor-fork.sql.ts +110 -0
- package/src/host/fork/fork-computers.adapter.ts +366 -0
- package/src/host/hash/blob-hashing.service.ts +14 -0
- package/src/host/job/job-durables.sql.ts +214 -0
- package/src/host/job/job-engine.adapter.ts +420 -0
- package/src/host/job/job-journal.sql.ts +257 -0
- package/src/host/job/job-results.service.ts +111 -0
- package/src/host/job/job-runs.pure.ts +445 -0
- package/src/host/job/undelivered-result.pure.ts +265 -0
- package/src/host/layout/actor-layout.sql.ts +45 -0
- package/src/host/layout/layout-version.errors.ts +10 -0
- package/src/host/layout/layout-version.pure.ts +22 -0
- package/src/host/migration/actor-migrations.service.ts +159 -0
- package/src/host/migration/migration-edited.errors.ts +9 -0
- package/src/host/migration/migration-failed.errors.ts +12 -0
- package/src/host/migration/migration-failure.pure.ts +28 -0
- package/src/host/migration/migration-hasher.adapter.ts +70 -0
- package/src/host/migration/migration-missing.errors.ts +9 -0
- package/src/host/migration/migration-plan.pure.ts +66 -0
- package/src/host/outbox/actor-outbox.sql.ts +98 -0
- package/src/host/outbox/outbox-acknowledgements.sql.ts +93 -0
- package/src/host/outbox/outbox-runner.service.ts +253 -0
- package/src/host/query/query-policy.pure.ts +31 -0
- package/src/host/query/query-runner.service.ts +132 -0
- package/src/host/sqlite/actor-connections.pure.ts +44 -0
- package/src/host/sqlite/sqlite-connection.adapter.ts +260 -0
- package/src/host/sqlite/sqlite-driver.service.ts +151 -0
- package/src/host/sqlite/sqlite-parameters.pure.ts +28 -0
- package/src/host/sqlite/sqlite-reason.pure.ts +19 -0
- package/src/host/timer/actor-timers.sql.ts +67 -0
- package/src/host/timer/timer-runner.service.ts +117 -0
- package/src/host/upkeep/actor-due.sql.ts +71 -0
- package/src/host/upkeep/actor-upkeep.service.ts +404 -0
- package/src/host/upkeep/execution-authority.pure.ts +37 -0
- package/src/runtime/akter-local.layer.ts +49 -0
- package/src/runtime/akter.layer.ts +208 -0
- package/src/runtime/blob-hashing.layer.ts +21 -0
- package/src/runtime/hosted-environment.layer.ts +85 -0
- package/src/runtime/http-server.layer.ts +29 -0
- package/src/runtime/local-actor-engine.layer.ts +33 -0
- package/src/runtime/local-engine.layer.ts +37 -0
- package/src/runtime/local-environments.layer.ts +214 -0
- package/src/runtime/local-file-clients.layer.ts +112 -0
- package/src/runtime/local-job-runtime.layer.ts +38 -0
- package/src/serve/archive/archived-actors.layer.ts +97 -0
- package/src/serve/archive/archived-store.layer.ts +46 -0
- package/src/serve/engine/actor-engine.layer.ts +46 -0
- package/src/serve/engine/actor-fork.service.ts +403 -0
- package/src/serve/engine/actor-holding.pure.ts +28 -0
- package/src/serve/engine/actor-host.service.ts +454 -0
- package/src/serve/engine/actor-location.service.ts +219 -0
- package/src/serve/engine/actor-residents.pure.ts +500 -0
- package/src/serve/engine/actor-shard.pure.ts +13 -0
- package/src/serve/engine/actor-state.pure.ts +45 -0
- package/src/serve/engine/actors-not-hosted.errors.ts +9 -0
- package/src/serve/engine/job-runtime.layer.ts +13 -0
- package/src/serve/environment/environment-already-exists.errors.ts +9 -0
- package/src/serve/environment/environment-in-use.errors.ts +17 -0
- package/src/serve/environment/environment-not-found.errors.ts +9 -0
- package/src/serve/environment/environment-records.sql.ts +208 -0
- package/src/serve/environment/environment-store.sql.ts +116 -0
- package/src/serve/environment/local-environment.schema.ts +79 -0
- package/src/serve/environment/local-environments.service.ts +268 -0
- package/src/serve/environment/promotion-notice.pure.ts +63 -0
- package/src/serve/environment/snapshot-operations.sql.ts +210 -0
- package/src/serve/environment/store-snapshot.sql.ts +128 -0
- package/src/serve/erasure/local-actor-erasure.service.ts +170 -0
- package/src/serve/history/actor-host-runners.service.ts +85 -0
- package/src/serve/hosted/hosted-app-build.errors.ts +11 -0
- package/src/serve/hosted/hosted-app-checks.layer.ts +74 -0
- package/src/serve/hosted/hosted-file-forward.layer.ts +63 -0
- package/src/serve/hosted/hosted-file-rpcs.layer.ts +149 -0
- package/src/serve/hosted/hosted-file-server.layer.ts +75 -0
- package/src/serve/hosted/hosted-files.layer.ts +76 -0
- package/src/serve/hosted/hosted-runtime.layer.ts +145 -0
- package/src/serve/hosted/hosted-runtime.service.ts +128 -0
- package/src/serve/hosted/hosted-secrets.layer.ts +38 -0
- package/src/serve/http/loopback-host.pure.ts +67 -0
- package/src/serve/inspect/actor-inspection.schema.ts +94 -0
- package/src/serve/inspect/actor-inspection.sql.ts +112 -0
- package/src/serve/inspect/inspect.service.ts +173 -0
- package/src/serve/inspect/inspector-page.pure.ts +159 -0
- package/src/serve/inspect/inspector-wal.pure.ts +40 -0
- package/src/serve/inspect/inspector.handlers.ts +103 -0
- package/src/serve/inspect/inspector.layer.ts +26 -0
- package/src/serve/live/live-reads.service.ts +285 -0
- package/src/serve/live/live-tables.sql.ts +148 -0
- package/src/serve/live/state-reads.pure.ts +22 -0
- package/src/serve/rpc/actor-rpc.handlers.ts +242 -0
- package/src/serve/rpc/akter-server.layer.ts +119 -0
- package/src/serve/rpc/computer/computer-copy.layer.ts +95 -0
- package/src/serve/rpc/computer/computer-rpc-access.pure.ts +75 -0
- package/src/serve/rpc/computer/computer-rpc.layer.ts +143 -0
- package/src/serve/rpc/computer/step-rpc.handlers.ts +84 -0
- package/src/serve/rpc/development-authentication.handlers.ts +28 -0
- package/src/serve/rpc/development-guard.pure.ts +39 -0
- package/src/serve/rpc/file/file-rpc-access.pure.ts +119 -0
- package/src/serve/rpc/file/file-rpc.layer.ts +209 -0
- package/src/serve/rpc/file/upload-sessions.pure.ts +363 -0
- package/src/serve/rpc/in-process-client.layer.ts +62 -0
- package/src/serve/rpc/listener-not-loopback.errors.ts +9 -0
- package/src/serve/rpc/ndjson-only.pure.ts +33 -0
- package/src/serve/rpc/served-rpc.layer.ts +34 -0
- package/src/serve/store/actor-not-migrated.errors.ts +10 -0
- package/src/serve/store/store-migrations.layer.ts +35 -0
- package/src/serve/store/store-migrations.service.ts +76 -0
- package/src/serve/store/store-unreadable.errors.ts +9 -0
- package/src/serve/verify/verify.layer.ts +77 -0
- package/src/testing/story-driver.service.ts +266 -0
- package/src/testing/story.layer.ts +99 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
declare const CallerNotAllowedError_base: Schema.Class<CallerNotAllowedError, Schema.TaggedStruct<"CallerNotAllowedError", {
|
|
3
|
+
readonly actor: Schema.String;
|
|
4
|
+
readonly kind: Schema.String;
|
|
5
|
+
readonly member: Schema.String;
|
|
6
|
+
}>, import("effect/Cause").YieldableError & {
|
|
7
|
+
readonly brand: unique symbol;
|
|
8
|
+
}>;
|
|
9
|
+
/**
|
|
10
|
+
* The caller's kind may not call this member. Its message names the refused kind and the declaration that admits it,
|
|
11
|
+
* such as `apiKey` for a script, agent or bench signed in with an Akter Cloud API key.
|
|
12
|
+
*/
|
|
13
|
+
export declare class CallerNotAllowedError extends CallerNotAllowedError_base {
|
|
14
|
+
get message(): string;
|
|
15
|
+
}
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
// src/contract/caller/caller-not-allowed.errors.ts
|
|
3
|
+
/**
|
|
4
|
+
* The caller's kind may not call this member. Its message names the refused kind and the declaration that admits it,
|
|
5
|
+
* such as `apiKey` for a script, agent or bench signed in with an Akter Cloud API key.
|
|
6
|
+
*/
|
|
7
|
+
var CallerNotAllowedError = class extends Schema.TaggedError()("CallerNotAllowedError", {
|
|
8
|
+
actor: Schema.String,
|
|
9
|
+
kind: Schema.String,
|
|
10
|
+
member: Schema.String
|
|
11
|
+
}) {
|
|
12
|
+
get message() {
|
|
13
|
+
if (this.member === "akter.files") return `${this.actor}'s files refuse caller kind "${this.kind}". To admit it, list it in the actor's files: Akter.fileAccess({ callers: ["${this.kind}"] }), and allow it in files.authorize.`;
|
|
14
|
+
if (this.member === "fork") return `${this.actor}.fork refuses caller kind "${this.kind}". Fork admits only an app's operators, the "user" and "apiKey" caller kinds.`;
|
|
15
|
+
return `${this.actor}.${this.member} refuses caller kind "${this.kind}". To admit it, declare it on the actor, as in callers: { ${this.kind}: Akter.Principal, user: Akter.Principal }, and add "${this.kind}" to the member's callers if it lists them.`;
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
export { CallerNotAllowedError };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
export declare const Caller: Schema.Struct<{
|
|
3
|
+
readonly kind: Schema.String;
|
|
4
|
+
readonly principal: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
5
|
+
}>;
|
|
6
|
+
export type Caller = typeof Caller.Type;
|
|
7
|
+
export declare const actorKind = "actor";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Context } from "effect";
|
|
2
|
+
declare const CurrentCaller_base: Context.ServiceClass<CurrentCaller, "@akterjs/effect/contract/caller/current-caller.service/CurrentCaller", {
|
|
3
|
+
readonly kind: string;
|
|
4
|
+
readonly principal: import("effect/Schema").Json;
|
|
5
|
+
}>;
|
|
6
|
+
export declare class CurrentCaller extends CurrentCaller_base {}
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
export declare const PrincipalId: Schema.brand<Schema.String, "PrincipalId">;
|
|
3
|
+
export type PrincipalId = typeof PrincipalId.Type;
|
|
4
|
+
export declare const Principal: Schema.Struct<{
|
|
5
|
+
readonly id: Schema.brand<Schema.String, "PrincipalId">;
|
|
6
|
+
}>;
|
|
7
|
+
export type Principal = typeof Principal.Type;
|
|
8
|
+
export declare const ActorPrincipal: Schema.Struct<{
|
|
9
|
+
readonly actor: Schema.String;
|
|
10
|
+
readonly id: Schema.brand<Schema.String, "PrincipalId">;
|
|
11
|
+
readonly key: Schema.String;
|
|
12
|
+
}>;
|
|
13
|
+
export type ActorPrincipal = typeof ActorPrincipal.Type;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
// src/contract/caller/principal.schema.ts
|
|
3
|
+
const PrincipalId = Schema.String.pipe(Schema.brand("PrincipalId"));
|
|
4
|
+
const Principal = Schema.Struct({ id: PrincipalId });
|
|
5
|
+
const ActorPrincipal = Schema.Struct({
|
|
6
|
+
actor: Schema.String,
|
|
7
|
+
id: PrincipalId,
|
|
8
|
+
key: Schema.String
|
|
9
|
+
});
|
|
10
|
+
export { ActorPrincipal, Principal, PrincipalId };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
declare const UnauthenticatedError_base: Schema.Class<UnauthenticatedError, Schema.TaggedStruct<"UnauthenticatedError", {
|
|
3
|
+
readonly message: Schema.String;
|
|
4
|
+
}>, import("effect/Cause").YieldableError & {
|
|
5
|
+
readonly brand: unique symbol;
|
|
6
|
+
}>;
|
|
7
|
+
export declare class UnauthenticatedError extends UnauthenticatedError_base {}
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { ActorRpcs, LiveUpdate } from "./actor-rpc.contract.mjs";
|
|
2
|
+
import { ActorClient, QueryClient } from "./actor-client.contract.mjs";
|
|
3
|
+
import { ActorDefinition } from "../actor/actor.contract.mjs";
|
|
4
|
+
import { SecretOf } from "../secret/actor-secrets.adapter.mjs";
|
|
5
|
+
import { ComputerClientOf } from "../computer/computer-client.adapter.mjs";
|
|
6
|
+
import { FileClientOf } from "../file/file-client.adapter.mjs";
|
|
7
|
+
import { Context, Effect, Layer, Scope, Stream } from "effect";
|
|
8
|
+
import { RpcClient } from "effect/rpc";
|
|
9
|
+
import { SecureRandom } from "effect/crypto";
|
|
10
|
+
type ClientServices = ActorClients | RpcClient.Protocol | Scope.Scope;
|
|
11
|
+
type ClientOf<Definition extends ActorDefinition> = (key: Definition["key"]["Type"]) => Effect.Effect<ActorClient<Definition>, never, ClientServices>;
|
|
12
|
+
interface ClientSource {
|
|
13
|
+
readonly definition: ActorDefinition;
|
|
14
|
+
readonly name: string;
|
|
15
|
+
readonly rpcs: ActorRpcs;
|
|
16
|
+
}
|
|
17
|
+
interface WireValue {
|
|
18
|
+
readonly wire: unique symbol;
|
|
19
|
+
}
|
|
20
|
+
interface WireFailure {
|
|
21
|
+
readonly _tag: string;
|
|
22
|
+
}
|
|
23
|
+
type WireCall = (payload: WireValue) => Effect.Effect<WireValue, WireFailure>;
|
|
24
|
+
type WireUpdates = Stream.Stream<LiveUpdate<WireValue>, WireFailure>;
|
|
25
|
+
type WireQuery = WireCall & {
|
|
26
|
+
readonly subscribe: (payload: WireValue) => WireUpdates;
|
|
27
|
+
};
|
|
28
|
+
type WireWarm = Effect.Effect<WireValue, WireFailure>;
|
|
29
|
+
type WireFork = (into: WireValue) => Effect.Effect<WireClient, WireFailure>;
|
|
30
|
+
type WireClient = Readonly<Record<string, WireCall | WireFork | WireQuery | WireUpdates | WireWarm>>;
|
|
31
|
+
declare const ActorClients_base: Context.ServiceClass<ActorClients, "@akterjs/effect/contract/client/actor-client.adapter/ActorClients", {
|
|
32
|
+
readonly connect: (source: ClientSource, key: WireValue) => Effect.Effect<WireClient, never, RpcClient.Protocol | Scope.Scope>;
|
|
33
|
+
}>;
|
|
34
|
+
export declare class ActorClients extends ActorClients_base {
|
|
35
|
+
static computerOf<Definition extends ActorDefinition>(source: Pick<ClientSource, "definition" | "name">): ComputerClientOf<Definition>;
|
|
36
|
+
static filesOf<Definition extends ActorDefinition>(source: Pick<ClientSource, "definition" | "name">): FileClientOf<Definition>;
|
|
37
|
+
/** The actor's declared secrets, read in its job activities (`ActorSecrets`). */
|
|
38
|
+
static secretOf<Definition extends ActorDefinition>(source: Pick<ClientSource, "definition" | "name">): SecretOf<Definition>;
|
|
39
|
+
static readonly layer: Layer.Layer<ActorClients, never, SecureRandom.SecureRandom>;
|
|
40
|
+
static clientOf<Definition extends ActorDefinition>(source: ClientSource): ClientOf<Definition>;
|
|
41
|
+
}
|
|
42
|
+
export type { ActorClient, ClientOf, ComputerClientOf, FileClientOf, QueryClient, SecretOf };
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { creationModesOf } from "./actor-rpc.contract.mjs";
|
|
2
|
+
import { ActorSecrets } from "../secret/actor-secrets.adapter.mjs";
|
|
3
|
+
import { ActorComputerClients } from "../computer/computer-client.adapter.mjs";
|
|
4
|
+
import { ActorFileClients } from "../file/file-client.adapter.mjs";
|
|
5
|
+
import { Array, Context, Duration, Effect, Layer, Predicate, Record, Schedule, Stream } from "effect";
|
|
6
|
+
import { RpcClient } from "effect/rpc";
|
|
7
|
+
import { SecureRandom } from "effect/crypto";
|
|
8
|
+
// src/contract/client/actor-client.adapter.ts
|
|
9
|
+
const retryMillis = 50;
|
|
10
|
+
const retryLimit = 5;
|
|
11
|
+
const resumeCapMillis = 5e3;
|
|
12
|
+
const noVersion = -1;
|
|
13
|
+
const isTransportFailure = (failure) => Predicate.isTagged(failure, "RpcClientError");
|
|
14
|
+
const resubscribing = Schedule.min([Schedule.exponential(Duration.millis(retryMillis)), Schedule.spaced(Duration.millis(resumeCapMillis))]).pipe(Schedule.while(({ input }) => isTransportFailure(input)));
|
|
15
|
+
const resumed = (updates) => updates.pipe(Stream.retry(resubscribing), Stream.mapAccum(() => noVersion, (last, update) => {
|
|
16
|
+
if (update.version > last) return [update.version, [update]];
|
|
17
|
+
return [last, []];
|
|
18
|
+
}));
|
|
19
|
+
function wireSenders(rpcs) {
|
|
20
|
+
return Effect.map(RpcClient.make(rpcs, { flatten: true }), (client) => ({
|
|
21
|
+
send: client,
|
|
22
|
+
watch: client
|
|
23
|
+
}));
|
|
24
|
+
}
|
|
25
|
+
const sendOnce = ({ random, senders }, tag, request) => Effect.flatMap(random.uuidV7(), (commandId) => Effect.retry(senders.send(tag, {
|
|
26
|
+
...request,
|
|
27
|
+
commandId
|
|
28
|
+
}), {
|
|
29
|
+
schedule: Schedule.exponential(Duration.millis(retryMillis)),
|
|
30
|
+
times: retryLimit,
|
|
31
|
+
while: isTransportFailure
|
|
32
|
+
}));
|
|
33
|
+
const queriesOf = ({ senders, source }, key) => Record.map(source.definition.queries, (_declaration, member) => {
|
|
34
|
+
const call = (payload) => senders.send(`${source.name}/${member}`, {
|
|
35
|
+
key,
|
|
36
|
+
payload
|
|
37
|
+
});
|
|
38
|
+
return Object.assign(call, { subscribe: (payload) => resumed(senders.watch(`${source.name}/${member}/subscribe`, {
|
|
39
|
+
key,
|
|
40
|
+
payload
|
|
41
|
+
})) });
|
|
42
|
+
});
|
|
43
|
+
const wireClient = (wiring, key) => {
|
|
44
|
+
const { definition, name } = wiring.source;
|
|
45
|
+
const { send, watch } = wiring.senders;
|
|
46
|
+
const command = (tag) => (payload) => sendOnce(wiring, tag, {
|
|
47
|
+
key,
|
|
48
|
+
payload
|
|
49
|
+
});
|
|
50
|
+
const creation = Record.fromEntries(Array.map(creationModesOf(definition.create), (mode) => [mode, command(`${name}/${mode}`)]));
|
|
51
|
+
const fork = (into) => Effect.as(sendOnce(wiring, `${name}/fork`, {
|
|
52
|
+
into,
|
|
53
|
+
key
|
|
54
|
+
}), wireClient(wiring, into));
|
|
55
|
+
return {
|
|
56
|
+
...Record.map(definition.commands, (_declaration, member) => command(`${name}/${member}`)),
|
|
57
|
+
...creation,
|
|
58
|
+
...queriesOf(wiring, key),
|
|
59
|
+
fork,
|
|
60
|
+
state: resumed(watch(`${name}/state/subscribe`, { key })),
|
|
61
|
+
warm: send(`${name}/warm`, { key })
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
var ActorClients = class ActorClients extends Context.Service()("@akterjs/effect/contract/client/actor-client.adapter/ActorClients") {
|
|
65
|
+
static computerOf(source) {
|
|
66
|
+
return ActorComputerClients.clientOf(source);
|
|
67
|
+
}
|
|
68
|
+
static filesOf(source) {
|
|
69
|
+
return ActorFileClients.clientOf(source);
|
|
70
|
+
}
|
|
71
|
+
/** The actor's declared secrets, read in its job activities (`ActorSecrets`). */
|
|
72
|
+
static secretOf(source) {
|
|
73
|
+
return ActorSecrets.secretOf({
|
|
74
|
+
name: source.name,
|
|
75
|
+
secrets: source.definition.secrets
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
static layer = Layer.effect(ActorClients, Effect.gen(function* makeActorClients() {
|
|
79
|
+
const random = yield* SecureRandom.SecureRandom;
|
|
80
|
+
return { connect: (source, key) => Effect.map(wireSenders(source.rpcs), (senders) => wireClient({
|
|
81
|
+
random,
|
|
82
|
+
senders,
|
|
83
|
+
source
|
|
84
|
+
}, key)) };
|
|
85
|
+
}));
|
|
86
|
+
static clientOf(source) {
|
|
87
|
+
return (key) => ActorClients.use((clients) => clients.connect(source, key));
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
export { ActorClients };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { ActorAlreadyExistsError } from "../actor/actor-already-exists.errors.mjs";
|
|
2
|
+
import { UnauthenticatedError } from "../caller/unauthenticated.errors.mjs";
|
|
3
|
+
import { LiveUpdate } from "./actor-rpc.contract.mjs";
|
|
4
|
+
import { ActorDefinition } from "../actor/actor.contract.mjs";
|
|
5
|
+
import { AnyCommand, AnyQuery } from "../command/command.contract.mjs";
|
|
6
|
+
import { HostedFailure } from "../hosted/hosted-failure.schema.mjs";
|
|
7
|
+
import "./client-failure.contract.mjs";
|
|
8
|
+
import { Effect, Schema, Stream } from "effect";
|
|
9
|
+
import { RpcClientError } from "effect/rpc";
|
|
10
|
+
type ClientFailure<Declaration extends AnyCommand | AnyQuery> = Declaration["error"]["Type"] | RpcClientError.RpcClientError | UnauthenticatedError | (typeof HostedFailure)["Type"];
|
|
11
|
+
type ClientCall<Declaration extends AnyCommand | AnyQuery> = (payload: Declaration["payload"]["Type"]) => Effect.Effect<Declaration["success"]["Type"], ClientFailure<Declaration>>;
|
|
12
|
+
type QueryClient<Declaration extends AnyQuery> = ClientCall<Declaration> & {
|
|
13
|
+
readonly subscribe: (payload: Declaration["payload"]["Type"]) => Stream.Stream<LiveUpdate<Declaration["success"]["Type"]>, ClientFailure<Declaration>>;
|
|
14
|
+
};
|
|
15
|
+
type StateFailure = RpcClientError.RpcClientError | UnauthenticatedError | (typeof HostedFailure)["Type"];
|
|
16
|
+
type CreationClient<Definition extends ActorDefinition> = Definition["create"] extends Schema.Never ? unknown : {
|
|
17
|
+
readonly create: (input: Definition["create"]["Type"]) => Effect.Effect<void, ActorAlreadyExistsError | StateFailure>;
|
|
18
|
+
readonly ensure: (input: Definition["create"]["Type"]) => Effect.Effect<void, StateFailure>;
|
|
19
|
+
};
|
|
20
|
+
type ForkClientFailure = ActorAlreadyExistsError | StateFailure;
|
|
21
|
+
type ActorClient<Definition extends ActorDefinition> = { readonly [Member in keyof Definition["commands"]]: ClientCall<Definition["commands"][Member]>; } & { readonly [Member in keyof Definition["queries"]]: QueryClient<Definition["queries"][Member]>; } & {
|
|
22
|
+
/**
|
|
23
|
+
* Forks this actor into a new one at `into`, with this actor's state and files at one cut and nothing in flight
|
|
24
|
+
* (ADR 0017), and answers the copy's client. A retried fork makes one copy.
|
|
25
|
+
*/
|
|
26
|
+
readonly fork: (into: Definition["key"]["Type"]) => Effect.Effect<ActorClient<Definition>, ForkClientFailure>;
|
|
27
|
+
readonly state: Stream.Stream<LiveUpdate<Definition["state"]["Type"]>, StateFailure>;
|
|
28
|
+
readonly warm: Effect.Effect<void, StateFailure>;
|
|
29
|
+
} & CreationClient<Definition>;
|
|
30
|
+
export type { ActorClient, QueryClient };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { KeySchema } from "../actor/actor.contract.mjs";
|
|
2
|
+
import { Authentication } from "../caller/authentication.api.mjs";
|
|
3
|
+
import { CommandId } from "../command/command-id.schema.mjs";
|
|
4
|
+
import { PlainSchema } from "../command/command.contract.mjs";
|
|
5
|
+
import { ComputerRpc, computerRpcsOf } from "../computer/rpc/computer-rpc.contract.mjs";
|
|
6
|
+
import { FileRpc, FileTag, fileRpcsOf } from "../file/rpc/file-rpc.contract.mjs";
|
|
7
|
+
import { ForkRpc, forkRpcOf } from "../fork/fork-rpc.contract.mjs";
|
|
8
|
+
import { Schema } from "effect";
|
|
9
|
+
import { Rpc, RpcGroup, RpcSchema } from "effect/rpc";
|
|
10
|
+
type ActorRpc = Rpc.Rpc<`${string}/${string}`, Schema.Struct<{
|
|
11
|
+
readonly commandId: typeof CommandId;
|
|
12
|
+
readonly key: KeySchema;
|
|
13
|
+
readonly payload: PlainSchema;
|
|
14
|
+
}>, PlainSchema, PlainSchema, typeof Authentication> | Rpc.Rpc<`${string}/${string}`, Schema.Struct<{
|
|
15
|
+
readonly key: KeySchema;
|
|
16
|
+
readonly payload: PlainSchema;
|
|
17
|
+
}>, PlainSchema, PlainSchema, typeof Authentication> | Rpc.Rpc<`${string}/warm`, Schema.Struct<{
|
|
18
|
+
readonly key: KeySchema;
|
|
19
|
+
}>, typeof Schema.Void, PlainSchema, typeof Authentication> | Rpc.Rpc<`${string}/${string}/subscribe`, Schema.Struct<{
|
|
20
|
+
readonly key: KeySchema;
|
|
21
|
+
readonly payload: PlainSchema;
|
|
22
|
+
}>, RpcSchema.Stream<PlainSchema, PlainSchema>, typeof Schema.Never, typeof Authentication> | Rpc.Rpc<`${string}/${string}/subscribe`, Schema.Struct<{
|
|
23
|
+
readonly key: KeySchema;
|
|
24
|
+
}>, RpcSchema.Stream<PlainSchema, PlainSchema>, typeof Schema.Never, typeof Authentication> | Rpc.AddMiddleware<FileRpc, typeof Authentication> | Rpc.AddMiddleware<ForkRpc, typeof Authentication> | Rpc.AddMiddleware<ComputerRpc, typeof Authentication>;
|
|
25
|
+
type ActorRpcs = RpcGroup.RpcGroup<ActorRpc>;
|
|
26
|
+
type CreationMode = "create" | "ensure";
|
|
27
|
+
declare const creationErrors: Readonly<Record<CreationMode, PlainSchema>>;
|
|
28
|
+
declare const creationModesOf: (create: PlainSchema) => readonly CreationMode[];
|
|
29
|
+
interface LiveUpdate<Value> {
|
|
30
|
+
readonly value: Value;
|
|
31
|
+
readonly version: number;
|
|
32
|
+
}
|
|
33
|
+
export { type ActorRpc, type ActorRpcs, type CreationMode, type FileTag, type LiveUpdate, computerRpcsOf, creationErrors, creationModesOf, fileRpcsOf, forkRpcOf };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ActorAlreadyExistsError } from "../actor/actor-already-exists.errors.mjs";
|
|
2
|
+
import { fileRpcsOf } from "../file/rpc/file-rpc.contract.mjs";
|
|
3
|
+
import { forkRpcOf } from "../fork/fork-rpc.contract.mjs";
|
|
4
|
+
import { computerRpcsOf } from "../computer/rpc/computer-rpc.contract.mjs";
|
|
5
|
+
import { Schema, SchemaAST } from "effect";
|
|
6
|
+
// src/contract/client/actor-rpc.contract.ts
|
|
7
|
+
const creationModes = ["create", "ensure"];
|
|
8
|
+
const creationErrors = {
|
|
9
|
+
create: ActorAlreadyExistsError,
|
|
10
|
+
ensure: Schema.Never
|
|
11
|
+
};
|
|
12
|
+
const creationModesOf = (create) => {
|
|
13
|
+
if (SchemaAST.isNever(create.ast)) return [];
|
|
14
|
+
return creationModes;
|
|
15
|
+
};
|
|
16
|
+
export { computerRpcsOf, creationErrors, creationModesOf, fileRpcsOf, forkRpcOf };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
declare const ActorUnavailableError_base: Schema.Class<ActorUnavailableError, Schema.TaggedStruct<"ActorUnavailableError", {
|
|
3
|
+
readonly actor: Schema.String;
|
|
4
|
+
readonly message: Schema.String;
|
|
5
|
+
}>, import("effect/Cause").YieldableError & {
|
|
6
|
+
readonly brand: unique symbol;
|
|
7
|
+
}>;
|
|
8
|
+
export declare class ActorUnavailableError extends ActorUnavailableError_base {}
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
// src/contract/client/actor-unavailable.errors.ts
|
|
3
|
+
var ActorUnavailableError = class extends Schema.TaggedError()("ActorUnavailableError", {
|
|
4
|
+
actor: Schema.String,
|
|
5
|
+
message: Schema.String
|
|
6
|
+
}) {};
|
|
7
|
+
export { ActorUnavailableError };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ActorAlreadyExistsError } from "../actor/actor-already-exists.errors.mjs";
|
|
2
|
+
import { ActorErasedError } from "../actor/actor-erased.errors.mjs";
|
|
3
|
+
import { ActorNotCreatedError } from "../actor/actor-not-created.errors.mjs";
|
|
4
|
+
import { ActorUnavailableError } from "./actor-unavailable.errors.mjs";
|
|
5
|
+
import { CallerNotAllowedError } from "../caller/caller-not-allowed.errors.mjs";
|
|
6
|
+
import { UnauthenticatedError } from "../caller/unauthenticated.errors.mjs";
|
|
7
|
+
import { CommandIdExpiredError } from "../command/command-id-expired.errors.mjs";
|
|
8
|
+
import { HandlerFailedError } from "../hosted/handler-failed.errors.mjs";
|
|
9
|
+
import { InvalidRequestError } from "./invalid-request.errors.mjs";
|
|
10
|
+
import { BillingUnavailableError } from "../spend/billing-unavailable.errors.mjs";
|
|
11
|
+
import { SpendCapReachedError } from "../spend/spend-cap-reached.errors.mjs";
|
|
12
|
+
import { StorageLimitError } from "./storage-limit.errors.mjs";
|
|
13
|
+
import { BlobTransferError } from "../file/blob-transfer.errors.mjs";
|
|
14
|
+
import { CheckpointExpiredError } from "../computer/checkpoint-expired.errors.mjs";
|
|
15
|
+
import { ComputerHeldError } from "../computer/computer-held.errors.mjs";
|
|
16
|
+
import { ComputerLimitError } from "../computer/computer-limit.errors.mjs";
|
|
17
|
+
import { ComputerLostError } from "../computer/computer-lost.errors.mjs";
|
|
18
|
+
import { ComputerNotFoundError } from "../computer/computer-not-found.errors.mjs";
|
|
19
|
+
import { ComputersUnavailableError } from "../computer/computers-unavailable.errors.mjs";
|
|
20
|
+
import { StepNotFoundError } from "../computer/step/step-not-found.errors.mjs";
|
|
21
|
+
import { FileAccessDeniedError } from "../file/access/file-access-denied.errors.mjs";
|
|
22
|
+
import { FileNotFoundError } from "../file/file-not-found.errors.mjs";
|
|
23
|
+
import { FileTooLargeError } from "../file/rpc/file-too-large.errors.mjs";
|
|
24
|
+
import { FilesUnavailableError } from "../file/files-unavailable.errors.mjs";
|
|
25
|
+
import { InvalidFileRequestError } from "../file/invalid-file-request.errors.mjs";
|
|
26
|
+
import { InvalidSecretNameError } from "../secret/invalid-secret-name.errors.mjs";
|
|
27
|
+
import { SecretUnavailableError } from "../secret/secret-unavailable.errors.mjs";
|
|
28
|
+
export { ActorAlreadyExistsError, ActorErasedError, ActorNotCreatedError, ActorUnavailableError, BillingUnavailableError, BlobTransferError, CallerNotAllowedError, CheckpointExpiredError, CommandIdExpiredError, ComputerHeldError, ComputerLimitError, ComputerLostError, ComputerNotFoundError, ComputersUnavailableError, FileAccessDeniedError, FileNotFoundError, FileTooLargeError, FilesUnavailableError, HandlerFailedError, InvalidFileRequestError, InvalidRequestError, InvalidSecretNameError, SecretUnavailableError, SpendCapReachedError, StepNotFoundError, StorageLimitError, UnauthenticatedError };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ActorAlreadyExistsError } from "../actor/actor-already-exists.errors.mjs";
|
|
2
|
+
import { ActorErasedError } from "../actor/actor-erased.errors.mjs";
|
|
3
|
+
import { ActorNotCreatedError } from "../actor/actor-not-created.errors.mjs";
|
|
4
|
+
import { ActorUnavailableError } from "./actor-unavailable.errors.mjs";
|
|
5
|
+
import { CallerNotAllowedError } from "../caller/caller-not-allowed.errors.mjs";
|
|
6
|
+
import { UnauthenticatedError } from "../caller/unauthenticated.errors.mjs";
|
|
7
|
+
import { CommandIdExpiredError } from "../command/command-id-expired.errors.mjs";
|
|
8
|
+
import { HandlerFailedError } from "../hosted/handler-failed.errors.mjs";
|
|
9
|
+
import { InvalidRequestError } from "./invalid-request.errors.mjs";
|
|
10
|
+
import { BillingUnavailableError } from "../spend/billing-unavailable.errors.mjs";
|
|
11
|
+
import { SpendCapReachedError } from "../spend/spend-cap-reached.errors.mjs";
|
|
12
|
+
import { StorageLimitError } from "./storage-limit.errors.mjs";
|
|
13
|
+
import { BlobTransferError } from "../file/blob-transfer.errors.mjs";
|
|
14
|
+
import { CheckpointExpiredError } from "../computer/checkpoint-expired.errors.mjs";
|
|
15
|
+
import { ComputerHeldError } from "../computer/computer-held.errors.mjs";
|
|
16
|
+
import { ComputerLimitError } from "../computer/computer-limit.errors.mjs";
|
|
17
|
+
import { ComputerLostError } from "../computer/computer-lost.errors.mjs";
|
|
18
|
+
import { ComputerNotFoundError } from "../computer/computer-not-found.errors.mjs";
|
|
19
|
+
import { ComputersUnavailableError } from "../computer/computers-unavailable.errors.mjs";
|
|
20
|
+
import { StepNotFoundError } from "../computer/step/step-not-found.errors.mjs";
|
|
21
|
+
import { FileAccessDeniedError } from "../file/access/file-access-denied.errors.mjs";
|
|
22
|
+
import { FileNotFoundError } from "../file/file-not-found.errors.mjs";
|
|
23
|
+
import { FileTooLargeError } from "../file/rpc/file-too-large.errors.mjs";
|
|
24
|
+
import { FilesUnavailableError } from "../file/files-unavailable.errors.mjs";
|
|
25
|
+
import { InvalidFileRequestError } from "../file/invalid-file-request.errors.mjs";
|
|
26
|
+
import { InvalidSecretNameError } from "../secret/invalid-secret-name.errors.mjs";
|
|
27
|
+
import { SecretUnavailableError } from "../secret/secret-unavailable.errors.mjs";
|
|
28
|
+
export { ActorAlreadyExistsError, ActorErasedError, ActorNotCreatedError, ActorUnavailableError, BillingUnavailableError, BlobTransferError, CallerNotAllowedError, CheckpointExpiredError, CommandIdExpiredError, ComputerHeldError, ComputerLimitError, ComputerLostError, ComputerNotFoundError, ComputersUnavailableError, FileAccessDeniedError, FileNotFoundError, FileTooLargeError, FilesUnavailableError, HandlerFailedError, InvalidFileRequestError, InvalidRequestError, InvalidSecretNameError, SecretUnavailableError, SpendCapReachedError, StepNotFoundError, StorageLimitError, UnauthenticatedError };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
declare const InvalidRequestError_base: Schema.Class<InvalidRequestError, Schema.TaggedStruct<"InvalidRequestError", {
|
|
3
|
+
readonly actor: Schema.String;
|
|
4
|
+
readonly message: Schema.String;
|
|
5
|
+
}>, import("effect/Cause").YieldableError & {
|
|
6
|
+
readonly brand: unique symbol;
|
|
7
|
+
}>;
|
|
8
|
+
export declare class InvalidRequestError extends InvalidRequestError_base {}
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
declare const StorageLimitError_base: Schema.Class<StorageLimitError, Schema.TaggedStruct<"StorageLimitError", {
|
|
3
|
+
readonly actor: Schema.String;
|
|
4
|
+
readonly ceilingBytes: Schema.Finite;
|
|
5
|
+
readonly dataBytes: Schema.Finite;
|
|
6
|
+
readonly readAt: Schema.Int;
|
|
7
|
+
}>, import("effect/Cause").YieldableError & {
|
|
8
|
+
readonly brand: unique symbol;
|
|
9
|
+
}>;
|
|
10
|
+
/**
|
|
11
|
+
* Akter Cloud refused a write because the app environment's stored data reached its ceiling: `dataBytes` of
|
|
12
|
+
* `ceilingBytes`, as read from storage at `readAt` (epoch milliseconds). Nothing ran. Queries and downloads still
|
|
13
|
+
* work; a write succeeds again once data is removed or the ceiling is raised.
|
|
14
|
+
*/
|
|
15
|
+
export declare class StorageLimitError extends StorageLimitError_base {}
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
// src/contract/client/storage-limit.errors.ts
|
|
3
|
+
/**
|
|
4
|
+
* Akter Cloud refused a write because the app environment's stored data reached its ceiling: `dataBytes` of
|
|
5
|
+
* `ceilingBytes`, as read from storage at `readAt` (epoch milliseconds). Nothing ran. Queries and downloads still
|
|
6
|
+
* work; a write succeeds again once data is removed or the ceiling is raised.
|
|
7
|
+
*/
|
|
8
|
+
var StorageLimitError = class extends Schema.TaggedError()("StorageLimitError", {
|
|
9
|
+
actor: Schema.String,
|
|
10
|
+
ceilingBytes: Schema.Finite,
|
|
11
|
+
dataBytes: Schema.Finite,
|
|
12
|
+
readAt: Schema.Int
|
|
13
|
+
}) {};
|
|
14
|
+
export { StorageLimitError };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
declare const CommandIdExpiredError_base: Schema.Class<CommandIdExpiredError, Schema.TaggedStruct<"CommandIdExpiredError", {
|
|
3
|
+
readonly actor: Schema.String;
|
|
4
|
+
readonly commandId: Schema.String;
|
|
5
|
+
readonly keptSince: Schema.Int;
|
|
6
|
+
readonly mintedAt: Schema.Int;
|
|
7
|
+
}>, import("effect/Cause").YieldableError & {
|
|
8
|
+
readonly brand: unique symbol;
|
|
9
|
+
}>;
|
|
10
|
+
export declare class CommandIdExpiredError extends CommandIdExpiredError_base {}
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
// src/contract/command/command-id-expired.errors.ts
|
|
3
|
+
var CommandIdExpiredError = class extends Schema.TaggedError()("CommandIdExpiredError", {
|
|
4
|
+
actor: Schema.String,
|
|
5
|
+
commandId: Schema.String,
|
|
6
|
+
keptSince: Schema.Int,
|
|
7
|
+
mintedAt: Schema.Int
|
|
8
|
+
}) {};
|
|
9
|
+
export { CommandIdExpiredError };
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { Context, Duration, Effect, Exit, Option, Schema } from "effect";
|
|
2
|
+
import { Workflow } from "effect/workflow";
|
|
3
|
+
type PlainSchema = Schema.Top & {
|
|
4
|
+
readonly DecodingServices: never;
|
|
5
|
+
readonly EncodingServices: never;
|
|
6
|
+
};
|
|
7
|
+
type PlainFields = Readonly<Record<PropertyKey, PlainSchema>>;
|
|
8
|
+
type Declared = PlainFields | PlainSchema;
|
|
9
|
+
type DeclaredSchema<Input extends Declared> = Input extends PlainFields ? Schema.Struct<Input> : Input;
|
|
10
|
+
interface Command<Payload extends PlainSchema, Success extends PlainSchema, Failure extends PlainSchema, Kinds extends string = string> {
|
|
11
|
+
readonly callers: Option.Option<readonly Kinds[]>;
|
|
12
|
+
readonly error: Failure;
|
|
13
|
+
readonly payload: Payload;
|
|
14
|
+
readonly success: Success;
|
|
15
|
+
}
|
|
16
|
+
interface Query<Payload extends PlainSchema, Success extends PlainSchema, Failure extends PlainSchema, Kinds extends string = string> extends Command<Payload, Success, Failure, Kinds> {
|
|
17
|
+
/** How old an answer may be when no `atLeast` asks for newer; none means every answer is fresh. */
|
|
18
|
+
readonly staleFor: Option.Option<Duration.Duration>;
|
|
19
|
+
}
|
|
20
|
+
type AnyCommand = Command<PlainSchema, PlainSchema, PlainSchema>;
|
|
21
|
+
type AnyQuery = Query<PlainSchema, PlainSchema, PlainSchema>;
|
|
22
|
+
interface DeclarationOptions {
|
|
23
|
+
readonly callers?: readonly string[];
|
|
24
|
+
readonly error?: PlainSchema;
|
|
25
|
+
readonly payload?: Declared;
|
|
26
|
+
readonly success?: PlainSchema;
|
|
27
|
+
}
|
|
28
|
+
interface QueryOptions extends DeclarationOptions {
|
|
29
|
+
/**
|
|
30
|
+
* How old an answer to this query may be. A read is at most `staleFor` old, and never older than the version the
|
|
31
|
+
* caller's `atLeast` names, so a caller reads its own writes. An engine may always answer fresher. Without it, every
|
|
32
|
+
* answer is fresh.
|
|
33
|
+
*/
|
|
34
|
+
readonly staleFor?: Duration.Input;
|
|
35
|
+
}
|
|
36
|
+
type PayloadOf<Options extends DeclarationOptions> = Options extends {
|
|
37
|
+
readonly payload: infer Input extends Declared;
|
|
38
|
+
} ? DeclaredSchema<Input> : Schema.Void;
|
|
39
|
+
type SuccessOf<Options extends DeclarationOptions> = Options extends {
|
|
40
|
+
readonly success: infer Success extends PlainSchema;
|
|
41
|
+
} ? Success : Schema.Void;
|
|
42
|
+
type ErrorOf<Options extends DeclarationOptions> = Options extends {
|
|
43
|
+
readonly error: infer Failure extends PlainSchema;
|
|
44
|
+
} ? Failure : Schema.Never;
|
|
45
|
+
type KindsOf<Options extends DeclarationOptions> = Options extends {
|
|
46
|
+
readonly callers: readonly (infer Kinds extends string)[];
|
|
47
|
+
} ? Kinds : never;
|
|
48
|
+
declare function declaredSchema<Input extends Declared>(input: Input): DeclaredSchema<Input>;
|
|
49
|
+
declare function command<const Options extends DeclarationOptions>(options?: Options): Command<PayloadOf<Options>, SuccessOf<Options>, ErrorOf<Options>, KindsOf<Options>>;
|
|
50
|
+
declare function query<const Options extends QueryOptions>(options?: Options): Query<PayloadOf<Options>, SuccessOf<Options>, ErrorOf<Options>, KindsOf<Options>>;
|
|
51
|
+
interface JobOptions {
|
|
52
|
+
readonly error?: PlainSchema;
|
|
53
|
+
readonly payload: PlainFields;
|
|
54
|
+
/**
|
|
55
|
+
* Named changes to the job's code. A job started while its contract declares a patch sees it with `Akter.patched`
|
|
56
|
+
* for its whole run; a job started before the patch existed doesn't, even after a deploy adds it.
|
|
57
|
+
*/
|
|
58
|
+
readonly patches?: readonly string[];
|
|
59
|
+
readonly success?: PlainSchema;
|
|
60
|
+
}
|
|
61
|
+
interface Job<Fields extends PlainFields, Success extends PlainSchema, Failure extends PlainSchema, Patch extends string = never> {
|
|
62
|
+
readonly error: Failure;
|
|
63
|
+
readonly patches: readonly Patch[];
|
|
64
|
+
readonly payload: Fields;
|
|
65
|
+
readonly success: Success;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* How the host reads and writes a job's payload and result. The host reads only the decoders and `encodeResult`
|
|
69
|
+
* (host interface item 2); `startedPayload` is the bundle's own, which `Akter.start` encodes with.
|
|
70
|
+
*/
|
|
71
|
+
interface JobCodecs {
|
|
72
|
+
readonly decodePayload: (text: string) => Effect.Effect<unknown, Schema.SchemaError>;
|
|
73
|
+
readonly decodeResult: (text: string) => Effect.Effect<Exit.Exit<unknown, unknown>, Schema.SchemaError>;
|
|
74
|
+
readonly encodeResult: (exit: Exit.Exit<unknown, unknown>) => Effect.Effect<string, Schema.SchemaError>;
|
|
75
|
+
/** The declared payload, encoded as the journal keeps it: with the patches the job declares, when it declares any. */
|
|
76
|
+
readonly startedPayload?: Schema.Codec<unknown, string>;
|
|
77
|
+
}
|
|
78
|
+
type AnyJob = Job<PlainFields, PlainSchema, PlainSchema, string>;
|
|
79
|
+
type PatchesOf<Options extends JobOptions> = Options extends {
|
|
80
|
+
readonly patches: readonly (infer Patch extends string)[];
|
|
81
|
+
} ? Patch : never;
|
|
82
|
+
type Jobs = Readonly<Record<string, AnyJob>>;
|
|
83
|
+
type NoJobs = Readonly<Record<string, never>>;
|
|
84
|
+
type JobWorkflow<Tag extends string, Declaring extends AnyJob> = Workflow.Workflow<Tag, Schema.Struct<Declaring["payload"]>, Declaring["success"], Declaring["error"]> & {
|
|
85
|
+
/** The patches the job's contract declares now. */
|
|
86
|
+
readonly patches: Declaring["patches"];
|
|
87
|
+
/**
|
|
88
|
+
* Inside the job's run: whether the code that started this run declared `name`. Gate a change to the job's code
|
|
89
|
+
* with it while jobs started before the change are still in flight.
|
|
90
|
+
*/
|
|
91
|
+
readonly patched: (name: Declaring["patches"][number]) => Effect.Effect<boolean>;
|
|
92
|
+
};
|
|
93
|
+
type ActorJobs<Name extends string, Declaring extends Jobs> = { readonly [Member in keyof Declaring & string]: JobWorkflow<`${Name}/${Member}`, Declaring[Member]>; };
|
|
94
|
+
interface StartableJob {
|
|
95
|
+
readonly _tag: string;
|
|
96
|
+
readonly annotations: Context.Context<never>;
|
|
97
|
+
readonly payloadSchema: PlainSchema;
|
|
98
|
+
}
|
|
99
|
+
interface Tagging {
|
|
100
|
+
readonly actor: string;
|
|
101
|
+
readonly member: string;
|
|
102
|
+
}
|
|
103
|
+
interface DeclaredJobs<Name extends string, Declaring extends Jobs> {
|
|
104
|
+
readonly jobs: Declaring;
|
|
105
|
+
readonly name: Name;
|
|
106
|
+
}
|
|
107
|
+
declare const JobCodecsOf: Context.Reference<Option.Option<JobCodecs>>;
|
|
108
|
+
declare function job<const Options extends JobOptions>(options: Options): Job<Options["payload"], SuccessOf<Options>, ErrorOf<Options>, PatchesOf<Options>>;
|
|
109
|
+
declare const jobTag: ({ actor, member }: Tagging) => string;
|
|
110
|
+
declare const jobResult: ({ error, success }: Pick<AnyJob, "error" | "success">) => Schema.Exit<PlainSchema, PlainSchema, Schema.Defect>;
|
|
111
|
+
/**
|
|
112
|
+
* A job's payload as its journal keeps it: the declared fields, plus the patches the starting code declared under
|
|
113
|
+
* `patchesKey` when it declared any. Code that predates patches ignores the extra key, so a rollback still reads it.
|
|
114
|
+
*/
|
|
115
|
+
declare const jobCodecs: (declared: AnyJob) => JobCodecs;
|
|
116
|
+
declare function jobsOf<Name extends string, Declaring extends Jobs>(declaring: DeclaredJobs<Name, Declaring>): ActorJobs<Name, Declaring>;
|
|
117
|
+
export { type ActorJobs, type AnyCommand, type AnyJob, type AnyQuery, type Command, type DeclarationOptions, type Declared, type DeclaredSchema, type Job, type JobCodecs, JobCodecsOf, type JobOptions, type JobWorkflow, type Jobs, type NoJobs, type PatchesOf, type PlainFields, type PlainSchema, type Query, type QueryOptions, type StartableJob, command, declaredSchema, job, jobCodecs, jobResult, jobTag, jobsOf, query };
|