@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,128 @@
|
|
|
1
|
+
import { Context, Effect, Layer } from "effect";
|
|
2
|
+
import type { Scope } from "effect";
|
|
3
|
+
import type { SqlClient } from "effect/sql";
|
|
4
|
+
|
|
5
|
+
import { ActorRegistry } from "#src/contract/actor/actor-registry.service";
|
|
6
|
+
import type { OpenedActor } from "#src/host/actor/actor-database.service";
|
|
7
|
+
import { CommandRunner } from "#src/host/command/command-runner.service";
|
|
8
|
+
import { unavailableFileStorage } from "#src/host/file/actor-file-storage.sql";
|
|
9
|
+
import { ActorMigrations } from "#src/host/migration/actor-migrations.service";
|
|
10
|
+
import type { ActorOpenError, PreparingActor } from "#src/host/migration/actor-migrations.service";
|
|
11
|
+
import { QueryRunner } from "#src/host/query/query-runner.service";
|
|
12
|
+
import { ActorUpkeep } from "#src/host/upkeep/actor-upkeep.service";
|
|
13
|
+
import type { Kept, Upkeep } from "#src/host/upkeep/actor-upkeep.service";
|
|
14
|
+
import { LiveReads } from "#src/serve/live/live-reads.service";
|
|
15
|
+
|
|
16
|
+
type DeclaredActor = Omit<PreparingActor, "sql">;
|
|
17
|
+
|
|
18
|
+
/** In Akter Cloud a failed statement's message goes to the host's log, not to the caller (`CommandRunner.statementDetail`). */
|
|
19
|
+
const logged = <Value, Failure, Services>(
|
|
20
|
+
effect: Effect.Effect<Value, Failure, Services>,
|
|
21
|
+
): Effect.Effect<Value, Failure, Services> => Effect.provideService(effect, CommandRunner.statementDetail, "logged");
|
|
22
|
+
|
|
23
|
+
interface HostedOpening {
|
|
24
|
+
readonly actor: DeclaredActor;
|
|
25
|
+
readonly filename: string;
|
|
26
|
+
readonly sql: SqlClient.SqlClient;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
interface HostedUpkeep<Failure> {
|
|
30
|
+
readonly exclusive: Upkeep<Failure>["exclusive"];
|
|
31
|
+
readonly read: Upkeep<Failure>["read"];
|
|
32
|
+
readonly key: string;
|
|
33
|
+
readonly measured?: NonNullable<Upkeep<Failure>["measured"]>;
|
|
34
|
+
readonly opened: OpenedActor;
|
|
35
|
+
readonly send: Upkeep<Failure>["send"];
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
type HostedKept<Failure> = Kept<Failure>;
|
|
39
|
+
|
|
40
|
+
type Declare = (
|
|
41
|
+
actor: string,
|
|
42
|
+
) => Effect.Effect<DeclaredActor, Effect.Error<ReturnType<ActorRegistry["Service"]["lookup"]>> | ActorOpenError>;
|
|
43
|
+
|
|
44
|
+
type Open = (opening: HostedOpening) => Effect.Effect<OpenedActor, ActorOpenError>;
|
|
45
|
+
|
|
46
|
+
const declaring = (registry: ActorRegistry["Service"], migrations: ActorMigrations["Service"]): Declare =>
|
|
47
|
+
Effect.fn("HostedRuntime.declare")(function* declare(name: string) {
|
|
48
|
+
const actor = yield* registry.lookup(name);
|
|
49
|
+
const declared = yield* migrations.declare(actor);
|
|
50
|
+
|
|
51
|
+
return { actor, declared };
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
const opening = (migrations: ActorMigrations["Service"]): Open =>
|
|
55
|
+
Effect.fn("HostedRuntime.open")(function* open({ actor, filename, sql }: HostedOpening) {
|
|
56
|
+
yield* migrations.apply({ ...actor, sql });
|
|
57
|
+
|
|
58
|
+
return { actor: actor.actor, filename, files: () => unavailableFileStorage, reader: sql, sql };
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
export class HostedRuntime extends Context.Service<
|
|
62
|
+
HostedRuntime,
|
|
63
|
+
{
|
|
64
|
+
/** When a command id first committed, so a host can mark an answer it replays from the journal. */
|
|
65
|
+
readonly committedAt: LiveReads["Service"]["committedAt"];
|
|
66
|
+
readonly coveredSince: QueryRunner["Service"]["coveredSince"];
|
|
67
|
+
readonly create: CommandRunner["Service"]["create"];
|
|
68
|
+
readonly declare: Declare;
|
|
69
|
+
readonly files: QueryRunner["Service"]["files"];
|
|
70
|
+
readonly history: QueryRunner["Service"]["history"];
|
|
71
|
+
readonly live: LiveReads["Service"]["open"];
|
|
72
|
+
readonly locateJobs: ActorUpkeep["Service"]["locateJobs"];
|
|
73
|
+
readonly open: Open;
|
|
74
|
+
readonly query: QueryRunner["Service"]["run"];
|
|
75
|
+
readonly retainedJobs: ActorUpkeep["Service"]["retainedJobs"];
|
|
76
|
+
readonly run: CommandRunner["Service"]["run"];
|
|
77
|
+
/** One durable computer step of an opened actor, by its key, with its output. */
|
|
78
|
+
readonly step: QueryRunner["Service"]["step"];
|
|
79
|
+
/** An opened actor's durable computer steps, newest first. */
|
|
80
|
+
readonly steps: QueryRunner["Service"]["steps"];
|
|
81
|
+
readonly upkeep: <Failure>(hosted: HostedUpkeep<Failure>) => Effect.Effect<HostedKept<Failure>, never, Scope.Scope>;
|
|
82
|
+
readonly version: LiveReads["Service"]["version"];
|
|
83
|
+
}
|
|
84
|
+
>()("@akterjs/effect/serve/hosted/hosted-runtime.service/HostedRuntime", {
|
|
85
|
+
make: Effect.gen(function* makeHostedRuntime() {
|
|
86
|
+
const registry = yield* ActorRegistry;
|
|
87
|
+
const migrations = yield* ActorMigrations;
|
|
88
|
+
const runner = yield* CommandRunner;
|
|
89
|
+
const queries = yield* QueryRunner;
|
|
90
|
+
const upkeeps = yield* ActorUpkeep;
|
|
91
|
+
const reads = yield* LiveReads;
|
|
92
|
+
|
|
93
|
+
const upkeep = <Failure>(hosted: HostedUpkeep<Failure>): Effect.Effect<HostedKept<Failure>, never, Scope.Scope> =>
|
|
94
|
+
logged(upkeeps.start({ ...hosted, lock: hosted.exclusive }));
|
|
95
|
+
|
|
96
|
+
return {
|
|
97
|
+
committedAt: reads.committedAt,
|
|
98
|
+
coveredSince: queries.coveredSince,
|
|
99
|
+
create: (...creating: Parameters<typeof runner.create>) => logged(runner.create(...creating)),
|
|
100
|
+
declare: declaring(registry, migrations),
|
|
101
|
+
files: queries.files,
|
|
102
|
+
history: queries.history,
|
|
103
|
+
live: reads.open,
|
|
104
|
+
locateJobs: upkeeps.locateJobs,
|
|
105
|
+
open: opening(migrations),
|
|
106
|
+
query: (...querying: Parameters<typeof queries.run>) => logged(queries.run(...querying)),
|
|
107
|
+
retainedJobs: upkeeps.retainedJobs,
|
|
108
|
+
run: (...running: Parameters<typeof runner.run>) => logged(runner.run(...running)),
|
|
109
|
+
step: queries.step,
|
|
110
|
+
steps: queries.steps,
|
|
111
|
+
upkeep,
|
|
112
|
+
version: reads.version,
|
|
113
|
+
} as const;
|
|
114
|
+
}),
|
|
115
|
+
}) {
|
|
116
|
+
public static readonly historyRetention = CommandRunner.historyRetention;
|
|
117
|
+
|
|
118
|
+
public static readonly hostTables = ActorMigrations.hostTables;
|
|
119
|
+
|
|
120
|
+
/** How long a timer the storage ceiling refused waits to fire again. */
|
|
121
|
+
public static readonly refusedTimerRetry = ActorUpkeep.refusedTimerRetry;
|
|
122
|
+
|
|
123
|
+
public static readonly layer = Layer.effect(this, this.make).pipe(
|
|
124
|
+
Layer.provide([ActorMigrations.layer, ActorUpkeep.layer, CommandRunner.layer, LiveReads.layer, QueryRunner.layer]),
|
|
125
|
+
);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export type { DeclaredActor, HostedKept, HostedOpening, HostedUpkeep };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Array as Arr, Effect, Layer, Option } from "effect";
|
|
2
|
+
|
|
3
|
+
import { ActorRegistry } from "#src/contract/actor/actor-registry.service";
|
|
4
|
+
import { ActorSecrets } from "#src/contract/secret/actor-secrets.adapter";
|
|
5
|
+
import type { SecretRequest } from "#src/contract/secret/actor-secrets.adapter";
|
|
6
|
+
import { SecretUnavailableError } from "#src/contract/secret/secret-unavailable.errors";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* The secrets a bundle's job activities read. The host's own `ActorSecrets`, when it has one, is asked only for a
|
|
10
|
+
* secret the asking actor declares in this build's registry: a bundle can't read a secret by naming another actor or
|
|
11
|
+
* skipping its own `Actor.secret`, and a host that delivers no secrets answers `unavailable`.
|
|
12
|
+
*/
|
|
13
|
+
const servedSecrets: Layer.Layer<ActorSecrets, never, ActorRegistry> = Layer.effect(
|
|
14
|
+
ActorSecrets,
|
|
15
|
+
Effect.gen(function* serveSecrets() {
|
|
16
|
+
const registry = yield* ActorRegistry;
|
|
17
|
+
const source = yield* Effect.serviceOption(ActorSecrets);
|
|
18
|
+
|
|
19
|
+
const read = Effect.fn("ActorSecrets.read")(function* read(request: SecretRequest) {
|
|
20
|
+
const actor = yield* Effect.option(registry.lookup(request.actor));
|
|
21
|
+
const declared = Option.exists(actor, ({ secrets }) => Arr.contains(secrets ?? [], request.secret));
|
|
22
|
+
|
|
23
|
+
if (!declared) {
|
|
24
|
+
return yield* SecretUnavailableError.make({ ...request, reason: "undeclared" });
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
if (Option.isNone(source)) {
|
|
28
|
+
return yield* SecretUnavailableError.make({ ...request, reason: "unavailable" });
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
return yield* source.value.read(request);
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
return ActorSecrets.of({ read });
|
|
35
|
+
}),
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
export { servedSecrets };
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { Array as Arr, Effect, Option, String as Str } from "effect";
|
|
2
|
+
import { Headers, HttpServerRequest, HttpServerResponse } from "effect/http";
|
|
3
|
+
|
|
4
|
+
type Response = HttpServerResponse.HttpServerResponse;
|
|
5
|
+
|
|
6
|
+
type AllowedHosts = readonly string[] | true;
|
|
7
|
+
|
|
8
|
+
type Middleware = <Failure, Services>(
|
|
9
|
+
app: Effect.Effect<Response, Failure, Services>,
|
|
10
|
+
) => Effect.Effect<Response, Failure, Services | HttpServerRequest.HttpServerRequest>;
|
|
11
|
+
|
|
12
|
+
const forbidden = 403;
|
|
13
|
+
|
|
14
|
+
const misdirected = 421;
|
|
15
|
+
|
|
16
|
+
const originScheme = /^https?:\/\//iu;
|
|
17
|
+
|
|
18
|
+
const portSuffix = /:\d{1,5}$/u;
|
|
19
|
+
|
|
20
|
+
const loopbackHost = /^(?:localhost|127(?:\.(?:25[0-5]|2[0-4]\d|1?\d?\d)){3}|\[::1\])(?::\d{1,5})?$/iu;
|
|
21
|
+
|
|
22
|
+
const refusal =
|
|
23
|
+
"this listener only answers a loopback Host (localhost, 127.0.0.0/8 or [::1]) or a name in allowedHosts, so a page that rebinds its own name to this address gets nothing";
|
|
24
|
+
|
|
25
|
+
const crossSite =
|
|
26
|
+
"this listener only answers requests from a loopback page or from outside a browser, so another site's page can't call it with your development caller";
|
|
27
|
+
|
|
28
|
+
const isLoopbackHost = (host: string): boolean => loopbackHost.test(host);
|
|
29
|
+
|
|
30
|
+
const isAllowedHost =
|
|
31
|
+
(allowed: AllowedHosts) =>
|
|
32
|
+
(host: string): boolean => {
|
|
33
|
+
if (allowed === true || isLoopbackHost(host)) {
|
|
34
|
+
return true;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const name = Str.toLowerCase(Str.replace(portSuffix, "")(host));
|
|
38
|
+
|
|
39
|
+
return Arr.some(allowed, (listed) => Str.toLowerCase(listed) === name);
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
const isLoopbackOrigin = (origin: string): boolean =>
|
|
43
|
+
originScheme.test(origin) && isLoopbackHost(Str.replace(originScheme, "")(origin));
|
|
44
|
+
|
|
45
|
+
const allowedHostsOnly =
|
|
46
|
+
(allowed: AllowedHosts): Middleware =>
|
|
47
|
+
(app) =>
|
|
48
|
+
HttpServerRequest.HttpServerRequest.use((request) => {
|
|
49
|
+
if (Option.exists(Headers.get(request.headers, "host"), isAllowedHost(allowed))) {
|
|
50
|
+
return app;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
return Effect.succeed(HttpServerResponse.text(refusal, { status: misdirected }));
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
const loopbackOriginOnly: Middleware = (app) =>
|
|
57
|
+
HttpServerRequest.HttpServerRequest.use((request) => {
|
|
58
|
+
if (Option.match(Headers.get(request.headers, "origin"), { onNone: () => true, onSome: isLoopbackOrigin })) {
|
|
59
|
+
return app;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
return Effect.succeed(HttpServerResponse.text(crossSite, { status: forbidden }));
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
export { allowedHostsOnly, isAllowedHost, isLoopbackHost, isLoopbackOrigin, loopbackOriginOnly };
|
|
66
|
+
|
|
67
|
+
export type { AllowedHosts };
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
|
|
3
|
+
const Cell = Schema.Union([Schema.String, Schema.Finite, Schema.Null]);
|
|
4
|
+
|
|
5
|
+
const Rows = Schema.Array(Schema.Array(Cell));
|
|
6
|
+
|
|
7
|
+
const DeveloperTable = Schema.Struct({
|
|
8
|
+
columns: Schema.Array(Schema.String),
|
|
9
|
+
name: Schema.String,
|
|
10
|
+
rows: Rows,
|
|
11
|
+
total: Schema.Int,
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
const JournaledCommand = Schema.Struct({
|
|
15
|
+
at: Schema.Int,
|
|
16
|
+
command: Schema.String,
|
|
17
|
+
commandId: Schema.String,
|
|
18
|
+
exit: Schema.String,
|
|
19
|
+
payload: Schema.String,
|
|
20
|
+
principal: Schema.String,
|
|
21
|
+
seq: Schema.Int,
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
const PendingTimer = Schema.Struct({
|
|
25
|
+
command: Schema.String,
|
|
26
|
+
dueAt: Schema.Int,
|
|
27
|
+
id: Schema.String,
|
|
28
|
+
payload: Schema.String,
|
|
29
|
+
principal: Schema.String,
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
const OutboxEntry = Schema.Struct({
|
|
33
|
+
actor: Schema.String,
|
|
34
|
+
commandId: Schema.String,
|
|
35
|
+
key: Schema.String,
|
|
36
|
+
member: Schema.String,
|
|
37
|
+
payload: Schema.String,
|
|
38
|
+
seq: Schema.Int,
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
const FailedDelivery = Schema.Struct({
|
|
42
|
+
actor: Schema.String,
|
|
43
|
+
at: Schema.Int,
|
|
44
|
+
commandId: Schema.String,
|
|
45
|
+
error: Schema.String,
|
|
46
|
+
key: Schema.String,
|
|
47
|
+
member: Schema.String,
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
const JobRun = Schema.Struct({
|
|
51
|
+
entries: Schema.Array(Schema.Struct({ entry: Schema.String, value: Schema.String })),
|
|
52
|
+
executionId: Schema.String,
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
const ActorFile = Schema.Struct({ bytes: Schema.Int, name: Schema.String });
|
|
56
|
+
|
|
57
|
+
const ActorInspection = Schema.Struct({
|
|
58
|
+
actor: Schema.String,
|
|
59
|
+
commands: Schema.Array(JournaledCommand),
|
|
60
|
+
failedDeliveries: Schema.Array(FailedDelivery),
|
|
61
|
+
files: Schema.Array(ActorFile),
|
|
62
|
+
jobs: Schema.Array(JobRun),
|
|
63
|
+
key: Schema.String,
|
|
64
|
+
outbox: Schema.Array(OutboxEntry),
|
|
65
|
+
state: Schema.NullOr(Schema.String),
|
|
66
|
+
tables: Schema.Array(DeveloperTable),
|
|
67
|
+
timers: Schema.Array(PendingTimer),
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
type ActorInspection = typeof ActorInspection.Type;
|
|
71
|
+
|
|
72
|
+
const ActorType = Schema.Struct({ actor: Schema.String, keys: Schema.Array(Schema.String) });
|
|
73
|
+
|
|
74
|
+
const ActorTypes = Schema.Array(ActorType);
|
|
75
|
+
|
|
76
|
+
type ActorTypes = typeof ActorTypes.Type;
|
|
77
|
+
|
|
78
|
+
type DeveloperTable = typeof DeveloperTable.Type;
|
|
79
|
+
|
|
80
|
+
type JournaledCommand = typeof JournaledCommand.Type;
|
|
81
|
+
|
|
82
|
+
type PendingTimer = typeof PendingTimer.Type;
|
|
83
|
+
|
|
84
|
+
type OutboxEntry = typeof OutboxEntry.Type;
|
|
85
|
+
|
|
86
|
+
type FailedDelivery = typeof FailedDelivery.Type;
|
|
87
|
+
|
|
88
|
+
type JobRun = typeof JobRun.Type;
|
|
89
|
+
|
|
90
|
+
type ActorFile = typeof ActorFile.Type;
|
|
91
|
+
|
|
92
|
+
export { ActorInspection, ActorTypes, Rows };
|
|
93
|
+
|
|
94
|
+
export type { ActorFile, DeveloperTable, FailedDelivery, JobRun, JournaledCommand, OutboxEntry, PendingTimer };
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { Array as Arr, Effect, Option, Schema, String as Str } from "effect";
|
|
2
|
+
import type { SqlClient, SqlError } from "effect/sql";
|
|
3
|
+
|
|
4
|
+
import { Rows } from "./actor-inspection.schema.js";
|
|
5
|
+
import type {
|
|
6
|
+
DeveloperTable,
|
|
7
|
+
FailedDelivery,
|
|
8
|
+
JobRun,
|
|
9
|
+
JournaledCommand,
|
|
10
|
+
OutboxEntry,
|
|
11
|
+
PendingTimer,
|
|
12
|
+
} from "./actor-inspection.schema.js";
|
|
13
|
+
|
|
14
|
+
type Sql<Value> = Effect.Effect<Value, SqlError.SqlError | Schema.SchemaError>;
|
|
15
|
+
|
|
16
|
+
interface NameRow {
|
|
17
|
+
readonly name: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
interface CountRow {
|
|
21
|
+
readonly total: number;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
interface WorkflowRow {
|
|
25
|
+
readonly entry: string;
|
|
26
|
+
readonly execution_id: string;
|
|
27
|
+
readonly value: string;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const shownRows = 100;
|
|
31
|
+
|
|
32
|
+
const shownCommands = 100;
|
|
33
|
+
|
|
34
|
+
const noRows = 0;
|
|
35
|
+
|
|
36
|
+
const decodeRows = Schema.decodeUnknownEffect(Rows);
|
|
37
|
+
|
|
38
|
+
const identifier = (name: string): string => `"${Str.replaceAll('"', '""')(name)}"`;
|
|
39
|
+
|
|
40
|
+
const shownColumn = (column: string): string =>
|
|
41
|
+
`CASE typeof(${identifier(column)}) WHEN 'blob' THEN '<' || length(${identifier(column)}) || ' bytes>' ELSE ${identifier(column)} END`;
|
|
42
|
+
|
|
43
|
+
const stateOf = (sql: SqlClient.SqlClient): Sql<Option.Option<string>> =>
|
|
44
|
+
Effect.map(sql<{ readonly value: string }>`SELECT value FROM akter_state WHERE id = 1`, (rows) =>
|
|
45
|
+
Option.map(Arr.head(rows), (row) => row.value),
|
|
46
|
+
);
|
|
47
|
+
|
|
48
|
+
const rowsOf = (sql: SqlClient.SqlClient, name: string, columns: readonly string[]): Sql<typeof Rows.Type> => {
|
|
49
|
+
const selected = Arr.join(Arr.map(columns, shownColumn), ", ");
|
|
50
|
+
|
|
51
|
+
return Effect.flatMap(
|
|
52
|
+
sql.unsafe(`SELECT ${selected} FROM ${identifier(name)} LIMIT ${shownRows}`).values,
|
|
53
|
+
decodeRows,
|
|
54
|
+
);
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
const developerTable = (sql: SqlClient.SqlClient, name: string): Sql<DeveloperTable> =>
|
|
58
|
+
Effect.gen(function* describeTable() {
|
|
59
|
+
const described = yield* sql.unsafe<NameRow>(`PRAGMA table_info(${identifier(name)})`);
|
|
60
|
+
const columns = Arr.map(described, (column) => column.name);
|
|
61
|
+
const rows = yield* rowsOf(sql, name, columns);
|
|
62
|
+
const counted = yield* sql.unsafe<CountRow>(`SELECT count(*) AS total FROM ${identifier(name)}`);
|
|
63
|
+
|
|
64
|
+
return {
|
|
65
|
+
columns,
|
|
66
|
+
name,
|
|
67
|
+
rows,
|
|
68
|
+
total: Option.getOrElse(
|
|
69
|
+
Option.map(Arr.head(counted), (row) => row.total),
|
|
70
|
+
() => noRows,
|
|
71
|
+
),
|
|
72
|
+
};
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
const developerTables = (sql: SqlClient.SqlClient): Sql<readonly DeveloperTable[]> =>
|
|
76
|
+
Effect.flatMap(
|
|
77
|
+
sql<NameRow>`SELECT name FROM sqlite_schema WHERE type = 'table' AND substr(name, 1, 7) <> 'sqlite_' AND substr(name, 1, 6) <> 'akter_' ORDER BY name`,
|
|
78
|
+
(tables) => Effect.forEach(tables, (table) => developerTable(sql, table.name)),
|
|
79
|
+
);
|
|
80
|
+
|
|
81
|
+
const commandsOf = (sql: SqlClient.SqlClient): Sql<readonly JournaledCommand[]> =>
|
|
82
|
+
sql<JournaledCommand>`SELECT seq, command_id AS "commandId", command, payload, principal, exit, at FROM akter_commands ORDER BY seq DESC LIMIT ${shownCommands}`;
|
|
83
|
+
|
|
84
|
+
const timersOf = (sql: SqlClient.SqlClient): Sql<readonly PendingTimer[]> =>
|
|
85
|
+
sql<PendingTimer>`SELECT id, due_at AS "dueAt", command, payload, principal FROM akter_timers ORDER BY due_at, id`;
|
|
86
|
+
|
|
87
|
+
const outboxOf = (sql: SqlClient.SqlClient): Sql<readonly OutboxEntry[]> =>
|
|
88
|
+
sql<OutboxEntry>`SELECT seq, command_id AS "commandId", actor, key, member, payload FROM akter_outbox ORDER BY seq`;
|
|
89
|
+
|
|
90
|
+
const failedDeliveriesOf = (sql: SqlClient.SqlClient): Sql<readonly FailedDelivery[]> =>
|
|
91
|
+
sql<FailedDelivery>`SELECT command_id AS "commandId", actor, key, member, error, at FROM akter_failed_deliveries ORDER BY at, command_id`;
|
|
92
|
+
|
|
93
|
+
const runsOf = (rows: readonly WorkflowRow[]): readonly JobRun[] =>
|
|
94
|
+
Arr.match(rows, {
|
|
95
|
+
onEmpty: () => [],
|
|
96
|
+
onNonEmpty: (some) =>
|
|
97
|
+
Arr.map(
|
|
98
|
+
Arr.groupWith(some, (left, right) => left.execution_id === right.execution_id),
|
|
99
|
+
(group) => ({
|
|
100
|
+
entries: Arr.map(group, ({ entry, value }) => ({ entry, value })),
|
|
101
|
+
executionId: Arr.headNonEmpty(group).execution_id,
|
|
102
|
+
}),
|
|
103
|
+
),
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
const jobsOf = (sql: SqlClient.SqlClient): Sql<readonly JobRun[]> =>
|
|
107
|
+
Effect.map(
|
|
108
|
+
sql<WorkflowRow>`SELECT execution_id, entry, value FROM akter_workflow ORDER BY execution_id, entry`,
|
|
109
|
+
runsOf,
|
|
110
|
+
);
|
|
111
|
+
|
|
112
|
+
export { commandsOf, developerTables, failedDeliveriesOf, jobsOf, outboxOf, stateOf, timersOf };
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import { Array as Arr, Context, Effect, FileSystem, Layer, Option, Schema, Stream } from "effect";
|
|
2
|
+
import type { Duration, Scope, Path } from "effect";
|
|
3
|
+
import type { SqlClient } from "effect/sql";
|
|
4
|
+
|
|
5
|
+
import { ActorNotCreatedError } from "#src/contract/actor/actor-not-created.errors";
|
|
6
|
+
import { SqliteDriver } from "#src/host/sqlite/sqlite-driver.service";
|
|
7
|
+
import { ActorLocation } from "#src/serve/engine/actor-location.service";
|
|
8
|
+
import type { ActorAddress } from "#src/serve/engine/actor-location.service";
|
|
9
|
+
import { StoreUnreadableError } from "#src/serve/store/store-unreadable.errors";
|
|
10
|
+
import { filePage } from "#src/host/blob/reference/blob-file-page.sql";
|
|
11
|
+
|
|
12
|
+
import { ActorInspection } from "./actor-inspection.schema.js";
|
|
13
|
+
import type { ActorFile, ActorTypes } from "./actor-inspection.schema.js";
|
|
14
|
+
import { prepareInspectionWal } from "./inspector-wal.pure.js";
|
|
15
|
+
import {
|
|
16
|
+
commandsOf,
|
|
17
|
+
developerTables,
|
|
18
|
+
failedDeliveriesOf,
|
|
19
|
+
jobsOf,
|
|
20
|
+
outboxOf,
|
|
21
|
+
stateOf,
|
|
22
|
+
timersOf,
|
|
23
|
+
} from "./actor-inspection.sql.js";
|
|
24
|
+
|
|
25
|
+
type InspectFailure = ActorNotCreatedError | StoreUnreadableError;
|
|
26
|
+
|
|
27
|
+
interface Inspected extends ActorAddress {
|
|
28
|
+
readonly directory: string;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
interface Watched extends Inspected {
|
|
32
|
+
readonly every: Duration.Input;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
interface InspectOperations {
|
|
36
|
+
readonly actor: (inspected: Inspected) => Effect.Effect<ActorInspection, InspectFailure>;
|
|
37
|
+
readonly actors: (directory: string) => Effect.Effect<ActorTypes, StoreUnreadableError>;
|
|
38
|
+
readonly watch: (watched: Watched) => Stream.Stream<ActorInspection, InspectFailure>;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
interface Reader {
|
|
42
|
+
readonly read: Effect.Effect<ActorInspection, StoreUnreadableError>;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
type Inspecting = FileSystem.FileSystem | Path.Path | SqliteDriver;
|
|
46
|
+
|
|
47
|
+
const locationIn = (
|
|
48
|
+
directory: string,
|
|
49
|
+
): Effect.Effect<ActorLocation["Service"], never, FileSystem.FileSystem | Path.Path | Scope.Scope> =>
|
|
50
|
+
Effect.map(Layer.build(ActorLocation.directory(directory)), (services) => Context.get(services, ActorLocation));
|
|
51
|
+
|
|
52
|
+
const encodeInspection = Schema.encodeEffect(Schema.fromJsonString(ActorInspection));
|
|
53
|
+
|
|
54
|
+
const unreadable =
|
|
55
|
+
(directory: string) =>
|
|
56
|
+
(failure: { readonly message: string }): StoreUnreadableError =>
|
|
57
|
+
StoreUnreadableError.make({ directory, message: failure.message });
|
|
58
|
+
|
|
59
|
+
const filesIn = Effect.fn("Inspect.filesIn")(function* filesIn(sql: SqlClient.SqlClient) {
|
|
60
|
+
const owners = yield* sql<{
|
|
61
|
+
readonly actor: string;
|
|
62
|
+
}>`SELECT actor FROM akter_blob_owners WHERE id = 1 AND state = 'active'`;
|
|
63
|
+
|
|
64
|
+
const owner = Arr.head(owners);
|
|
65
|
+
|
|
66
|
+
if (Option.isNone(owner)) {
|
|
67
|
+
return [];
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
const page = yield* filePage({ actor: owner.value.actor, listing: {}, sql });
|
|
71
|
+
|
|
72
|
+
return Arr.map(page.entries, ({ bytes, path }): ActorFile => ({ bytes, name: path }));
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
type Files = ReturnType<typeof filesIn>;
|
|
76
|
+
|
|
77
|
+
const sidecarsUnlinked = Effect.fn("Inspect.sidecarsUnlinked")(function* sidecarsUnlinked(
|
|
78
|
+
fileSystem: FileSystem.FileSystem,
|
|
79
|
+
database: string,
|
|
80
|
+
) {
|
|
81
|
+
const unlinked = yield* Effect.forEach(["-wal", "-shm"], (suffix) =>
|
|
82
|
+
fileSystem.lstat(`${database}${suffix}`).pipe(
|
|
83
|
+
Effect.map((stats) => stats.type !== "SymbolicLink"),
|
|
84
|
+
Effect.catchReason("PlatformError", "NotFound", () => Effect.succeed(true)),
|
|
85
|
+
),
|
|
86
|
+
);
|
|
87
|
+
|
|
88
|
+
return Arr.every(unlinked, (safe) => safe);
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
const inspectionOf = (
|
|
92
|
+
sql: SqlClient.SqlClient,
|
|
93
|
+
address: ActorAddress,
|
|
94
|
+
files: Files,
|
|
95
|
+
): Effect.Effect<ActorInspection, Effect.Error<ReturnType<typeof commandsOf>> | Effect.Error<Files>> =>
|
|
96
|
+
Effect.all({
|
|
97
|
+
commands: commandsOf(sql),
|
|
98
|
+
failedDeliveries: failedDeliveriesOf(sql),
|
|
99
|
+
files,
|
|
100
|
+
jobs: jobsOf(sql),
|
|
101
|
+
outbox: outboxOf(sql),
|
|
102
|
+
state: Effect.map(stateOf(sql), Option.getOrNull),
|
|
103
|
+
tables: developerTables(sql),
|
|
104
|
+
timers: timersOf(sql),
|
|
105
|
+
}).pipe(Effect.map((parts) => ({ ...parts, actor: address.actor, key: address.key })));
|
|
106
|
+
|
|
107
|
+
const readerOf = Effect.fn("Inspect.readerOf")(function* readerOf({ actor, directory, key }: Inspected) {
|
|
108
|
+
const location = yield* locationIn(directory);
|
|
109
|
+
const { driver, fileSystem } = yield* Effect.all({ driver: SqliteDriver, fileSystem: FileSystem.FileSystem });
|
|
110
|
+
const { database } = location.locate({ actor, key });
|
|
111
|
+
const listed = yield* location.list;
|
|
112
|
+
|
|
113
|
+
if (
|
|
114
|
+
!Arr.some(listed, (stored) => stored.actor === actor && stored.key === key) ||
|
|
115
|
+
!(yield* Effect.mapError(sidecarsUnlinked(fileSystem, database), unreadable(directory)))
|
|
116
|
+
) {
|
|
117
|
+
return yield* ActorNotCreatedError.make({ actor: `${actor}/${key}` });
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
yield* Effect.mapError(prepareInspectionWal(fileSystem, database), unreadable(directory));
|
|
121
|
+
const sql = yield* Effect.mapError(driver.openQueryOnly(database, { readOnly: true }), unreadable(directory));
|
|
122
|
+
const files = filesIn(sql);
|
|
123
|
+
|
|
124
|
+
return {
|
|
125
|
+
read: Effect.mapError(sql.withTransaction(inspectionOf(sql, { actor, key }, files)), unreadable(directory)),
|
|
126
|
+
} satisfies Reader;
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
const byType = (listed: readonly ActorAddress[]): ActorTypes =>
|
|
130
|
+
Arr.match(listed, {
|
|
131
|
+
onEmpty: () => [],
|
|
132
|
+
onNonEmpty: (some) =>
|
|
133
|
+
Arr.map(
|
|
134
|
+
Arr.groupWith(some, (left, right) => left.actor === right.actor),
|
|
135
|
+
(group) => ({ actor: Arr.headNonEmpty(group).actor, keys: Arr.map(group, (address) => address.key) }),
|
|
136
|
+
),
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
const actors = (directory: string): Effect.Effect<ActorTypes, StoreUnreadableError, Inspecting> =>
|
|
140
|
+
Effect.scoped(Effect.flatMap(locationIn(directory), (location) => Effect.map(location.list, byType)));
|
|
141
|
+
|
|
142
|
+
const actor = (inspected: Inspected): Effect.Effect<ActorInspection, InspectFailure, Inspecting> =>
|
|
143
|
+
Effect.scoped(Effect.flatMap(readerOf(inspected), (reader) => reader.read));
|
|
144
|
+
|
|
145
|
+
const watch = ({ every, ...inspected }: Watched): Stream.Stream<ActorInspection, InspectFailure, Inspecting> =>
|
|
146
|
+
Stream.unwrap(
|
|
147
|
+
Effect.map(readerOf(inspected), ({ read }) => {
|
|
148
|
+
const encoded = Effect.flatMap(read, (inspection) =>
|
|
149
|
+
Effect.map(Effect.orDie(encodeInspection(inspection)), (text) => ({ inspection, text })),
|
|
150
|
+
);
|
|
151
|
+
|
|
152
|
+
return Stream.tick(every).pipe(
|
|
153
|
+
Stream.mapEffect(() => encoded),
|
|
154
|
+
Stream.changesWith((before, after) => before.text === after.text),
|
|
155
|
+
Stream.map(({ inspection }) => inspection),
|
|
156
|
+
);
|
|
157
|
+
}),
|
|
158
|
+
);
|
|
159
|
+
|
|
160
|
+
export class Inspect extends Context.Service<Inspect, InspectOperations>()(
|
|
161
|
+
"@akterjs/effect/serve/inspect/inspect.service/Inspect",
|
|
162
|
+
) {
|
|
163
|
+
public static readonly layer: Layer.Layer<Inspect, never, Inspecting> = Layer.effect(
|
|
164
|
+
this,
|
|
165
|
+
Effect.map(Effect.context<Inspecting>(), (services) => ({
|
|
166
|
+
actor: (inspected: Inspected) => Effect.provideContext(actor(inspected), services),
|
|
167
|
+
actors: (directory: string) => Effect.provideContext(actors(directory), services),
|
|
168
|
+
watch: (watched: Watched) => Stream.provideContext(watch(watched), services),
|
|
169
|
+
})),
|
|
170
|
+
);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
export type { Inspecting, InspectFailure };
|