@akterjs/effect 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/README.md +43 -2
- package/dist/contract/actor/actor-already-exists.errors.d.mts +8 -0
- package/dist/contract/actor/actor-already-exists.errors.mjs +4 -0
- package/dist/contract/actor/actor-definition.pure.d.mts +21 -0
- package/dist/contract/actor/actor-definition.pure.mjs +106 -0
- package/dist/contract/actor/actor-erased.errors.d.mts +8 -0
- package/dist/contract/actor/actor-erased.errors.mjs +4 -0
- package/dist/contract/actor/actor-names.pure.d.mts +11 -0
- package/dist/contract/actor/actor-names.pure.mjs +51 -0
- package/dist/contract/actor/actor-not-created.errors.d.mts +8 -0
- package/dist/contract/actor/actor-not-created.errors.mjs +4 -0
- package/dist/contract/actor/actor-not-registered.errors.d.mts +8 -0
- package/dist/contract/actor/actor-not-registered.errors.mjs +4 -0
- package/dist/contract/actor/actor-registry.service.d.mts +16 -0
- package/dist/contract/actor/actor-registry.service.mjs +21 -0
- package/dist/contract/actor/actor.contract.d.mts +238 -0
- package/dist/contract/actor/actor.contract.mjs +1 -0
- package/dist/contract/actor/host-interface.pure.d.mts +23 -0
- package/dist/contract/actor/host-interface.pure.mjs +39 -0
- package/dist/contract/actor/reserved-member.errors.d.mts +9 -0
- package/dist/contract/actor/reserved-member.errors.mjs +7 -0
- package/dist/contract/akter.service.d.mts +75 -0
- package/dist/contract/akter.service.mjs +134 -0
- package/dist/contract/caller/authentication.api.d.mts +6 -0
- package/dist/contract/caller/authentication.api.mjs +5 -0
- package/dist/contract/caller/caller-admission.pure.d.mts +27 -0
- package/dist/contract/caller/caller-admission.pure.mjs +59 -0
- package/dist/contract/caller/caller-not-allowed.errors.d.mts +16 -0
- package/dist/contract/caller/caller-not-allowed.errors.mjs +18 -0
- package/dist/contract/caller/caller.schema.d.mts +7 -0
- package/dist/contract/caller/caller.schema.mjs +8 -0
- package/dist/contract/caller/current-caller.service.d.mts +7 -0
- package/dist/contract/caller/current-caller.service.mjs +4 -0
- package/dist/contract/caller/principal.schema.d.mts +13 -0
- package/dist/contract/caller/principal.schema.mjs +10 -0
- package/dist/contract/caller/unauthenticated.errors.d.mts +8 -0
- package/dist/contract/caller/unauthenticated.errors.mjs +4 -0
- package/dist/contract/client/actor-client.adapter.d.mts +42 -0
- package/dist/contract/client/actor-client.adapter.mjs +90 -0
- package/dist/contract/client/actor-client.contract.d.mts +30 -0
- package/dist/contract/client/actor-client.contract.mjs +1 -0
- package/dist/contract/client/actor-rpc.contract.d.mts +33 -0
- package/dist/contract/client/actor-rpc.contract.mjs +16 -0
- package/dist/contract/client/actor-unavailable.errors.d.mts +9 -0
- package/dist/contract/client/actor-unavailable.errors.mjs +7 -0
- package/dist/contract/client/client-failure.contract.d.mts +28 -0
- package/dist/contract/client/client-failure.contract.mjs +28 -0
- package/dist/contract/client/invalid-request.errors.d.mts +9 -0
- package/dist/contract/client/invalid-request.errors.mjs +7 -0
- package/dist/contract/client/storage-limit.errors.d.mts +16 -0
- package/dist/contract/client/storage-limit.errors.mjs +14 -0
- package/dist/contract/command/command-id-expired.errors.d.mts +11 -0
- package/dist/contract/command/command-id-expired.errors.mjs +9 -0
- package/dist/contract/command/command-id.schema.d.mts +3 -0
- package/dist/contract/command/command-id.schema.mjs +4 -0
- package/dist/contract/command/command.contract.d.mts +117 -0
- package/dist/contract/command/command.contract.mjs +111 -0
- package/dist/contract/command/outbox-id.pure.d.mts +9 -0
- package/dist/contract/command/outbox-id.pure.mjs +14 -0
- package/dist/contract/command/outbox.schema.d.mts +9 -0
- package/dist/contract/command/outbox.schema.mjs +10 -0
- package/dist/contract/command/timer.schema.d.mts +20 -0
- package/dist/contract/command/timer.schema.mjs +14 -0
- package/dist/contract/computer/checkpoint-expired.errors.d.mts +12 -0
- package/dist/contract/computer/checkpoint-expired.errors.mjs +8 -0
- package/dist/contract/computer/computer-client-failure.contract.d.mts +16 -0
- package/dist/contract/computer/computer-client-failure.contract.mjs +1 -0
- package/dist/contract/computer/computer-client.adapter.d.mts +21 -0
- package/dist/contract/computer/computer-client.adapter.mjs +70 -0
- package/dist/contract/computer/computer-client.contract.d.mts +56 -0
- package/dist/contract/computer/computer-client.contract.mjs +1 -0
- package/dist/contract/computer/computer-held.errors.d.mts +13 -0
- package/dist/contract/computer/computer-held.errors.mjs +11 -0
- package/dist/contract/computer/computer-limit.errors.d.mts +15 -0
- package/dist/contract/computer/computer-limit.errors.mjs +13 -0
- package/dist/contract/computer/computer-lost.errors.d.mts +12 -0
- package/dist/contract/computer/computer-lost.errors.mjs +8 -0
- package/dist/contract/computer/computer-not-found.errors.d.mts +9 -0
- package/dist/contract/computer/computer-not-found.errors.mjs +5 -0
- package/dist/contract/computer/computer.schema.d.mts +122 -0
- package/dist/contract/computer/computer.schema.mjs +117 -0
- package/dist/contract/computer/computers-unavailable.errors.d.mts +9 -0
- package/dist/contract/computer/computers-unavailable.errors.mjs +5 -0
- package/dist/contract/computer/files/computer-files.schema.d.mts +28 -0
- package/dist/contract/computer/files/computer-files.schema.mjs +24 -0
- package/dist/contract/computer/rpc/computer-rpc.contract.d.mts +108 -0
- package/dist/contract/computer/rpc/computer-rpc.contract.mjs +117 -0
- package/dist/contract/computer/step/computer-step.contract.d.mts +21 -0
- package/dist/contract/computer/step/computer-step.contract.mjs +89 -0
- package/dist/contract/computer/step/computer-step.schema.d.mts +69 -0
- package/dist/contract/computer/step/computer-step.schema.mjs +71 -0
- package/dist/contract/computer/step/step-failure.schema.d.mts +13 -0
- package/dist/contract/computer/step/step-failure.schema.mjs +24 -0
- package/dist/contract/computer/step/step-not-found.errors.d.mts +9 -0
- package/dist/contract/computer/step/step-not-found.errors.mjs +5 -0
- package/dist/contract/description/published-contract.pure.d.mts +51 -0
- package/dist/contract/description/published-contract.pure.mjs +75 -0
- package/dist/contract/file/access/file-access-denied.errors.d.mts +11 -0
- package/dist/contract/file/access/file-access-denied.errors.mjs +9 -0
- package/dist/contract/file/access/file-access.contract.d.mts +35 -0
- package/dist/contract/file/access/file-access.contract.mjs +32 -0
- package/dist/contract/file/actor-files.contract.d.mts +50 -0
- package/dist/contract/file/actor-files.contract.mjs +1 -0
- package/dist/contract/file/blob-transfer.errors.d.mts +9 -0
- package/dist/contract/file/blob-transfer.errors.mjs +7 -0
- package/dist/contract/file/file-client-failure.contract.d.mts +24 -0
- package/dist/contract/file/file-client-failure.contract.mjs +1 -0
- package/dist/contract/file/file-client.adapter.d.mts +17 -0
- package/dist/contract/file/file-client.adapter.mjs +21 -0
- package/dist/contract/file/file-client.contract.d.mts +14 -0
- package/dist/contract/file/file-client.contract.mjs +1 -0
- package/dist/contract/file/file-listing.pure.d.mts +6 -0
- package/dist/contract/file/file-listing.pure.mjs +18 -0
- package/dist/contract/file/file-not-found.errors.d.mts +8 -0
- package/dist/contract/file/file-not-found.errors.mjs +4 -0
- package/dist/contract/file/file-path.pure.d.mts +4 -0
- package/dist/contract/file/file-path.pure.mjs +38 -0
- package/dist/contract/file/files-unavailable.errors.d.mts +8 -0
- package/dist/contract/file/files-unavailable.errors.mjs +4 -0
- package/dist/contract/file/invalid-file-request.errors.d.mts +9 -0
- package/dist/contract/file/invalid-file-request.errors.mjs +7 -0
- package/dist/contract/file/rpc/file-rpc.contract.d.mts +88 -0
- package/dist/contract/file/rpc/file-rpc.contract.mjs +117 -0
- package/dist/contract/file/rpc/file-too-large.errors.d.mts +13 -0
- package/dist/contract/file/rpc/file-too-large.errors.mjs +11 -0
- package/dist/contract/file/rpc/rpc-file-clients.layer.d.mts +10 -0
- package/dist/contract/file/rpc/rpc-file-clients.layer.mjs +95 -0
- package/dist/contract/fork/fork-rpc.contract.d.mts +40 -0
- package/dist/contract/fork/fork-rpc.contract.mjs +26 -0
- package/dist/contract/history/actor-journal.service.d.mts +58 -0
- package/dist/contract/history/actor-journal.service.mjs +67 -0
- package/dist/contract/history/history-entry.pure.d.mts +79 -0
- package/dist/contract/history/history-entry.pure.mjs +95 -0
- package/dist/contract/hosted/handler-failed.errors.d.mts +16 -0
- package/dist/contract/hosted/handler-failed.errors.mjs +14 -0
- package/dist/contract/hosted/handler-failure.pure.d.mts +21 -0
- package/dist/contract/hosted/handler-failure.pure.mjs +86 -0
- package/dist/contract/hosted/hosted-actor.service.d.mts +23 -0
- package/dist/contract/hosted/hosted-actor.service.mjs +64 -0
- package/dist/contract/hosted/hosted-command.service.d.mts +20 -0
- package/dist/contract/hosted/hosted-command.service.mjs +88 -0
- package/dist/contract/hosted/hosted-create.service.d.mts +17 -0
- package/dist/contract/hosted/hosted-create.service.mjs +67 -0
- package/dist/contract/hosted/hosted-error.contract.d.mts +11 -0
- package/dist/contract/hosted/hosted-error.contract.mjs +1 -0
- package/dist/contract/hosted/hosted-failure.schema.d.mts +18 -0
- package/dist/contract/hosted/hosted-failure.schema.mjs +31 -0
- package/dist/contract/hosted/hosted-outcome.contract.d.mts +18 -0
- package/dist/contract/hosted/hosted-outcome.contract.mjs +1 -0
- package/dist/contract/hosted/hosted-query.service.d.mts +16 -0
- package/dist/contract/hosted/hosted-query.service.mjs +42 -0
- package/dist/contract/hosted/hosted-request.pure.d.mts +61 -0
- package/dist/contract/hosted/hosted-request.pure.mjs +91 -0
- package/dist/contract/job/job-id.pure.d.mts +11 -0
- package/dist/contract/job/job-id.pure.mjs +20 -0
- package/dist/contract/job/job-patches.contract.d.mts +32 -0
- package/dist/contract/job/job-patches.contract.mjs +45 -0
- package/dist/contract/job/job-signal.schema.d.mts +13 -0
- package/dist/contract/job/job-signal.schema.mjs +16 -0
- package/dist/contract/job/reserved-payload-field.errors.d.mts +10 -0
- package/dist/contract/job/reserved-payload-field.errors.mjs +8 -0
- package/dist/contract/job/started-job.schema.d.mts +7 -0
- package/dist/contract/job/started-job.schema.mjs +8 -0
- package/dist/contract/json-codec.pure.d.mts +7 -0
- package/dist/contract/json-codec.pure.mjs +14 -0
- package/dist/contract/room.contract.d.mts +75 -0
- package/dist/contract/room.contract.mjs +36 -0
- package/dist/contract/secret/actor-secrets.adapter.d.mts +33 -0
- package/dist/contract/secret/actor-secrets.adapter.mjs +38 -0
- package/dist/contract/secret/invalid-secret-name.errors.d.mts +10 -0
- package/dist/contract/secret/invalid-secret-name.errors.mjs +8 -0
- package/dist/contract/secret/secret-unavailable.errors.d.mts +11 -0
- package/dist/contract/secret/secret-unavailable.errors.mjs +10 -0
- package/dist/contract/secret/secret.schema.d.mts +25 -0
- package/dist/contract/secret/secret.schema.mjs +34 -0
- package/dist/contract/spend/billing-unavailable.errors.d.mts +12 -0
- package/dist/contract/spend/billing-unavailable.errors.mjs +8 -0
- package/dist/contract/spend/spend-cap-reached.errors.d.mts +17 -0
- package/dist/contract/spend/spend-cap-reached.errors.mjs +15 -0
- package/dist/contract/state/actor-state.pure.d.mts +38 -0
- package/dist/contract/state/actor-state.pure.mjs +153 -0
- package/dist/contract/state/actor-state.service.d.mts +45 -0
- package/dist/contract/state/actor-state.service.mjs +18 -0
- package/dist/contract/state/state-migration.pure.d.mts +11 -0
- package/dist/contract/state/state-migration.pure.mjs +23 -0
- package/dist/contract/state/state-read.pure.d.mts +12 -0
- package/dist/contract/state/state-read.pure.mjs +22 -0
- package/dist/contract/state/state-unreadable.errors.d.mts +9 -0
- package/dist/contract/state/state-unreadable.errors.mjs +7 -0
- package/dist/host/actor/actor-database.service.d.mts +46 -0
- package/dist/host/actor/actor-database.service.mjs +112 -0
- package/dist/host/actor/actor-exclusive.pure.d.mts +7 -0
- package/dist/host/actor/actor-exclusive.pure.mjs +16 -0
- package/dist/host/actor/actor-records.sql.d.mts +29 -0
- package/dist/host/actor/actor-records.sql.mjs +26 -0
- package/dist/host/actor/reserved-name.errors.d.mts +10 -0
- package/dist/host/actor/reserved-name.errors.mjs +8 -0
- package/dist/host/actor/reserved-names.pure.d.mts +15 -0
- package/dist/host/actor/reserved-names.pure.mjs +20 -0
- package/dist/host/actor/room.actor.d.mts +4 -0
- package/dist/host/actor/room.actor.mjs +36 -0
- package/dist/host/blob/blob-frames.pure.d.mts +7 -0
- package/dist/host/blob/blob-frames.pure.mjs +28 -0
- package/dist/host/blob/blob-grant.schema.d.mts +14 -0
- package/dist/host/blob/blob-grant.schema.mjs +15 -0
- package/dist/host/blob/blob-grants.service.d.mts +28 -0
- package/dist/host/blob/blob-grants.service.mjs +129 -0
- package/dist/host/blob/blob-keyring.service.d.mts +18 -0
- package/dist/host/blob/blob-keyring.service.mjs +4 -0
- package/dist/host/blob/blob-range.pure.d.mts +13 -0
- package/dist/host/blob/blob-range.pure.mjs +23 -0
- package/dist/host/blob/blob-sealing.contract.d.mts +37 -0
- package/dist/host/blob/blob-sealing.contract.mjs +1 -0
- package/dist/host/blob/blob-sealing.service.d.mts +11 -0
- package/dist/host/blob/blob-sealing.service.mjs +16 -0
- package/dist/host/blob/export/blob-archive.sql.d.mts +21 -0
- package/dist/host/blob/export/blob-archive.sql.mjs +75 -0
- package/dist/host/blob/export/blob-export-holds.sql.d.mts +49 -0
- package/dist/host/blob/export/blob-export-holds.sql.mjs +25 -0
- package/dist/host/blob/plain-blob-sealing.pure.d.mts +5 -0
- package/dist/host/blob/plain-blob-sealing.pure.mjs +55 -0
- package/dist/host/blob/reference/blob-catalog.sql.d.mts +40 -0
- package/dist/host/blob/reference/blob-catalog.sql.mjs +145 -0
- package/dist/host/blob/reference/blob-coordinator.pure.d.mts +10 -0
- package/dist/host/blob/reference/blob-coordinator.pure.mjs +153 -0
- package/dist/host/blob/reference/blob-file-page.sql.d.mts +13 -0
- package/dist/host/blob/reference/blob-file-page.sql.mjs +21 -0
- package/dist/host/blob/reference/blob-forks.sql.d.mts +21 -0
- package/dist/host/blob/reference/blob-forks.sql.mjs +40 -0
- package/dist/host/blob/reference/blob-lineage.sql.d.mts +14 -0
- package/dist/host/blob/reference/blob-lineage.sql.mjs +24 -0
- package/dist/host/blob/reference/blob-reads.pure.d.mts +15 -0
- package/dist/host/blob/reference/blob-reads.pure.mjs +97 -0
- package/dist/host/blob/reference/blob-receipts.sql.d.mts +71 -0
- package/dist/host/blob/reference/blob-receipts.sql.mjs +176 -0
- package/dist/host/blob/reference/blob-transfer-adopt.pure.d.mts +21 -0
- package/dist/host/blob/reference/blob-transfer-adopt.pure.mjs +68 -0
- package/dist/host/blob/reference/blob-transfer-fork.pure.d.mts +15 -0
- package/dist/host/blob/reference/blob-transfer-fork.pure.mjs +125 -0
- package/dist/host/blob/reference/blob-transfer-upkeep.pure.d.mts +18 -0
- package/dist/host/blob/reference/blob-transfer-upkeep.pure.mjs +54 -0
- package/dist/host/blob/reference/blob-transfer.pure.d.mts +85 -0
- package/dist/host/blob/reference/blob-transfer.pure.mjs +1 -0
- package/dist/host/blob/sealed-blob-sealing.pure.d.mts +10 -0
- package/dist/host/blob/sealed-blob-sealing.pure.mjs +130 -0
- package/dist/host/blob/stream/blob-directory.pure.d.mts +18 -0
- package/dist/host/blob/stream/blob-directory.pure.mjs +84 -0
- package/dist/host/blob/stream/blob-length.pure.d.mts +9 -0
- package/dist/host/blob/stream/blob-length.pure.mjs +19 -0
- package/dist/host/blob/stream/blob-writing.pure.d.mts +8 -0
- package/dist/host/blob/stream/blob-writing.pure.mjs +15 -0
- package/dist/host/command/batch/command-batch.sql.d.mts +61 -0
- package/dist/host/command/batch/command-batch.sql.mjs +100 -0
- package/dist/host/command/command-context.adapter.d.mts +47 -0
- package/dist/host/command/command-context.adapter.mjs +90 -0
- package/dist/host/command/command-id-age.pure.d.mts +13 -0
- package/dist/host/command/command-id-age.pure.mjs +31 -0
- package/dist/host/command/command-id-reuse.pure.d.mts +28 -0
- package/dist/host/command/command-id-reuse.pure.mjs +38 -0
- package/dist/host/command/command-id-reused.errors.d.mts +13 -0
- package/dist/host/command/command-id-reused.errors.mjs +11 -0
- package/dist/host/command/command-journal.sql.d.mts +84 -0
- package/dist/host/command/command-journal.sql.mjs +74 -0
- package/dist/host/command/command-rejected.errors.d.mts +8 -0
- package/dist/host/command/command-rejected.errors.mjs +4 -0
- package/dist/host/command/command-replay.service.d.mts +62 -0
- package/dist/host/command/command-replay.service.mjs +140 -0
- package/dist/host/command/command-reply.pure.d.mts +8 -0
- package/dist/host/command/command-reply.pure.mjs +12 -0
- package/dist/host/command/command-runner.service.d.mts +68 -0
- package/dist/host/command/command-runner.service.mjs +215 -0
- package/dist/host/command/files/command-file-inputs.sql.d.mts +51 -0
- package/dist/host/command/files/command-file-inputs.sql.mjs +59 -0
- package/dist/host/command/history-pruned.errors.d.mts +10 -0
- package/dist/host/command/history-pruned.errors.mjs +8 -0
- package/dist/host/command/replay/replay-cursor-stalled.errors.d.mts +9 -0
- package/dist/host/command/replay/replay-cursor-stalled.errors.mjs +7 -0
- package/dist/host/command/replay/replay-cursor.pure.d.mts +7 -0
- package/dist/host/command/replay/replay-cursor.pure.mjs +12 -0
- package/dist/host/computer/computer-steps.sql.d.mts +14 -0
- package/dist/host/computer/computer-steps.sql.mjs +76 -0
- package/dist/host/computer/job-computers.service.d.mts +20 -0
- package/dist/host/computer/job-computers.service.mjs +59 -0
- package/dist/host/computer/local-computer-files.layer.d.mts +11 -0
- package/dist/host/computer/local-computer-files.layer.mjs +69 -0
- package/dist/host/computer/local-computer-log.layer.d.mts +23 -0
- package/dist/host/computer/local-computer-log.layer.mjs +64 -0
- package/dist/host/computer/local-computer-records.layer.d.mts +190 -0
- package/dist/host/computer/local-computer-records.layer.mjs +99 -0
- package/dist/host/computer/local-computer.schema.d.mts +69 -0
- package/dist/host/computer/local-computer.schema.mjs +29 -0
- package/dist/host/computer/local-computers.adapter.d.mts +18 -0
- package/dist/host/computer/local-computers.adapter.mjs +248 -0
- package/dist/host/computer/local-step.layer.d.mts +30 -0
- package/dist/host/computer/local-step.layer.mjs +119 -0
- package/dist/host/file/actor-file-storage.sql.d.mts +15 -0
- package/dist/host/file/actor-file-storage.sql.mjs +82 -0
- package/dist/host/file/actor-files.sql.d.mts +9 -0
- package/dist/host/file/actor-files.sql.mjs +3 -0
- package/dist/host/file/blob-home-lock.pure.d.mts +8 -0
- package/dist/host/file/blob-home-lock.pure.mjs +10 -0
- package/dist/host/file/blob-home.sql.d.mts +19 -0
- package/dist/host/file/blob-home.sql.mjs +30 -0
- package/dist/host/file/local-blob-home.service.d.mts +16 -0
- package/dist/host/file/local-blob-home.service.mjs +43 -0
- package/dist/host/file/local-blob-owner.sql.d.mts +30 -0
- package/dist/host/file/local-blob-owner.sql.mjs +68 -0
- package/dist/host/file/local-file-upkeep.pure.d.mts +12 -0
- package/dist/host/file/local-file-upkeep.pure.mjs +41 -0
- package/dist/host/file/replay-file-storage.sql.d.mts +7 -0
- package/dist/host/file/replay-file-storage.sql.mjs +26 -0
- package/dist/host/fork/actor-fork.sql.d.mts +52 -0
- package/dist/host/fork/actor-fork.sql.mjs +42 -0
- package/dist/host/fork/fork-computers.adapter.d.mts +43 -0
- package/dist/host/fork/fork-computers.adapter.mjs +193 -0
- package/dist/host/hash/blob-hashing.service.d.mts +10 -0
- package/dist/host/hash/blob-hashing.service.mjs +4 -0
- package/dist/host/job/job-durables.sql.d.mts +44 -0
- package/dist/host/job/job-durables.sql.mjs +136 -0
- package/dist/host/job/job-engine.adapter.d.mts +33 -0
- package/dist/host/job/job-engine.adapter.mjs +258 -0
- package/dist/host/job/job-journal.sql.d.mts +85 -0
- package/dist/host/job/job-journal.sql.mjs +109 -0
- package/dist/host/job/job-results.service.d.mts +37 -0
- package/dist/host/job/job-results.service.mjs +63 -0
- package/dist/host/job/job-runs.pure.d.mts +103 -0
- package/dist/host/job/job-runs.pure.mjs +193 -0
- package/dist/host/job/undelivered-result.pure.d.mts +49 -0
- package/dist/host/job/undelivered-result.pure.mjs +147 -0
- package/dist/host/layout/actor-layout.sql.d.mts +8 -0
- package/dist/host/layout/actor-layout.sql.mjs +33 -0
- package/dist/host/layout/layout-version.errors.d.mts +10 -0
- package/dist/host/layout/layout-version.errors.mjs +8 -0
- package/dist/host/layout/layout-version.pure.d.mts +10 -0
- package/dist/host/layout/layout-version.pure.mjs +14 -0
- package/dist/host/migration/actor-migrations.service.d.mts +46 -0
- package/dist/host/migration/actor-migrations.service.mjs +143 -0
- package/dist/host/migration/migration-edited.errors.d.mts +9 -0
- package/dist/host/migration/migration-edited.errors.mjs +7 -0
- package/dist/host/migration/migration-failed.errors.d.mts +12 -0
- package/dist/host/migration/migration-failed.errors.mjs +10 -0
- package/dist/host/migration/migration-failure.pure.d.mts +9 -0
- package/dist/host/migration/migration-failure.pure.mjs +19 -0
- package/dist/host/migration/migration-hasher.adapter.d.mts +15 -0
- package/dist/host/migration/migration-hasher.adapter.mjs +40 -0
- package/dist/host/migration/migration-missing.errors.d.mts +9 -0
- package/dist/host/migration/migration-missing.errors.mjs +7 -0
- package/dist/host/migration/migration-plan.pure.d.mts +20 -0
- package/dist/host/migration/migration-plan.pure.mjs +32 -0
- package/dist/host/outbox/actor-outbox.sql.d.mts +33 -0
- package/dist/host/outbox/actor-outbox.sql.mjs +28 -0
- package/dist/host/outbox/outbox-acknowledgements.sql.d.mts +12 -0
- package/dist/host/outbox/outbox-acknowledgements.sql.mjs +47 -0
- package/dist/host/outbox/outbox-runner.service.d.mts +37 -0
- package/dist/host/outbox/outbox-runner.service.mjs +155 -0
- package/dist/host/query/query-policy.pure.d.mts +15 -0
- package/dist/host/query/query-policy.pure.mjs +12 -0
- package/dist/host/query/query-runner.service.d.mts +42 -0
- package/dist/host/query/query-runner.service.mjs +72 -0
- package/dist/host/sqlite/actor-connections.pure.d.mts +26 -0
- package/dist/host/sqlite/actor-connections.pure.mjs +4 -0
- package/dist/host/sqlite/sqlite-connection.adapter.d.mts +22 -0
- package/dist/host/sqlite/sqlite-connection.adapter.mjs +151 -0
- package/dist/host/sqlite/sqlite-driver.service.d.mts +33 -0
- package/dist/host/sqlite/sqlite-driver.service.mjs +88 -0
- package/dist/host/sqlite/sqlite-parameters.pure.d.mts +5 -0
- package/dist/host/sqlite/sqlite-parameters.pure.mjs +21 -0
- package/dist/host/sqlite/sqlite-reason.pure.d.mts +8 -0
- package/dist/host/sqlite/sqlite-reason.pure.mjs +13 -0
- package/dist/host/timer/actor-timers.sql.d.mts +32 -0
- package/dist/host/timer/actor-timers.sql.mjs +8 -0
- package/dist/host/timer/timer-runner.service.d.mts +26 -0
- package/dist/host/timer/timer-runner.service.mjs +68 -0
- package/dist/host/upkeep/actor-due.sql.d.mts +26 -0
- package/dist/host/upkeep/actor-due.sql.mjs +43 -0
- package/dist/host/upkeep/actor-upkeep.service.d.mts +55 -0
- package/dist/host/upkeep/actor-upkeep.service.mjs +218 -0
- package/dist/host/upkeep/execution-authority.pure.d.mts +19 -0
- package/dist/host/upkeep/execution-authority.pure.mjs +10 -0
- package/dist/runtime/akter-local.layer.d.mts +28 -0
- package/dist/runtime/akter-local.layer.mjs +24 -0
- package/dist/runtime/akter.layer.d.mts +91 -0
- package/dist/runtime/akter.layer.mjs +99 -0
- package/dist/runtime/blob-hashing.layer.d.mts +4 -0
- package/dist/runtime/blob-hashing.layer.mjs +15 -0
- package/dist/runtime/hosted-environment.layer.d.mts +34 -0
- package/dist/runtime/hosted-environment.layer.mjs +40 -0
- package/dist/runtime/http-server.layer.d.mts +9 -0
- package/dist/runtime/http-server.layer.mjs +15 -0
- package/dist/runtime/local-actor-engine.layer.d.mts +10 -0
- package/dist/runtime/local-actor-engine.layer.mjs +14 -0
- package/dist/runtime/local-engine.layer.d.mts +15 -0
- package/dist/runtime/local-engine.layer.mjs +14 -0
- package/dist/runtime/local-environments.layer.d.mts +24 -0
- package/dist/runtime/local-environments.layer.mjs +159 -0
- package/dist/runtime/local-file-clients.layer.d.mts +13 -0
- package/dist/runtime/local-file-clients.layer.mjs +78 -0
- package/dist/runtime/local-job-runtime.layer.d.mts +19 -0
- package/dist/runtime/local-job-runtime.layer.mjs +21 -0
- package/dist/serve/archive/archived-actors.layer.d.mts +17 -0
- package/dist/serve/archive/archived-actors.layer.mjs +84 -0
- package/dist/serve/archive/archived-store.layer.d.mts +12 -0
- package/dist/serve/archive/archived-store.layer.mjs +40 -0
- package/dist/serve/engine/actor-engine.layer.d.mts +8 -0
- package/dist/serve/engine/actor-engine.layer.mjs +30 -0
- package/dist/serve/engine/actor-fork.service.d.mts +63 -0
- package/dist/serve/engine/actor-fork.service.mjs +277 -0
- package/dist/serve/engine/actor-holding.pure.d.mts +7 -0
- package/dist/serve/engine/actor-holding.pure.mjs +9 -0
- package/dist/serve/engine/actor-host.service.d.mts +66 -0
- package/dist/serve/engine/actor-host.service.mjs +209 -0
- package/dist/serve/engine/actor-location.service.d.mts +38 -0
- package/dist/serve/engine/actor-location.service.mjs +109 -0
- package/dist/serve/engine/actor-residents.pure.d.mts +92 -0
- package/dist/serve/engine/actor-residents.pure.mjs +201 -0
- package/dist/serve/engine/actor-shard.pure.d.mts +4 -0
- package/dist/serve/engine/actor-shard.pure.mjs +8 -0
- package/dist/serve/engine/actor-state.pure.d.mts +17 -0
- package/dist/serve/engine/actor-state.pure.mjs +20 -0
- package/dist/serve/engine/actors-not-hosted.errors.d.mts +9 -0
- package/dist/serve/engine/actors-not-hosted.errors.mjs +7 -0
- package/dist/serve/engine/job-runtime.layer.d.mts +6 -0
- package/dist/serve/engine/job-runtime.layer.mjs +5 -0
- package/dist/serve/environment/environment-already-exists.errors.d.mts +10 -0
- package/dist/serve/environment/environment-already-exists.errors.mjs +9 -0
- package/dist/serve/environment/environment-in-use.errors.d.mts +10 -0
- package/dist/serve/environment/environment-in-use.errors.mjs +14 -0
- package/dist/serve/environment/environment-not-found.errors.d.mts +10 -0
- package/dist/serve/environment/environment-not-found.errors.mjs +9 -0
- package/dist/serve/environment/environment-records.sql.d.mts +92 -0
- package/dist/serve/environment/environment-records.sql.mjs +59 -0
- package/dist/serve/environment/environment-store.sql.d.mts +38 -0
- package/dist/serve/environment/environment-store.sql.mjs +78 -0
- package/dist/serve/environment/local-environment.schema.d.mts +38 -0
- package/dist/serve/environment/local-environment.schema.mjs +43 -0
- package/dist/serve/environment/local-environments.service.d.mts +44 -0
- package/dist/serve/environment/local-environments.service.mjs +196 -0
- package/dist/serve/environment/promotion-notice.pure.d.mts +22 -0
- package/dist/serve/environment/promotion-notice.pure.mjs +30 -0
- package/dist/serve/environment/snapshot-operations.sql.d.mts +32 -0
- package/dist/serve/environment/snapshot-operations.sql.mjs +131 -0
- package/dist/serve/environment/store-snapshot.sql.d.mts +32 -0
- package/dist/serve/environment/store-snapshot.sql.mjs +74 -0
- package/dist/serve/erasure/local-actor-erasure.service.d.mts +26 -0
- package/dist/serve/erasure/local-actor-erasure.service.mjs +102 -0
- package/dist/serve/history/actor-host-runners.service.d.mts +23 -0
- package/dist/serve/history/actor-host-runners.service.mjs +35 -0
- package/dist/serve/hosted/hosted-app-build.errors.d.mts +13 -0
- package/dist/serve/hosted/hosted-app-build.errors.mjs +9 -0
- package/dist/serve/hosted/hosted-app-checks.layer.d.mts +15 -0
- package/dist/serve/hosted/hosted-app-checks.layer.mjs +32 -0
- package/dist/serve/hosted/hosted-file-forward.layer.d.mts +22 -0
- package/dist/serve/hosted/hosted-file-forward.layer.mjs +42 -0
- package/dist/serve/hosted/hosted-file-rpcs.layer.d.mts +25 -0
- package/dist/serve/hosted/hosted-file-rpcs.layer.mjs +82 -0
- package/dist/serve/hosted/hosted-file-server.layer.d.mts +18 -0
- package/dist/serve/hosted/hosted-file-server.layer.mjs +33 -0
- package/dist/serve/hosted/hosted-files.layer.d.mts +32 -0
- package/dist/serve/hosted/hosted-files.layer.mjs +55 -0
- package/dist/serve/hosted/hosted-runtime.layer.d.mts +42 -0
- package/dist/serve/hosted/hosted-runtime.layer.mjs +48 -0
- package/dist/serve/hosted/hosted-runtime.service.d.mts +77 -0
- package/dist/serve/hosted/hosted-runtime.service.mjs +74 -0
- package/dist/serve/hosted/hosted-secrets.layer.d.mts +10 -0
- package/dist/serve/hosted/hosted-secrets.layer.mjs +28 -0
- package/dist/serve/http/loopback-host.pure.d.mts +11 -0
- package/dist/serve/http/loopback-host.pure.mjs +29 -0
- package/dist/serve/inspect/actor-inspection.schema.d.mts +119 -0
- package/dist/serve/inspect/actor-inspection.schema.mjs +75 -0
- package/dist/serve/inspect/actor-inspection.sql.d.mts +12 -0
- package/dist/serve/inspect/actor-inspection.sql.mjs +43 -0
- package/dist/serve/inspect/inspect.service.d.mts +24 -0
- package/dist/serve/inspect/inspect.service.mjs +92 -0
- package/dist/serve/inspect/inspector-page.pure.d.mts +2 -0
- package/dist/serve/inspect/inspector-page.pure.mjs +155 -0
- package/dist/serve/inspect/inspector-wal.pure.d.mts +3 -0
- package/dist/serve/inspect/inspector-wal.pure.mjs +19 -0
- package/dist/serve/inspect/inspector.handlers.d.mts +5 -0
- package/dist/serve/inspect/inspector.handlers.mjs +50 -0
- package/dist/serve/inspect/inspector.layer.d.mts +9 -0
- package/dist/serve/inspect/inspector.layer.mjs +14 -0
- package/dist/serve/live/live-reads.service.d.mts +44 -0
- package/dist/serve/live/live-reads.service.mjs +152 -0
- package/dist/serve/live/live-tables.sql.d.mts +35 -0
- package/dist/serve/live/live-tables.sql.mjs +66 -0
- package/dist/serve/live/state-reads.pure.d.mts +11 -0
- package/dist/serve/live/state-reads.pure.mjs +7 -0
- package/dist/serve/rpc/actor-rpc.handlers.d.mts +24 -0
- package/dist/serve/rpc/actor-rpc.handlers.mjs +142 -0
- package/dist/serve/rpc/akter-server.layer.d.mts +18 -0
- package/dist/serve/rpc/akter-server.layer.mjs +61 -0
- package/dist/serve/rpc/computer/computer-copy.layer.d.mts +22 -0
- package/dist/serve/rpc/computer/computer-copy.layer.mjs +70 -0
- package/dist/serve/rpc/computer/computer-rpc-access.pure.d.mts +29 -0
- package/dist/serve/rpc/computer/computer-rpc-access.pure.mjs +46 -0
- package/dist/serve/rpc/computer/computer-rpc.layer.d.mts +39 -0
- package/dist/serve/rpc/computer/computer-rpc.layer.mjs +84 -0
- package/dist/serve/rpc/computer/step-rpc.handlers.d.mts +23 -0
- package/dist/serve/rpc/computer/step-rpc.handlers.mjs +43 -0
- package/dist/serve/rpc/development-authentication.handlers.d.mts +7 -0
- package/dist/serve/rpc/development-authentication.handlers.mjs +19 -0
- package/dist/serve/rpc/development-guard.pure.d.mts +10 -0
- package/dist/serve/rpc/development-guard.pure.mjs +16 -0
- package/dist/serve/rpc/file/file-rpc-access.pure.d.mts +55 -0
- package/dist/serve/rpc/file/file-rpc-access.pure.mjs +67 -0
- package/dist/serve/rpc/file/file-rpc.layer.d.mts +53 -0
- package/dist/serve/rpc/file/file-rpc.layer.mjs +143 -0
- package/dist/serve/rpc/file/upload-sessions.pure.d.mts +45 -0
- package/dist/serve/rpc/file/upload-sessions.pure.mjs +187 -0
- package/dist/serve/rpc/in-process-client.layer.d.mts +13 -0
- package/dist/serve/rpc/in-process-client.layer.mjs +34 -0
- package/dist/serve/rpc/listener-not-loopback.errors.d.mts +9 -0
- package/dist/serve/rpc/listener-not-loopback.errors.mjs +7 -0
- package/dist/serve/rpc/ndjson-only.pure.d.mts +5 -0
- package/dist/serve/rpc/ndjson-only.pure.mjs +14 -0
- package/dist/serve/rpc/served-rpc.layer.d.mts +6 -0
- package/dist/serve/rpc/served-rpc.layer.mjs +19 -0
- package/dist/serve/store/actor-not-migrated.errors.d.mts +10 -0
- package/dist/serve/store/actor-not-migrated.errors.mjs +8 -0
- package/dist/serve/store/store-migrations.layer.d.mts +5 -0
- package/dist/serve/store/store-migrations.layer.mjs +18 -0
- package/dist/serve/store/store-migrations.service.d.mts +26 -0
- package/dist/serve/store/store-migrations.service.mjs +47 -0
- package/dist/serve/store/store-unreadable.errors.d.mts +9 -0
- package/dist/serve/store/store-unreadable.errors.mjs +7 -0
- package/dist/serve/verify/verify.layer.d.mts +16 -0
- package/dist/serve/verify/verify.layer.mjs +36 -0
- package/dist/testing/story-driver.service.d.mts +29 -0
- package/dist/testing/story-driver.service.mjs +126 -0
- package/dist/testing/story.layer.d.mts +21 -0
- package/dist/testing/story.layer.mjs +42 -0
- package/package.json +106 -3
- package/src/contract/actor/actor-already-exists.errors.ts +8 -0
- package/src/contract/actor/actor-definition.pure.ts +157 -0
- package/src/contract/actor/actor-erased.errors.ts +8 -0
- package/src/contract/actor/actor-names.pure.ts +64 -0
- package/src/contract/actor/actor-not-created.errors.ts +8 -0
- package/src/contract/actor/actor-not-registered.errors.ts +8 -0
- package/src/contract/actor/actor-registry.service.ts +35 -0
- package/src/contract/actor/actor.contract.ts +409 -0
- package/src/contract/actor/host-interface.pure.ts +60 -0
- package/src/contract/actor/reserved-member.errors.ts +9 -0
- package/src/contract/akter.service.ts +233 -0
- package/src/contract/caller/authentication.api.ts +9 -0
- package/src/contract/caller/caller-admission.pure.ts +90 -0
- package/src/contract/caller/caller-not-allowed.errors.ts +26 -0
- package/src/contract/caller/caller.schema.ts +7 -0
- package/src/contract/caller/current-caller.service.ts +7 -0
- package/src/contract/caller/principal.schema.ts +13 -0
- package/src/contract/caller/unauthenticated.errors.ts +8 -0
- package/src/contract/client/actor-client.adapter.ts +217 -0
- package/src/contract/client/actor-client.contract.ts +53 -0
- package/src/contract/client/actor-rpc.contract.ts +91 -0
- package/src/contract/client/actor-unavailable.errors.ts +9 -0
- package/src/contract/client/client-failure.contract.ts +53 -0
- package/src/contract/client/invalid-request.errors.ts +9 -0
- package/src/contract/client/storage-limit.errors.ts +16 -0
- package/src/contract/command/command-id-expired.errors.ts +11 -0
- package/src/contract/command/command-id.schema.ts +5 -0
- package/src/contract/command/command.contract.ts +334 -0
- package/src/contract/command/outbox-id.pure.ts +25 -0
- package/src/contract/command/outbox.schema.ts +11 -0
- package/src/contract/command/timer.schema.ts +21 -0
- package/src/contract/computer/checkpoint-expired.errors.ts +12 -0
- package/src/contract/computer/computer-client-failure.contract.ts +27 -0
- package/src/contract/computer/computer-client.adapter.ts +110 -0
- package/src/contract/computer/computer-client.contract.ts +75 -0
- package/src/contract/computer/computer-held.errors.ts +10 -0
- package/src/contract/computer/computer-limit.errors.ts +11 -0
- package/src/contract/computer/computer-lost.errors.ts +10 -0
- package/src/contract/computer/computer-not-found.errors.ts +9 -0
- package/src/contract/computer/computer.schema.ts +159 -0
- package/src/contract/computer/computers-unavailable.errors.ts +9 -0
- package/src/contract/computer/files/computer-files.schema.ts +31 -0
- package/src/contract/computer/rpc/computer-rpc.contract.ts +140 -0
- package/src/contract/computer/step/computer-step.contract.ts +126 -0
- package/src/contract/computer/step/computer-step.schema.ts +80 -0
- package/src/contract/computer/step/step-failure.schema.ts +26 -0
- package/src/contract/computer/step/step-not-found.errors.ts +7 -0
- package/src/contract/description/published-contract.pure.ts +187 -0
- package/src/contract/file/access/file-access-denied.errors.ts +11 -0
- package/src/contract/file/access/file-access.contract.ts +56 -0
- package/src/contract/file/actor-files.contract.ts +78 -0
- package/src/contract/file/blob-transfer.errors.ts +6 -0
- package/src/contract/file/file-client-failure.contract.ts +43 -0
- package/src/contract/file/file-client.adapter.ts +45 -0
- package/src/contract/file/file-client.contract.ts +24 -0
- package/src/contract/file/file-listing.pure.ts +30 -0
- package/src/contract/file/file-not-found.errors.ts +6 -0
- package/src/contract/file/file-path.pure.ts +37 -0
- package/src/contract/file/files-unavailable.errors.ts +8 -0
- package/src/contract/file/invalid-file-request.errors.ts +9 -0
- package/src/contract/file/rpc/file-rpc.contract.ts +148 -0
- package/src/contract/file/rpc/file-too-large.errors.ts +10 -0
- package/src/contract/file/rpc/rpc-file-clients.layer.ts +184 -0
- package/src/contract/fork/fork-rpc.contract.ts +44 -0
- package/src/contract/history/actor-journal.service.ts +195 -0
- package/src/contract/history/history-entry.pure.ts +282 -0
- package/src/contract/hosted/handler-failed.errors.ts +16 -0
- package/src/contract/hosted/handler-failure.pure.ts +161 -0
- package/src/contract/hosted/hosted-actor.service.ts +97 -0
- package/src/contract/hosted/hosted-command.service.ts +114 -0
- package/src/contract/hosted/hosted-create.service.ts +95 -0
- package/src/contract/hosted/hosted-error.contract.ts +22 -0
- package/src/contract/hosted/hosted-failure.schema.ts +32 -0
- package/src/contract/hosted/hosted-outcome.contract.ts +21 -0
- package/src/contract/hosted/hosted-query.service.ts +50 -0
- package/src/contract/hosted/hosted-request.pure.ts +185 -0
- package/src/contract/job/job-id.pure.ts +37 -0
- package/src/contract/job/job-patches.contract.ts +86 -0
- package/src/contract/job/job-signal.schema.ts +23 -0
- package/src/contract/job/reserved-payload-field.errors.ts +10 -0
- package/src/contract/job/started-job.schema.ts +9 -0
- package/src/contract/json-codec.pure.ts +27 -0
- package/src/contract/room.contract.ts +31 -0
- package/src/contract/secret/actor-secrets.adapter.ts +87 -0
- package/src/contract/secret/invalid-secret-name.errors.ts +10 -0
- package/src/contract/secret/secret-unavailable.errors.ts +13 -0
- package/src/contract/secret/secret.schema.ts +43 -0
- package/src/contract/spend/billing-unavailable.errors.ts +12 -0
- package/src/contract/spend/spend-cap-reached.errors.ts +17 -0
- package/src/contract/state/actor-state.pure.ts +192 -0
- package/src/contract/state/actor-state.service.ts +69 -0
- package/src/contract/state/state-migration.pure.ts +57 -0
- package/src/contract/state/state-read.pure.ts +40 -0
- package/src/contract/state/state-unreadable.errors.ts +9 -0
- package/src/host/actor/actor-database.service.ts +145 -0
- package/src/host/actor/actor-exclusive.pure.ts +32 -0
- package/src/host/actor/actor-records.sql.ts +78 -0
- package/src/host/actor/reserved-name.errors.ts +10 -0
- package/src/host/actor/reserved-names.pure.ts +40 -0
- package/src/host/actor/room.actor.ts +57 -0
- package/src/host/blob/blob-frames.pure.ts +52 -0
- package/src/host/blob/blob-grant.schema.ts +22 -0
- package/src/host/blob/blob-grants.service.ts +197 -0
- package/src/host/blob/blob-keyring.service.ts +25 -0
- package/src/host/blob/blob-range.pure.ts +33 -0
- package/src/host/blob/blob-sealing.contract.ts +46 -0
- package/src/host/blob/blob-sealing.service.ts +25 -0
- package/src/host/blob/export/blob-archive.sql.ts +153 -0
- package/src/host/blob/export/blob-export-holds.sql.ts +91 -0
- package/src/host/blob/plain-blob-sealing.pure.ts +70 -0
- package/src/host/blob/reference/blob-catalog.sql.ts +339 -0
- package/src/host/blob/reference/blob-coordinator.pure.ts +217 -0
- package/src/host/blob/reference/blob-file-page.sql.ts +48 -0
- package/src/host/blob/reference/blob-forks.sql.ts +125 -0
- package/src/host/blob/reference/blob-lineage.sql.ts +63 -0
- package/src/host/blob/reference/blob-reads.pure.ts +172 -0
- package/src/host/blob/reference/blob-receipts.sql.ts +375 -0
- package/src/host/blob/reference/blob-transfer-adopt.pure.ts +127 -0
- package/src/host/blob/reference/blob-transfer-fork.pure.ts +174 -0
- package/src/host/blob/reference/blob-transfer-upkeep.pure.ts +132 -0
- package/src/host/blob/reference/blob-transfer.pure.ts +127 -0
- package/src/host/blob/sealed-blob-sealing.pure.ts +163 -0
- package/src/host/blob/stream/blob-directory.pure.ts +177 -0
- package/src/host/blob/stream/blob-length.pure.ts +40 -0
- package/src/host/blob/stream/blob-writing.pure.ts +49 -0
- package/src/host/command/batch/command-batch.sql.ts +207 -0
- package/src/host/command/command-context.adapter.ts +134 -0
- package/src/host/command/command-id-age.pure.ts +54 -0
- package/src/host/command/command-id-reuse.pure.ts +90 -0
- package/src/host/command/command-id-reused.errors.ts +13 -0
- package/src/host/command/command-journal.sql.ts +232 -0
- package/src/host/command/command-rejected.errors.ts +8 -0
- package/src/host/command/command-replay.service.ts +223 -0
- package/src/host/command/command-reply.pure.ts +21 -0
- package/src/host/command/command-runner.service.ts +320 -0
- package/src/host/command/files/command-file-inputs.sql.ts +114 -0
- package/src/host/command/history-pruned.errors.ts +10 -0
- package/src/host/command/replay/replay-cursor-stalled.errors.ts +9 -0
- package/src/host/command/replay/replay-cursor.pure.ts +19 -0
- package/src/host/computer/computer-steps.sql.ts +120 -0
- package/src/host/computer/job-computers.service.ts +84 -0
- package/src/host/computer/local-computer-files.layer.ts +103 -0
- package/src/host/computer/local-computer-log.layer.ts +115 -0
- package/src/host/computer/local-computer-records.layer.ts +205 -0
- package/src/host/computer/local-computer.schema.ts +36 -0
- package/src/host/computer/local-computers.adapter.ts +379 -0
- package/src/host/computer/local-step.layer.ts +174 -0
- package/src/host/file/actor-file-storage.sql.ts +79 -0
- package/src/host/file/actor-files.sql.ts +15 -0
- package/src/host/file/blob-home-lock.pure.ts +23 -0
- package/src/host/file/blob-home.sql.ts +55 -0
- package/src/host/file/local-blob-home.service.ts +71 -0
- package/src/host/file/local-blob-owner.sql.ts +89 -0
- package/src/host/file/local-file-upkeep.pure.ts +77 -0
- package/src/host/file/replay-file-storage.sql.ts +43 -0
- package/src/host/fork/actor-fork.sql.ts +110 -0
- package/src/host/fork/fork-computers.adapter.ts +366 -0
- package/src/host/hash/blob-hashing.service.ts +14 -0
- package/src/host/job/job-durables.sql.ts +214 -0
- package/src/host/job/job-engine.adapter.ts +420 -0
- package/src/host/job/job-journal.sql.ts +257 -0
- package/src/host/job/job-results.service.ts +111 -0
- package/src/host/job/job-runs.pure.ts +445 -0
- package/src/host/job/undelivered-result.pure.ts +265 -0
- package/src/host/layout/actor-layout.sql.ts +45 -0
- package/src/host/layout/layout-version.errors.ts +10 -0
- package/src/host/layout/layout-version.pure.ts +22 -0
- package/src/host/migration/actor-migrations.service.ts +159 -0
- package/src/host/migration/migration-edited.errors.ts +9 -0
- package/src/host/migration/migration-failed.errors.ts +12 -0
- package/src/host/migration/migration-failure.pure.ts +28 -0
- package/src/host/migration/migration-hasher.adapter.ts +70 -0
- package/src/host/migration/migration-missing.errors.ts +9 -0
- package/src/host/migration/migration-plan.pure.ts +66 -0
- package/src/host/outbox/actor-outbox.sql.ts +98 -0
- package/src/host/outbox/outbox-acknowledgements.sql.ts +93 -0
- package/src/host/outbox/outbox-runner.service.ts +253 -0
- package/src/host/query/query-policy.pure.ts +31 -0
- package/src/host/query/query-runner.service.ts +132 -0
- package/src/host/sqlite/actor-connections.pure.ts +44 -0
- package/src/host/sqlite/sqlite-connection.adapter.ts +260 -0
- package/src/host/sqlite/sqlite-driver.service.ts +151 -0
- package/src/host/sqlite/sqlite-parameters.pure.ts +28 -0
- package/src/host/sqlite/sqlite-reason.pure.ts +19 -0
- package/src/host/timer/actor-timers.sql.ts +67 -0
- package/src/host/timer/timer-runner.service.ts +117 -0
- package/src/host/upkeep/actor-due.sql.ts +71 -0
- package/src/host/upkeep/actor-upkeep.service.ts +404 -0
- package/src/host/upkeep/execution-authority.pure.ts +37 -0
- package/src/runtime/akter-local.layer.ts +49 -0
- package/src/runtime/akter.layer.ts +208 -0
- package/src/runtime/blob-hashing.layer.ts +21 -0
- package/src/runtime/hosted-environment.layer.ts +85 -0
- package/src/runtime/http-server.layer.ts +29 -0
- package/src/runtime/local-actor-engine.layer.ts +33 -0
- package/src/runtime/local-engine.layer.ts +37 -0
- package/src/runtime/local-environments.layer.ts +214 -0
- package/src/runtime/local-file-clients.layer.ts +112 -0
- package/src/runtime/local-job-runtime.layer.ts +38 -0
- package/src/serve/archive/archived-actors.layer.ts +97 -0
- package/src/serve/archive/archived-store.layer.ts +46 -0
- package/src/serve/engine/actor-engine.layer.ts +46 -0
- package/src/serve/engine/actor-fork.service.ts +403 -0
- package/src/serve/engine/actor-holding.pure.ts +28 -0
- package/src/serve/engine/actor-host.service.ts +454 -0
- package/src/serve/engine/actor-location.service.ts +219 -0
- package/src/serve/engine/actor-residents.pure.ts +500 -0
- package/src/serve/engine/actor-shard.pure.ts +13 -0
- package/src/serve/engine/actor-state.pure.ts +45 -0
- package/src/serve/engine/actors-not-hosted.errors.ts +9 -0
- package/src/serve/engine/job-runtime.layer.ts +13 -0
- package/src/serve/environment/environment-already-exists.errors.ts +9 -0
- package/src/serve/environment/environment-in-use.errors.ts +17 -0
- package/src/serve/environment/environment-not-found.errors.ts +9 -0
- package/src/serve/environment/environment-records.sql.ts +208 -0
- package/src/serve/environment/environment-store.sql.ts +116 -0
- package/src/serve/environment/local-environment.schema.ts +79 -0
- package/src/serve/environment/local-environments.service.ts +268 -0
- package/src/serve/environment/promotion-notice.pure.ts +63 -0
- package/src/serve/environment/snapshot-operations.sql.ts +210 -0
- package/src/serve/environment/store-snapshot.sql.ts +128 -0
- package/src/serve/erasure/local-actor-erasure.service.ts +170 -0
- package/src/serve/history/actor-host-runners.service.ts +85 -0
- package/src/serve/hosted/hosted-app-build.errors.ts +11 -0
- package/src/serve/hosted/hosted-app-checks.layer.ts +74 -0
- package/src/serve/hosted/hosted-file-forward.layer.ts +63 -0
- package/src/serve/hosted/hosted-file-rpcs.layer.ts +149 -0
- package/src/serve/hosted/hosted-file-server.layer.ts +75 -0
- package/src/serve/hosted/hosted-files.layer.ts +76 -0
- package/src/serve/hosted/hosted-runtime.layer.ts +145 -0
- package/src/serve/hosted/hosted-runtime.service.ts +128 -0
- package/src/serve/hosted/hosted-secrets.layer.ts +38 -0
- package/src/serve/http/loopback-host.pure.ts +67 -0
- package/src/serve/inspect/actor-inspection.schema.ts +94 -0
- package/src/serve/inspect/actor-inspection.sql.ts +112 -0
- package/src/serve/inspect/inspect.service.ts +173 -0
- package/src/serve/inspect/inspector-page.pure.ts +159 -0
- package/src/serve/inspect/inspector-wal.pure.ts +40 -0
- package/src/serve/inspect/inspector.handlers.ts +103 -0
- package/src/serve/inspect/inspector.layer.ts +26 -0
- package/src/serve/live/live-reads.service.ts +285 -0
- package/src/serve/live/live-tables.sql.ts +148 -0
- package/src/serve/live/state-reads.pure.ts +22 -0
- package/src/serve/rpc/actor-rpc.handlers.ts +242 -0
- package/src/serve/rpc/akter-server.layer.ts +119 -0
- package/src/serve/rpc/computer/computer-copy.layer.ts +95 -0
- package/src/serve/rpc/computer/computer-rpc-access.pure.ts +75 -0
- package/src/serve/rpc/computer/computer-rpc.layer.ts +143 -0
- package/src/serve/rpc/computer/step-rpc.handlers.ts +84 -0
- package/src/serve/rpc/development-authentication.handlers.ts +28 -0
- package/src/serve/rpc/development-guard.pure.ts +39 -0
- package/src/serve/rpc/file/file-rpc-access.pure.ts +119 -0
- package/src/serve/rpc/file/file-rpc.layer.ts +209 -0
- package/src/serve/rpc/file/upload-sessions.pure.ts +363 -0
- package/src/serve/rpc/in-process-client.layer.ts +62 -0
- package/src/serve/rpc/listener-not-loopback.errors.ts +9 -0
- package/src/serve/rpc/ndjson-only.pure.ts +33 -0
- package/src/serve/rpc/served-rpc.layer.ts +34 -0
- package/src/serve/store/actor-not-migrated.errors.ts +10 -0
- package/src/serve/store/store-migrations.layer.ts +35 -0
- package/src/serve/store/store-migrations.service.ts +76 -0
- package/src/serve/store/store-unreadable.errors.ts +9 -0
- package/src/serve/verify/verify.layer.ts +77 -0
- package/src/testing/story-driver.service.ts +266 -0
- package/src/testing/story.layer.ts +99 -0
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { ComputerSecret } from "../secret/secret.schema.mjs";
|
|
2
|
+
import { ComputerCopy, ComputerCopyResult, ComputerFileRequest, computerFileBytes } from "./files/computer-files.schema.mjs";
|
|
3
|
+
import { Schema } from "effect";
|
|
4
|
+
// src/contract/computer/computer.schema.ts
|
|
5
|
+
const kib = 1024;
|
|
6
|
+
const mib = kib * kib;
|
|
7
|
+
const inputKib = 100;
|
|
8
|
+
const outputMib = 4;
|
|
9
|
+
const smallest = 1;
|
|
10
|
+
const nothing = 0;
|
|
11
|
+
/**
|
|
12
|
+
* Archil's serverless exec limits, applied to every exec step so a step behaves the same in any engine: five
|
|
13
|
+
* minutes, 100 KiB of command and standard input together, and 4 MiB of each output stream returned. Longer work
|
|
14
|
+
* runs as a process in the computer; longer output belongs in files.
|
|
15
|
+
*/
|
|
16
|
+
const execLimits = {
|
|
17
|
+
inputBytes: inputKib * kib,
|
|
18
|
+
outputBytes: outputMib * mib,
|
|
19
|
+
seconds: 300
|
|
20
|
+
};
|
|
21
|
+
const encoder = new globalThis.TextEncoder();
|
|
22
|
+
/** One of an actor's computers. Lowercase letters, digits and hyphens, starting with a letter. */
|
|
23
|
+
const ComputerName = Schema.String.check(Schema.isPattern(new RegExp(`^[a-z][a-z0-9-]{0,62}$`, "u"))).pipe(Schema.brand("ComputerName")).annotate({ description: "A computer's name, unique among its actor's computers." });
|
|
24
|
+
const Seconds = Schema.Int.check(Schema.isBetween({
|
|
25
|
+
maximum: execLimits.seconds,
|
|
26
|
+
minimum: smallest
|
|
27
|
+
}));
|
|
28
|
+
const Positive = Schema.Int.check(Schema.isGreaterThanOrEqualTo(smallest));
|
|
29
|
+
const ComputerSize = Schema.Struct({
|
|
30
|
+
memoryMib: Positive,
|
|
31
|
+
vcpu: Positive
|
|
32
|
+
});
|
|
33
|
+
/**
|
|
34
|
+
* A computer to keep: its image, its size and the hosts it may reach. `egress` lists hosts or rules, never
|
|
35
|
+
* credentials. `secrets` names the credentials the platform adds to an allowed host's requests on the way out, from
|
|
36
|
+
* the actor's declared secrets, so no value ever reaches the computer.
|
|
37
|
+
*/
|
|
38
|
+
const ComputerSpec = Schema.Struct({
|
|
39
|
+
egress: Schema.Array(Schema.String),
|
|
40
|
+
image: Schema.String,
|
|
41
|
+
name: ComputerName,
|
|
42
|
+
secrets: Schema.optionalKey(Schema.Array(ComputerSecret)),
|
|
43
|
+
size: ComputerSize
|
|
44
|
+
});
|
|
45
|
+
/**
|
|
46
|
+
* Where a computer is. `paused` keeps its memory, processes and files; `stopped` and `failed` keep only its files;
|
|
47
|
+
* `gone` means its disk no longer exists, so it is never recreated empty under the same name by accident.
|
|
48
|
+
*/
|
|
49
|
+
const ComputerState = Schema.Literals([
|
|
50
|
+
"starting",
|
|
51
|
+
"running",
|
|
52
|
+
"paused",
|
|
53
|
+
"stopped",
|
|
54
|
+
"failed",
|
|
55
|
+
"gone"
|
|
56
|
+
]);
|
|
57
|
+
const Computer = Schema.Struct({
|
|
58
|
+
...ComputerSpec.fields,
|
|
59
|
+
state: ComputerState
|
|
60
|
+
});
|
|
61
|
+
const withinInput = Schema.makeFilter((request) => encoder.encode(request.command).byteLength + (request.stdin?.byteLength ?? nothing) <= execLimits.inputBytes, { expected: `a command and standard input of at most ${execLimits.inputBytes} bytes together` });
|
|
62
|
+
/**
|
|
63
|
+
* One exec step. `key` is the step's stable logical-operation key, such as `Activity.idempotencyKey(name)`: the
|
|
64
|
+
* computer records the outcome under it, so the same step sent again reads that outcome back instead of running.
|
|
65
|
+
*/
|
|
66
|
+
const ExecRequest = Schema.Struct({
|
|
67
|
+
command: Schema.String,
|
|
68
|
+
cwd: Schema.optionalKey(Schema.String),
|
|
69
|
+
key: Schema.String.check(Schema.isMinLength(smallest)),
|
|
70
|
+
stdin: Schema.optionalKey(Schema.Uint8Array),
|
|
71
|
+
timeoutSeconds: Schema.optionalKey(Seconds)
|
|
72
|
+
}).check(withinInput);
|
|
73
|
+
/**
|
|
74
|
+
* The step ran to an end, or its recorded outcome was read back; the two look the same. `exitCode` is absent when
|
|
75
|
+
* the process was ended without one, such as at the time limit. Past 4 MiB a stream, output is not returned and
|
|
76
|
+
* `truncated` is set; the whole of each stream stays in the step's directory on the computer.
|
|
77
|
+
*/
|
|
78
|
+
const ExecRan = Schema.TaggedStruct("Ran", {
|
|
79
|
+
exitCode: Schema.optionalKey(Schema.Int),
|
|
80
|
+
stderr: Schema.String,
|
|
81
|
+
stdout: Schema.String,
|
|
82
|
+
truncated: Schema.Boolean
|
|
83
|
+
});
|
|
84
|
+
/**
|
|
85
|
+
* The step started once but no outcome was recorded: the computer lost power, or the step is still running. It is
|
|
86
|
+
* not run again, because whatever it did outside the computer may already have happened. Reconcile with the
|
|
87
|
+
* outside system by the step's key.
|
|
88
|
+
*/
|
|
89
|
+
const ExecUnknown = Schema.TaggedStruct("Unknown", {});
|
|
90
|
+
const ExecResult = Schema.Union([ExecRan, ExecUnknown]);
|
|
91
|
+
/** How much a log page returns at most, and when a request names no limit. */
|
|
92
|
+
const logPageLines = 1e3;
|
|
93
|
+
/**
|
|
94
|
+
* One line of a computer's log, oldest first: what the platform did to it (made, paused, resumed, stopped, forked,
|
|
95
|
+
* deleted) and each exec step's key and outcome. `seq` rises by one per line of the computer, so a reader passes the
|
|
96
|
+
* last `seq` it saw as `after` to read on.
|
|
97
|
+
*/
|
|
98
|
+
const ComputerLogLine = Schema.Struct({
|
|
99
|
+
at: Schema.Int,
|
|
100
|
+
level: Schema.Literals([
|
|
101
|
+
"info",
|
|
102
|
+
"warn",
|
|
103
|
+
"error"
|
|
104
|
+
]),
|
|
105
|
+
message: Schema.String,
|
|
106
|
+
seq: Schema.Int
|
|
107
|
+
});
|
|
108
|
+
const LogLimit = Schema.Int.check(Schema.isBetween({
|
|
109
|
+
maximum: logPageLines,
|
|
110
|
+
minimum: smallest
|
|
111
|
+
}));
|
|
112
|
+
/** A page of a computer's log: the lines after `after`, at most `limit` (1 to 1,000; 1,000 when absent). */
|
|
113
|
+
const ComputerLogPage = Schema.Struct({
|
|
114
|
+
after: Schema.optionalKey(Schema.Int),
|
|
115
|
+
limit: Schema.optionalKey(LogLimit)
|
|
116
|
+
});
|
|
117
|
+
export { Computer, ComputerCopy, ComputerCopyResult, ComputerFileRequest, ComputerLogLine, ComputerLogPage, ComputerName, ComputerSecret, ComputerSize, ComputerSpec, ComputerState, ExecRan, ExecRequest, ExecResult, ExecUnknown, computerFileBytes, execLimits, logPageLines };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
declare const ComputersUnavailableError_base: Schema.Class<ComputersUnavailableError, Schema.TaggedStruct<"ComputersUnavailableError", {
|
|
3
|
+
readonly message: Schema.String;
|
|
4
|
+
}>, import("effect/Cause").YieldableError & {
|
|
5
|
+
readonly brand: unique symbol;
|
|
6
|
+
}>;
|
|
7
|
+
/** This engine runs no computers, or their provider didn't answer. */
|
|
8
|
+
export declare class ComputersUnavailableError extends ComputersUnavailableError_base {}
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
// src/contract/computer/computers-unavailable.errors.ts
|
|
3
|
+
/** This engine runs no computers, or their provider didn't answer. */
|
|
4
|
+
var ComputersUnavailableError = class extends Schema.TaggedError()("ComputersUnavailableError", { message: Schema.String }) {};
|
|
5
|
+
export { ComputersUnavailableError };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
/** One file per call, bounded before crossing the host/control link. Paths are relative to the computer's files directory. */
|
|
3
|
+
declare const computerFileBytes = 1048576;
|
|
4
|
+
declare const ComputerFileRequest: Schema.TaggedUnion<{
|
|
5
|
+
readonly Read: Schema.TaggedStruct<"Read", {
|
|
6
|
+
readonly path: Schema.String;
|
|
7
|
+
}>;
|
|
8
|
+
readonly Write: Schema.TaggedStruct<"Write", {
|
|
9
|
+
readonly content: Schema.Uint8ArrayFromBase64;
|
|
10
|
+
readonly path: Schema.String;
|
|
11
|
+
}>;
|
|
12
|
+
}>;
|
|
13
|
+
type ComputerFileRequest = typeof ComputerFileRequest.Type;
|
|
14
|
+
declare const ComputerCopy: Schema.Struct<{
|
|
15
|
+
readonly computer: Schema.String;
|
|
16
|
+
readonly computerPath: Schema.String;
|
|
17
|
+
readonly direction: Schema.Literals<readonly ["toComputer", "fromComputer"]>;
|
|
18
|
+
readonly key: Schema.String;
|
|
19
|
+
readonly path: Schema.String;
|
|
20
|
+
}>;
|
|
21
|
+
type ComputerCopy = typeof ComputerCopy.Type;
|
|
22
|
+
/** Copy-back returns an upload receipt; only an actor command can attach it to an actor path. */
|
|
23
|
+
declare const ComputerCopyResult: Schema.Struct<{
|
|
24
|
+
readonly bytes: Schema.Int;
|
|
25
|
+
readonly receipt: Schema.optionalKey<Schema.String>;
|
|
26
|
+
}>;
|
|
27
|
+
type ComputerCopyResult = typeof ComputerCopyResult.Type;
|
|
28
|
+
export { ComputerCopy, ComputerCopyResult, ComputerFileRequest, computerFileBytes };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
// src/contract/computer/files/computer-files.schema.ts
|
|
3
|
+
/** One file per call, bounded before crossing the host/control link. Paths are relative to the computer's files directory. */
|
|
4
|
+
const computerFileBytes = 1048576;
|
|
5
|
+
const ComputerFileRequest = Schema.TaggedUnion({
|
|
6
|
+
Read: { path: Schema.String },
|
|
7
|
+
Write: {
|
|
8
|
+
content: Schema.Uint8ArrayFromBase64,
|
|
9
|
+
path: Schema.String
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
const ComputerCopy = Schema.Struct({
|
|
13
|
+
computer: Schema.String,
|
|
14
|
+
computerPath: Schema.String,
|
|
15
|
+
direction: Schema.Literals(["toComputer", "fromComputer"]),
|
|
16
|
+
key: Schema.String,
|
|
17
|
+
path: Schema.String
|
|
18
|
+
});
|
|
19
|
+
/** Copy-back returns an upload receipt; only an actor command can attach it to an actor path. */
|
|
20
|
+
const ComputerCopyResult = Schema.Struct({
|
|
21
|
+
bytes: Schema.Int,
|
|
22
|
+
receipt: Schema.optionalKey(Schema.String)
|
|
23
|
+
});
|
|
24
|
+
export { ComputerCopy, ComputerCopyResult, ComputerFileRequest, computerFileBytes };
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { ActorErasedError } from "../../actor/actor-erased.errors.mjs";
|
|
2
|
+
import { ActorNotCreatedError } from "../../actor/actor-not-created.errors.mjs";
|
|
3
|
+
import { ActorUnavailableError } from "../../client/actor-unavailable.errors.mjs";
|
|
4
|
+
import { BillingUnavailableError } from "../../spend/billing-unavailable.errors.mjs";
|
|
5
|
+
import { CallerNotAllowedError } from "../../caller/caller-not-allowed.errors.mjs";
|
|
6
|
+
import { CommandIdExpiredError } from "../../command/command-id-expired.errors.mjs";
|
|
7
|
+
import { HandlerFailedError } from "../../hosted/handler-failed.errors.mjs";
|
|
8
|
+
import { InvalidRequestError } from "../../client/invalid-request.errors.mjs";
|
|
9
|
+
import { SpendCapReachedError } from "../../spend/spend-cap-reached.errors.mjs";
|
|
10
|
+
import { StorageLimitError } from "../../client/storage-limit.errors.mjs";
|
|
11
|
+
import { ComputerHeldError } from "../computer-held.errors.mjs";
|
|
12
|
+
import { ComputerLostError } from "../computer-lost.errors.mjs";
|
|
13
|
+
import { ComputerNotFoundError } from "../computer-not-found.errors.mjs";
|
|
14
|
+
import { ComputersUnavailableError } from "../computers-unavailable.errors.mjs";
|
|
15
|
+
import { ComputerCopy, ComputerCopyResult } from "../files/computer-files.schema.mjs";
|
|
16
|
+
import { Computer } from "../computer.schema.mjs";
|
|
17
|
+
import { ComputerStep } from "../step/computer-step.schema.mjs";
|
|
18
|
+
import { StepNotFoundError } from "../step/step-not-found.errors.mjs";
|
|
19
|
+
import { Schema } from "effect";
|
|
20
|
+
import { Rpc } from "effect/rpc";
|
|
21
|
+
declare const ComputerRpcFailure: Schema.Union<readonly [Schema.Union<readonly [typeof ActorErasedError, typeof ActorNotCreatedError, typeof ActorUnavailableError, typeof BillingUnavailableError, typeof CallerNotAllowedError, typeof CommandIdExpiredError, typeof HandlerFailedError, typeof InvalidRequestError, typeof SpendCapReachedError, typeof StorageLimitError]>, typeof ComputerHeldError, typeof ComputerLostError, typeof ComputerNotFoundError, typeof ComputersUnavailableError, typeof StepNotFoundError]>;
|
|
22
|
+
type ComputerRpcFailureSchema = typeof ComputerRpcFailure;
|
|
23
|
+
type ComputerRpcFailureType = ComputerRpcFailureSchema["Type"];
|
|
24
|
+
/** The actor's encoded key, as every actor RPC carries it. */
|
|
25
|
+
declare const Keyed: {
|
|
26
|
+
key: Schema.String;
|
|
27
|
+
};
|
|
28
|
+
/** One computer of the actor, by name. */
|
|
29
|
+
declare const Named: {
|
|
30
|
+
computer: Schema.String;
|
|
31
|
+
key: Schema.String;
|
|
32
|
+
};
|
|
33
|
+
declare const Logs: {
|
|
34
|
+
after: Schema.optionalKey<Schema.Int>;
|
|
35
|
+
limit: Schema.optionalKey<Schema.Int>;
|
|
36
|
+
computer: Schema.String;
|
|
37
|
+
key: Schema.String;
|
|
38
|
+
};
|
|
39
|
+
/** A page of the actor's durable steps. */
|
|
40
|
+
declare const Paged: {
|
|
41
|
+
limit: Schema.optionalKey<Schema.Int>;
|
|
42
|
+
key: Schema.String;
|
|
43
|
+
};
|
|
44
|
+
/** One durable step of the actor, by its key. */
|
|
45
|
+
declare const Stepped: {
|
|
46
|
+
key: Schema.String;
|
|
47
|
+
step: Schema.String;
|
|
48
|
+
};
|
|
49
|
+
declare const Computers: Schema.$Array<Schema.Struct<{
|
|
50
|
+
readonly egress: Schema.$Array<Schema.String>;
|
|
51
|
+
readonly image: Schema.String;
|
|
52
|
+
readonly name: Schema.brand<Schema.String, "ComputerName">;
|
|
53
|
+
readonly secrets: Schema.optionalKey<Schema.$Array<Schema.Struct<{
|
|
54
|
+
readonly header: Schema.String;
|
|
55
|
+
readonly host: Schema.String;
|
|
56
|
+
readonly prefix: Schema.optionalKey<Schema.String>;
|
|
57
|
+
readonly secret: Schema.String;
|
|
58
|
+
}>>>;
|
|
59
|
+
readonly size: Schema.Struct<{
|
|
60
|
+
readonly memoryMib: Schema.Int;
|
|
61
|
+
readonly vcpu: Schema.Int;
|
|
62
|
+
}>;
|
|
63
|
+
readonly state: Schema.Literals<readonly ["starting", "running", "paused", "stopped", "failed", "gone"]>;
|
|
64
|
+
}>>;
|
|
65
|
+
declare const Steps: Schema.$Array<Schema.Struct<{
|
|
66
|
+
readonly command: Schema.String;
|
|
67
|
+
readonly computer: Schema.String;
|
|
68
|
+
readonly endedAt: Schema.optionalKey<Schema.Int>;
|
|
69
|
+
readonly exitCode: Schema.optionalKey<Schema.Int>;
|
|
70
|
+
readonly failure: Schema.optionalKey<Schema.String>;
|
|
71
|
+
readonly job: Schema.String;
|
|
72
|
+
readonly name: Schema.String;
|
|
73
|
+
readonly startedAt: Schema.Int;
|
|
74
|
+
readonly state: Schema.Literals<readonly ["running", "ran", "unknown", "failed"]>;
|
|
75
|
+
readonly stderr: Schema.optionalKey<Schema.String>;
|
|
76
|
+
readonly stdout: Schema.optionalKey<Schema.String>;
|
|
77
|
+
readonly step: Schema.String;
|
|
78
|
+
readonly timeoutSeconds: Schema.Int;
|
|
79
|
+
readonly truncated: Schema.optionalKey<Schema.Boolean>;
|
|
80
|
+
}>>;
|
|
81
|
+
declare const LogLines: Schema.$Array<Schema.Struct<{
|
|
82
|
+
readonly at: Schema.Int;
|
|
83
|
+
readonly level: Schema.Literals<readonly ["info", "warn", "error"]>;
|
|
84
|
+
readonly message: Schema.String;
|
|
85
|
+
readonly seq: Schema.Int;
|
|
86
|
+
}>>;
|
|
87
|
+
/** Moves a computer to a state and answers it as it is then. */
|
|
88
|
+
type ComputerMove = "pause" | "resume" | "stop";
|
|
89
|
+
type ComputerRpcOperation = ComputerMove | "delete" | "files" | "get" | "list" | "logs" | "step" | "steps";
|
|
90
|
+
type ComputerTag<Operation extends ComputerRpcOperation = ComputerRpcOperation, Actor extends string = string> = `${Actor}/computer/${Operation}`;
|
|
91
|
+
declare const computerTag: <Operation extends ComputerRpcOperation, Actor extends string>({ actor, operation }: {
|
|
92
|
+
readonly actor: Actor;
|
|
93
|
+
readonly operation: Operation;
|
|
94
|
+
}) => ComputerTag<Operation, Actor>;
|
|
95
|
+
type NamedRpc<Operation extends ComputerRpcOperation, Success extends Schema.Top, Actor extends string> = Rpc.Rpc<ComputerTag<Operation, Actor>, Schema.Struct<typeof Named>, Success, ComputerRpcFailureSchema>;
|
|
96
|
+
/** One computer RPC of the actor named `Actor`, so a client of a known actor sends exact tags. */
|
|
97
|
+
type ComputerRpc<Actor extends string = string> = Rpc.Rpc<ComputerTag<"files", Actor>, typeof ComputerCopy, typeof ComputerCopyResult, ComputerRpcFailureSchema> | Rpc.Rpc<ComputerTag<"list", Actor>, Schema.Struct<typeof Keyed>, typeof Computers, ComputerRpcFailureSchema> | Rpc.Rpc<ComputerTag<"logs", Actor>, Schema.Struct<typeof Logs>, typeof LogLines, ComputerRpcFailureSchema> | Rpc.Rpc<ComputerTag<"steps", Actor>, Schema.Struct<typeof Paged>, typeof Steps, ComputerRpcFailureSchema> | Rpc.Rpc<ComputerTag<"step", Actor>, Schema.Struct<typeof Stepped>, typeof ComputerStep, ComputerRpcFailureSchema> | NamedRpc<"delete", typeof Schema.Void, Actor> | NamedRpc<"get", typeof Computer, Actor> | NamedRpc<"pause", typeof Computer, Actor> | NamedRpc<"resume", typeof Computer, Actor> | NamedRpc<"stop", typeof Computer, Actor>;
|
|
98
|
+
/**
|
|
99
|
+
* An actor's computers as seen from outside the actor, under the tags docs/adr/0016 reserves:
|
|
100
|
+
* `<Actor>/computer/<operation>`. Every payload carries the actor's encoded key. `list` and `get` answer computers as
|
|
101
|
+
* they are; `pause`, `resume` and `stop` drive one there and answer it, and a `resume` of a computer a fork holds
|
|
102
|
+
* fails with `ComputerHeldError`; `delete` removes one with its disk and answers nothing, so a client confirms it
|
|
103
|
+
* first; `logs` reads a page of its log. There is no outside `exec` and no `ensure`: only the actor makes and runs
|
|
104
|
+
* its computers. `steps` reads a page of the actor's durable steps, newest first, and `step` one step by its key with its
|
|
105
|
+
* output (`StepNotFoundError` when the journal has none); both read the actor's own journal, not a computer.
|
|
106
|
+
*/
|
|
107
|
+
declare const computerRpcsOf: <Actor extends string>(actor: Actor) => readonly ComputerRpc<Actor>[];
|
|
108
|
+
export { type ComputerMove, type ComputerRpc, type ComputerRpcFailureType, type ComputerRpcOperation, type ComputerTag, computerRpcsOf, computerTag };
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { HostedFailure } from "../../hosted/hosted-failure.schema.mjs";
|
|
2
|
+
import { ComputerHeldError } from "../computer-held.errors.mjs";
|
|
3
|
+
import { ComputerLostError } from "../computer-lost.errors.mjs";
|
|
4
|
+
import { ComputerNotFoundError } from "../computer-not-found.errors.mjs";
|
|
5
|
+
import { ComputersUnavailableError } from "../computers-unavailable.errors.mjs";
|
|
6
|
+
import { Computer, ComputerLogLine, ComputerLogPage } from "../computer.schema.mjs";
|
|
7
|
+
import { ComputerCopy, ComputerCopyResult } from "../files/computer-files.schema.mjs";
|
|
8
|
+
import { ComputerStep, StepPage } from "../step/computer-step.schema.mjs";
|
|
9
|
+
import { StepNotFoundError } from "../step/step-not-found.errors.mjs";
|
|
10
|
+
import { Schema } from "effect";
|
|
11
|
+
import { Rpc } from "effect/rpc";
|
|
12
|
+
// src/contract/computer/rpc/computer-rpc.contract.ts
|
|
13
|
+
const ComputerRpcFailure = Schema.Union([
|
|
14
|
+
HostedFailure,
|
|
15
|
+
ComputerHeldError,
|
|
16
|
+
ComputerLostError,
|
|
17
|
+
ComputerNotFoundError,
|
|
18
|
+
ComputersUnavailableError,
|
|
19
|
+
StepNotFoundError
|
|
20
|
+
]);
|
|
21
|
+
/** The actor's encoded key, as every actor RPC carries it. */
|
|
22
|
+
const Keyed = { key: Schema.String };
|
|
23
|
+
/** One computer of the actor, by name. */
|
|
24
|
+
const Named = {
|
|
25
|
+
computer: Schema.String,
|
|
26
|
+
key: Schema.String
|
|
27
|
+
};
|
|
28
|
+
const Logs = {
|
|
29
|
+
...Named,
|
|
30
|
+
...ComputerLogPage.fields
|
|
31
|
+
};
|
|
32
|
+
/** A page of the actor's durable steps. */
|
|
33
|
+
const Paged = {
|
|
34
|
+
...Keyed,
|
|
35
|
+
...StepPage.fields
|
|
36
|
+
};
|
|
37
|
+
/** One durable step of the actor, by its key. */
|
|
38
|
+
const Stepped = {
|
|
39
|
+
key: Schema.String,
|
|
40
|
+
step: Schema.String
|
|
41
|
+
};
|
|
42
|
+
const Computers = Schema.Array(Computer);
|
|
43
|
+
const Steps = Schema.Array(ComputerStep);
|
|
44
|
+
const LogLines = Schema.Array(ComputerLogLine);
|
|
45
|
+
const computerTag = ({ actor, operation }) => `${actor}/computer/${operation}`;
|
|
46
|
+
const named = (actor, operation) => Rpc.make(computerTag({
|
|
47
|
+
actor,
|
|
48
|
+
operation
|
|
49
|
+
}), {
|
|
50
|
+
error: ComputerRpcFailure,
|
|
51
|
+
payload: Named,
|
|
52
|
+
success: Computer
|
|
53
|
+
});
|
|
54
|
+
/**
|
|
55
|
+
* An actor's computers as seen from outside the actor, under the tags docs/adr/0016 reserves:
|
|
56
|
+
* `<Actor>/computer/<operation>`. Every payload carries the actor's encoded key. `list` and `get` answer computers as
|
|
57
|
+
* they are; `pause`, `resume` and `stop` drive one there and answer it, and a `resume` of a computer a fork holds
|
|
58
|
+
* fails with `ComputerHeldError`; `delete` removes one with its disk and answers nothing, so a client confirms it
|
|
59
|
+
* first; `logs` reads a page of its log. There is no outside `exec` and no `ensure`: only the actor makes and runs
|
|
60
|
+
* its computers. `steps` reads a page of the actor's durable steps, newest first, and `step` one step by its key with its
|
|
61
|
+
* output (`StepNotFoundError` when the journal has none); both read the actor's own journal, not a computer.
|
|
62
|
+
*/
|
|
63
|
+
const computerRpcsOf = (actor) => [
|
|
64
|
+
Rpc.make(computerTag({
|
|
65
|
+
actor,
|
|
66
|
+
operation: "files"
|
|
67
|
+
}), {
|
|
68
|
+
error: ComputerRpcFailure,
|
|
69
|
+
payload: ComputerCopy,
|
|
70
|
+
success: ComputerCopyResult
|
|
71
|
+
}),
|
|
72
|
+
Rpc.make(computerTag({
|
|
73
|
+
actor,
|
|
74
|
+
operation: "list"
|
|
75
|
+
}), {
|
|
76
|
+
error: ComputerRpcFailure,
|
|
77
|
+
payload: Keyed,
|
|
78
|
+
success: Computers
|
|
79
|
+
}),
|
|
80
|
+
named(actor, "get"),
|
|
81
|
+
named(actor, "pause"),
|
|
82
|
+
named(actor, "resume"),
|
|
83
|
+
named(actor, "stop"),
|
|
84
|
+
Rpc.make(computerTag({
|
|
85
|
+
actor,
|
|
86
|
+
operation: "delete"
|
|
87
|
+
}), {
|
|
88
|
+
error: ComputerRpcFailure,
|
|
89
|
+
payload: Named,
|
|
90
|
+
success: Schema.Void
|
|
91
|
+
}),
|
|
92
|
+
Rpc.make(computerTag({
|
|
93
|
+
actor,
|
|
94
|
+
operation: "logs"
|
|
95
|
+
}), {
|
|
96
|
+
error: ComputerRpcFailure,
|
|
97
|
+
payload: Logs,
|
|
98
|
+
success: LogLines
|
|
99
|
+
}),
|
|
100
|
+
Rpc.make(computerTag({
|
|
101
|
+
actor,
|
|
102
|
+
operation: "steps"
|
|
103
|
+
}), {
|
|
104
|
+
error: ComputerRpcFailure,
|
|
105
|
+
payload: Paged,
|
|
106
|
+
success: Steps
|
|
107
|
+
}),
|
|
108
|
+
Rpc.make(computerTag({
|
|
109
|
+
actor,
|
|
110
|
+
operation: "step"
|
|
111
|
+
}), {
|
|
112
|
+
error: ComputerRpcFailure,
|
|
113
|
+
payload: Stepped,
|
|
114
|
+
success: ComputerStep
|
|
115
|
+
})
|
|
116
|
+
];
|
|
117
|
+
export { computerRpcsOf, computerTag };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ComputerClient } from "../computer-client.contract.mjs";
|
|
2
|
+
import { ExecResult } from "../computer.schema.mjs";
|
|
3
|
+
import { ComputerClientFailure } from "../computer-client-failure.contract.mjs";
|
|
4
|
+
import { StepRequest } from "./computer-step.schema.mjs";
|
|
5
|
+
import { Effect } from "effect";
|
|
6
|
+
import { WorkflowEngine } from "effect/workflow";
|
|
7
|
+
/**
|
|
8
|
+
* Runs one command in one of the actor's computers as a durable step of the job that calls it, and answers its
|
|
9
|
+
* outcome. The step journals where it runs, its key and when it started before it sends anything, then its outcome,
|
|
10
|
+
* so `akter steps` reads it from the actor. A job replayed after a host or control plane restart reads both back: a
|
|
11
|
+
* settled step answers its journaled outcome without reaching the computer, and a step cut off mid-flight sends the
|
|
12
|
+
* same key again, which reads the command's own recorded outcome back and never runs it a second time. A command whose
|
|
13
|
+
* outcome no send could read before its deadline answers `Unknown`; reconcile it with the outside system by its key.
|
|
14
|
+
* Call it from a job, never from inside an activity, and give each step of a job its own name.
|
|
15
|
+
*/
|
|
16
|
+
declare const step: ({ client, computer, request }: {
|
|
17
|
+
readonly client: ComputerClient;
|
|
18
|
+
readonly computer: string;
|
|
19
|
+
readonly request: StepRequest;
|
|
20
|
+
}) => Effect.Effect<ExecResult, ComputerClientFailure, WorkflowEngine.WorkflowEngine | WorkflowEngine.WorkflowInstance>;
|
|
21
|
+
export { step };
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { ActorUnavailableError } from "../../client/actor-unavailable.errors.mjs";
|
|
2
|
+
import { ComputersUnavailableError } from "../computers-unavailable.errors.mjs";
|
|
3
|
+
import { ExecRan, ExecUnknown, execLimits } from "../computer.schema.mjs";
|
|
4
|
+
import { StepEnd, StepStart } from "./computer-step.schema.mjs";
|
|
5
|
+
import { StepFailure } from "./step-failure.schema.mjs";
|
|
6
|
+
import { Clock, Duration, Effect, Schedule, Schema, Struct } from "effect";
|
|
7
|
+
import { Activity } from "effect/workflow";
|
|
8
|
+
// src/contract/computer/step/computer-step.contract.ts
|
|
9
|
+
/**
|
|
10
|
+
* How long past its own time limit a step keeps asking for its outcome, measured from when it was first journaled: the
|
|
11
|
+
* time between journaling and the computer starting the command, which a lost reply or a restart can stretch.
|
|
12
|
+
*/
|
|
13
|
+
const graceSeconds = 10;
|
|
14
|
+
/** How often a step asks again while its computer is unreachable or its command has no outcome yet. */
|
|
15
|
+
const askEverySeconds = 2;
|
|
16
|
+
const millis = 1e3;
|
|
17
|
+
const none = 0;
|
|
18
|
+
/** The step was sent before and its command has no recorded outcome yet: it may still be running. */
|
|
19
|
+
var NoOutcomeYetError = class extends Schema.TaggedError()("NoOutcomeYetError", {}) {};
|
|
20
|
+
/** Failures that say nothing about the step: the engine or control plane between the job and the computer is away. */
|
|
21
|
+
const isPassing = Schema.is(Schema.Union([
|
|
22
|
+
ActorUnavailableError,
|
|
23
|
+
ComputersUnavailableError,
|
|
24
|
+
NoOutcomeYetError
|
|
25
|
+
]));
|
|
26
|
+
const isRan = Schema.is(ExecRan);
|
|
27
|
+
const sentOnce = (client, request, start) => {
|
|
28
|
+
const sent = client.exec(start.computer, {
|
|
29
|
+
...Struct.omit(request, ["name"]),
|
|
30
|
+
key: start.key,
|
|
31
|
+
timeoutSeconds: start.timeoutSeconds
|
|
32
|
+
});
|
|
33
|
+
return Effect.filterOrFail(sent, isRan, () => NoOutcomeYetError.make({}));
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* Sends the step under its key until it has an outcome, asking again while its computer is unreachable or its command
|
|
37
|
+
* runs on past a lost reply, until its time limit and the grace have passed since it was first journaled. The key
|
|
38
|
+
* makes every send after the first read the command's outcome back instead of running it again. Past the deadline with
|
|
39
|
+
* no outcome the step is `Unknown`: it may have done its work, and it never runs again.
|
|
40
|
+
*/
|
|
41
|
+
const settled = (client, request, start) => Effect.gen(function* settledStep() {
|
|
42
|
+
const now = yield* Clock.currentTimeMillis;
|
|
43
|
+
const deadline = start.startedAt + (start.timeoutSeconds + graceSeconds) * millis;
|
|
44
|
+
const remaining = Duration.millis(Math.max(none, deadline - now));
|
|
45
|
+
const asking = Schedule.spaced(Duration.seconds(askEverySeconds)).pipe(Schedule.upTo({ duration: remaining }));
|
|
46
|
+
const outcome = yield* sentOnce(client, request, start).pipe(Effect.retry({
|
|
47
|
+
schedule: asking,
|
|
48
|
+
while: isPassing
|
|
49
|
+
}), Effect.catchIf(isPassing, () => Effect.succeed(ExecUnknown.make({}))));
|
|
50
|
+
return {
|
|
51
|
+
endedAt: yield* Clock.currentTimeMillis,
|
|
52
|
+
outcome
|
|
53
|
+
};
|
|
54
|
+
});
|
|
55
|
+
const started = (computer, request) => Effect.gen(function* startedStep() {
|
|
56
|
+
const key = yield* Activity.idempotencyKey(`step/${request.name}`);
|
|
57
|
+
const startedAt = yield* Clock.currentTimeMillis;
|
|
58
|
+
const timeoutSeconds = request.timeoutSeconds ?? execLimits.seconds;
|
|
59
|
+
return {
|
|
60
|
+
command: request.command,
|
|
61
|
+
computer,
|
|
62
|
+
key,
|
|
63
|
+
startedAt,
|
|
64
|
+
timeoutSeconds
|
|
65
|
+
};
|
|
66
|
+
});
|
|
67
|
+
/**
|
|
68
|
+
* Runs one command in one of the actor's computers as a durable step of the job that calls it, and answers its
|
|
69
|
+
* outcome. The step journals where it runs, its key and when it started before it sends anything, then its outcome,
|
|
70
|
+
* so `akter steps` reads it from the actor. A job replayed after a host or control plane restart reads both back: a
|
|
71
|
+
* settled step answers its journaled outcome without reaching the computer, and a step cut off mid-flight sends the
|
|
72
|
+
* same key again, which reads the command's own recorded outcome back and never runs it a second time. A command whose
|
|
73
|
+
* outcome no send could read before its deadline answers `Unknown`; reconcile it with the outside system by its key.
|
|
74
|
+
* Call it from a job, never from inside an activity, and give each step of a job its own name.
|
|
75
|
+
*/
|
|
76
|
+
const step = ({ client, computer, request }) => Effect.gen(function* durableStep() {
|
|
77
|
+
const start = yield* Activity.make({
|
|
78
|
+
execute: started(computer, request),
|
|
79
|
+
name: `step-start/${request.name}`,
|
|
80
|
+
success: StepStart
|
|
81
|
+
});
|
|
82
|
+
return (yield* Activity.make({
|
|
83
|
+
error: StepFailure,
|
|
84
|
+
execute: settled(client, request, start),
|
|
85
|
+
name: `step/${request.name}`,
|
|
86
|
+
success: StepEnd
|
|
87
|
+
})).outcome;
|
|
88
|
+
});
|
|
89
|
+
export { step };
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
declare const stepPage = 100;
|
|
3
|
+
declare const largestPage = 1000;
|
|
4
|
+
/**
|
|
5
|
+
* One durable step of a job (`step` on an actor's computers): the exec request without its key, which the step derives from its job and
|
|
6
|
+
* name, so the same step in a replayed job sends the same key.
|
|
7
|
+
*/
|
|
8
|
+
declare const StepRequest: Schema.Struct<{
|
|
9
|
+
readonly command: Schema.String;
|
|
10
|
+
readonly cwd: Schema.optionalKey<Schema.String>;
|
|
11
|
+
readonly name: Schema.String;
|
|
12
|
+
readonly stdin: Schema.optionalKey<Schema.Uint8Array>;
|
|
13
|
+
readonly timeoutSeconds: Schema.optionalKey<Schema.Int>;
|
|
14
|
+
}>;
|
|
15
|
+
type StepRequest = typeof StepRequest.Type;
|
|
16
|
+
/** What a step journals before it sends anything: where it runs, its key, and when it first started. */
|
|
17
|
+
declare const StepStart: Schema.Struct<{
|
|
18
|
+
readonly command: Schema.String;
|
|
19
|
+
readonly computer: Schema.String;
|
|
20
|
+
readonly key: Schema.String;
|
|
21
|
+
readonly startedAt: Schema.Int;
|
|
22
|
+
readonly timeoutSeconds: Schema.Int;
|
|
23
|
+
}>;
|
|
24
|
+
type StepStart = typeof StepStart.Type;
|
|
25
|
+
/** What a step journals once it settles: its outcome, and when it settled. */
|
|
26
|
+
declare const StepEnd: Schema.Struct<{
|
|
27
|
+
readonly endedAt: Schema.Int;
|
|
28
|
+
readonly outcome: Schema.Union<readonly [Schema.TaggedStruct<"Ran", {
|
|
29
|
+
readonly exitCode: Schema.optionalKey<Schema.Int>;
|
|
30
|
+
readonly stderr: Schema.String;
|
|
31
|
+
readonly stdout: Schema.String;
|
|
32
|
+
readonly truncated: Schema.Boolean;
|
|
33
|
+
}>, Schema.TaggedStruct<"Unknown", {}>]>;
|
|
34
|
+
}>;
|
|
35
|
+
type StepEnd = typeof StepEnd.Type;
|
|
36
|
+
/**
|
|
37
|
+
* Where a step is. `running` has no outcome yet; `ran` ended with its exit code and output; `unknown` started and has no
|
|
38
|
+
* recorded outcome, so it may or may not have done its work, and is never run again; `failed` could not run, such as on
|
|
39
|
+
* a lost computer.
|
|
40
|
+
*/
|
|
41
|
+
declare const StepState: Schema.Literals<readonly ["running", "ran", "unknown", "failed"]>;
|
|
42
|
+
type StepState = typeof StepState.Type;
|
|
43
|
+
/**
|
|
44
|
+
* One step as the actor's journal holds it. `step` is its key, the id a reader asks for it by and the key an outside
|
|
45
|
+
* system reconciles an `unknown` step with. Output is only in a single step's read.
|
|
46
|
+
*/
|
|
47
|
+
declare const ComputerStep: Schema.Struct<{
|
|
48
|
+
readonly command: Schema.String;
|
|
49
|
+
readonly computer: Schema.String;
|
|
50
|
+
readonly endedAt: Schema.optionalKey<Schema.Int>;
|
|
51
|
+
readonly exitCode: Schema.optionalKey<Schema.Int>;
|
|
52
|
+
readonly failure: Schema.optionalKey<Schema.String>;
|
|
53
|
+
readonly job: Schema.String;
|
|
54
|
+
readonly name: Schema.String;
|
|
55
|
+
readonly startedAt: Schema.Int;
|
|
56
|
+
readonly state: Schema.Literals<readonly ["running", "ran", "unknown", "failed"]>;
|
|
57
|
+
readonly stderr: Schema.optionalKey<Schema.String>;
|
|
58
|
+
readonly stdout: Schema.optionalKey<Schema.String>;
|
|
59
|
+
readonly step: Schema.String;
|
|
60
|
+
readonly timeoutSeconds: Schema.Int;
|
|
61
|
+
readonly truncated: Schema.optionalKey<Schema.Boolean>;
|
|
62
|
+
}>;
|
|
63
|
+
type ComputerStep = typeof ComputerStep.Type;
|
|
64
|
+
/** A page of an actor's steps, newest first: at most `limit` (1 to 1,000; 100 when absent). */
|
|
65
|
+
declare const StepPage: Schema.Struct<{
|
|
66
|
+
readonly limit: Schema.optionalKey<Schema.Int>;
|
|
67
|
+
}>;
|
|
68
|
+
type StepPage = typeof StepPage.Type;
|
|
69
|
+
export { ComputerStep, StepEnd, StepPage, StepRequest, StepStart, StepState, largestPage, stepPage };
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { ExecRequest, ExecResult } from "../computer.schema.mjs";
|
|
2
|
+
import { Schema } from "effect";
|
|
3
|
+
// src/contract/computer/step/computer-step.schema.ts
|
|
4
|
+
const smallest = 1;
|
|
5
|
+
const stepPage = 100;
|
|
6
|
+
const largestPage = 1e3;
|
|
7
|
+
/** A step's name, unique among its job's steps: lowercase letters, digits, dots, underscores and hyphens. */
|
|
8
|
+
const StepName = Schema.String.check(Schema.isPattern(new RegExp(`^[a-z0-9][a-z0-9._-]{0,62}$`, "u"))).annotate({ description: "A step's name, unique among its job's steps." });
|
|
9
|
+
const { command, cwd, stdin, timeoutSeconds } = ExecRequest.fields;
|
|
10
|
+
/**
|
|
11
|
+
* One durable step of a job (`step` on an actor's computers): the exec request without its key, which the step derives from its job and
|
|
12
|
+
* name, so the same step in a replayed job sends the same key.
|
|
13
|
+
*/
|
|
14
|
+
const StepRequest = Schema.Struct({
|
|
15
|
+
command,
|
|
16
|
+
cwd,
|
|
17
|
+
name: StepName,
|
|
18
|
+
stdin,
|
|
19
|
+
timeoutSeconds
|
|
20
|
+
});
|
|
21
|
+
/** What a step journals before it sends anything: where it runs, its key, and when it first started. */
|
|
22
|
+
const StepStart = Schema.Struct({
|
|
23
|
+
command: Schema.String,
|
|
24
|
+
computer: Schema.String,
|
|
25
|
+
key: Schema.String,
|
|
26
|
+
startedAt: Schema.Int,
|
|
27
|
+
timeoutSeconds: Schema.Int
|
|
28
|
+
});
|
|
29
|
+
/** What a step journals once it settles: its outcome, and when it settled. */
|
|
30
|
+
const StepEnd = Schema.Struct({
|
|
31
|
+
endedAt: Schema.Int,
|
|
32
|
+
outcome: ExecResult
|
|
33
|
+
});
|
|
34
|
+
/**
|
|
35
|
+
* Where a step is. `running` has no outcome yet; `ran` ended with its exit code and output; `unknown` started and has no
|
|
36
|
+
* recorded outcome, so it may or may not have done its work, and is never run again; `failed` could not run, such as on
|
|
37
|
+
* a lost computer.
|
|
38
|
+
*/
|
|
39
|
+
const StepState = Schema.Literals([
|
|
40
|
+
"running",
|
|
41
|
+
"ran",
|
|
42
|
+
"unknown",
|
|
43
|
+
"failed"
|
|
44
|
+
]);
|
|
45
|
+
/**
|
|
46
|
+
* One step as the actor's journal holds it. `step` is its key, the id a reader asks for it by and the key an outside
|
|
47
|
+
* system reconciles an `unknown` step with. Output is only in a single step's read.
|
|
48
|
+
*/
|
|
49
|
+
const ComputerStep = Schema.Struct({
|
|
50
|
+
command: Schema.String,
|
|
51
|
+
computer: Schema.String,
|
|
52
|
+
endedAt: Schema.optionalKey(Schema.Int),
|
|
53
|
+
exitCode: Schema.optionalKey(Schema.Int),
|
|
54
|
+
failure: Schema.optionalKey(Schema.String),
|
|
55
|
+
job: Schema.String,
|
|
56
|
+
name: Schema.String,
|
|
57
|
+
startedAt: Schema.Int,
|
|
58
|
+
state: StepState,
|
|
59
|
+
stderr: Schema.optionalKey(Schema.String),
|
|
60
|
+
stdout: Schema.optionalKey(Schema.String),
|
|
61
|
+
step: Schema.String,
|
|
62
|
+
timeoutSeconds: Schema.Int,
|
|
63
|
+
truncated: Schema.optionalKey(Schema.Boolean)
|
|
64
|
+
});
|
|
65
|
+
const StepLimit = Schema.Int.check(Schema.isBetween({
|
|
66
|
+
maximum: largestPage,
|
|
67
|
+
minimum: smallest
|
|
68
|
+
}));
|
|
69
|
+
/** A page of an actor's steps, newest first: at most `limit` (1 to 1,000; 100 when absent). */
|
|
70
|
+
const StepPage = Schema.Struct({ limit: Schema.optionalKey(StepLimit) });
|
|
71
|
+
export { ComputerStep, StepEnd, StepPage, StepRequest, StepStart, StepState, largestPage, stepPage };
|