@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,74 @@
|
|
|
1
|
+
import { Context, Effect, Layer, Option, Schema } from "effect";
|
|
2
|
+
import { WorkflowEngine } from "effect/workflow";
|
|
3
|
+
|
|
4
|
+
import { ActorRegistry } from "#src/contract/actor/actor-registry.service";
|
|
5
|
+
import {
|
|
6
|
+
hostInterface,
|
|
7
|
+
hostInterfaceOf,
|
|
8
|
+
oldestHostInterface,
|
|
9
|
+
servesHostInterface,
|
|
10
|
+
} from "#src/contract/actor/host-interface.pure";
|
|
11
|
+
import { JobCodecsOf } from "#src/contract/command/command.contract";
|
|
12
|
+
import { HostedAppBuildError } from "./hosted-app-build.errors.js";
|
|
13
|
+
|
|
14
|
+
/** Why a host refuses to load an app's bundle: it was built with an akter this host doesn't serve. */
|
|
15
|
+
type RefusedBuild = HostedAppBuildError;
|
|
16
|
+
|
|
17
|
+
/** The refusal of an actor built with a host interface version outside this host's window. */
|
|
18
|
+
const outsideWindow = (actor: string, built: number): HostedAppBuildError =>
|
|
19
|
+
HostedAppBuildError.make({
|
|
20
|
+
reason: `${actor} was built with akter host interface ${String(built)}, and this host serves ${String(oldestHostInterface)} to ${String(hostInterface)}: deploy the app again with a current akter`,
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
/** The workflow engine a bundle registers its jobs with. It refuses a job built before jobs carried their codecs. */
|
|
24
|
+
const bundleWorkflows = Layer.effect(
|
|
25
|
+
WorkflowEngine.WorkflowEngine,
|
|
26
|
+
WorkflowEngine.WorkflowEngine.use((engine) =>
|
|
27
|
+
Effect.succeed(
|
|
28
|
+
WorkflowEngine.WorkflowEngine.of({
|
|
29
|
+
...engine,
|
|
30
|
+
register: (workflow, execute) => {
|
|
31
|
+
const codecs = Context.get(workflow.annotations, JobCodecsOf);
|
|
32
|
+
|
|
33
|
+
if (Option.isNone(codecs)) {
|
|
34
|
+
return Effect.die(
|
|
35
|
+
HostedAppBuildError.make({ reason: "the app was built with an older SDK; rebuild the app" }),
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
return engine.register(workflow, execute);
|
|
40
|
+
},
|
|
41
|
+
}),
|
|
42
|
+
),
|
|
43
|
+
),
|
|
44
|
+
);
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* The registry a bundle registers its actors in. It refuses an actor built with a host interface version outside the
|
|
48
|
+
* window this host reads, so a build it can't serve fails to load, typed, instead of failing each call.
|
|
49
|
+
*/
|
|
50
|
+
const servedRegistry = Layer.effect(
|
|
51
|
+
ActorRegistry,
|
|
52
|
+
ActorRegistry.use((registry) =>
|
|
53
|
+
Effect.succeed(
|
|
54
|
+
ActorRegistry.of({
|
|
55
|
+
...registry,
|
|
56
|
+
register: (actor) => {
|
|
57
|
+
const built = hostInterfaceOf(actor);
|
|
58
|
+
|
|
59
|
+
if (!servesHostInterface(built)) {
|
|
60
|
+
return Effect.die(outsideWindow(actor.name, built));
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
return registry.register(actor);
|
|
64
|
+
},
|
|
65
|
+
}),
|
|
66
|
+
),
|
|
67
|
+
),
|
|
68
|
+
);
|
|
69
|
+
|
|
70
|
+
const isRefusedBuild = Schema.is(HostedAppBuildError);
|
|
71
|
+
|
|
72
|
+
export { bundleWorkflows, isRefusedBuild, servedRegistry };
|
|
73
|
+
|
|
74
|
+
export type { RefusedBuild };
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { Effect, Layer, Schema } from "effect";
|
|
2
|
+
import { Headers, HttpServerRequest } from "effect/http";
|
|
3
|
+
|
|
4
|
+
import { Authentication } from "#src/contract/caller/authentication.api";
|
|
5
|
+
import { Caller } from "#src/contract/caller/caller.schema";
|
|
6
|
+
import { CurrentCaller } from "#src/contract/caller/current-caller.service";
|
|
7
|
+
import { UnauthenticatedError } from "#src/contract/caller/unauthenticated.errors";
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* One file RPC a gateway forwarded: the verified caller and the client's RPC request, unchanged. Its `id` is the
|
|
11
|
+
* client's own, a number or a string, and every frame of the answer carries it back as given, because the client
|
|
12
|
+
* matches frames to its request by that exact value.
|
|
13
|
+
*/
|
|
14
|
+
interface FileForward {
|
|
15
|
+
readonly caller: Caller;
|
|
16
|
+
readonly request: { readonly id: number | string; readonly payload: unknown; readonly tag: string };
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const callerHeader = "akter-forwarded-caller";
|
|
20
|
+
|
|
21
|
+
const CallerJson = Schema.fromJsonString(Schema.toCodecJson(Caller));
|
|
22
|
+
|
|
23
|
+
const RequestMessage = Schema.TaggedStruct("Request", {
|
|
24
|
+
headers: Schema.Array(Schema.Tuple([Schema.String, Schema.String])),
|
|
25
|
+
id: Schema.Union([Schema.String, Schema.Finite]),
|
|
26
|
+
payload: Schema.Unknown,
|
|
27
|
+
tag: Schema.String,
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
const RequestLine = Schema.fromJsonString(RequestMessage);
|
|
31
|
+
|
|
32
|
+
const unverified = UnauthenticatedError.make({ message: "the forwarded file request carried no verified caller" });
|
|
33
|
+
|
|
34
|
+
const callerOf = (headers: Headers.Headers): Effect.Effect<Caller, UnauthenticatedError> => {
|
|
35
|
+
const header = Effect.fromOption(Headers.get(headers, callerHeader));
|
|
36
|
+
|
|
37
|
+
return Effect.mapError(Effect.flatMap(header, Schema.decodeEffect(CallerJson)), () => unverified);
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
/** The caller the host verified, which `forwardedRequest` puts in a header only the in-memory file server reads. */
|
|
41
|
+
const ForwardedAuthentication = Layer.succeed(Authentication)((effect, { headers }) =>
|
|
42
|
+
Effect.flatMap(callerOf(headers), (caller) => Effect.provideService(effect, CurrentCaller, caller)),
|
|
43
|
+
);
|
|
44
|
+
|
|
45
|
+
/** The forward as the one-request NDJSON body an Effect RPC HTTP server reads, carrying the verified caller. */
|
|
46
|
+
const forwardedRequest = (forward: FileForward): Effect.Effect<HttpServerRequest.HttpServerRequest> =>
|
|
47
|
+
Effect.gen(function* encodeForward() {
|
|
48
|
+
const message = RequestMessage.make({ ...forward.request, headers: [] });
|
|
49
|
+
const line = yield* Schema.encodeEffect(RequestLine)(message);
|
|
50
|
+
const caller = yield* Schema.encodeEffect(CallerJson)(forward.caller);
|
|
51
|
+
|
|
52
|
+
const request = new globalThis.Request("http://akter.internal/rpc", {
|
|
53
|
+
body: `${line}\n`,
|
|
54
|
+
headers: { [callerHeader]: caller, "content-type": "application/ndjson" },
|
|
55
|
+
method: "POST",
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
return HttpServerRequest.fromWeb(request);
|
|
59
|
+
}).pipe(Effect.orDie);
|
|
60
|
+
|
|
61
|
+
export { ForwardedAuthentication, forwardedRequest };
|
|
62
|
+
|
|
63
|
+
export type { FileForward };
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Array as Arr,
|
|
3
|
+
Context,
|
|
4
|
+
Effect,
|
|
5
|
+
Option,
|
|
6
|
+
Record as Rec,
|
|
7
|
+
Schema,
|
|
8
|
+
Scope,
|
|
9
|
+
String as Str,
|
|
10
|
+
SynchronizedRef,
|
|
11
|
+
} from "effect";
|
|
12
|
+
import { HttpServerRequest } from "effect/http";
|
|
13
|
+
import type { HttpServerResponse } from "effect/http";
|
|
14
|
+
|
|
15
|
+
import { Principal } from "#src/contract/caller/principal.schema";
|
|
16
|
+
import { InvalidRequestError } from "#src/contract/client/invalid-request.errors";
|
|
17
|
+
import { ActorComputerClients } from "#src/contract/computer/computer-client.adapter";
|
|
18
|
+
import { ActorHost } from "#src/serve/engine/actor-host.service";
|
|
19
|
+
import { uploadSessionsWith } from "#src/serve/rpc/file/upload-sessions.pure";
|
|
20
|
+
import type { UploadLimits, UploadSessions } from "#src/serve/rpc/file/upload-sessions.pure";
|
|
21
|
+
import { forwardedRequest } from "./hosted-file-forward.layer.js";
|
|
22
|
+
import type { FileForward } from "./hosted-file-forward.layer.js";
|
|
23
|
+
import { fileServerOf } from "./hosted-file-server.layer.js";
|
|
24
|
+
import type { FileServer } from "./hosted-file-server.layer.js";
|
|
25
|
+
import { HostedRuntime } from "./hosted-runtime.service.js";
|
|
26
|
+
|
|
27
|
+
type Answer = (
|
|
28
|
+
forward: FileForward,
|
|
29
|
+
) => Effect.Effect<HttpServerResponse.HttpServerResponse, InvalidRequestError, Scope.Scope>;
|
|
30
|
+
|
|
31
|
+
interface Started {
|
|
32
|
+
readonly computers: Option.Option<ActorComputerClients["Service"]>;
|
|
33
|
+
readonly host: ActorHost["Service"];
|
|
34
|
+
readonly steps: boolean;
|
|
35
|
+
readonly runtime: HostedRuntime["Service"];
|
|
36
|
+
readonly scope: Scope.Scope;
|
|
37
|
+
readonly uploads: UploadSessions;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Whether forwarded `<Actor>/computer/steps` and `step` read the actor's durable steps. Off by default, so a host
|
|
42
|
+
* answers them `ComputersUnavailableError` until the engine hosting it turns them on.
|
|
43
|
+
*/
|
|
44
|
+
const ServeDurableSteps = Context.Reference<boolean>(
|
|
45
|
+
"@akterjs/effect/serve/hosted/hosted-file-rpcs.layer/ServeDurableSteps",
|
|
46
|
+
{
|
|
47
|
+
defaultValue: () => false,
|
|
48
|
+
},
|
|
49
|
+
);
|
|
50
|
+
|
|
51
|
+
/** The groups this server answers: `<Actor>/files/<operation>` and `<Actor>/computer/<operation>`. */
|
|
52
|
+
const groupSegments: readonly string[] = ["/files/", "/computer/"];
|
|
53
|
+
|
|
54
|
+
const noActor = 0;
|
|
55
|
+
|
|
56
|
+
const notForwarded = (tag: string): InvalidRequestError =>
|
|
57
|
+
InvalidRequestError.make({ actor: tag, message: `${tag} isn't a file or computer request` });
|
|
58
|
+
|
|
59
|
+
const actorOfTag = (tag: string): Effect.Effect<string, InvalidRequestError> => {
|
|
60
|
+
const found = Arr.findFirst(groupSegments, (segment) => Option.isSome(Str.indexOf(segment)(tag)));
|
|
61
|
+
const at = Option.flatMap(found, (segment) => Str.indexOf(segment)(tag));
|
|
62
|
+
const named = Option.filter(at, (index) => index !== noActor);
|
|
63
|
+
|
|
64
|
+
return Effect.mapBoth(Effect.fromOption(named), {
|
|
65
|
+
onFailure: () => notForwarded(tag),
|
|
66
|
+
onSuccess: (index) => Str.slice(noActor, index)(tag),
|
|
67
|
+
});
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
const startServer = (
|
|
71
|
+
{ computers, host, runtime, scope, steps, uploads }: Started,
|
|
72
|
+
actor: string,
|
|
73
|
+
): Effect.Effect<FileServer, InvalidRequestError> =>
|
|
74
|
+
Effect.gen(function* declaredServer() {
|
|
75
|
+
const declared = yield* Effect.mapError(runtime.declare(actor), () =>
|
|
76
|
+
InvalidRequestError.make({ actor, message: `${actor} isn't an actor of this app` }),
|
|
77
|
+
);
|
|
78
|
+
|
|
79
|
+
const { callers, fileAccess = Option.none(), key } = declared.actor;
|
|
80
|
+
|
|
81
|
+
/* A bundle carries its own copy of effect (akter-cloud ADR 0027), and this host's copy can't run what the bundle's
|
|
82
|
+
built inside a schema: it hands a transformation no value and decodes a declaration such as `Schema.Json` to
|
|
83
|
+
nothing, so a plain SDK actor, whose key and principals run their Standard validators that way, had every key
|
|
84
|
+
and caller refused. The host decodes a key by its encoded side, a string with its own checks, and admits a
|
|
85
|
+
principal of a kind the actor declares by the shape every principal has; the actor's handlers decode the rest in
|
|
86
|
+
the bundle. */
|
|
87
|
+
const hostPrincipals = Rec.map(callers, () => Principal);
|
|
88
|
+
|
|
89
|
+
/* A bundle built before contracts declared file calls has no `fileAccess`. Its file calls are refused like those of
|
|
90
|
+
a new build that declares none, since a rule-less path would let any admitted kind reach every key's files (FG1). */
|
|
91
|
+
const fileActor = { callers: hostPrincipals, fileAccess, key: Schema.toEncoded(key), name: actor };
|
|
92
|
+
|
|
93
|
+
return yield* Effect.provideService(
|
|
94
|
+
fileServerOf({ actor: fileActor, computers, host, steps: Option.liftPredicate(host, () => steps), uploads }),
|
|
95
|
+
Scope.Scope,
|
|
96
|
+
scope,
|
|
97
|
+
);
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Serves forwarded `<Actor>/files/<operation>` and `<Actor>/computer/<operation>` RPCs: one in-memory Effect RPC
|
|
102
|
+
* server per actor, started on first use, answering each request with the NDJSON frames a gateway relays to the client
|
|
103
|
+
* unchanged (chunks as they are produced, then one `Exit`). Upload sessions are shared by every actor the host serves,
|
|
104
|
+
* so build this once per host. Computers are reached through the `ActorComputerClients` in context when it is built;
|
|
105
|
+
* without one they answer `ComputersUnavailableError`. The forward's caller must already be verified by the host.
|
|
106
|
+
* Uploads are held to `limits` over `defaultUploadLimits`, so a host sets its own largest file and session caps.
|
|
107
|
+
*/
|
|
108
|
+
const hostedFileRpcsWith = (
|
|
109
|
+
limits: Partial<UploadLimits> = {},
|
|
110
|
+
): Effect.Effect<Answer, never, ActorHost | HostedRuntime | Scope.Scope> =>
|
|
111
|
+
Effect.gen(function* makeHostedFileRpcs() {
|
|
112
|
+
const started: Started = {
|
|
113
|
+
computers: yield* Effect.serviceOption(ActorComputerClients),
|
|
114
|
+
host: yield* ActorHost,
|
|
115
|
+
runtime: yield* HostedRuntime,
|
|
116
|
+
scope: yield* Effect.scope,
|
|
117
|
+
steps: yield* ServeDurableSteps,
|
|
118
|
+
uploads: yield* uploadSessionsWith(limits),
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
const servers = yield* SynchronizedRef.make(new Map<string, FileServer>());
|
|
122
|
+
|
|
123
|
+
const serverFor = (actor: string): Effect.Effect<FileServer, InvalidRequestError> =>
|
|
124
|
+
SynchronizedRef.modifyEffect(servers, (known) =>
|
|
125
|
+
Option.match(Option.fromNullishOr(known.get(actor)), {
|
|
126
|
+
onNone: () =>
|
|
127
|
+
Effect.map(
|
|
128
|
+
startServer(started, actor),
|
|
129
|
+
(server) => [server, new Map([...known, [actor, server]])] as const,
|
|
130
|
+
),
|
|
131
|
+
onSome: (server) => Effect.succeed([server, known] as const),
|
|
132
|
+
}),
|
|
133
|
+
);
|
|
134
|
+
|
|
135
|
+
return (forward: FileForward) =>
|
|
136
|
+
Effect.gen(function* answer() {
|
|
137
|
+
const server = yield* Effect.flatMap(actorOfTag(forward.request.tag), serverFor);
|
|
138
|
+
const request = yield* forwardedRequest(forward);
|
|
139
|
+
|
|
140
|
+
return yield* Effect.provideService(server, HttpServerRequest.HttpServerRequest, request);
|
|
141
|
+
});
|
|
142
|
+
});
|
|
143
|
+
|
|
144
|
+
/** `hostedFileRpcsWith` at `defaultUploadLimits`. */
|
|
145
|
+
const hostedFileRpcs = hostedFileRpcsWith();
|
|
146
|
+
|
|
147
|
+
export { hostedFileRpcs, hostedFileRpcsWith, ServeDurableSteps };
|
|
148
|
+
|
|
149
|
+
export type { FileForward } from "./hosted-file-forward.layer.js";
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { Effect } from "effect";
|
|
2
|
+
import type { Scope } from "effect";
|
|
3
|
+
import type { HttpServerRequest, HttpServerResponse } from "effect/http";
|
|
4
|
+
import { RpcGroup, RpcSerialization, RpcServer } from "effect/rpc";
|
|
5
|
+
import type { Rpc } from "effect/rpc";
|
|
6
|
+
|
|
7
|
+
import { Authentication } from "#src/contract/caller/authentication.api";
|
|
8
|
+
import type { CurrentCaller } from "#src/contract/caller/current-caller.service";
|
|
9
|
+
import { computerRpcsOf } from "#src/contract/computer/rpc/computer-rpc.contract";
|
|
10
|
+
import type { ComputerRpc } from "#src/contract/computer/rpc/computer-rpc.contract";
|
|
11
|
+
import { fileRpcsOf } from "#src/contract/file/rpc/file-rpc.contract";
|
|
12
|
+
import type { FileRpc } from "#src/contract/file/rpc/file-rpc.contract";
|
|
13
|
+
import { computerHandlersFor } from "#src/serve/rpc/computer/computer-rpc.layer";
|
|
14
|
+
import type { ComputerHandlers } from "#src/serve/rpc/computer/computer-rpc.layer";
|
|
15
|
+
import { fileHandlersFor } from "#src/serve/rpc/file/file-rpc.layer";
|
|
16
|
+
import type { FileHandlers, FileServing } from "#src/serve/rpc/file/file-rpc.layer";
|
|
17
|
+
import { ForwardedAuthentication } from "./hosted-file-forward.layer.js";
|
|
18
|
+
|
|
19
|
+
/** One actor's file RPC server: answers the request in context with its NDJSON frames. */
|
|
20
|
+
type FileServer = Effect.Effect<
|
|
21
|
+
HttpServerResponse.HttpServerResponse,
|
|
22
|
+
never,
|
|
23
|
+
HttpServerRequest.HttpServerRequest | Scope.Scope
|
|
24
|
+
>;
|
|
25
|
+
|
|
26
|
+
type ServedFileRpc = Rpc.AddMiddleware<FileRpc | ComputerRpc, typeof Authentication>;
|
|
27
|
+
|
|
28
|
+
const groupOf = (actor: string): RpcGroup.RpcGroup<ServedFileRpc> =>
|
|
29
|
+
RpcGroup.make(...fileRpcsOf(actor), ...computerRpcsOf(actor)).middleware(Authentication);
|
|
30
|
+
|
|
31
|
+
type GroupHandlers = {
|
|
32
|
+
readonly [Current in ServedFileRpc as Current["_tag"]]: Rpc.ToHandlerFn<Current, CurrentCaller>;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
type Handlers = Readonly<Record<string, FileHandlers[string] | ComputerHandlers[string]>>;
|
|
36
|
+
|
|
37
|
+
function asGroupHandlers(handlers: Handlers): GroupHandlers;
|
|
38
|
+
function asGroupHandlers(handlers: Handlers): Handlers | GroupHandlers {
|
|
39
|
+
return handlers;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Serves one actor's `<Actor>/files/<operation>` and `<Actor>/computer/<operation>` RPCs with the same Effect RPC
|
|
44
|
+
* server and NDJSON framing `akter dev` serves them with, behind the forwarded caller. The server lives as long as
|
|
45
|
+
* `Scope`.
|
|
46
|
+
*/
|
|
47
|
+
type ComputerServing = Parameters<typeof computerHandlersFor>[number];
|
|
48
|
+
|
|
49
|
+
const fileServerOf = (
|
|
50
|
+
serving: FileServing & {
|
|
51
|
+
readonly actor: ComputerServing["actor"];
|
|
52
|
+
readonly computers: ComputerServing["clients"];
|
|
53
|
+
readonly steps: ComputerServing["steps"];
|
|
54
|
+
},
|
|
55
|
+
): Effect.Effect<FileServer, never, Scope.Scope> => {
|
|
56
|
+
const group = groupOf(serving.actor.name);
|
|
57
|
+
|
|
58
|
+
const computers = computerHandlersFor({
|
|
59
|
+
actor: serving.actor,
|
|
60
|
+
clients: serving.computers,
|
|
61
|
+
host: serving.host,
|
|
62
|
+
steps: serving.steps,
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
const served = asGroupHandlers({ ...fileHandlersFor(serving), ...computers });
|
|
66
|
+
const handlers = group.toLayer(Effect.succeed(served));
|
|
67
|
+
|
|
68
|
+
return RpcServer.toHttpEffect(group).pipe(
|
|
69
|
+
Effect.provide([handlers, ForwardedAuthentication, RpcSerialization.layerNdjson]),
|
|
70
|
+
);
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
export { fileServerOf };
|
|
74
|
+
|
|
75
|
+
export type { FileServer };
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { Context, Effect, Layer } from "effect";
|
|
2
|
+
import type { FileSystem, Path, Scope } from "effect";
|
|
3
|
+
import type { SqlClient } from "effect/sql";
|
|
4
|
+
|
|
5
|
+
import type { OpenedActor } from "#src/host/actor/actor-database.service";
|
|
6
|
+
import { BlobSealing } from "#src/host/blob/blob-sealing.service";
|
|
7
|
+
import type { BlobOwner, TransferEffect } from "#src/host/blob/reference/blob-transfer.pure";
|
|
8
|
+
import { actorFileStorage } from "#src/host/file/actor-file-storage.sql";
|
|
9
|
+
import { blobHomeOn, canonicalHome } from "#src/host/file/blob-home.sql";
|
|
10
|
+
import type { LocalBlobHome } from "#src/host/file/blob-home.sql";
|
|
11
|
+
import { actorFilesOn, blobOwnerOn } from "#src/host/file/local-blob-owner.sql";
|
|
12
|
+
import { BlobHashing } from "#src/host/hash/blob-hashing.service";
|
|
13
|
+
import { blobHashing } from "#src/runtime/blob-hashing.layer";
|
|
14
|
+
|
|
15
|
+
interface HostedFileHomeOpening {
|
|
16
|
+
readonly catalog: SqlClient.SqlClient;
|
|
17
|
+
readonly root: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
interface HostedActorFilesOpening {
|
|
21
|
+
readonly exclusive: BlobOwner["exclusive"];
|
|
22
|
+
readonly home: LocalBlobHome;
|
|
23
|
+
readonly identity: string;
|
|
24
|
+
readonly opened: OpenedActor;
|
|
25
|
+
readonly snapshot: BlobOwner["snapshot"];
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* A file home for a host that keeps its own SQLite connections, such as one per Cloud shard: blobs are written under
|
|
30
|
+
* `root` (created if missing), sealed by the provided `BlobSealing`, and their catalog (claims and reference counts) lives on `catalog`,
|
|
31
|
+
* which only this home writes. Blobs adopted from another home are checked with akter's own SHA-256, so the host
|
|
32
|
+
* provides no hashing. Its transfers close with the scope.
|
|
33
|
+
*/
|
|
34
|
+
const hostedFileHome = ({
|
|
35
|
+
catalog,
|
|
36
|
+
root,
|
|
37
|
+
}: HostedFileHomeOpening): TransferEffect<
|
|
38
|
+
LocalBlobHome,
|
|
39
|
+
BlobSealing | FileSystem.FileSystem | Path.Path | Effect.Services<ReturnType<typeof blobHomeOn>>
|
|
40
|
+
> =>
|
|
41
|
+
Effect.gen(function* openHostedFileHome() {
|
|
42
|
+
const sealing = yield* BlobSealing;
|
|
43
|
+
const hashed = yield* Layer.build(blobHashing);
|
|
44
|
+
const hashing = Context.get(hashed, BlobHashing);
|
|
45
|
+
const canonical = yield* canonicalHome(root);
|
|
46
|
+
|
|
47
|
+
return yield* blobHomeOn({ catalog, hashing, root: canonical, sealing });
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Gives an opened actor its files on `home`. `identity` names the actor to the sealing keyring and the catalog, and
|
|
52
|
+
* every read and write of the actor's own file tables goes through `exclusive`, the host's serializer for the actor's
|
|
53
|
+
* connection, so it never interleaves with a command batch. It recovers unfinished transfers, settles references and
|
|
54
|
+
* keeps them settled until the scope closes. Commands of the returned actor reach the files through `Akter.files`.
|
|
55
|
+
*/
|
|
56
|
+
const hostedActorFiles = ({
|
|
57
|
+
exclusive,
|
|
58
|
+
home,
|
|
59
|
+
identity,
|
|
60
|
+
opened,
|
|
61
|
+
snapshot,
|
|
62
|
+
}: HostedActorFilesOpening): TransferEffect<OpenedActor, Scope.Scope> =>
|
|
63
|
+
Effect.gen(function* openHostedActorFiles() {
|
|
64
|
+
const owner = yield* blobOwnerOn({ actor: identity, exclusive, snapshot, sql: opened.sql });
|
|
65
|
+
const fileSession = yield* actorFilesOn({ home, owner, sql: opened.sql });
|
|
66
|
+
|
|
67
|
+
return {
|
|
68
|
+
...opened,
|
|
69
|
+
fileSession,
|
|
70
|
+
files: (sql: SqlClient.SqlClient) => actorFileStorage({ actor: identity, open: home.transfers.open, sql }),
|
|
71
|
+
};
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
export { hostedActorFiles, hostedFileHome };
|
|
75
|
+
|
|
76
|
+
export type { HostedActorFilesOpening, HostedFileHomeOpening };
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import { layer as nodeFileSystem } from "@effect/platform-node/NodeFileSystem";
|
|
2
|
+
import { layer as nodePath } from "@effect/platform-node/NodePath";
|
|
3
|
+
import { Cause, Effect, Layer } from "effect";
|
|
4
|
+
import type { WorkflowEngine } from "effect/workflow";
|
|
5
|
+
|
|
6
|
+
import { ActorRegistry } from "#src/contract/actor/actor-registry.service";
|
|
7
|
+
import { withJobs } from "#src/serve/engine/job-runtime.layer";
|
|
8
|
+
import { providedHandlers } from "#src/serve/engine/actor-engine.layer";
|
|
9
|
+
import { HostedRuntime } from "./hosted-runtime.service.js";
|
|
10
|
+
import { bundleWorkflows, isRefusedBuild, servedRegistry } from "./hosted-app-checks.layer.js";
|
|
11
|
+
import type { RefusedBuild } from "./hosted-app-checks.layer.js";
|
|
12
|
+
import { servedSecrets } from "./hosted-secrets.layer.js";
|
|
13
|
+
|
|
14
|
+
const runtime = HostedRuntime.layer.pipe(Layer.provide([providedHandlers, nodeFileSystem, nodePath]));
|
|
15
|
+
|
|
16
|
+
const hostedRuntime: Layer.Layer<HostedRuntime | WorkflowEngine.WorkflowEngine> = withJobs(runtime);
|
|
17
|
+
|
|
18
|
+
const hostedApp = <Output, Failure>(
|
|
19
|
+
app: Layer.Layer<Output, Failure, ActorRegistry | WorkflowEngine.WorkflowEngine>,
|
|
20
|
+
): Layer.Layer<HostedRuntime | WorkflowEngine.WorkflowEngine, Failure | RefusedBuild> => {
|
|
21
|
+
const registered = app.pipe(Layer.provide([bundleWorkflows, servedRegistry, servedSecrets]));
|
|
22
|
+
|
|
23
|
+
return runtime.pipe(
|
|
24
|
+
Layer.provide(registered),
|
|
25
|
+
Layer.provide(ActorRegistry.layer),
|
|
26
|
+
withJobs,
|
|
27
|
+
Layer.catchCause((cause): Layer.Layer<HostedRuntime | WorkflowEngine.WorkflowEngine, Failure | RefusedBuild> => {
|
|
28
|
+
for (const reason of cause.reasons) {
|
|
29
|
+
if (Cause.isDieReason(reason) && isRefusedBuild(reason.defect)) {
|
|
30
|
+
return Layer.effectContext<HostedRuntime | WorkflowEngine.WorkflowEngine, Failure | RefusedBuild, never>(
|
|
31
|
+
Effect.fail(reason.defect),
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
return Layer.effectContext<HostedRuntime | WorkflowEngine.WorkflowEngine, Failure | RefusedBuild, never>(
|
|
37
|
+
Effect.failCause(cause),
|
|
38
|
+
);
|
|
39
|
+
}),
|
|
40
|
+
);
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export { hostedApp, hostedRuntime };
|
|
44
|
+
|
|
45
|
+
export { ActorSecrets } from "#src/contract/secret/actor-secrets.adapter";
|
|
46
|
+
|
|
47
|
+
export type { SecretRequest } from "#src/contract/secret/actor-secrets.adapter";
|
|
48
|
+
|
|
49
|
+
export { ExecutionAuthority } from "#src/host/upkeep/execution-authority.pure";
|
|
50
|
+
|
|
51
|
+
export { engineOwnedRefusal } from "#src/contract/hosted/handler-failure.pure";
|
|
52
|
+
|
|
53
|
+
export { engineOwned, HandlerSql, QueryReadOnly } from "#src/host/query/query-policy.pure";
|
|
54
|
+
|
|
55
|
+
export { CommandBatch, commandBatch, dropCommand, keepCommand } from "#src/host/command/batch/command-batch.sql";
|
|
56
|
+
|
|
57
|
+
export type { CommandBatchScope } from "#src/host/command/batch/command-batch.sql";
|
|
58
|
+
|
|
59
|
+
export { ActorConnections } from "#src/host/sqlite/actor-connections.pure";
|
|
60
|
+
|
|
61
|
+
export type {
|
|
62
|
+
ActorConnectionOpener,
|
|
63
|
+
ActorDatabaseTarget,
|
|
64
|
+
SqliteHandle,
|
|
65
|
+
SqliteRow,
|
|
66
|
+
SqliteStatement,
|
|
67
|
+
SqliteValue,
|
|
68
|
+
} from "#src/host/sqlite/actor-connections.pure";
|
|
69
|
+
|
|
70
|
+
export type { ExecutionGuard } from "#src/host/upkeep/execution-authority.pure";
|
|
71
|
+
|
|
72
|
+
export { HostedAppBuildError } from "./hosted-app-build.errors.js";
|
|
73
|
+
|
|
74
|
+
export {
|
|
75
|
+
bundleHostInterface,
|
|
76
|
+
hostInterface,
|
|
77
|
+
hostInterfaceLine,
|
|
78
|
+
hostInterfaceOf,
|
|
79
|
+
oldestHostInterface,
|
|
80
|
+
servesHostInterface,
|
|
81
|
+
} from "#src/contract/actor/host-interface.pure";
|
|
82
|
+
|
|
83
|
+
export { HostedRuntime } from "./hosted-runtime.service.js";
|
|
84
|
+
|
|
85
|
+
export { JobComputers } from "#src/host/computer/job-computers.service";
|
|
86
|
+
|
|
87
|
+
export { hostedActorFiles, hostedFileHome } from "./hosted-files.layer.js";
|
|
88
|
+
|
|
89
|
+
export { hostedFileRpcs, hostedFileRpcsWith, ServeDurableSteps } from "./hosted-file-rpcs.layer.js";
|
|
90
|
+
|
|
91
|
+
export { defaultUploadLimits } from "#src/serve/rpc/file/upload-sessions.pure";
|
|
92
|
+
|
|
93
|
+
export type { UploadLimits } from "#src/serve/rpc/file/upload-sessions.pure";
|
|
94
|
+
|
|
95
|
+
export type { FileForward } from "./hosted-file-rpcs.layer.js";
|
|
96
|
+
|
|
97
|
+
export type { HostedActorFilesOpening, HostedFileHomeOpening } from "./hosted-files.layer.js";
|
|
98
|
+
|
|
99
|
+
export type { LocalBlobHome as HostedFileHome } from "#src/host/file/local-blob-home.service";
|
|
100
|
+
|
|
101
|
+
export type { LocalActorFiles as HostedFileSession } from "#src/host/file/local-blob-owner.sql";
|
|
102
|
+
|
|
103
|
+
export { heldExportFile, heldExportFiles, holdExportFiles } from "#src/host/blob/export/blob-export-holds.sql";
|
|
104
|
+
|
|
105
|
+
export type {
|
|
106
|
+
ExportedFile,
|
|
107
|
+
ExportHold,
|
|
108
|
+
HeldBlob,
|
|
109
|
+
HeldLookup,
|
|
110
|
+
HeldPage,
|
|
111
|
+
} from "#src/host/blob/export/blob-export-holds.sql";
|
|
112
|
+
|
|
113
|
+
export { ArchivedActors } from "#src/serve/archive/archived-actors.layer";
|
|
114
|
+
|
|
115
|
+
export { ArchivedStore } from "#src/serve/archive/archived-store.layer";
|
|
116
|
+
|
|
117
|
+
export { BlobKeyring } from "#src/host/blob/blob-keyring.service";
|
|
118
|
+
|
|
119
|
+
export { BlobSealing } from "#src/host/blob/blob-sealing.service";
|
|
120
|
+
|
|
121
|
+
export { BlobTransferError } from "#src/contract/file/blob-transfer.errors";
|
|
122
|
+
|
|
123
|
+
export { blobHashing } from "#src/runtime/blob-hashing.layer";
|
|
124
|
+
|
|
125
|
+
export { BlobHashing } from "#src/host/hash/blob-hashing.service";
|
|
126
|
+
|
|
127
|
+
export type { DeclaredActor, HostedKept, HostedOpening, HostedUpkeep } from "./hosted-runtime.service.js";
|
|
128
|
+
|
|
129
|
+
export type { CommittedCommand, HostFailure, LiveActor } from "#src/serve/live/live-reads.service";
|
|
130
|
+
|
|
131
|
+
export type { LiveUpdate } from "#src/contract/client/actor-rpc.contract";
|
|
132
|
+
|
|
133
|
+
export type { QueryRequest } from "#src/host/query/query-runner.service";
|
|
134
|
+
|
|
135
|
+
export type { OpenedActor } from "#src/host/actor/actor-database.service";
|
|
136
|
+
|
|
137
|
+
export type { CommandRequest, CreationRequest } from "#src/host/command/command-runner.service";
|
|
138
|
+
|
|
139
|
+
export type { JournalWindow } from "#src/contract/history/actor-journal.service";
|
|
140
|
+
|
|
141
|
+
export type { JobStore } from "#src/host/job/job-engine.adapter";
|
|
142
|
+
|
|
143
|
+
export type { Delivery, DeliveryBatch } from "#src/host/outbox/outbox-runner.service";
|
|
144
|
+
|
|
145
|
+
export type { JobAddress } from "#src/contract/job/job-id.pure";
|