@elie-laloum/outpost 2.0.0 → 4.0.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/CHANGELOG.md +42 -0
- package/README.md +3 -1
- package/SECURITY.md +3 -1
- package/dist/adapters/agents/claude-diagnostics.d.ts +1 -0
- package/dist/adapters/agents/claude-diagnostics.js +7 -0
- package/dist/adapters/agents/claude-diagnostics.js.map +1 -0
- package/dist/adapters/agents/cli-diagnostics.constants.d.ts +12 -0
- package/dist/adapters/agents/cli-diagnostics.constants.js +24 -0
- package/dist/adapters/agents/cli-diagnostics.constants.js.map +1 -0
- package/dist/adapters/agents/cli-diagnostics.d.ts +4 -0
- package/dist/adapters/agents/cli-diagnostics.js +14 -0
- package/dist/adapters/agents/cli-diagnostics.js.map +1 -0
- package/dist/adapters/agents/cli-diagnostics.types.d.ts +13 -0
- package/dist/adapters/agents/cli-diagnostics.types.js +2 -0
- package/dist/adapters/agents/cli-diagnostics.types.js.map +1 -0
- package/dist/adapters/agents/codex-diagnostics.d.ts +1 -0
- package/dist/adapters/agents/codex-diagnostics.js +7 -0
- package/dist/adapters/agents/codex-diagnostics.js.map +1 -0
- package/dist/adapters/agents/gemini-adapter.d.ts +3 -0
- package/dist/adapters/agents/gemini-adapter.js +15 -0
- package/dist/adapters/agents/gemini-adapter.js.map +1 -0
- package/dist/adapters/agents/gemini-diagnostics.d.ts +2 -0
- package/dist/adapters/agents/gemini-diagnostics.js +15 -0
- package/dist/adapters/agents/gemini-diagnostics.js.map +1 -0
- package/dist/adapters/agents/gemini-events.d.ts +2 -0
- package/dist/adapters/agents/gemini-events.js +50 -0
- package/dist/adapters/agents/gemini-events.js.map +1 -0
- package/dist/adapters/agents/gemini-request.d.ts +4 -0
- package/dist/adapters/agents/gemini-request.js +21 -0
- package/dist/adapters/agents/gemini-request.js.map +1 -0
- package/dist/adapters/agents/gemini.types.d.ts +6 -0
- package/dist/adapters/agents/gemini.types.js +2 -0
- package/dist/adapters/agents/gemini.types.js.map +1 -0
- package/dist/adapters/agents/protocol-fixtures.constants.d.ts +2 -0
- package/dist/adapters/agents/protocol-fixtures.constants.js +105 -0
- package/dist/adapters/agents/protocol-fixtures.constants.js.map +1 -0
- package/dist/adapters/agents/protocol-fixtures.types.d.ts +6 -0
- package/dist/adapters/agents/protocol-fixtures.types.js +2 -0
- package/dist/adapters/agents/protocol-fixtures.types.js.map +1 -0
- package/dist/application/agent-bootstrap.constants.d.ts +1 -0
- package/dist/application/agent-bootstrap.constants.js +1 -0
- package/dist/application/agent-bootstrap.constants.js.map +1 -1
- package/dist/application/agent-bootstrap.js +6 -2
- package/dist/application/agent-bootstrap.js.map +1 -1
- package/dist/application/agent-output.js +9 -2
- package/dist/application/agent-output.js.map +1 -1
- package/dist/application/artifact-tasks.d.ts +5 -0
- package/dist/application/artifact-tasks.js +31 -0
- package/dist/application/artifact-tasks.js.map +1 -0
- package/dist/application/artifact-tasks.types.d.ts +8 -0
- package/dist/application/artifact-tasks.types.js +2 -0
- package/dist/application/artifact-tasks.types.js.map +1 -0
- package/dist/application/diagnostic-probe.d.ts +3 -0
- package/dist/application/diagnostic-probe.js +55 -0
- package/dist/application/diagnostic-probe.js.map +1 -0
- package/dist/application/dispatch-validation.js +2 -0
- package/dist/application/dispatch-validation.js.map +1 -1
- package/dist/application/doctor-agent.constants.d.ts +11 -0
- package/dist/application/doctor-agent.constants.js +10 -0
- package/dist/application/doctor-agent.constants.js.map +1 -0
- package/dist/application/doctor-agent.d.ts +3 -0
- package/dist/application/doctor-agent.js +53 -0
- package/dist/application/doctor-agent.js.map +1 -0
- package/dist/application/doctor-image.d.ts +3 -0
- package/dist/application/doctor-image.js +133 -0
- package/dist/application/doctor-image.js.map +1 -0
- package/dist/application/doctor-protocol.d.ts +3 -0
- package/dist/application/doctor-protocol.js +30 -0
- package/dist/application/doctor-protocol.js.map +1 -0
- package/dist/application/doctor-protocol.types.d.ts +10 -0
- package/dist/application/doctor-protocol.types.js +2 -0
- package/dist/application/doctor-protocol.types.js.map +1 -0
- package/dist/application/doctor-sandbox.constants.d.ts +5 -0
- package/dist/application/doctor-sandbox.constants.js +6 -0
- package/dist/application/doctor-sandbox.constants.js.map +1 -0
- package/dist/application/doctor-sandbox.d.ts +4 -0
- package/dist/application/doctor-sandbox.js +133 -0
- package/dist/application/doctor-sandbox.js.map +1 -0
- package/dist/application/doctor-sandbox.types.d.ts +23 -0
- package/dist/application/doctor-sandbox.types.js +2 -0
- package/dist/application/doctor-sandbox.types.js.map +1 -0
- package/dist/application/doctor-transfers.constants.d.ts +6 -0
- package/dist/application/doctor-transfers.constants.js +7 -0
- package/dist/application/doctor-transfers.constants.js.map +1 -0
- package/dist/application/doctor-transfers.d.ts +4 -0
- package/dist/application/doctor-transfers.js +88 -0
- package/dist/application/doctor-transfers.js.map +1 -0
- package/dist/application/doctor.constants.d.ts +9 -0
- package/dist/application/doctor.constants.js +15 -0
- package/dist/application/doctor.constants.js.map +1 -0
- package/dist/application/doctor.d.ts +3 -0
- package/dist/application/doctor.js +106 -0
- package/dist/application/doctor.js.map +1 -0
- package/dist/application/doctor.types.d.ts +39 -0
- package/dist/application/doctor.types.js +2 -0
- package/dist/application/doctor.types.js.map +1 -0
- package/dist/application/execution.js +1 -0
- package/dist/application/execution.js.map +1 -1
- package/dist/application/outpost.types.d.ts +4 -0
- package/dist/application/outpost.types.js.map +1 -1
- package/dist/application/queue-worker.d.ts +2 -0
- package/dist/application/queue-worker.js +75 -0
- package/dist/application/queue-worker.js.map +1 -0
- package/dist/application/queue-worker.types.d.ts +15 -0
- package/dist/application/queue-worker.types.js +2 -0
- package/dist/application/queue-worker.types.js.map +1 -0
- package/dist/application/queued-task.d.ts +3 -0
- package/dist/application/queued-task.js +56 -0
- package/dist/application/queued-task.js.map +1 -0
- package/dist/application/queued-task.types.d.ts +11 -0
- package/dist/application/queued-task.types.js +2 -0
- package/dist/application/queued-task.types.js.map +1 -0
- package/dist/application/recovery-checksum-capture.d.ts +2 -0
- package/dist/application/recovery-checksum-capture.js +32 -0
- package/dist/application/recovery-checksum-capture.js.map +1 -0
- package/dist/application/recovery-checksum-paths.d.ts +2 -0
- package/dist/application/recovery-checksum-paths.js +11 -0
- package/dist/application/recovery-checksum-paths.js.map +1 -0
- package/dist/application/recovery-checksums.constants.d.ts +5 -0
- package/dist/application/recovery-checksums.constants.js +6 -0
- package/dist/application/recovery-checksums.constants.js.map +1 -0
- package/dist/application/recovery-checksums.d.ts +3 -0
- package/dist/application/recovery-checksums.js +94 -0
- package/dist/application/recovery-checksums.js.map +1 -0
- package/dist/application/recovery-checksums.types.d.ts +17 -0
- package/dist/application/recovery-checksums.types.js +2 -0
- package/dist/application/recovery-checksums.types.js.map +1 -0
- package/dist/application/recovery-inspection.d.ts +2 -0
- package/dist/application/recovery-inspection.js +32 -0
- package/dist/application/recovery-inspection.js.map +1 -0
- package/dist/application/recovery-inspection.types.d.ts +18 -0
- package/dist/application/recovery-inspection.types.js +2 -0
- package/dist/application/recovery-inspection.types.js.map +1 -0
- package/dist/application/recovery-restorability.d.ts +2 -0
- package/dist/application/recovery-restorability.js +137 -0
- package/dist/application/recovery-restorability.js.map +1 -0
- package/dist/application/recovery-restore-snapshot.d.ts +2 -0
- package/dist/application/recovery-restore-snapshot.js +57 -0
- package/dist/application/recovery-restore-snapshot.js.map +1 -0
- package/dist/application/recovery-restore.d.ts +3 -0
- package/dist/application/recovery-restore.js +161 -0
- package/dist/application/recovery-restore.js.map +1 -0
- package/dist/application/recovery-restore.types.d.ts +28 -0
- package/dist/application/recovery-restore.types.js +2 -0
- package/dist/application/recovery-restore.types.js.map +1 -0
- package/dist/application/recovery-retention-policy.d.ts +2 -0
- package/dist/application/recovery-retention-policy.js +21 -0
- package/dist/application/recovery-retention-policy.js.map +1 -0
- package/dist/application/recovery-retention.constants.d.ts +3 -0
- package/dist/application/recovery-retention.constants.js +2 -0
- package/dist/application/recovery-retention.constants.js.map +1 -0
- package/dist/application/recovery-retention.d.ts +4 -0
- package/dist/application/recovery-retention.js +207 -0
- package/dist/application/recovery-retention.js.map +1 -0
- package/dist/application/recovery-retention.types.d.ts +52 -0
- package/dist/application/recovery-retention.types.js +2 -0
- package/dist/application/recovery-retention.types.js.map +1 -0
- package/dist/application/recovery-verification.constants.d.ts +5 -0
- package/dist/application/recovery-verification.constants.js +10 -0
- package/dist/application/recovery-verification.constants.js.map +1 -0
- package/dist/application/recovery-verification.d.ts +3 -0
- package/dist/application/recovery-verification.js +107 -0
- package/dist/application/recovery-verification.js.map +1 -0
- package/dist/application/recovery-verification.types.d.ts +26 -0
- package/dist/application/recovery-verification.types.js +2 -0
- package/dist/application/recovery-verification.types.js.map +1 -0
- package/dist/application/remote-apply.js +30 -6
- package/dist/application/remote-apply.js.map +1 -1
- package/dist/application/remote-backup.js +6 -2
- package/dist/application/remote-backup.js.map +1 -1
- package/dist/application/remote-download.js +38 -6
- package/dist/application/remote-download.js.map +1 -1
- package/dist/application/remote-history.d.ts +6 -0
- package/dist/application/remote-history.js +114 -0
- package/dist/application/remote-history.js.map +1 -0
- package/dist/application/remote-upload.d.ts +2 -0
- package/dist/application/remote-upload.js +17 -0
- package/dist/application/remote-upload.js.map +1 -0
- package/dist/application/remote-validation.js +39 -28
- package/dist/application/remote-validation.js.map +1 -1
- package/dist/application/remote-workspace.constants.d.ts +3 -0
- package/dist/application/remote-workspace.constants.js +2 -0
- package/dist/application/remote-workspace.constants.js.map +1 -0
- package/dist/application/remote-workspace.js +10 -10
- package/dist/application/remote-workspace.js.map +1 -1
- package/dist/application/remote-workspace.types.d.ts +3 -1
- package/dist/application/remote-workspace.types.js.map +1 -1
- package/dist/application/sandbox-activity.d.ts +3 -0
- package/dist/application/sandbox-activity.js +25 -0
- package/dist/application/sandbox-activity.js.map +1 -0
- package/dist/application/sandbox-provision.js +55 -10
- package/dist/application/sandbox-provision.js.map +1 -1
- package/dist/application/sandbox-session.types.d.ts +2 -0
- package/dist/application/sandbox-session.types.js.map +1 -1
- package/dist/application/sandbox.js +33 -10
- package/dist/application/sandbox.js.map +1 -1
- package/dist/application/speculation-host.d.ts +2 -0
- package/dist/application/speculation-host.js +30 -0
- package/dist/application/speculation-host.js.map +1 -0
- package/dist/application/speculation.constants.d.ts +4 -0
- package/dist/application/speculation.constants.js +2 -0
- package/dist/application/speculation.constants.js.map +1 -0
- package/dist/application/speculation.d.ts +2 -0
- package/dist/application/speculation.js +166 -0
- package/dist/application/speculation.js.map +1 -0
- package/dist/application/speculation.types.d.ts +56 -0
- package/dist/application/speculation.types.js +2 -0
- package/dist/application/speculation.types.js.map +1 -0
- package/dist/application/storage-reservation.d.ts +3 -0
- package/dist/application/storage-reservation.js +10 -0
- package/dist/application/storage-reservation.js.map +1 -0
- package/dist/application/storage-reservation.types.d.ts +4 -0
- package/dist/application/storage-reservation.types.js +2 -0
- package/dist/application/storage-reservation.types.js.map +1 -0
- package/dist/application/task-usage.d.ts +4 -0
- package/dist/application/task-usage.js +41 -0
- package/dist/application/task-usage.js.map +1 -0
- package/dist/application/task-usage.types.d.ts +5 -0
- package/dist/application/task-usage.types.js +2 -0
- package/dist/application/task-usage.types.js.map +1 -0
- package/dist/application/tasks.js +23 -2
- package/dist/application/tasks.js.map +1 -1
- package/dist/application/tasks.types.d.ts +4 -3
- package/dist/application/tasks.types.js.map +1 -1
- package/dist/application/workspace-allocation.d.ts +3 -0
- package/dist/application/workspace-allocation.js +34 -0
- package/dist/application/workspace-allocation.js.map +1 -0
- package/dist/application/workspace.js +2 -2
- package/dist/application/workspace.js.map +1 -1
- package/dist/cli/commands.js +4 -0
- package/dist/cli/commands.js.map +1 -1
- package/dist/cli/doctor-command.d.ts +3 -0
- package/dist/cli/doctor-command.js +38 -0
- package/dist/cli/doctor-command.js.map +1 -0
- package/dist/cli/main.constants.d.ts +38 -2
- package/dist/cli/main.constants.js +21 -2
- package/dist/cli/main.constants.js.map +1 -1
- package/dist/cli/recovery-command.d.ts +2 -0
- package/dist/cli/recovery-command.js +93 -0
- package/dist/cli/recovery-command.js.map +1 -0
- package/dist/cli/recovery-prune-command.d.ts +2 -0
- package/dist/cli/recovery-prune-command.js +34 -0
- package/dist/cli/recovery-prune-command.js.map +1 -0
- package/dist/cli/recovery-restore-command.d.ts +2 -0
- package/dist/cli/recovery-restore-command.js +34 -0
- package/dist/cli/recovery-restore-command.js.map +1 -0
- package/dist/cli/recovery-verify-command.d.ts +2 -0
- package/dist/cli/recovery-verify-command.js +43 -0
- package/dist/cli/recovery-verify-command.js.map +1 -0
- package/dist/cli/scaffold-files.js +2 -2
- package/dist/cli/scaffold-files.js.map +1 -1
- package/dist/cli/scaffold-validation.js +1 -1
- package/dist/cli/scaffold-validation.js.map +1 -1
- package/dist/cli/scaffold.constants.d.ts +5 -0
- package/dist/cli/scaffold.constants.js +7 -2
- package/dist/cli/scaffold.constants.js.map +1 -1
- package/dist/cli/scaffold.types.d.ts +1 -1
- package/dist/cli/scaffold.types.js.map +1 -1
- package/dist/domain/agent.types.d.ts +2 -0
- package/dist/domain/agent.types.js.map +1 -1
- package/dist/domain/artifact-reference.d.ts +4 -0
- package/dist/domain/artifact-reference.js +90 -0
- package/dist/domain/artifact-reference.js.map +1 -0
- package/dist/domain/artifact.constants.d.ts +2 -0
- package/dist/domain/artifact.constants.js +3 -0
- package/dist/domain/artifact.constants.js.map +1 -0
- package/dist/domain/artifact.d.ts +7 -0
- package/dist/domain/artifact.js +104 -0
- package/dist/domain/artifact.js.map +1 -0
- package/dist/domain/artifact.types.d.ts +44 -0
- package/dist/domain/artifact.types.js +2 -0
- package/dist/domain/artifact.types.js.map +1 -0
- package/dist/domain/egress.constants.d.ts +1 -0
- package/dist/domain/egress.constants.js +7 -0
- package/dist/domain/egress.constants.js.map +1 -0
- package/dist/domain/egress.d.ts +2 -0
- package/dist/domain/egress.js +48 -0
- package/dist/domain/egress.js.map +1 -0
- package/dist/domain/egress.types.d.ts +8 -0
- package/dist/domain/egress.types.js +2 -0
- package/dist/domain/egress.types.js.map +1 -0
- package/dist/domain/ports.d.ts +1 -1
- package/dist/domain/ports.js.map +1 -1
- package/dist/domain/sandbox.types.d.ts +13 -0
- package/dist/domain/sandbox.types.js.map +1 -1
- package/dist/domain/task-queue.constants.d.ts +8 -0
- package/dist/domain/task-queue.constants.js +9 -0
- package/dist/domain/task-queue.constants.js.map +1 -0
- package/dist/domain/task-queue.d.ts +11 -0
- package/dist/domain/task-queue.js +105 -0
- package/dist/domain/task-queue.js.map +1 -0
- package/dist/domain/task-queue.types.d.ts +41 -0
- package/dist/domain/task-queue.types.js +2 -0
- package/dist/domain/task-queue.types.js.map +1 -0
- package/dist/domain/workflow/budget.constants.d.ts +1 -0
- package/dist/domain/workflow/budget.constants.js +7 -0
- package/dist/domain/workflow/budget.constants.js.map +1 -0
- package/dist/domain/workflow/budget.d.ts +9 -0
- package/dist/domain/workflow/budget.js +69 -0
- package/dist/domain/workflow/budget.js.map +1 -0
- package/dist/domain/workflow/budget.types.d.ts +15 -0
- package/dist/domain/workflow/budget.types.js +2 -0
- package/dist/domain/workflow/budget.types.js.map +1 -0
- package/dist/domain/workflow/checkpoint-validation.d.ts +3 -0
- package/dist/domain/workflow/checkpoint-validation.js +81 -0
- package/dist/domain/workflow/checkpoint-validation.js.map +1 -0
- package/dist/domain/workflow/checkpoint-value.d.ts +2 -0
- package/dist/domain/workflow/checkpoint-value.js +49 -0
- package/dist/domain/workflow/checkpoint-value.js.map +1 -0
- package/dist/domain/workflow/checkpoint.d.ts +3 -0
- package/dist/domain/workflow/checkpoint.js +70 -0
- package/dist/domain/workflow/checkpoint.js.map +1 -0
- package/dist/domain/workflow/checkpoint.types.d.ts +40 -0
- package/dist/domain/workflow/checkpoint.types.js +2 -0
- package/dist/domain/workflow/checkpoint.types.js.map +1 -0
- package/dist/domain/workflow/gate-validation.d.ts +4 -0
- package/dist/domain/workflow/gate-validation.js +71 -0
- package/dist/domain/workflow/gate-validation.js.map +1 -0
- package/dist/domain/workflow/gates.constants.d.ts +4 -0
- package/dist/domain/workflow/gates.constants.js +5 -0
- package/dist/domain/workflow/gates.constants.js.map +1 -0
- package/dist/domain/workflow/gates.d.ts +7 -0
- package/dist/domain/workflow/gates.js +85 -0
- package/dist/domain/workflow/gates.js.map +1 -0
- package/dist/domain/workflow/gates.types.d.ts +27 -0
- package/dist/domain/workflow/gates.types.js +2 -0
- package/dist/domain/workflow/gates.types.js.map +1 -0
- package/dist/domain/workflow/task-runner.js +22 -3
- package/dist/domain/workflow/task-runner.js.map +1 -1
- package/dist/domain/workflow/usage-receipt.constants.d.ts +2 -0
- package/dist/domain/workflow/usage-receipt.constants.js +3 -0
- package/dist/domain/workflow/usage-receipt.constants.js.map +1 -0
- package/dist/domain/workflow/usage-receipt.d.ts +2 -0
- package/dist/domain/workflow/usage-receipt.js +18 -0
- package/dist/domain/workflow/usage-receipt.js.map +1 -0
- package/dist/domain/workflow/validation.js +6 -0
- package/dist/domain/workflow/validation.js.map +1 -1
- package/dist/domain/workflow/workflow-scheduler.js +68 -33
- package/dist/domain/workflow/workflow-scheduler.js.map +1 -1
- package/dist/domain/workflow/workflow-state.d.ts +2 -1
- package/dist/domain/workflow/workflow-state.js +107 -3
- package/dist/domain/workflow/workflow-state.js.map +1 -1
- package/dist/domain/workflow.d.ts +2 -0
- package/dist/domain/workflow.js +1 -0
- package/dist/domain/workflow.js.map +1 -1
- package/dist/domain/workflow.types.d.ts +23 -3
- package/dist/domain/workflow.types.js.map +1 -1
- package/dist/index.d.ts +44 -5
- package/dist/index.js +19 -2
- package/dist/index.js.map +1 -1
- package/dist/infrastructure/artifact-store.constants.d.ts +1 -0
- package/dist/infrastructure/artifact-store.constants.js +2 -0
- package/dist/infrastructure/artifact-store.constants.js.map +1 -0
- package/dist/infrastructure/artifact-store.d.ts +3 -0
- package/dist/infrastructure/artifact-store.js +100 -0
- package/dist/infrastructure/artifact-store.js.map +1 -0
- package/dist/infrastructure/artifact-store.types.d.ts +4 -0
- package/dist/infrastructure/artifact-store.types.js +2 -0
- package/dist/infrastructure/artifact-store.types.js.map +1 -0
- package/dist/infrastructure/file-manifest.d.ts +6 -0
- package/dist/infrastructure/file-manifest.js +92 -0
- package/dist/infrastructure/file-manifest.js.map +1 -0
- package/dist/infrastructure/git/lock-inspection.constants.d.ts +4 -0
- package/dist/infrastructure/git/lock-inspection.constants.js +5 -0
- package/dist/infrastructure/git/lock-inspection.constants.js.map +1 -0
- package/dist/infrastructure/git/lock-inspection.d.ts +3 -0
- package/dist/infrastructure/git/lock-inspection.js +64 -0
- package/dist/infrastructure/git/lock-inspection.js.map +1 -0
- package/dist/infrastructure/git/lock-inspection.types.d.ts +27 -0
- package/dist/infrastructure/git/lock-inspection.types.js +2 -0
- package/dist/infrastructure/git/lock-inspection.types.js.map +1 -0
- package/dist/infrastructure/git/lock.d.ts +1 -0
- package/dist/infrastructure/git/lock.js +70 -29
- package/dist/infrastructure/git/lock.js.map +1 -1
- package/dist/infrastructure/git/process-identity.d.ts +3 -0
- package/dist/infrastructure/git/process-identity.js +73 -0
- package/dist/infrastructure/git/process-identity.js.map +1 -0
- package/dist/infrastructure/git/process-identity.types.d.ts +10 -0
- package/dist/infrastructure/git/process-identity.types.js +2 -0
- package/dist/infrastructure/git/process-identity.types.js.map +1 -0
- package/dist/infrastructure/git/verification-command.d.ts +1 -0
- package/dist/infrastructure/git/verification-command.js +37 -0
- package/dist/infrastructure/git/verification-command.js.map +1 -0
- package/dist/infrastructure/git/workspace-lease.js +1 -0
- package/dist/infrastructure/git/workspace-lease.js.map +1 -1
- package/dist/infrastructure/git/workspace.js +5 -1
- package/dist/infrastructure/git/workspace.js.map +1 -1
- package/dist/infrastructure/git/worktree-inspection.constants.d.ts +5 -0
- package/dist/infrastructure/git/worktree-inspection.constants.js +16 -0
- package/dist/infrastructure/git/worktree-inspection.constants.js.map +1 -0
- package/dist/infrastructure/git/worktree-inspection.d.ts +3 -0
- package/dist/infrastructure/git/worktree-inspection.js +120 -0
- package/dist/infrastructure/git/worktree-inspection.js.map +1 -0
- package/dist/infrastructure/git/worktree-inspection.types.d.ts +19 -0
- package/dist/infrastructure/git/worktree-inspection.types.js +2 -0
- package/dist/infrastructure/git/worktree-inspection.types.js.map +1 -0
- package/dist/infrastructure/inspection-file.constants.d.ts +1 -0
- package/dist/infrastructure/inspection-file.constants.js +5 -0
- package/dist/infrastructure/inspection-file.constants.js.map +1 -0
- package/dist/infrastructure/inspection-file.d.ts +1 -0
- package/dist/infrastructure/inspection-file.js +43 -0
- package/dist/infrastructure/inspection-file.js.map +1 -0
- package/dist/infrastructure/inspection-hash.constants.d.ts +1 -0
- package/dist/infrastructure/inspection-hash.constants.js +2 -0
- package/dist/infrastructure/inspection-hash.constants.js.map +1 -0
- package/dist/infrastructure/inspection-hash.d.ts +2 -0
- package/dist/infrastructure/inspection-hash.js +62 -0
- package/dist/infrastructure/inspection-hash.js.map +1 -0
- package/dist/infrastructure/inspection-hash.types.d.ts +5 -0
- package/dist/infrastructure/inspection-hash.types.js +2 -0
- package/dist/infrastructure/inspection-hash.types.js.map +1 -0
- package/dist/infrastructure/journal-retention.constants.d.ts +4 -0
- package/dist/infrastructure/journal-retention.constants.js +5 -0
- package/dist/infrastructure/journal-retention.constants.js.map +1 -0
- package/dist/infrastructure/journal-retention.d.ts +2 -0
- package/dist/infrastructure/journal-retention.js +51 -0
- package/dist/infrastructure/journal-retention.js.map +1 -0
- package/dist/infrastructure/journal.js +37 -13
- package/dist/infrastructure/journal.js.map +1 -1
- package/dist/infrastructure/opentelemetry.constants.d.ts +10 -0
- package/dist/infrastructure/opentelemetry.constants.js +11 -0
- package/dist/infrastructure/opentelemetry.constants.js.map +1 -0
- package/dist/infrastructure/opentelemetry.d.ts +3 -0
- package/dist/infrastructure/opentelemetry.js +131 -0
- package/dist/infrastructure/opentelemetry.js.map +1 -0
- package/dist/infrastructure/opentelemetry.types.d.ts +21 -0
- package/dist/infrastructure/opentelemetry.types.js +2 -0
- package/dist/infrastructure/opentelemetry.types.js.map +1 -0
- package/dist/infrastructure/resource-activity-inspection.d.ts +2 -0
- package/dist/infrastructure/resource-activity-inspection.js +152 -0
- package/dist/infrastructure/resource-activity-inspection.js.map +1 -0
- package/dist/infrastructure/resource-activity.constants.d.ts +8 -0
- package/dist/infrastructure/resource-activity.constants.js +26 -0
- package/dist/infrastructure/resource-activity.constants.js.map +1 -0
- package/dist/infrastructure/resource-activity.d.ts +2 -0
- package/dist/infrastructure/resource-activity.js +166 -0
- package/dist/infrastructure/resource-activity.js.map +1 -0
- package/dist/infrastructure/resource-activity.types.d.ts +53 -0
- package/dist/infrastructure/resource-activity.types.js +2 -0
- package/dist/infrastructure/resource-activity.types.js.map +1 -0
- package/dist/infrastructure/storage-inventory.constants.d.ts +6 -0
- package/dist/infrastructure/storage-inventory.constants.js +11 -0
- package/dist/infrastructure/storage-inventory.constants.js.map +1 -0
- package/dist/infrastructure/storage-inventory.d.ts +2 -0
- package/dist/infrastructure/storage-inventory.js +123 -0
- package/dist/infrastructure/storage-inventory.js.map +1 -0
- package/dist/infrastructure/storage-inventory.types.d.ts +38 -0
- package/dist/infrastructure/storage-inventory.types.js +2 -0
- package/dist/infrastructure/storage-inventory.types.js.map +1 -0
- package/dist/infrastructure/storage-mutation-lock.constants.d.ts +5 -0
- package/dist/infrastructure/storage-mutation-lock.constants.js +6 -0
- package/dist/infrastructure/storage-mutation-lock.constants.js.map +1 -0
- package/dist/infrastructure/storage-mutation-lock.d.ts +1 -0
- package/dist/infrastructure/storage-mutation-lock.js +21 -0
- package/dist/infrastructure/storage-mutation-lock.js.map +1 -0
- package/dist/infrastructure/storage-reservations.constants.d.ts +4 -0
- package/dist/infrastructure/storage-reservations.constants.js +5 -0
- package/dist/infrastructure/storage-reservations.constants.js.map +1 -0
- package/dist/infrastructure/storage-reservations.d.ts +2 -0
- package/dist/infrastructure/storage-reservations.js +150 -0
- package/dist/infrastructure/storage-reservations.js.map +1 -0
- package/dist/infrastructure/storage-reservations.types.d.ts +21 -0
- package/dist/infrastructure/storage-reservations.types.js +2 -0
- package/dist/infrastructure/storage-reservations.types.js.map +1 -0
- package/dist/infrastructure/task-queue-http.constants.d.ts +2 -0
- package/dist/infrastructure/task-queue-http.constants.js +3 -0
- package/dist/infrastructure/task-queue-http.constants.js.map +1 -0
- package/dist/infrastructure/task-queue-http.d.ts +4 -0
- package/dist/infrastructure/task-queue-http.js +158 -0
- package/dist/infrastructure/task-queue-http.js.map +1 -0
- package/dist/infrastructure/task-queue-http.types.d.ts +16 -0
- package/dist/infrastructure/task-queue-http.types.js +2 -0
- package/dist/infrastructure/task-queue-http.types.js.map +1 -0
- package/dist/infrastructure/task-queue.d.ts +2 -0
- package/dist/infrastructure/task-queue.js +134 -0
- package/dist/infrastructure/task-queue.js.map +1 -0
- package/dist/infrastructure/transfer.js +17 -0
- package/dist/infrastructure/transfer.js.map +1 -1
- package/dist/infrastructure/workflow-checkpoint.constants.d.ts +1 -0
- package/dist/infrastructure/workflow-checkpoint.constants.js +2 -0
- package/dist/infrastructure/workflow-checkpoint.constants.js.map +1 -0
- package/dist/infrastructure/workflow-checkpoint.d.ts +3 -0
- package/dist/infrastructure/workflow-checkpoint.js +77 -0
- package/dist/infrastructure/workflow-checkpoint.js.map +1 -0
- package/dist/infrastructure/workflow-checkpoint.types.d.ts +4 -0
- package/dist/infrastructure/workflow-checkpoint.types.js +2 -0
- package/dist/infrastructure/workflow-checkpoint.types.js.map +1 -0
- package/dist/providers/agents.d.ts +2 -0
- package/dist/providers/agents.js +1 -0
- package/dist/providers/agents.js.map +1 -1
- package/dist/providers/cloud.constants.d.ts +1 -0
- package/dist/providers/cloud.constants.js +1 -0
- package/dist/providers/cloud.constants.js.map +1 -1
- package/dist/providers/container-cache.constants.d.ts +11 -0
- package/dist/providers/container-cache.constants.js +9 -0
- package/dist/providers/container-cache.constants.js.map +1 -0
- package/dist/providers/container-cache.d.ts +4 -0
- package/dist/providers/container-cache.js +48 -0
- package/dist/providers/container-cache.js.map +1 -0
- package/dist/providers/container-cache.types.d.ts +8 -0
- package/dist/providers/container-cache.types.js +2 -0
- package/dist/providers/container-cache.types.js.map +1 -0
- package/dist/providers/container-isolation.d.ts +2 -0
- package/dist/providers/container-isolation.js +29 -0
- package/dist/providers/container-isolation.js.map +1 -0
- package/dist/providers/container-mounts.js +7 -2
- package/dist/providers/container-mounts.js.map +1 -1
- package/dist/providers/container-network.d.ts +2 -0
- package/dist/providers/container-network.js +14 -0
- package/dist/providers/container-network.js.map +1 -0
- package/dist/providers/container-plan.js +6 -2
- package/dist/providers/container-plan.js.map +1 -1
- package/dist/providers/container.constants.d.ts +1 -0
- package/dist/providers/container.constants.js +1 -0
- package/dist/providers/container.constants.js.map +1 -1
- package/dist/providers/container.js +50 -3
- package/dist/providers/container.js.map +1 -1
- package/dist/providers/container.types.d.ts +5 -0
- package/dist/providers/container.types.js.map +1 -1
- package/dist/providers/daytona-command.js +10 -6
- package/dist/providers/daytona-command.js.map +1 -1
- package/dist/providers/daytona-terminal.d.ts +3 -0
- package/dist/providers/daytona-terminal.js +128 -0
- package/dist/providers/daytona-terminal.js.map +1 -0
- package/dist/providers/daytona.js +15 -4
- package/dist/providers/daytona.js.map +1 -1
- package/dist/providers/diagnostic-container.d.ts +4 -0
- package/dist/providers/diagnostic-container.js +15 -0
- package/dist/providers/diagnostic-container.js.map +1 -0
- package/dist/providers/docker.d.ts +2 -0
- package/dist/providers/docker.js.map +1 -1
- package/dist/providers/file-batches.constants.d.ts +10 -0
- package/dist/providers/file-batches.constants.js +57 -0
- package/dist/providers/file-batches.constants.js.map +1 -0
- package/dist/providers/file-batches.d.ts +2 -0
- package/dist/providers/file-batches.js +160 -0
- package/dist/providers/file-batches.js.map +1 -0
- package/dist/providers/file-upload.constants.d.ts +1 -0
- package/dist/providers/file-upload.constants.js +68 -0
- package/dist/providers/file-upload.constants.js.map +1 -0
- package/dist/providers/file-upload.d.ts +2 -0
- package/dist/providers/file-upload.js +146 -0
- package/dist/providers/file-upload.js.map +1 -0
- package/dist/providers/firecracker-command.d.ts +5 -0
- package/dist/providers/firecracker-command.js +114 -0
- package/dist/providers/firecracker-command.js.map +1 -0
- package/dist/providers/firecracker-files.constants.d.ts +1 -0
- package/dist/providers/firecracker-files.constants.js +21 -0
- package/dist/providers/firecracker-files.constants.js.map +1 -0
- package/dist/providers/firecracker-files.d.ts +3 -0
- package/dist/providers/firecracker-files.js +110 -0
- package/dist/providers/firecracker-files.js.map +1 -0
- package/dist/providers/firecracker-machine.d.ts +3 -0
- package/dist/providers/firecracker-machine.js +155 -0
- package/dist/providers/firecracker-machine.js.map +1 -0
- package/dist/providers/firecracker.constants.d.ts +10 -0
- package/dist/providers/firecracker.constants.js +11 -0
- package/dist/providers/firecracker.constants.js.map +1 -0
- package/dist/providers/firecracker.d.ts +4 -0
- package/dist/providers/firecracker.js +103 -0
- package/dist/providers/firecracker.js.map +1 -0
- package/dist/providers/firecracker.types.d.ts +36 -0
- package/dist/providers/firecracker.types.js +2 -0
- package/dist/providers/firecracker.types.js.map +1 -0
- package/dist/providers/local.js +2 -1
- package/dist/providers/local.js.map +1 -1
- package/dist/providers/podman.d.ts +2 -0
- package/dist/providers/podman.js.map +1 -1
- package/dist/providers/terminal-bridge.d.ts +14 -0
- package/dist/providers/terminal-bridge.js +100 -0
- package/dist/providers/terminal-bridge.js.map +1 -0
- package/dist/providers/vercel-directory.d.ts +2 -0
- package/dist/providers/vercel-directory.js +7 -0
- package/dist/providers/vercel-directory.js.map +1 -0
- package/dist/providers/vercel-files.js +3 -2
- package/dist/providers/vercel-files.js.map +1 -1
- package/dist/providers/vercel-network.d.ts +2 -0
- package/dist/providers/vercel-network.js +18 -0
- package/dist/providers/vercel-network.js.map +1 -0
- package/dist/providers/vercel.d.ts +1 -0
- package/dist/providers/vercel.js +8 -2
- package/dist/providers/vercel.js.map +1 -1
- package/dist/providers/vercel.types.d.ts +2 -0
- package/dist/providers/vercel.types.js.map +1 -1
- package/dist/providers/versions.constants.d.ts +1 -0
- package/dist/providers/versions.constants.js +1 -0
- package/dist/providers/versions.constants.js.map +1 -1
- package/package.json +16 -1
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { lstat, opendir } from "node:fs/promises";
|
|
2
|
+
import { basename, join } from "node:path";
|
|
3
|
+
import { positive } from "../domain/errors.js";
|
|
4
|
+
import { storageCategories, storageInventoryDefaults, } from "./storage-inventory.constants.js";
|
|
5
|
+
function usage() {
|
|
6
|
+
return { bytes: 0, files: 0, directories: 0, symlinks: 0, other: 0 };
|
|
7
|
+
}
|
|
8
|
+
function addUsage(target, incoming) {
|
|
9
|
+
target.bytes += incoming.bytes;
|
|
10
|
+
target.files += incoming.files;
|
|
11
|
+
target.directories += incoming.directories;
|
|
12
|
+
target.symlinks += incoming.symlinks;
|
|
13
|
+
target.other += incoming.other;
|
|
14
|
+
}
|
|
15
|
+
function errorCode(error) {
|
|
16
|
+
if (error &&
|
|
17
|
+
typeof error === "object" &&
|
|
18
|
+
"code" in error &&
|
|
19
|
+
typeof error.code === "string")
|
|
20
|
+
return error.code;
|
|
21
|
+
return "UNAVAILABLE";
|
|
22
|
+
}
|
|
23
|
+
async function availableDirectory(path, scan) {
|
|
24
|
+
try {
|
|
25
|
+
const info = await lstat(path);
|
|
26
|
+
if (info.isDirectory() && !info.isSymbolicLink())
|
|
27
|
+
return true;
|
|
28
|
+
scan.issues.push({
|
|
29
|
+
path,
|
|
30
|
+
code: info.isSymbolicLink() ? "SYMLINK_ROOT" : "NOT_DIRECTORY",
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
catch (error) {
|
|
34
|
+
if (errorCode(error) !== "ENOENT")
|
|
35
|
+
scan.issues.push({ path, code: errorCode(error) });
|
|
36
|
+
}
|
|
37
|
+
return false;
|
|
38
|
+
}
|
|
39
|
+
async function measure(path, scan, depth) {
|
|
40
|
+
const startIssues = scan.issues.length;
|
|
41
|
+
const entry = {
|
|
42
|
+
...usage(),
|
|
43
|
+
name: basename(path),
|
|
44
|
+
path,
|
|
45
|
+
kind: "unknown",
|
|
46
|
+
complete: true,
|
|
47
|
+
};
|
|
48
|
+
if (scan.remaining === 0) {
|
|
49
|
+
scan.issues.push({ path, code: "ENTRY_LIMIT" });
|
|
50
|
+
return { ...entry, complete: false };
|
|
51
|
+
}
|
|
52
|
+
scan.remaining--;
|
|
53
|
+
try {
|
|
54
|
+
const info = await lstat(path);
|
|
55
|
+
entry.modifiedAt = info.mtime.toISOString();
|
|
56
|
+
if (info.isSymbolicLink())
|
|
57
|
+
return { ...entry, kind: "symlink", symlinks: 1 };
|
|
58
|
+
if (info.isFile())
|
|
59
|
+
return { ...entry, kind: "file", files: 1, bytes: info.size };
|
|
60
|
+
if (!info.isDirectory()) {
|
|
61
|
+
scan.issues.push({ path, code: "UNSUPPORTED_TYPE" });
|
|
62
|
+
return { ...entry, kind: "other", other: 1, complete: false };
|
|
63
|
+
}
|
|
64
|
+
entry.kind = "directory";
|
|
65
|
+
entry.directories = 1;
|
|
66
|
+
if (depth >= storageInventoryDefaults.maxDepth) {
|
|
67
|
+
scan.issues.push({ path, code: "DEPTH_LIMIT" });
|
|
68
|
+
return { ...entry, complete: false };
|
|
69
|
+
}
|
|
70
|
+
for await (const child of await opendir(path)) {
|
|
71
|
+
const nested = await measure(join(path, child.name), scan, depth + 1);
|
|
72
|
+
addUsage(entry, nested);
|
|
73
|
+
if (nested.modifiedAt && nested.modifiedAt > entry.modifiedAt)
|
|
74
|
+
entry.modifiedAt = nested.modifiedAt;
|
|
75
|
+
if (!nested.complete)
|
|
76
|
+
entry.complete = false;
|
|
77
|
+
if (scan.remaining === 0 && !nested.complete)
|
|
78
|
+
break;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
catch (error) {
|
|
82
|
+
scan.issues.push({ path, code: errorCode(error) });
|
|
83
|
+
}
|
|
84
|
+
entry.complete = entry.complete && scan.issues.length === startIssues;
|
|
85
|
+
return entry;
|
|
86
|
+
}
|
|
87
|
+
export async function storageInventory(root, maxEntries = storageInventoryDefaults.maxEntries) {
|
|
88
|
+
positive(maxEntries, "maxEntries");
|
|
89
|
+
const scan = { remaining: maxEntries, issues: [] };
|
|
90
|
+
const categories = [];
|
|
91
|
+
const total = usage();
|
|
92
|
+
const available = await availableDirectory(root, scan);
|
|
93
|
+
for (const name of storageCategories) {
|
|
94
|
+
const path = join(root, name);
|
|
95
|
+
const entries = [];
|
|
96
|
+
if (available && (await availableDirectory(path, scan))) {
|
|
97
|
+
try {
|
|
98
|
+
for await (const child of await opendir(path)) {
|
|
99
|
+
const entry = await measure(join(path, child.name), scan, 0);
|
|
100
|
+
entries.push(entry);
|
|
101
|
+
addUsage(total, entry);
|
|
102
|
+
if (scan.remaining === 0 && !entry.complete)
|
|
103
|
+
break;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
catch (error) {
|
|
107
|
+
scan.issues.push({ path, code: errorCode(error) });
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
entries.sort((left, right) => left.name < right.name ? -1 : Number(left.name > right.name));
|
|
111
|
+
categories.push({ name, path, entries });
|
|
112
|
+
}
|
|
113
|
+
return {
|
|
114
|
+
root,
|
|
115
|
+
categories,
|
|
116
|
+
usage: total,
|
|
117
|
+
issues: scan.issues,
|
|
118
|
+
complete: scan.issues.length === 0,
|
|
119
|
+
scannedEntries: maxEntries - scan.remaining,
|
|
120
|
+
maxEntries,
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
//# sourceMappingURL=storage-inventory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"storage-inventory.js","sourceRoot":"","sources":["../../src/infrastructure/storage-inventory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EACL,iBAAiB,EACjB,wBAAwB,GACzB,MAAM,kCAAkC,CAAC;AAS1C,SAAS,KAAK;IACZ,OAAO,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AAC,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;YACrD,CAAC;QACH,CAAC;QACD,OAAO,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAC3B,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,CAC7D,CAAC;QACF,UAAU,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC;IAC3C,CAAC;IACD,OAAO;QACL,IAAI;QACJ,UAAU;QACV,KAAK,EAAE,KAAK;QACZ,MAAM,EAAE,IAAI,CAAC,MAAM;QACnB,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,KAAK,CAAC;QAClC,cAAc,EAAE,UAAU,GAAG,IAAI,CAAC,SAAS;QAC3C,UAAU;KACX,CAAC;AACJ,CAAC","sourcesContent":["import { lstat, opendir } from \"node:fs/promises\";\nimport { basename, join } from \"node:path\";\nimport { positive } from \"../domain/errors.ts\";\nimport {\n storageCategories,\n storageInventoryDefaults,\n} from \"./storage-inventory.constants.ts\";\nimport type {\n StorageCategory,\n StorageEntry,\n StorageInventory,\n StorageScan,\n StorageUsage,\n} from \"./storage-inventory.types.ts\";\n\nfunction usage(): StorageUsage {\n return { bytes: 0, files: 0, directories: 0, symlinks: 0, other: 0 };\n}\nfunction addUsage(\n target: StorageUsage,\n incoming: Readonly<StorageUsage>,\n): void {\n target.bytes += incoming.bytes;\n target.files += incoming.files;\n target.directories += incoming.directories;\n target.symlinks += incoming.symlinks;\n target.other += incoming.other;\n}\nfunction errorCode(error: unknown): string {\n if (\n error &&\n typeof error === \"object\" &&\n \"code\" in error &&\n typeof error.code === \"string\"\n )\n return error.code;\n return \"UNAVAILABLE\";\n}\nasync function availableDirectory(\n path: string,\n scan: StorageScan,\n): Promise<boolean> {\n try {\n const info = await lstat(path);\n if (info.isDirectory() && !info.isSymbolicLink()) return true;\n scan.issues.push({\n path,\n code: info.isSymbolicLink() ? \"SYMLINK_ROOT\" : \"NOT_DIRECTORY\",\n });\n } catch (error) {\n if (errorCode(error) !== \"ENOENT\")\n scan.issues.push({ path, code: errorCode(error) });\n }\n return false;\n}\nasync function measure(\n path: string,\n scan: StorageScan,\n depth: number,\n): Promise<StorageEntry> {\n const startIssues = scan.issues.length;\n const entry: StorageEntry = {\n ...usage(),\n name: basename(path),\n path,\n kind: \"unknown\",\n complete: true,\n };\n if (scan.remaining === 0) {\n scan.issues.push({ path, code: \"ENTRY_LIMIT\" });\n return { ...entry, complete: false };\n }\n scan.remaining--;\n try {\n const info = await lstat(path);\n entry.modifiedAt = info.mtime.toISOString();\n if (info.isSymbolicLink())\n return { ...entry, kind: \"symlink\", symlinks: 1 };\n if (info.isFile())\n return { ...entry, kind: \"file\", files: 1, bytes: info.size };\n if (!info.isDirectory()) {\n scan.issues.push({ path, code: \"UNSUPPORTED_TYPE\" });\n return { ...entry, kind: \"other\", other: 1, complete: false };\n }\n entry.kind = \"directory\";\n entry.directories = 1;\n if (depth >= storageInventoryDefaults.maxDepth) {\n scan.issues.push({ path, code: \"DEPTH_LIMIT\" });\n return { ...entry, complete: false };\n }\n for await (const child of await opendir(path)) {\n const nested = await measure(join(path, child.name), scan, depth + 1);\n addUsage(entry, nested);\n if (nested.modifiedAt && nested.modifiedAt > entry.modifiedAt)\n entry.modifiedAt = nested.modifiedAt;\n if (!nested.complete) entry.complete = false;\n if (scan.remaining === 0 && !nested.complete) break;\n }\n } catch (error) {\n scan.issues.push({ path, code: errorCode(error) });\n }\n entry.complete = entry.complete && scan.issues.length === startIssues;\n return entry;\n}\n\nexport async function storageInventory(\n root: string,\n maxEntries: number = storageInventoryDefaults.maxEntries,\n): Promise<StorageInventory> {\n positive(maxEntries, \"maxEntries\");\n const scan: StorageScan = { remaining: maxEntries, issues: [] };\n const categories: StorageCategory[] = [];\n const total = usage();\n const available = await availableDirectory(root, scan);\n for (const name of storageCategories) {\n const path = join(root, name);\n const entries: StorageEntry[] = [];\n if (available && (await availableDirectory(path, scan))) {\n try {\n for await (const child of await opendir(path)) {\n const entry = await measure(join(path, child.name), scan, 0);\n entries.push(entry);\n addUsage(total, entry);\n if (scan.remaining === 0 && !entry.complete) break;\n }\n } catch (error) {\n scan.issues.push({ path, code: errorCode(error) });\n }\n }\n entries.sort((left, right) =>\n left.name < right.name ? -1 : Number(left.name > right.name),\n );\n categories.push({ name, path, entries });\n }\n return {\n root,\n categories,\n usage: total,\n issues: scan.issues,\n complete: scan.issues.length === 0,\n scannedEntries: maxEntries - scan.remaining,\n maxEntries,\n };\n}\n"]}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export type StorageCategoryName = "recovery" | "logs" | "locks" | "workspaces";
|
|
2
|
+
export type StorageEntryKind = "file" | "directory" | "symlink" | "other" | "unknown";
|
|
3
|
+
export interface StorageIssue {
|
|
4
|
+
readonly path: string;
|
|
5
|
+
readonly code: string;
|
|
6
|
+
}
|
|
7
|
+
export interface StorageUsage {
|
|
8
|
+
bytes: number;
|
|
9
|
+
files: number;
|
|
10
|
+
directories: number;
|
|
11
|
+
symlinks: number;
|
|
12
|
+
other: number;
|
|
13
|
+
}
|
|
14
|
+
export interface StorageEntry extends StorageUsage {
|
|
15
|
+
readonly name: string;
|
|
16
|
+
readonly path: string;
|
|
17
|
+
kind: StorageEntryKind;
|
|
18
|
+
modifiedAt?: string;
|
|
19
|
+
complete: boolean;
|
|
20
|
+
}
|
|
21
|
+
export interface StorageCategory {
|
|
22
|
+
readonly name: StorageCategoryName;
|
|
23
|
+
readonly path: string;
|
|
24
|
+
readonly entries: readonly StorageEntry[];
|
|
25
|
+
}
|
|
26
|
+
export interface StorageInventory {
|
|
27
|
+
readonly root: string;
|
|
28
|
+
readonly categories: readonly StorageCategory[];
|
|
29
|
+
readonly usage: Readonly<StorageUsage>;
|
|
30
|
+
readonly issues: readonly StorageIssue[];
|
|
31
|
+
readonly complete: boolean;
|
|
32
|
+
readonly scannedEntries: number;
|
|
33
|
+
readonly maxEntries: number;
|
|
34
|
+
}
|
|
35
|
+
export interface StorageScan {
|
|
36
|
+
remaining: number;
|
|
37
|
+
readonly issues: StorageIssue[];
|
|
38
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"storage-inventory.types.js","sourceRoot":"","sources":["../../src/infrastructure/storage-inventory.types.ts"],"names":[],"mappings":"","sourcesContent":["export type StorageCategoryName = \"recovery\" | \"logs\" | \"locks\" | \"workspaces\";\nexport type StorageEntryKind =\n \"file\" | \"directory\" | \"symlink\" | \"other\" | \"unknown\";\n\nexport interface StorageIssue {\n readonly path: string;\n readonly code: string;\n}\nexport interface StorageUsage {\n bytes: number;\n files: number;\n directories: number;\n symlinks: number;\n other: number;\n}\nexport interface StorageEntry extends StorageUsage {\n readonly name: string;\n readonly path: string;\n kind: StorageEntryKind;\n modifiedAt?: string;\n complete: boolean;\n}\nexport interface StorageCategory {\n readonly name: StorageCategoryName;\n readonly path: string;\n readonly entries: readonly StorageEntry[];\n}\nexport interface StorageInventory {\n readonly root: string;\n readonly categories: readonly StorageCategory[];\n readonly usage: Readonly<StorageUsage>;\n readonly issues: readonly StorageIssue[];\n readonly complete: boolean;\n readonly scannedEntries: number;\n readonly maxEntries: number;\n}\nexport interface StorageScan {\n remaining: number;\n readonly issues: StorageIssue[];\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"storage-mutation-lock.constants.js","sourceRoot":"","sources":["../../src/infrastructure/storage-mutation-lock.constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,2BAA2B,GAAG;IACzC,OAAO,EAAE,yBAAyB;IAClC,UAAU,EAAE,KAAK;IACjB,UAAU,EAAE,EAAE;CACN,CAAC","sourcesContent":["export const storageMutationLockDefaults = {\n lockKey: \"storage-reservations:v1\",\n lockWaitMs: 5_000,\n lockPollMs: 20,\n} as const;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function lockStorageMutation(root: string, signal?: AbortSignal): Promise<() => Promise<void>>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { setTimeout } from "node:timers/promises";
|
|
2
|
+
import { OutpostError } from "../domain/errors.js";
|
|
3
|
+
import { lock } from "./git/lock.js";
|
|
4
|
+
import { storageMutationLockDefaults as defaults } from "./storage-mutation-lock.constants.js";
|
|
5
|
+
export async function lockStorageMutation(root, signal) {
|
|
6
|
+
const deadline = Date.now() + defaults.lockWaitMs;
|
|
7
|
+
while (true) {
|
|
8
|
+
signal?.throwIfAborted();
|
|
9
|
+
try {
|
|
10
|
+
return await lock(root, defaults.lockKey);
|
|
11
|
+
}
|
|
12
|
+
catch (error) {
|
|
13
|
+
if (!(error instanceof OutpostError) ||
|
|
14
|
+
error.code !== "conflict" ||
|
|
15
|
+
Date.now() >= deadline)
|
|
16
|
+
throw error;
|
|
17
|
+
await setTimeout(defaults.lockPollMs, undefined, { signal });
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=storage-mutation-lock.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"storage-mutation-lock.js","sourceRoot":"","sources":["../../src/infrastructure/storage-mutation-lock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,2BAA2B,IAAI,QAAQ,EAAE,MAAM,sCAAsC,CAAC;AAE/F,MAAM,CAAC,KAAK,UAAU,mBAAmB,CAAC,IAAY,EAAE,MAAoB;IAC1E,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,QAAQ,CAAC,UAAU,CAAC;IAClD,OAAO,IAAI,EAAE,CAAC;QACZ,MAAM,EAAE,cAAc,EAAE,CAAC;QACzB,IAAI,CAAC;YACH,OAAO,MAAM,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC;QAC5C,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IACE,CAAC,CAAC,KAAK,YAAY,YAAY,CAAC;gBAChC,KAAK,CAAC,IAAI,KAAK,UAAU;gBACzB,IAAI,CAAC,GAAG,EAAE,IAAI,QAAQ;gBAEtB,MAAM,KAAK,CAAC;YACd,MAAM,UAAU,CAAC,QAAQ,CAAC,UAAU,EAAE,SAAS,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;QAC/D,CAAC;IACH,CAAC;AACH,CAAC","sourcesContent":["import { setTimeout } from \"node:timers/promises\";\nimport { OutpostError } from \"../domain/errors.ts\";\nimport { lock } from \"./git/lock.ts\";\nimport { storageMutationLockDefaults as defaults } from \"./storage-mutation-lock.constants.ts\";\n\nexport async function lockStorageMutation(root: string, signal?: AbortSignal) {\n const deadline = Date.now() + defaults.lockWaitMs;\n while (true) {\n signal?.throwIfAborted();\n try {\n return await lock(root, defaults.lockKey);\n } catch (error) {\n if (\n !(error instanceof OutpostError) ||\n error.code !== \"conflict\" ||\n Date.now() >= deadline\n )\n throw error;\n await setTimeout(defaults.lockPollMs, undefined, { signal });\n }\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"storage-reservations.constants.js","sourceRoot":"","sources":["../../src/infrastructure/storage-reservations.constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,0BAA0B,GAAG;IACxC,cAAc,EAAE,KAAK;IACrB,UAAU,EAAE,MAAM;CACV,CAAC","sourcesContent":["export const storageReservationDefaults = {\n maxRecordBytes: 4_096,\n maxRecords: 10_000,\n} as const;\n"]}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import { randomUUID } from "node:crypto";
|
|
2
|
+
import { mkdir, open, readdir, realpath, rm } from "node:fs/promises";
|
|
3
|
+
import { join } from "node:path";
|
|
4
|
+
import { invariant, OutpostError } from "../domain/errors.js";
|
|
5
|
+
import { lockStorageMutation } from "./storage-mutation-lock.js";
|
|
6
|
+
import { localProcessIdentity, observeOwnership, } from "./git/process-identity.js";
|
|
7
|
+
import { readInspectionFile } from "./inspection-file.js";
|
|
8
|
+
import { storageInventory } from "./storage-inventory.js";
|
|
9
|
+
import { storageReservationDefaults as defaults } from "./storage-reservations.constants.js";
|
|
10
|
+
async function reservationDirectory(root) {
|
|
11
|
+
const paths = [
|
|
12
|
+
join(root, ".outpost"),
|
|
13
|
+
join(root, ".outpost", "locks"),
|
|
14
|
+
join(root, ".outpost", "locks", "storage-reservations"),
|
|
15
|
+
];
|
|
16
|
+
for (const path of paths) {
|
|
17
|
+
await mkdir(path, { recursive: true, mode: 0o700 });
|
|
18
|
+
invariant((await realpath(path)) === path, "Storage reservation directory must not use symlinks");
|
|
19
|
+
}
|
|
20
|
+
return paths[2];
|
|
21
|
+
}
|
|
22
|
+
function validRecord(value) {
|
|
23
|
+
if (!value || typeof value !== "object")
|
|
24
|
+
return false;
|
|
25
|
+
return ("version" in value &&
|
|
26
|
+
value.version === 1 &&
|
|
27
|
+
"id" in value &&
|
|
28
|
+
typeof value.id === "string" &&
|
|
29
|
+
"pid" in value &&
|
|
30
|
+
typeof value.pid === "number" &&
|
|
31
|
+
Number.isSafeInteger(value.pid) &&
|
|
32
|
+
value.pid > 0 &&
|
|
33
|
+
value.pid <= 2_147_483_647 &&
|
|
34
|
+
"reserveBytes" in value &&
|
|
35
|
+
typeof value.reserveBytes === "number" &&
|
|
36
|
+
Number.isSafeInteger(value.reserveBytes) &&
|
|
37
|
+
value.reserveBytes >= 0 &&
|
|
38
|
+
"createdAt" in value &&
|
|
39
|
+
typeof value.createdAt === "string" &&
|
|
40
|
+
Number.isFinite(Date.parse(value.createdAt)));
|
|
41
|
+
}
|
|
42
|
+
async function readRecord(path) {
|
|
43
|
+
try {
|
|
44
|
+
const value = JSON.parse((await readInspectionFile(path, defaults.maxRecordBytes)).toString("utf8"));
|
|
45
|
+
if (validRecord(value))
|
|
46
|
+
return value;
|
|
47
|
+
}
|
|
48
|
+
catch (cause) {
|
|
49
|
+
throw new OutpostError("workspace", "Storage reservation record is unreadable; admission refused", { path }, cause);
|
|
50
|
+
}
|
|
51
|
+
throw new OutpostError("workspace", "Storage reservation record is invalid; admission refused", { path });
|
|
52
|
+
}
|
|
53
|
+
async function reservedBytes(directory) {
|
|
54
|
+
const names = await readdir(directory);
|
|
55
|
+
invariant(names.length <= defaults.maxRecords, "Too many storage reservation records");
|
|
56
|
+
let reserved = 0;
|
|
57
|
+
for (const name of names) {
|
|
58
|
+
const path = join(directory, name);
|
|
59
|
+
const record = await readRecord(path);
|
|
60
|
+
invariant(name === `${record.id}.json`, "Storage reservation identity mismatch");
|
|
61
|
+
const owner = await observeOwnership(record.pid, record.identity);
|
|
62
|
+
if (owner.status === "inactive") {
|
|
63
|
+
await rm(path);
|
|
64
|
+
continue;
|
|
65
|
+
}
|
|
66
|
+
reserved += record.reserveBytes;
|
|
67
|
+
invariant(Number.isSafeInteger(reserved), "Storage reservation total exceeds safe integer range");
|
|
68
|
+
}
|
|
69
|
+
return reserved;
|
|
70
|
+
}
|
|
71
|
+
async function releaseRecord(root, path, id) {
|
|
72
|
+
await reservationDirectory(root);
|
|
73
|
+
const unlock = await lockStorageMutation(root);
|
|
74
|
+
try {
|
|
75
|
+
const names = await readdir(join(root, ".outpost", "locks", "storage-reservations"));
|
|
76
|
+
if (!names.includes(`${id}.json`))
|
|
77
|
+
return;
|
|
78
|
+
const record = await readRecord(path);
|
|
79
|
+
invariant(record.id === id, "Storage reservation identity changed; refusing release");
|
|
80
|
+
await rm(path);
|
|
81
|
+
}
|
|
82
|
+
finally {
|
|
83
|
+
await unlock();
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
export async function reserveStorage(repository, options) {
|
|
87
|
+
invariant(Number.isSafeInteger(options.maxBytes) && options.maxBytes >= 0, "maxBytes must be a nonnegative integer");
|
|
88
|
+
invariant(Number.isSafeInteger(options.reserveBytes) && options.reserveBytes >= 0, "reserveBytes must be a nonnegative integer");
|
|
89
|
+
options.signal?.throwIfAborted();
|
|
90
|
+
const directory = await reservationDirectory(repository);
|
|
91
|
+
const unlock = await lockStorageMutation(repository, options.signal);
|
|
92
|
+
const id = randomUUID();
|
|
93
|
+
const path = join(directory, `${id}.json`);
|
|
94
|
+
try {
|
|
95
|
+
const reserved = await reservedBytes(directory);
|
|
96
|
+
const inventory = await storageInventory(join(repository, ".outpost"), options.maxEntries);
|
|
97
|
+
const record = {
|
|
98
|
+
version: 1,
|
|
99
|
+
id,
|
|
100
|
+
pid: process.pid,
|
|
101
|
+
identity: await localProcessIdentity(),
|
|
102
|
+
reserveBytes: options.reserveBytes,
|
|
103
|
+
createdAt: new Date().toISOString(),
|
|
104
|
+
};
|
|
105
|
+
const data = JSON.stringify(record);
|
|
106
|
+
if (!inventory.complete ||
|
|
107
|
+
inventory.usage.bytes +
|
|
108
|
+
reserved +
|
|
109
|
+
options.reserveBytes +
|
|
110
|
+
Buffer.byteLength(data) >
|
|
111
|
+
options.maxBytes)
|
|
112
|
+
throw new OutpostError("workspace", "Outpost storage reservation admission refused", {
|
|
113
|
+
usageBytes: inventory.usage.bytes,
|
|
114
|
+
reservedBytes: reserved,
|
|
115
|
+
reserveBytes: options.reserveBytes,
|
|
116
|
+
maxBytes: options.maxBytes,
|
|
117
|
+
complete: inventory.complete,
|
|
118
|
+
});
|
|
119
|
+
options.signal?.throwIfAborted();
|
|
120
|
+
const file = await open(path, "wx", 0o600);
|
|
121
|
+
try {
|
|
122
|
+
await file.writeFile(data);
|
|
123
|
+
await file.sync();
|
|
124
|
+
}
|
|
125
|
+
catch (error) {
|
|
126
|
+
await file.close();
|
|
127
|
+
await rm(path, { force: true });
|
|
128
|
+
throw error;
|
|
129
|
+
}
|
|
130
|
+
await file.close();
|
|
131
|
+
}
|
|
132
|
+
finally {
|
|
133
|
+
await unlock();
|
|
134
|
+
}
|
|
135
|
+
let released = false;
|
|
136
|
+
const release = async () => {
|
|
137
|
+
if (released)
|
|
138
|
+
return;
|
|
139
|
+
await releaseRecord(repository, path, id);
|
|
140
|
+
released = true;
|
|
141
|
+
};
|
|
142
|
+
return {
|
|
143
|
+
id,
|
|
144
|
+
repository,
|
|
145
|
+
reserveBytes: options.reserveBytes,
|
|
146
|
+
release,
|
|
147
|
+
[Symbol.asyncDispose]: release,
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
//# sourceMappingURL=storage-reservations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"storage-reservations.js","sourceRoot":"","sources":["../../src/infrastructure/storage-reservations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AACtE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EACL,oBAAoB,EACpB,gBAAgB,GACjB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,0BAA0B,IAAI,QAAQ,EAAE,MAAM,qCAAqC,CAAC;AAO7F,KAAK,UAAU,oBAAoB,CAAC,IAAY;IAC9C,MAAM,KAAK,GAAG;QACZ,IAAI,CAAC,IAAI,EAAE,UAAU,C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EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;QAC3C,IAAI,CAAC;YACH,MAAM,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;YAC3B,MAAM,IAAI,CAAC,IAAI,EAAE,CAAC;QACpB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,IAAI,CAAC,KAAK,EAAE,CAAC;YACnB,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;YAChC,MAAM,KAAK,CAAC;QACd,CAAC;QACD,MAAM,IAAI,CAAC,KAAK,EAAE,CAAC;IACrB,CAAC;YAAS,CAAC;QACT,MAAM,MAAM,EAAE,CAAC;IACjB,CAAC;IACD,IAAI,QAAQ,GAAG,KAAK,CAAC;IACrB,MAAM,OAAO,GAAG,KAAK,IAAI,EAAE;QACzB,IAAI,QAAQ;YAAE,OAAO;QACrB,MAAM,aAAa,CAAC,UAAU,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC;QAC1C,QAAQ,GAAG,IAAI,CAAC;IAClB,CAAC,CAAC;IACF,OAAO;QACL,EAAE;QACF,UAAU;QACV,YAAY,EAAE,OAAO,CAAC,YAAY;QAClC,OAAO;QACP,CAAC,MAAM,CAAC,YAAY,CAAC,EAAE,OAAO;KAC/B,CAAC;AACJ,CAAC","sourcesContent":["import { randomUUID } from \"node:crypto\";\nimport { mkdir, open, readdir, realpath, rm } from \"node:fs/promises\";\nimport { join } from \"node:path\";\nimport { invariant, OutpostError } from \"../domain/errors.ts\";\nimport { lockStorageMutation } from \"./storage-mutation-lock.ts\";\nimport {\n localProcessIdentity,\n observeOwnership,\n} from \"./git/process-identity.ts\";\nimport { readInspectionFile } from \"./inspection-file.ts\";\nimport { storageInventory } from \"./storage-inventory.ts\";\nimport { storageReservationDefaults as defaults } from \"./storage-reservations.constants.ts\";\nimport type {\n StorageReservation,\n StorageReservationOptions,\n StorageReservationRecord,\n} from \"./storage-reservations.types.ts\";\n\nasync function reservationDirectory(root: string): Promise<string> {\n const paths = [\n join(root, \".outpost\"),\n join(root, \".outpost\", \"locks\"),\n join(root, \".outpost\", \"locks\", \"storage-reservations\"),\n ];\n for (const path of paths) {\n await mkdir(path, { recursive: true, mode: 0o700 });\n invariant(\n (await realpath(path)) === path,\n \"Storage reservation directory must not use symlinks\",\n );\n }\n return paths[2]!;\n}\n\nfunction validRecord(value: unknown): value is StorageReservationRecord {\n if (!value || typeof value !== \"object\") return false;\n return (\n \"version\" in value &&\n value.version === 1 &&\n \"id\" in value &&\n typeof value.id === \"string\" &&\n \"pid\" in value &&\n typeof value.pid === \"number\" &&\n Number.isSafeInteger(value.pid) &&\n value.pid > 0 &&\n value.pid <= 2_147_483_647 &&\n \"reserveBytes\" in value &&\n typeof value.reserveBytes === \"number\" &&\n Number.isSafeInteger(value.reserveBytes) &&\n value.reserveBytes >= 0 &&\n \"createdAt\" in value &&\n typeof value.createdAt === \"string\" &&\n Number.isFinite(Date.parse(value.createdAt))\n );\n}\n\nasync function readRecord(path: string): Promise<StorageReservationRecord> {\n try {\n const value: unknown = JSON.parse(\n (await readInspectionFile(path, defaults.maxRecordBytes)).toString(\n \"utf8\",\n ),\n );\n if (validRecord(value)) return value;\n } catch (cause) {\n throw new OutpostError(\n \"workspace\",\n \"Storage reservation record is unreadable; admission refused\",\n { path },\n cause,\n );\n }\n throw new OutpostError(\n \"workspace\",\n \"Storage reservation record is invalid; admission refused\",\n { path },\n );\n}\n\nasync function reservedBytes(directory: string): Promise<number> {\n const names = await readdir(directory);\n invariant(\n names.length <= defaults.maxRecords,\n \"Too many storage reservation records\",\n );\n let reserved = 0;\n for (const name of names) {\n const path = join(directory, name);\n const record = await readRecord(path);\n invariant(\n name === `${record.id}.json`,\n \"Storage reservation identity mismatch\",\n );\n const owner = await observeOwnership(record.pid, record.identity);\n if (owner.status === \"inactive\") {\n await rm(path);\n continue;\n }\n reserved += record.reserveBytes;\n invariant(\n Number.isSafeInteger(reserved),\n \"Storage reservation total exceeds safe integer range\",\n );\n }\n return reserved;\n}\n\nasync function releaseRecord(\n root: string,\n path: string,\n id: string,\n): Promise<void> {\n await reservationDirectory(root);\n const unlock = await lockStorageMutation(root);\n try {\n const names = await readdir(\n join(root, \".outpost\", \"locks\", \"storage-reservations\"),\n );\n if (!names.includes(`${id}.json`)) return;\n const record = await readRecord(path);\n invariant(\n record.id === id,\n \"Storage reservation identity changed; refusing release\",\n );\n await rm(path);\n } finally {\n await unlock();\n }\n}\n\nexport async function reserveStorage(\n repository: string,\n options: StorageReservationOptions,\n): Promise<StorageReservation> {\n invariant(\n Number.isSafeInteger(options.maxBytes) && options.maxBytes >= 0,\n \"maxBytes must be a nonnegative integer\",\n );\n invariant(\n Number.isSafeInteger(options.reserveBytes) && options.reserveBytes >= 0,\n \"reserveBytes must be a nonnegative integer\",\n );\n options.signal?.throwIfAborted();\n const directory = await reservationDirectory(repository);\n const unlock = await lockStorageMutation(repository, options.signal);\n const id = randomUUID();\n const path = join(directory, `${id}.json`);\n try {\n const reserved = await reservedBytes(directory);\n const inventory = await storageInventory(\n join(repository, \".outpost\"),\n options.maxEntries,\n );\n const record: StorageReservationRecord = {\n version: 1,\n id,\n pid: process.pid,\n identity: await localProcessIdentity(),\n reserveBytes: options.reserveBytes,\n createdAt: new Date().toISOString(),\n };\n const data = JSON.stringify(record);\n if (\n !inventory.complete ||\n inventory.usage.bytes +\n reserved +\n options.reserveBytes +\n Buffer.byteLength(data) >\n options.maxBytes\n )\n throw new OutpostError(\n \"workspace\",\n \"Outpost storage reservation admission refused\",\n {\n usageBytes: inventory.usage.bytes,\n reservedBytes: reserved,\n reserveBytes: options.reserveBytes,\n maxBytes: options.maxBytes,\n complete: inventory.complete,\n },\n );\n options.signal?.throwIfAborted();\n const file = await open(path, \"wx\", 0o600);\n try {\n await file.writeFile(data);\n await file.sync();\n } catch (error) {\n await file.close();\n await rm(path, { force: true });\n throw error;\n }\n await file.close();\n } finally {\n await unlock();\n }\n let released = false;\n const release = async () => {\n if (released) return;\n await releaseRecord(repository, path, id);\n released = true;\n };\n return {\n id,\n repository,\n reserveBytes: options.reserveBytes,\n release,\n [Symbol.asyncDispose]: release,\n };\n}\n"]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export interface StorageReservationOptions {
|
|
2
|
+
readonly maxBytes: number;
|
|
3
|
+
readonly reserveBytes: number;
|
|
4
|
+
readonly maxEntries?: number;
|
|
5
|
+
readonly signal?: AbortSignal;
|
|
6
|
+
}
|
|
7
|
+
export interface StorageReservation {
|
|
8
|
+
readonly id: string;
|
|
9
|
+
readonly repository: string;
|
|
10
|
+
readonly reserveBytes: number;
|
|
11
|
+
release(): Promise<void>;
|
|
12
|
+
[Symbol.asyncDispose](): Promise<void>;
|
|
13
|
+
}
|
|
14
|
+
export interface StorageReservationRecord {
|
|
15
|
+
readonly version: 1;
|
|
16
|
+
readonly id: string;
|
|
17
|
+
readonly pid: number;
|
|
18
|
+
readonly identity?: unknown;
|
|
19
|
+
readonly reserveBytes: number;
|
|
20
|
+
readonly createdAt: string;
|
|
21
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"storage-reservations.types.js","sourceRoot":"","sources":["../../src/infrastructure/storage-reservations.types.ts"],"names":[],"mappings":"","sourcesContent":["export interface StorageReservationOptions {\n readonly maxBytes: number;\n readonly reserveBytes: number;\n readonly maxEntries?: number;\n readonly signal?: AbortSignal;\n}\n\nexport interface StorageReservation {\n readonly id: string;\n readonly repository: string;\n readonly reserveBytes: number;\n release(): Promise<void>;\n [Symbol.asyncDispose](): Promise<void>;\n}\n\nexport interface StorageReservationRecord {\n readonly version: 1;\n readonly id: string;\n readonly pid: number;\n readonly identity?: unknown;\n readonly reserveBytes: number;\n readonly createdAt: string;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"task-queue-http.constants.js","sourceRoot":"","sources":["../../src/infrastructure/task-queue-http.constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAC;AACzC,MAAM,CAAC,MAAM,uBAAuB,GAAG,IAAI,CAAC","sourcesContent":["export const queueHttpTimeoutMs = 10_000;\nexport const queueHttpMaxHeaderBytes = 8192;\n"]}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { TaskQueue } from "../domain/task-queue.types.ts";
|
|
2
|
+
import type { QueueClientOptions, QueueServer, QueueServerOptions } from "./task-queue-http.types.ts";
|
|
3
|
+
export declare function serveTaskQueue(options: QueueServerOptions): Promise<QueueServer>;
|
|
4
|
+
export declare function httpTaskQueue(options: QueueClientOptions): TaskQueue;
|