@akterjs/effect 0.0.0-stage → 0.1.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/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,91 @@
|
|
|
1
|
+
import { ActorSecrets } from "../contract/secret/actor-secrets.adapter.mjs";
|
|
2
|
+
import { JobComputers } from "../host/computer/job-computers.service.mjs";
|
|
3
|
+
import { JobEngine } from "../host/job/job-engine.adapter.mjs";
|
|
4
|
+
import { Akter as Akter$1 } from "../contract/akter.service.mjs";
|
|
5
|
+
import { ActorHost } from "../serve/engine/actor-host.service.mjs";
|
|
6
|
+
import { ActorsNotHostedError } from "../serve/engine/actors-not-hosted.errors.mjs";
|
|
7
|
+
import { ListenerNotLoopbackError } from "../serve/rpc/listener-not-loopback.errors.mjs";
|
|
8
|
+
import { ServeOptions } from "../serve/rpc/akter-server.layer.mjs";
|
|
9
|
+
import { environments, historyRetention, local, migrate } from "./akter-local.layer.mjs";
|
|
10
|
+
import { ActorJournal, HistoryOptions } from "../contract/history/actor-journal.service.mjs";
|
|
11
|
+
import { Branching, LocalEnvironments } from "../serve/environment/local-environments.service.mjs";
|
|
12
|
+
import { Snapshotting } from "../serve/environment/snapshot-operations.sql.mjs";
|
|
13
|
+
import { EnvironmentName, LocalEnvironment, LocalSnapshot, Promotion, SnapshotName } from "../serve/environment/local-environment.schema.mjs";
|
|
14
|
+
import { AlreadyExistsError } from "../serve/environment/environment-already-exists.errors.mjs";
|
|
15
|
+
import { InUseError } from "../serve/environment/environment-in-use.errors.mjs";
|
|
16
|
+
import { NotFoundError } from "../serve/environment/environment-not-found.errors.mjs";
|
|
17
|
+
import { LocalActorEngineServices } from "./local-actor-engine.layer.mjs";
|
|
18
|
+
import { HostedAppBuildError } from "../serve/hosted/hosted-app-build.errors.mjs";
|
|
19
|
+
import { MigrationHasher } from "../host/migration/migration-hasher.adapter.mjs";
|
|
20
|
+
import { ActorAlreadyExistsError } from "../contract/actor/actor-already-exists.errors.mjs";
|
|
21
|
+
import { ActorErasedError } from "../contract/actor/actor-erased.errors.mjs";
|
|
22
|
+
import { ActorNotCreatedError } from "../contract/actor/actor-not-created.errors.mjs";
|
|
23
|
+
import { ActorNotRegisteredError } from "../contract/actor/actor-not-registered.errors.mjs";
|
|
24
|
+
import { ActorUnavailableError } from "../contract/client/actor-unavailable.errors.mjs";
|
|
25
|
+
import { CallerNotAllowedError } from "../contract/caller/caller-not-allowed.errors.mjs";
|
|
26
|
+
import { CommandIdExpiredError } from "../contract/command/command-id-expired.errors.mjs";
|
|
27
|
+
import { CheckpointExpiredError } from "../contract/computer/checkpoint-expired.errors.mjs";
|
|
28
|
+
import { ComputerHeldError } from "../contract/computer/computer-held.errors.mjs";
|
|
29
|
+
import { HistoryEntry, RecordedCommand, UnreadableCommand } from "../contract/history/history-entry.pure.mjs";
|
|
30
|
+
import { ComputerLimitError } from "../contract/computer/computer-limit.errors.mjs";
|
|
31
|
+
import { ComputerLostError } from "../contract/computer/computer-lost.errors.mjs";
|
|
32
|
+
import { ComputerNotFoundError } from "../contract/computer/computer-not-found.errors.mjs";
|
|
33
|
+
import { ComputersUnavailableError } from "../contract/computer/computers-unavailable.errors.mjs";
|
|
34
|
+
import { StepNotFoundError } from "../contract/computer/step/step-not-found.errors.mjs";
|
|
35
|
+
import { FileAccessDeniedError } from "../contract/file/access/file-access-denied.errors.mjs";
|
|
36
|
+
import { FileNotFoundError } from "../contract/file/file-not-found.errors.mjs";
|
|
37
|
+
import { FileTooLargeError } from "../contract/file/rpc/file-too-large.errors.mjs";
|
|
38
|
+
import { BlobTransferError } from "../contract/file/blob-transfer.errors.mjs";
|
|
39
|
+
import { FilesUnavailableError } from "../contract/file/files-unavailable.errors.mjs";
|
|
40
|
+
import { HandlerFailedError } from "../contract/hosted/handler-failed.errors.mjs";
|
|
41
|
+
import { InvalidFileRequestError } from "../contract/file/invalid-file-request.errors.mjs";
|
|
42
|
+
import { InvalidRequestError } from "../contract/client/invalid-request.errors.mjs";
|
|
43
|
+
import { BillingUnavailableError } from "../contract/spend/billing-unavailable.errors.mjs";
|
|
44
|
+
import { SpendCapReachedError } from "../contract/spend/spend-cap-reached.errors.mjs";
|
|
45
|
+
import { StorageLimitError } from "../contract/client/storage-limit.errors.mjs";
|
|
46
|
+
import { ReservedMemberError } from "../contract/actor/reserved-member.errors.mjs";
|
|
47
|
+
import { ServedActor } from "../serve/rpc/actor-rpc.handlers.mjs";
|
|
48
|
+
import { ReservedPayloadFieldError } from "../contract/job/reserved-payload-field.errors.mjs";
|
|
49
|
+
import { StateUnreadableError } from "../contract/state/state-unreadable.errors.mjs";
|
|
50
|
+
import { InvalidSecretNameError } from "../contract/secret/invalid-secret-name.errors.mjs";
|
|
51
|
+
import { SecretUnavailableError } from "../contract/secret/secret-unavailable.errors.mjs";
|
|
52
|
+
import { UnauthenticatedError } from "../contract/caller/unauthenticated.errors.mjs";
|
|
53
|
+
import { CommandRejectedError } from "../host/command/command-rejected.errors.mjs";
|
|
54
|
+
import { LayoutVersionError } from "../host/layout/layout-version.errors.mjs";
|
|
55
|
+
import { MigrationEditedError } from "../host/migration/migration-edited.errors.mjs";
|
|
56
|
+
import { MigrationFailedError } from "../host/migration/migration-failed.errors.mjs";
|
|
57
|
+
import { localClient } from "../serve/rpc/in-process-client.layer.mjs";
|
|
58
|
+
import { MigrationMissingError } from "../host/migration/migration-missing.errors.mjs";
|
|
59
|
+
import { ReservedNameError } from "../host/actor/reserved-name.errors.mjs";
|
|
60
|
+
import { HistoryPrunedError } from "../host/command/history-pruned.errors.mjs";
|
|
61
|
+
import { CommandIdReusedError } from "../host/command/command-id-reused.errors.mjs";
|
|
62
|
+
import { ReplayCursorStalledError } from "../host/command/replay/replay-cursor-stalled.errors.mjs";
|
|
63
|
+
import { ActorNotMigratedError } from "../serve/store/actor-not-migrated.errors.mjs";
|
|
64
|
+
import { StoreUnreadableError } from "../serve/store/store-unreadable.errors.mjs";
|
|
65
|
+
import { ReplaySource, Verify, VerifyFailure } from "../serve/verify/verify.layer.mjs";
|
|
66
|
+
import { JournalPoint, ReplayDifference, ReplayFailure, ReplayReport, ReplayWindow, ReplayedOutcome } from "../host/command/command-replay.service.mjs";
|
|
67
|
+
import { LocalMigration, MigratedActor } from "../serve/store/store-migrations.service.mjs";
|
|
68
|
+
import { Layer } from "effect";
|
|
69
|
+
import { HttpServer, HttpServerError } from "effect/http";
|
|
70
|
+
interface InspectorOptions {
|
|
71
|
+
readonly allowedHosts?: readonly string[] | true;
|
|
72
|
+
readonly directory: string;
|
|
73
|
+
readonly port?: number;
|
|
74
|
+
}
|
|
75
|
+
export declare class Akter extends Akter$1 {
|
|
76
|
+
/** A data directory's environments and snapshots, read and changed without running an engine on it. */
|
|
77
|
+
static readonly environments: typeof environments;
|
|
78
|
+
static readonly historyRetention: typeof historyRetention;
|
|
79
|
+
/**
|
|
80
|
+
* The local engine's job runtime. Provide it under an app layer whose job handlers need the `WorkflowEngine`,
|
|
81
|
+
* beside `Akter.local`, so the handlers register on the engine that runs their jobs:
|
|
82
|
+
* `Akter.local(directory).pipe(Layer.provide(app.layer), Layer.provide(Akter.jobs))`.
|
|
83
|
+
*/
|
|
84
|
+
static readonly jobs: Layer.Layer<ActorSecrets | JobComputers | JobEngine | import("effect/workflow/WorkflowEngine").WorkflowEngine, never, never>;
|
|
85
|
+
static readonly local: typeof local;
|
|
86
|
+
static readonly localClient: typeof localClient;
|
|
87
|
+
static inspector(options: InspectorOptions): Layer.Layer<HttpServer.HttpServer, HttpServerError.ServeError>;
|
|
88
|
+
static readonly migrate: typeof migrate;
|
|
89
|
+
static serve<const Actors extends readonly ServedActor[]>(options: ServeOptions<Actors>): Layer.Layer<HttpServer.HttpServer, ActorsNotHostedError | HttpServerError.ServeError | ListenerNotLoopbackError, ActorHost>;
|
|
90
|
+
}
|
|
91
|
+
export { ActorAlreadyExistsError, ActorErasedError, ActorHost, ActorJournal, ActorNotCreatedError, ActorNotMigratedError, ActorNotRegisteredError, ActorUnavailableError, ActorsNotHostedError, AlreadyExistsError, BillingUnavailableError, BlobTransferError, type Branching, CallerNotAllowedError, CheckpointExpiredError, CommandIdExpiredError, CommandIdReusedError, CommandRejectedError, ComputerHeldError, ComputerLimitError, ComputerLostError, ComputerNotFoundError, ComputersUnavailableError, EnvironmentName, FileAccessDeniedError, FileNotFoundError, FileTooLargeError, FilesUnavailableError, HandlerFailedError, type HistoryEntry, type HistoryOptions, HistoryPrunedError, HostedAppBuildError, InUseError, InvalidFileRequestError, InvalidRequestError, InvalidSecretNameError, type JournalPoint, LayoutVersionError, ListenerNotLoopbackError, type LocalActorEngineServices, LocalEnvironment, LocalEnvironments, type LocalMigration, LocalSnapshot, type MigratedActor, MigrationEditedError, MigrationFailedError, MigrationHasher, MigrationMissingError, NotFoundError, Promotion, type RecordedCommand, ReplayCursorStalledError, type ReplayDifference, type ReplayFailure, type ReplayReport, type ReplaySource, type ReplayWindow, type ReplayedOutcome, ReservedMemberError, ReservedNameError, ReservedPayloadFieldError, SecretUnavailableError, SnapshotName, type Snapshotting, SpendCapReachedError, StateUnreadableError, StepNotFoundError, StorageLimitError, StoreUnreadableError, UnauthenticatedError, type UnreadableCommand, Verify, type VerifyFailure };
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { Akter as Akter$1 } from "../contract/akter.service.mjs";
|
|
2
|
+
import { serveInspector } from "../serve/inspect/inspector.layer.mjs";
|
|
3
|
+
import { serve } from "../serve/rpc/akter-server.layer.mjs";
|
|
4
|
+
import { environments, historyRetention, local, migrate } from "./akter-local.layer.mjs";
|
|
5
|
+
import { httpServer } from "./http-server.layer.mjs";
|
|
6
|
+
import { ActorJournal } from "../contract/history/actor-journal.service.mjs";
|
|
7
|
+
import { LocalEnvironments } from "../serve/environment/local-environments.service.mjs";
|
|
8
|
+
import { EnvironmentName, LocalEnvironment, LocalSnapshot, Promotion, SnapshotName } from "../serve/environment/local-environment.schema.mjs";
|
|
9
|
+
import { AlreadyExistsError } from "../serve/environment/environment-already-exists.errors.mjs";
|
|
10
|
+
import { InUseError } from "../serve/environment/environment-in-use.errors.mjs";
|
|
11
|
+
import { NotFoundError } from "../serve/environment/environment-not-found.errors.mjs";
|
|
12
|
+
import { HostedAppBuildError } from "../serve/hosted/hosted-app-build.errors.mjs";
|
|
13
|
+
import { MigrationHasher } from "../host/migration/migration-hasher.adapter.mjs";
|
|
14
|
+
import { ActorAlreadyExistsError } from "../contract/actor/actor-already-exists.errors.mjs";
|
|
15
|
+
import { ActorErasedError } from "../contract/actor/actor-erased.errors.mjs";
|
|
16
|
+
import { ActorNotCreatedError } from "../contract/actor/actor-not-created.errors.mjs";
|
|
17
|
+
import { ActorNotRegisteredError } from "../contract/actor/actor-not-registered.errors.mjs";
|
|
18
|
+
import { ActorUnavailableError } from "../contract/client/actor-unavailable.errors.mjs";
|
|
19
|
+
import { CallerNotAllowedError } from "../contract/caller/caller-not-allowed.errors.mjs";
|
|
20
|
+
import { CommandIdExpiredError } from "../contract/command/command-id-expired.errors.mjs";
|
|
21
|
+
import { CheckpointExpiredError } from "../contract/computer/checkpoint-expired.errors.mjs";
|
|
22
|
+
import { ComputerHeldError } from "../contract/computer/computer-held.errors.mjs";
|
|
23
|
+
import { ComputerLimitError } from "../contract/computer/computer-limit.errors.mjs";
|
|
24
|
+
import { ComputerLostError } from "../contract/computer/computer-lost.errors.mjs";
|
|
25
|
+
import { ComputerNotFoundError } from "../contract/computer/computer-not-found.errors.mjs";
|
|
26
|
+
import { ComputersUnavailableError } from "../contract/computer/computers-unavailable.errors.mjs";
|
|
27
|
+
import { StepNotFoundError } from "../contract/computer/step/step-not-found.errors.mjs";
|
|
28
|
+
import { FileAccessDeniedError } from "../contract/file/access/file-access-denied.errors.mjs";
|
|
29
|
+
import { FileNotFoundError } from "../contract/file/file-not-found.errors.mjs";
|
|
30
|
+
import { FileTooLargeError } from "../contract/file/rpc/file-too-large.errors.mjs";
|
|
31
|
+
import { BlobTransferError } from "../contract/file/blob-transfer.errors.mjs";
|
|
32
|
+
import { FilesUnavailableError } from "../contract/file/files-unavailable.errors.mjs";
|
|
33
|
+
import { HandlerFailedError } from "../contract/hosted/handler-failed.errors.mjs";
|
|
34
|
+
import { InvalidFileRequestError } from "../contract/file/invalid-file-request.errors.mjs";
|
|
35
|
+
import { InvalidRequestError } from "../contract/client/invalid-request.errors.mjs";
|
|
36
|
+
import { BillingUnavailableError } from "../contract/spend/billing-unavailable.errors.mjs";
|
|
37
|
+
import { SpendCapReachedError } from "../contract/spend/spend-cap-reached.errors.mjs";
|
|
38
|
+
import { StorageLimitError } from "../contract/client/storage-limit.errors.mjs";
|
|
39
|
+
import { ReservedMemberError } from "../contract/actor/reserved-member.errors.mjs";
|
|
40
|
+
import { ReservedPayloadFieldError } from "../contract/job/reserved-payload-field.errors.mjs";
|
|
41
|
+
import { StateUnreadableError } from "../contract/state/state-unreadable.errors.mjs";
|
|
42
|
+
import { InvalidSecretNameError } from "../contract/secret/invalid-secret-name.errors.mjs";
|
|
43
|
+
import { SecretUnavailableError } from "../contract/secret/secret-unavailable.errors.mjs";
|
|
44
|
+
import { UnauthenticatedError } from "../contract/caller/unauthenticated.errors.mjs";
|
|
45
|
+
import { CommandRejectedError } from "../host/command/command-rejected.errors.mjs";
|
|
46
|
+
import { LayoutVersionError } from "../host/layout/layout-version.errors.mjs";
|
|
47
|
+
import { MigrationEditedError } from "../host/migration/migration-edited.errors.mjs";
|
|
48
|
+
import { MigrationFailedError } from "../host/migration/migration-failed.errors.mjs";
|
|
49
|
+
import { MigrationMissingError } from "../host/migration/migration-missing.errors.mjs";
|
|
50
|
+
import { jobs } from "./local-job-runtime.layer.mjs";
|
|
51
|
+
import { ReservedNameError } from "../host/actor/reserved-name.errors.mjs";
|
|
52
|
+
import { HistoryPrunedError } from "../host/command/history-pruned.errors.mjs";
|
|
53
|
+
import { CommandIdReusedError } from "../host/command/command-id-reused.errors.mjs";
|
|
54
|
+
import { ReplayCursorStalledError } from "../host/command/replay/replay-cursor-stalled.errors.mjs";
|
|
55
|
+
import { localClient } from "../serve/rpc/in-process-client.layer.mjs";
|
|
56
|
+
import { ActorNotMigratedError } from "../serve/store/actor-not-migrated.errors.mjs";
|
|
57
|
+
import { ActorsNotHostedError } from "../serve/engine/actors-not-hosted.errors.mjs";
|
|
58
|
+
import { ListenerNotLoopbackError } from "../serve/rpc/listener-not-loopback.errors.mjs";
|
|
59
|
+
import { StoreUnreadableError } from "../serve/store/store-unreadable.errors.mjs";
|
|
60
|
+
import { ActorHost } from "../serve/engine/actor-host.service.mjs";
|
|
61
|
+
import { Verify } from "../serve/verify/verify.layer.mjs";
|
|
62
|
+
import { Layer, String } from "effect";
|
|
63
|
+
// src/runtime/akter.layer.ts
|
|
64
|
+
const defaultPort = 4e3;
|
|
65
|
+
const loopback = "127.0.0.1";
|
|
66
|
+
const bracketed = /^\[(?<address>.*)\]$/u;
|
|
67
|
+
const defaultInspectorPort = 4001;
|
|
68
|
+
var Akter = class extends Akter$1 {
|
|
69
|
+
/** A data directory's environments and snapshots, read and changed without running an engine on it. */
|
|
70
|
+
static environments = environments;
|
|
71
|
+
static historyRetention = historyRetention;
|
|
72
|
+
/**
|
|
73
|
+
* The local engine's job runtime. Provide it under an app layer whose job handlers need the `WorkflowEngine`,
|
|
74
|
+
* beside `Akter.local`, so the handlers register on the engine that runs their jobs:
|
|
75
|
+
* `Akter.local(directory).pipe(Layer.provide(app.layer), Layer.provide(Akter.jobs))`.
|
|
76
|
+
*/
|
|
77
|
+
static jobs = jobs;
|
|
78
|
+
static local = local;
|
|
79
|
+
static localClient = localClient;
|
|
80
|
+
static inspector(options) {
|
|
81
|
+
const listener = {
|
|
82
|
+
hostname: loopback,
|
|
83
|
+
port: options.port ?? defaultInspectorPort
|
|
84
|
+
};
|
|
85
|
+
return serveInspector({
|
|
86
|
+
allowedHosts: options.allowedHosts ?? [],
|
|
87
|
+
directory: options.directory
|
|
88
|
+
}).pipe(Layer.provideMerge(httpServer(listener)));
|
|
89
|
+
}
|
|
90
|
+
static migrate = migrate;
|
|
91
|
+
static serve(options) {
|
|
92
|
+
const listener = {
|
|
93
|
+
hostname: String.replace(bracketed, "$<address>")(options.hostname ?? loopback),
|
|
94
|
+
port: options.port ?? defaultPort
|
|
95
|
+
};
|
|
96
|
+
return serve(options).pipe(Layer.provideMerge(httpServer(listener)));
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
export { ActorAlreadyExistsError, ActorErasedError, ActorHost, ActorJournal, ActorNotCreatedError, ActorNotMigratedError, ActorNotRegisteredError, ActorUnavailableError, ActorsNotHostedError, Akter, AlreadyExistsError, BillingUnavailableError, BlobTransferError, CallerNotAllowedError, CheckpointExpiredError, CommandIdExpiredError, CommandIdReusedError, CommandRejectedError, ComputerHeldError, ComputerLimitError, ComputerLostError, ComputerNotFoundError, ComputersUnavailableError, EnvironmentName, FileAccessDeniedError, FileNotFoundError, FileTooLargeError, FilesUnavailableError, HandlerFailedError, HistoryPrunedError, HostedAppBuildError, InUseError, InvalidFileRequestError, InvalidRequestError, InvalidSecretNameError, LayoutVersionError, ListenerNotLoopbackError, LocalEnvironment, LocalEnvironments, LocalSnapshot, MigrationEditedError, MigrationFailedError, MigrationHasher, MigrationMissingError, NotFoundError, Promotion, ReplayCursorStalledError, ReservedMemberError, ReservedNameError, ReservedPayloadFieldError, SecretUnavailableError, SnapshotName, SpendCapReachedError, StateUnreadableError, StepNotFoundError, StorageLimitError, StoreUnreadableError, UnauthenticatedError, Verify };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { BlobHashing } from "../host/hash/blob-hashing.service.mjs";
|
|
2
|
+
import { Effect, Layer } from "effect";
|
|
3
|
+
import { createHash } from "node:crypto";
|
|
4
|
+
// src/runtime/blob-hashing.layer.ts
|
|
5
|
+
const sha256 = Effect.sync(() => {
|
|
6
|
+
const hash = createHash("sha256");
|
|
7
|
+
return {
|
|
8
|
+
digest: Effect.sync(() => hash.digest("hex")),
|
|
9
|
+
update: (bytes) => Effect.sync(() => {
|
|
10
|
+
hash.update(bytes);
|
|
11
|
+
})
|
|
12
|
+
};
|
|
13
|
+
});
|
|
14
|
+
const blobHashing = Layer.succeed(BlobHashing, { sha256 });
|
|
15
|
+
export { blobHashing };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { LocalBlobHomes } from "../host/file/local-blob-home.service.mjs";
|
|
2
|
+
import { SqliteDriver } from "../host/sqlite/sqlite-driver.service.mjs";
|
|
3
|
+
import { ActorHost } from "../serve/engine/actor-host.service.mjs";
|
|
4
|
+
import { ActorLocation } from "../serve/engine/actor-location.service.mjs";
|
|
5
|
+
import { Cut } from "../serve/environment/snapshot-operations.sql.mjs";
|
|
6
|
+
import { Context, Effect, FileSystem, Latch, Path, Scope } from "effect";
|
|
7
|
+
/**
|
|
8
|
+
* What an environment's engine needs from the local engine around it. The context also carries what isn't typed
|
|
9
|
+
* here: the app's handlers, the job engine their jobs run on, and settings such as the history retention.
|
|
10
|
+
*/
|
|
11
|
+
type EngineContext = Context.Context<FileSystem.FileSystem | Path.Path | SqliteDriver>;
|
|
12
|
+
/** The environment the local engine serves now, on an engine of its own that closes with `scope`. */
|
|
13
|
+
interface HostedEnvironment {
|
|
14
|
+
/** Open while the environment isn't quiet; its actors' upkeep waits at it. */
|
|
15
|
+
readonly gate: Latch.Latch;
|
|
16
|
+
readonly host: ActorHost["Service"];
|
|
17
|
+
readonly homes: LocalBlobHomes["Service"];
|
|
18
|
+
readonly location: ActorLocation["Service"];
|
|
19
|
+
readonly name: string;
|
|
20
|
+
readonly scope: Scope.Closeable;
|
|
21
|
+
/** The environment's store, the directory its shards and files are in. */
|
|
22
|
+
readonly store: string;
|
|
23
|
+
}
|
|
24
|
+
interface EnvironmentOpening {
|
|
25
|
+
readonly context: EngineContext;
|
|
26
|
+
readonly name: string;
|
|
27
|
+
readonly quiet: number;
|
|
28
|
+
readonly store: string;
|
|
29
|
+
}
|
|
30
|
+
/** Opens one environment's engine, quiet when its record says so, with every service it needs from `context`. */
|
|
31
|
+
declare const openEnvironment: (args_0: EnvironmentOpening) => Effect.Effect<HostedEnvironment, never, never>;
|
|
32
|
+
/** How a snapshot cuts the hosted environment's store: each actor under its command lock, under its files' hold. */
|
|
33
|
+
declare const cutOf: (context: EngineContext) => ({ homes, host, location, store }: HostedEnvironment) => Cut;
|
|
34
|
+
export { type EngineContext, type EnvironmentOpening, type HostedEnvironment, cutOf, openEnvironment };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { LocalBlobHomes } from "../host/file/local-blob-home.service.mjs";
|
|
2
|
+
import { SqliteDriver } from "../host/sqlite/sqlite-driver.service.mjs";
|
|
3
|
+
import { UpkeepGate } from "../host/upkeep/execution-authority.pure.mjs";
|
|
4
|
+
import { ActorHost } from "../serve/engine/actor-host.service.mjs";
|
|
5
|
+
import { ActorLocation } from "../serve/engine/actor-location.service.mjs";
|
|
6
|
+
import { cutStore } from "../serve/environment/store-snapshot.sql.mjs";
|
|
7
|
+
import { actorEngine } from "../serve/engine/actor-engine.layer.mjs";
|
|
8
|
+
import { fileHomes } from "./local-actor-engine.layer.mjs";
|
|
9
|
+
import { Context, Effect, Exit, Latch, Layer, Scope } from "effect";
|
|
10
|
+
// src/runtime/hosted-environment.layer.ts
|
|
11
|
+
const quietFlag = 1;
|
|
12
|
+
/** The engine of one environment's store: its host, where its actors are, and its file home. */
|
|
13
|
+
const environmentEngine = (directory) => Layer.merge(actorEngine(directory), ActorLocation.directory(directory)).pipe(Layer.provideMerge(fileHomes(directory)));
|
|
14
|
+
/** Opens one environment's engine, quiet when its record says so, with every service it needs from `context`. */
|
|
15
|
+
const openEnvironment = Effect.fnUntraced(function* openEnvironment({ context, name, quiet, store }) {
|
|
16
|
+
const scope = yield* Scope.make();
|
|
17
|
+
const gate = yield* Latch.make(quiet !== quietFlag);
|
|
18
|
+
const engine = environmentEngine(store).pipe(Layer.provide(Layer.succeed(UpkeepGate, gate)));
|
|
19
|
+
const built = Layer.buildWithScope(engine, scope).pipe(Effect.provideContext(context));
|
|
20
|
+
const services = yield* Effect.onError(built, (cause) => Scope.close(scope, Exit.failCause(cause)));
|
|
21
|
+
return {
|
|
22
|
+
gate,
|
|
23
|
+
homes: Context.get(services, LocalBlobHomes),
|
|
24
|
+
host: Context.get(services, ActorHost),
|
|
25
|
+
location: Context.get(services, ActorLocation),
|
|
26
|
+
name,
|
|
27
|
+
scope,
|
|
28
|
+
store
|
|
29
|
+
};
|
|
30
|
+
});
|
|
31
|
+
/** How a snapshot cuts the hosted environment's store: each actor under its command lock, under its files' hold. */
|
|
32
|
+
const cutOf = (context) => ({ homes, host, location, store }) => (into) => Effect.flatMap(homes.get, (home) => cutStore({
|
|
33
|
+
driver: Context.get(context, SqliteDriver),
|
|
34
|
+
home,
|
|
35
|
+
host,
|
|
36
|
+
into,
|
|
37
|
+
location,
|
|
38
|
+
store
|
|
39
|
+
})).pipe(Effect.provideContext(context));
|
|
40
|
+
export { cutOf, openEnvironment };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { FileSystem, Layer, Path } from "effect";
|
|
2
|
+
import { HttpServer, HttpServerError } from "effect/http";
|
|
3
|
+
type PlatformHttpServer = Layer.Layer<FileSystem.FileSystem | HttpServer.HttpServer | Path.Path, HttpServerError.ServeError>;
|
|
4
|
+
interface Listener {
|
|
5
|
+
readonly hostname: string;
|
|
6
|
+
readonly port: number;
|
|
7
|
+
}
|
|
8
|
+
export declare const httpServer: ({ hostname, port }: Listener) => PlatformHttpServer;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Effect, Layer } from "effect";
|
|
2
|
+
import { createServer } from "node:http";
|
|
3
|
+
import { layer } from "@effect/platform-node/NodeHttpServer";
|
|
4
|
+
// src/runtime/http-server.layer.ts
|
|
5
|
+
const httpServer = ({ hostname, port }) => {
|
|
6
|
+
if ("Bun" in globalThis) return Layer.unwrap(Effect.map(Effect.promise(() => import("@effect/platform-bun/BunHttpServer")), (BunHttpServer) => BunHttpServer.layer({
|
|
7
|
+
hostname,
|
|
8
|
+
port
|
|
9
|
+
})));
|
|
10
|
+
return layer(createServer, {
|
|
11
|
+
host: hostname,
|
|
12
|
+
port
|
|
13
|
+
});
|
|
14
|
+
};
|
|
15
|
+
export { httpServer };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ActorRegistry } from "../contract/actor/actor-registry.service.mjs";
|
|
2
|
+
import { ActorJournal } from "../contract/history/actor-journal.service.mjs";
|
|
3
|
+
import { LocalBlobHomes } from "../host/file/local-blob-home.service.mjs";
|
|
4
|
+
import { ActorHost } from "../serve/engine/actor-host.service.mjs";
|
|
5
|
+
import { localFileClients } from "./local-file-clients.layer.mjs";
|
|
6
|
+
import { FileSystem, Layer, Path } from "effect";
|
|
7
|
+
declare const fileHomes: (directory: string) => Layer.Layer<LocalBlobHomes, never, FileSystem.FileSystem | Path.Path>;
|
|
8
|
+
type LocalActorEngineServices = ActorHost | ActorJournal | ActorRegistry | Layer.Success<typeof localFileClients>;
|
|
9
|
+
declare const localActorEngine: (directory: string) => Layer.Layer<LocalActorEngineServices, never, FileSystem.FileSystem | Path.Path>;
|
|
10
|
+
export { type LocalActorEngineServices, fileHomes, localActorEngine };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { LocalBlobHomes } from "../host/file/local-blob-home.service.mjs";
|
|
2
|
+
import { SqliteDriver } from "../host/sqlite/sqlite-driver.service.mjs";
|
|
3
|
+
import { actorEngine, hostJournal } from "../serve/engine/actor-engine.layer.mjs";
|
|
4
|
+
import { blobHashing } from "./blob-hashing.layer.mjs";
|
|
5
|
+
import { localFileClients } from "./local-file-clients.layer.mjs";
|
|
6
|
+
import { Effect, Layer, Path } from "effect";
|
|
7
|
+
import { SecureRandom } from "effect/crypto";
|
|
8
|
+
// src/runtime/local-actor-engine.layer.ts
|
|
9
|
+
const fileHomes = (directory) => Layer.unwrap(Effect.map(Path.Path, (path) => LocalBlobHomes.layer(path.join(directory, "files-home")))).pipe(Layer.provide(blobHashing), Layer.provide(SecureRandom.layerWebCrypto), Layer.provide(SqliteDriver.layerNode));
|
|
10
|
+
const localActorEngine = (directory) => {
|
|
11
|
+
const engine = hostJournal.pipe(Layer.provideMerge(actorEngine(directory)), Layer.provide(fileHomes(directory)));
|
|
12
|
+
return localFileClients.pipe(Layer.provideMerge(engine));
|
|
13
|
+
};
|
|
14
|
+
export { fileHomes, localActorEngine };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { hostJournal, providedHandlers } from "../serve/engine/actor-engine.layer.mjs";
|
|
2
|
+
import { ActorHost } from "../serve/engine/actor-host.service.mjs";
|
|
3
|
+
import { LocalEnvironments } from "../serve/environment/local-environments.service.mjs";
|
|
4
|
+
import { LocalOptions, offlineEnvironments } from "./local-environments.layer.mjs";
|
|
5
|
+
import { localFileClients } from "./local-file-clients.layer.mjs";
|
|
6
|
+
import { ComputerNeeds } from "./local-job-runtime.layer.mjs";
|
|
7
|
+
import { Layer } from "effect";
|
|
8
|
+
/**
|
|
9
|
+
* The local engine `Akter.local` runs: the data directory's environments behind one switching host, with the
|
|
10
|
+
* journal, the file clients, the registry of the handlers it is given, and, with `AKTER_LOCAL_COMPUTERS` on, the
|
|
11
|
+
* computers of the store it serves, which the app's jobs reach through the same `JobComputers` that `Akter.jobs` gives
|
|
12
|
+
* them and its `<Actor>/computer/*` RPCs reach directly.
|
|
13
|
+
*/
|
|
14
|
+
declare const localEngine: (options: LocalOptions) => Layer.Layer<ActorHost | LocalEnvironments | Layer.Success<typeof hostJournal> | Layer.Success<typeof localFileClients> | Layer.Success<typeof providedHandlers>, never, ComputerNeeds>;
|
|
15
|
+
export { localEngine, offlineEnvironments };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { JobComputers } from "../host/computer/job-computers.service.mjs";
|
|
2
|
+
import { hostJournal, providedHandlers } from "../serve/engine/actor-engine.layer.mjs";
|
|
3
|
+
import { localEnvironments, offlineEnvironments } from "./local-environments.layer.mjs";
|
|
4
|
+
import { localFileClients } from "./local-file-clients.layer.mjs";
|
|
5
|
+
import { Layer } from "effect";
|
|
6
|
+
// src/runtime/local-engine.layer.ts
|
|
7
|
+
/**
|
|
8
|
+
* The local engine `Akter.local` runs: the data directory's environments behind one switching host, with the
|
|
9
|
+
* journal, the file clients, the registry of the handlers it is given, and, with `AKTER_LOCAL_COMPUTERS` on, the
|
|
10
|
+
* computers of the store it serves, which the app's jobs reach through the same `JobComputers` that `Akter.jobs` gives
|
|
11
|
+
* them and its `<Actor>/computer/*` RPCs reach directly.
|
|
12
|
+
*/
|
|
13
|
+
const localEngine = (options) => Layer.mergeAll(localFileClients, hostJournal).pipe(Layer.provideMerge(localEnvironments(options)), Layer.provideMerge(providedHandlers), Layer.provideMerge(JobComputers.layer));
|
|
14
|
+
export { localEngine, offlineEnvironments };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ActorHost } from "../serve/engine/actor-host.service.mjs";
|
|
2
|
+
import { LocalEnvironments } from "../serve/environment/local-environments.service.mjs";
|
|
3
|
+
import { BinderNeeds } from "./local-job-runtime.layer.mjs";
|
|
4
|
+
import { FileSystem, Layer, Path } from "effect";
|
|
5
|
+
interface LocalOptions {
|
|
6
|
+
/** The data directory, `.akter` for `akter dev`. */
|
|
7
|
+
readonly directory: string;
|
|
8
|
+
/**
|
|
9
|
+
* Serve this environment of the data directory, such as a branch to call before promoting it, instead of the one
|
|
10
|
+
* promoted to serve. It stays quiet until it is promoted.
|
|
11
|
+
*/
|
|
12
|
+
readonly environment?: string | undefined;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* The local engine on a data directory's environments: it serves one of them at a time through one actor host, and
|
|
16
|
+
* switches to another when a promote makes it serve. `LocalEnvironments` snapshots, branches and promotes them.
|
|
17
|
+
*/
|
|
18
|
+
declare const localEnvironments: (options: LocalOptions) => Layer.Layer<ActorHost | LocalEnvironments, never, BinderNeeds>;
|
|
19
|
+
/**
|
|
20
|
+
* A data directory's environments without an engine, as the CLI reads them: what it changes, the `akter dev` serving
|
|
21
|
+
* the directory applies on its next look, and a snapshot is waited for while that engine takes it.
|
|
22
|
+
*/
|
|
23
|
+
declare const offlineEnvironments: (directory: string) => Layer.Layer<LocalEnvironments, never, FileSystem.FileSystem | Path.Path>;
|
|
24
|
+
export { type LocalOptions, localEnvironments, offlineEnvironments };
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import { SqliteDriver } from "../host/sqlite/sqlite-driver.service.mjs";
|
|
2
|
+
import { ActorHost } from "../serve/engine/actor-host.service.mjs";
|
|
3
|
+
import { environmentRow, servingRow } from "../serve/environment/environment-records.sql.mjs";
|
|
4
|
+
import { LocalEnvironments } from "../serve/environment/local-environments.service.mjs";
|
|
5
|
+
import { takePending } from "../serve/environment/snapshot-operations.sql.mjs";
|
|
6
|
+
import { cutOf, openEnvironment } from "./hosted-environment.layer.mjs";
|
|
7
|
+
import { computersBinder } from "./local-job-runtime.layer.mjs";
|
|
8
|
+
import { Context, Duration, Effect, Exit, Latch, Layer, Option, Ref, Schedule, Scope, Semaphore, Stream } from "effect";
|
|
9
|
+
// src/runtime/local-environments.layer.ts
|
|
10
|
+
/** How often the engine reads the record, for what `akter dev environments` and `snapshots` changed in another process. */
|
|
11
|
+
const watchEvery = "1 second";
|
|
12
|
+
const settleWithin = Duration.seconds(30);
|
|
13
|
+
const quietFlag = 1;
|
|
14
|
+
const oneAtATime = 1;
|
|
15
|
+
/**
|
|
16
|
+
* An actor host that answers each call with whichever host `current` gives at that moment, so the local engine can
|
|
17
|
+
* switch the environment it serves, as a promote does, while the server and its clients stay as they are.
|
|
18
|
+
*/
|
|
19
|
+
const switchingHost = (current) => ({
|
|
20
|
+
command: (call) => Effect.flatMap(current, (host) => host.command(call)),
|
|
21
|
+
coveredSince: (request) => Effect.flatMap(current, (host) => host.coveredSince(request)),
|
|
22
|
+
create: (call) => Effect.flatMap(current, (host) => host.create(call)),
|
|
23
|
+
currentFiles: (address) => Effect.flatMap(current, (host) => host.currentFiles(address)),
|
|
24
|
+
drain: Effect.flatMap(current, (host) => host.drain),
|
|
25
|
+
erase: (address) => Effect.flatMap(current, (host) => Option.match(Option.fromNullishOr(host.erase), {
|
|
26
|
+
onNone: () => Effect.die("the local engine has no actor erasure"),
|
|
27
|
+
onSome: (erase) => erase(address)
|
|
28
|
+
})),
|
|
29
|
+
files: (address) => Effect.flatMap(current, (host) => host.files(address)),
|
|
30
|
+
fork: (call) => Effect.flatMap(current, (host) => host.fork(call)),
|
|
31
|
+
history: (request) => Effect.flatMap(current, (host) => host.history(request)),
|
|
32
|
+
prepareFiles: (address) => Effect.flatMap(current, (host) => host.prepareFiles(address)),
|
|
33
|
+
query: (call) => Effect.flatMap(current, (host) => host.query(call)),
|
|
34
|
+
state: (address) => Stream.unwrap(Effect.map(current, (host) => host.state(address))),
|
|
35
|
+
step: (request) => Effect.flatMap(current, (host) => host.step(request)),
|
|
36
|
+
steps: (request) => Effect.flatMap(current, (host) => host.steps(request)),
|
|
37
|
+
subscribe: (call) => Stream.unwrap(Effect.map(current, (host) => host.subscribe(call))),
|
|
38
|
+
warm: (address) => Effect.flatMap(current, (host) => host.warm(address))
|
|
39
|
+
});
|
|
40
|
+
const hostingOf = ({ context, store }, row) => ({
|
|
41
|
+
context,
|
|
42
|
+
name: row.name,
|
|
43
|
+
quiet: row.quiet,
|
|
44
|
+
store: store.path.resolve(store.directory, row.directory)
|
|
45
|
+
});
|
|
46
|
+
const switchTo = Effect.fnUntraced(function* switchTo(switcher, row) {
|
|
47
|
+
const before = yield* Ref.get(switcher.current);
|
|
48
|
+
yield* switcher.ready.close;
|
|
49
|
+
yield* Scope.close(before.scope, Exit.void);
|
|
50
|
+
const next = yield* openEnvironment(hostingOf(switcher, row));
|
|
51
|
+
yield* switcher.bindComputers(next.store);
|
|
52
|
+
yield* Ref.set(switcher.current, next);
|
|
53
|
+
yield* switcher.ready.open;
|
|
54
|
+
});
|
|
55
|
+
const quietAs = (gate, row) => {
|
|
56
|
+
if (row.quiet === quietFlag) return gate.close;
|
|
57
|
+
return gate.open;
|
|
58
|
+
};
|
|
59
|
+
/** The environment the record says this engine serves: the pinned one, or the one promoted to serve, while Ready. */
|
|
60
|
+
const servedRow = Effect.fnUntraced(function* servedRow({ pinned, store }) {
|
|
61
|
+
const serving = yield* servingRow(store);
|
|
62
|
+
const wanted = Option.getOrElse(pinned, () => serving.environment);
|
|
63
|
+
const found = yield* environmentRow({
|
|
64
|
+
name: wanted,
|
|
65
|
+
sql: store.sql
|
|
66
|
+
});
|
|
67
|
+
return Option.filter(found, (row) => row.status === "Ready");
|
|
68
|
+
});
|
|
69
|
+
/**
|
|
70
|
+
* Applies the record: serves the environment it names (the pinned one, or the one promoted to serve), holds its
|
|
71
|
+
* actors' upkeep while it is quiet and runs it once it isn't, and takes its pending snapshots.
|
|
72
|
+
*/
|
|
73
|
+
const applied = Effect.fnUntraced(function* applied(switcher) {
|
|
74
|
+
const { store } = switcher;
|
|
75
|
+
const row = yield* servedRow(switcher);
|
|
76
|
+
const hosted = yield* Ref.get(switcher.current);
|
|
77
|
+
if (Option.isSome(row) && row.value.name !== hosted.name) yield* switchTo(switcher, row.value);
|
|
78
|
+
const current = yield* Ref.get(switcher.current);
|
|
79
|
+
yield* Effect.forEach(Option.toArray(row), (now) => quietAs(current.gate, now));
|
|
80
|
+
yield* takePending({
|
|
81
|
+
cut: cutOf(switcher.context)(current),
|
|
82
|
+
store
|
|
83
|
+
})(current.name);
|
|
84
|
+
});
|
|
85
|
+
const firstHosted = Effect.fnUntraced(function* firstHosted({ context, store }, pinned) {
|
|
86
|
+
const ready = yield* servedRow({
|
|
87
|
+
pinned,
|
|
88
|
+
store
|
|
89
|
+
});
|
|
90
|
+
const unknown = Effect.die(`akter dev has no Ready environment ${Option.getOrElse(pinned, () => "")} to serve`);
|
|
91
|
+
const row = yield* Option.match(ready, {
|
|
92
|
+
onNone: () => unknown,
|
|
93
|
+
onSome: Effect.succeed
|
|
94
|
+
});
|
|
95
|
+
return yield* openEnvironment(hostingOf({
|
|
96
|
+
context,
|
|
97
|
+
store
|
|
98
|
+
}, row));
|
|
99
|
+
});
|
|
100
|
+
const openRecord = (directory, hosting) => Effect.orDie(SqliteDriver.use((driver) => LocalEnvironments.openStore({
|
|
101
|
+
directory,
|
|
102
|
+
hosting,
|
|
103
|
+
open: driver.open
|
|
104
|
+
})));
|
|
105
|
+
const startSwitcher = Effect.fnUntraced(function* startSwitcher({ directory, environment }) {
|
|
106
|
+
const context = yield* Effect.context();
|
|
107
|
+
const bindComputers = yield* computersBinder();
|
|
108
|
+
const store = yield* openRecord(directory, {
|
|
109
|
+
apply: Effect.void,
|
|
110
|
+
settleWithin: Duration.zero
|
|
111
|
+
});
|
|
112
|
+
const pinned = Option.fromUndefinedOr(environment);
|
|
113
|
+
const first = yield* Effect.orDie(firstHosted({
|
|
114
|
+
context,
|
|
115
|
+
store
|
|
116
|
+
}, pinned));
|
|
117
|
+
yield* bindComputers(first.store);
|
|
118
|
+
const current = yield* Ref.make(first);
|
|
119
|
+
const ready = yield* Latch.make(true);
|
|
120
|
+
yield* Effect.addFinalizer(() => Effect.flatMap(Ref.get(current), (hosted) => Scope.close(hosted.scope, Exit.void)));
|
|
121
|
+
return {
|
|
122
|
+
bindComputers,
|
|
123
|
+
context,
|
|
124
|
+
current,
|
|
125
|
+
pinned,
|
|
126
|
+
ready,
|
|
127
|
+
store
|
|
128
|
+
};
|
|
129
|
+
});
|
|
130
|
+
const applying = (switcher, semaphore) => semaphore.withPermits(oneAtATime)(applied(switcher)).pipe(Effect.catchCause((cause) => Effect.logWarning("akter dev could not apply its environments", cause)));
|
|
131
|
+
/**
|
|
132
|
+
* The local engine on a data directory's environments: it serves one of them at a time through one actor host, and
|
|
133
|
+
* switches to another when a promote makes it serve. `LocalEnvironments` snapshots, branches and promotes them.
|
|
134
|
+
*/
|
|
135
|
+
const localEnvironments = (options) => Layer.effectContext(Effect.gen(function* makeLocalEnvironments() {
|
|
136
|
+
const switcher = yield* startSwitcher(options);
|
|
137
|
+
const semaphore = yield* Semaphore.make(oneAtATime);
|
|
138
|
+
const apply = applying(switcher, semaphore);
|
|
139
|
+
const served = Effect.andThen(switcher.ready.await, Ref.get(switcher.current));
|
|
140
|
+
yield* Effect.forkScoped(Effect.repeat(apply, Schedule.spaced(watchEvery)));
|
|
141
|
+
const environments = LocalEnvironments.on({
|
|
142
|
+
...switcher.store,
|
|
143
|
+
hosting: {
|
|
144
|
+
apply,
|
|
145
|
+
settleWithin: Duration.zero
|
|
146
|
+
}
|
|
147
|
+
});
|
|
148
|
+
const host = switchingHost(Effect.map(served, (hosted) => hosted.host));
|
|
149
|
+
return Context.make(ActorHost, host).pipe(Context.add(LocalEnvironments, environments));
|
|
150
|
+
})).pipe(Layer.provide(SqliteDriver.layerNode));
|
|
151
|
+
/**
|
|
152
|
+
* A data directory's environments without an engine, as the CLI reads them: what it changes, the `akter dev` serving
|
|
153
|
+
* the directory applies on its next look, and a snapshot is waited for while that engine takes it.
|
|
154
|
+
*/
|
|
155
|
+
const offlineEnvironments = (directory) => Layer.effect(LocalEnvironments, Effect.map(openRecord(directory, {
|
|
156
|
+
apply: Effect.void,
|
|
157
|
+
settleWithin
|
|
158
|
+
}), LocalEnvironments.on)).pipe(Layer.provide(SqliteDriver.layerNode));
|
|
159
|
+
export { localEnvironments, offlineEnvironments };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ActorFileClients } from "../contract/file/file-client.adapter.mjs";
|
|
2
|
+
import { FileAddress, FileClient } from "../contract/file/file-client.contract.mjs";
|
|
3
|
+
import { ActorHost } from "../serve/engine/actor-host.service.mjs";
|
|
4
|
+
import { Layer } from "effect";
|
|
5
|
+
interface FileBinding {
|
|
6
|
+
readonly address: FileAddress;
|
|
7
|
+
readonly host: ActorHost["Service"];
|
|
8
|
+
}
|
|
9
|
+
declare const clientWith: (binding: FileBinding) => FileClient;
|
|
10
|
+
/** The file client of one actor on this host, outside its commands and queries. */
|
|
11
|
+
declare const hostFileClient: typeof clientWith;
|
|
12
|
+
declare const localFileClients: Layer.Layer<ActorFileClients, never, ActorHost>;
|
|
13
|
+
export { hostFileClient, localFileClients };
|