@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
|
@@ -7,7 +7,7 @@ export function agentOutput(agent, options, markers, pass) {
|
|
|
7
7
|
let pending = "", text = "", rawTail = "";
|
|
8
8
|
let finalText, conversation, failure;
|
|
9
9
|
let usage = { input: 0, cached: 0, output: 0 };
|
|
10
|
-
let completed = false;
|
|
10
|
+
let completed = false, finished = false;
|
|
11
11
|
const handlers = {
|
|
12
12
|
text: (event) => {
|
|
13
13
|
text += event.text;
|
|
@@ -18,6 +18,9 @@ export function agentOutput(agent, options, markers, pass) {
|
|
|
18
18
|
conversation: (event) => {
|
|
19
19
|
conversation = event.id;
|
|
20
20
|
},
|
|
21
|
+
finished: () => {
|
|
22
|
+
finished = true;
|
|
23
|
+
},
|
|
21
24
|
failure: (event) => {
|
|
22
25
|
failure = event.message;
|
|
23
26
|
},
|
|
@@ -33,7 +36,9 @@ export function agentOutput(agent, options, markers, pass) {
|
|
|
33
36
|
if (event.kind !== "raw")
|
|
34
37
|
notify(options.observe, { ...event, pass, at });
|
|
35
38
|
}
|
|
36
|
-
completed =
|
|
39
|
+
completed =
|
|
40
|
+
(!agent.requiresFinishedEvent || finished) &&
|
|
41
|
+
markers.some((marker) => (finalText ?? text).includes(marker));
|
|
37
42
|
}
|
|
38
43
|
return {
|
|
39
44
|
get completed() {
|
|
@@ -61,6 +66,8 @@ export function agentOutput(agent, options, markers, pass) {
|
|
|
61
66
|
result() {
|
|
62
67
|
if (failure)
|
|
63
68
|
throw new OutpostError("process", failure, { conversation });
|
|
69
|
+
if (agent.requiresFinishedEvent && !finished)
|
|
70
|
+
throw new OutpostError("process", "Agent exited without a successful final event", { conversation });
|
|
64
71
|
return {
|
|
65
72
|
text: finalText ?? (text || rawTail),
|
|
66
73
|
usage,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-output.js","sourceRoot":"","sources":["../../src/application/agent-output.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAE5D,OAAO,EAAE,YAAY,EAAE,MAAM,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AI,CAAC,IAAI,IAAI,OAAO,CAAC;gBACpC,KAAK;gBACL,GAAG,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;aAC1C,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["import { visitAgentEvent } from \"../domain/agent-events.ts\";\nimport type { AgentAdapter, Usage } from \"../domain/agent.types.ts\";\nimport { OutpostError } from \"../domain/errors.ts\";\nimport { addUsage } from \"../domain/usage.ts\";\nimport { executionDefaults } from \"./execution.constants.ts\";\nimport type { AgentOutput, DispatchOptions } from \"./execution.types.ts\";\nimport { notify } from \"./observation.ts\";\n\nexport function agentOutput(\n agent: AgentAdapter,\n options: DispatchOptions<unknown>,\n markers: readonly string[],\n pass: number,\n): AgentOutput {\n let pending = \"\",\n text = \"\",\n rawTail = \"\";\n let finalText: string | undefined,\n conversation: string | undefined,\n failure: string | undefined;\n let usage: Usage = { input: 0, cached: 0, output: 0 };\n let completed = false,\n finished = false;\n const handlers: import(\"../domain/agent.types.ts\").AgentEventHandlers = {\n text: (event) => {\n text += event.text;\n },\n result: (event) => {\n finalText = event.text;\n },\n conversation: (event) => {\n conversation = event.id;\n },\n finished: () => {\n finished = true;\n },\n failure: (event) => {\n failure = event.message;\n },\n usage: (event) => {\n usage = addUsage(usage, event.tokens);\n },\n };\n function consume(line: string): void {\n const at = new Date().toISOString();\n notify(options.observe, { kind: \"raw\", value: line, pass, at });\n for (const event of agent.events(line)) {\n visitAgentEvent(event, handlers);\n if (event.kind !== \"raw\") notify(options.observe, { ...event, pass, at });\n }\n completed =\n (!agent.requiresFinishedEvent || finished) &&\n markers.some((marker) => (finalText ?? text).includes(marker));\n }\n return {\n get completed() {\n return completed;\n },\n get conversation() {\n return conversation;\n },\n append(chunk) {\n rawTail = (rawTail + chunk).slice(-executionDefaults.rawTailBytes);\n pending += chunk;\n let end: number;\n while ((end = pending.indexOf(\"\\n\")) >= 0) {\n consume(pending.slice(0, end));\n pending = pending.slice(end + 1);\n }\n if (pending.length > executionDefaults.eventBytes)\n throw new OutpostError(\"process\", \"Agent emitted an oversized event\");\n },\n flush() {\n if (pending) consume(pending);\n pending = \"\";\n },\n result() {\n if (failure) throw new OutpostError(\"process\", failure, { conversation });\n if (agent.requiresFinishedEvent && !finished)\n throw new OutpostError(\n \"process\",\n \"Agent exited without a successful final event\",\n { conversation },\n );\n return {\n text: finalText ?? (text || rawTail),\n usage,\n ...(conversation ? { conversation } : {}),\n };\n },\n };\n}\n"]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ArtifactContract, ArtifactReference, ArtifactStore } from "../domain/artifact.types.ts";
|
|
2
|
+
import type { Task, TaskContext } from "../domain/workflow.types.ts";
|
|
3
|
+
import type { ArtifactTaskOptions } from "./artifact-tasks.types.ts";
|
|
4
|
+
export declare function artifactTask<T>(options: ArtifactTaskOptions<T>): Task<ArtifactReference>;
|
|
5
|
+
export declare function readArtifact<T>(context: TaskContext, dependency: Task<ArtifactReference>, contract: ArtifactContract<T>, store: ArtifactStore): Promise<T>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { publishArtifact, readStoredArtifact } from "../domain/artifact.js";
|
|
2
|
+
import { validateArtifactReference } from "../domain/artifact-reference.js";
|
|
3
|
+
import { task } from "../domain/workflow.js";
|
|
4
|
+
export function artifactTask(options) {
|
|
5
|
+
const { store, contract, produce, parents, ...definition } = options;
|
|
6
|
+
return task({
|
|
7
|
+
...definition,
|
|
8
|
+
async perform(context) {
|
|
9
|
+
const lineage = parents?.(context) ?? [];
|
|
10
|
+
return publishArtifact(store, contract, await produce(context), {
|
|
11
|
+
producer: {
|
|
12
|
+
executionId: context.executionId,
|
|
13
|
+
taskKey: definition.key,
|
|
14
|
+
attempt: context.attempt,
|
|
15
|
+
},
|
|
16
|
+
parents: lineage,
|
|
17
|
+
signal: context.signal,
|
|
18
|
+
});
|
|
19
|
+
},
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
export async function readArtifact(context, dependency, contract, store) {
|
|
23
|
+
const reference = validateArtifactReference(context.value(dependency));
|
|
24
|
+
if (reference.producer.executionId !== context.executionId ||
|
|
25
|
+
reference.producer.taskKey !== dependency.key)
|
|
26
|
+
throw new Error("Artifact dependency producer mismatch");
|
|
27
|
+
return readStoredArtifact(store, contract, reference, {
|
|
28
|
+
signal: context.signal,
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=artifact-tasks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"artifact-tasks.js","sourceRoot":"","sources":["../../src/application/artifact-tasks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC5E,OAAO,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAC;AAM5E,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAI7C,MAAM,UAAU,YAAY,CAC1B,OAA+B;IAE/B,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,UAAU,EAAE,GAAG,OAAO,CAAC;IACrE,OAAO,IAAI,CAAC;QACV,GAAG,UAAU;QACb,KAAK,CAAC,OAAO,CAAC,OAAO;YACnB,MAAM,OAAO,GAAG,OAAO,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;YACzC,OAAO,eAAe,CAAC,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,EAAE;gBAC9D,QAAQ,EAAE;oBACR,WAAW,EAAE,OAAO,CAAC,WAAW;oBAChC,OAAO,EAAE,UAAU,CAAC,GAAG;oBACvB,OAAO,EAAE,OAAO,CAAC,OAAO;iBACzB;gBACD,OAAO,EAAE,OAAO;gBAChB,MAAM,EAAE,OAAO,CAAC,MAAM;aACvB,CAAC,CAAC;QACL,CAAC;KACF,CAAC,CAAC;AACL,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,YAAY,CAChC,OAAoB,EACpB,UAAmC,EACnC,QAA6B,EAC7B,KAAoB;IAEpB,MAAM,SAAS,GAAG,yBAAyB,CAAC,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC;IACvE,IACE,SAAS,CAAC,QAAQ,CAAC,WAAW,KAAK,OAAO,CAAC,WAAW;QACtD,SAAS,CAAC,QAAQ,CAAC,OAAO,KAAK,UAAU,CAAC,GAAG;QAE7C,MAAM,IAAI,KAAK,CAAC,uCAAuC,CAAC,CAAC;IAC3D,OAAO,kBAAkB,CAAC,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE;QACpD,MAAM,EAAE,OAAO,CAAC,MAAM;KACvB,CAAC,CAAC;AACL,CAAC","sourcesContent":["import { publishArtifact, readStoredArtifact } from \"../domain/artifact.ts\";\nimport { validateArtifactReference } from \"../domain/artifact-reference.ts\";\nimport type {\n ArtifactContract,\n ArtifactReference,\n ArtifactStore,\n} from \"../domain/artifact.types.ts\";\nimport { task } from \"../domain/workflow.ts\";\nimport type { Task, TaskContext } from \"../domain/workflow.types.ts\";\nimport type { ArtifactTaskOptions } from \"./artifact-tasks.types.ts\";\n\nexport function artifactTask<T>(\n options: ArtifactTaskOptions<T>,\n): Task<ArtifactReference> {\n const { store, contract, produce, parents, ...definition } = options;\n return task({\n ...definition,\n async perform(context) {\n const lineage = parents?.(context) ?? [];\n return publishArtifact(store, contract, await produce(context), {\n producer: {\n executionId: context.executionId,\n taskKey: definition.key,\n attempt: context.attempt,\n },\n parents: lineage,\n signal: context.signal,\n });\n },\n });\n}\n\nexport async function readArtifact<T>(\n context: TaskContext,\n dependency: Task<ArtifactReference>,\n contract: ArtifactContract<T>,\n store: ArtifactStore,\n): Promise<T> {\n const reference = validateArtifactReference(context.value(dependency));\n if (\n reference.producer.executionId !== context.executionId ||\n reference.producer.taskKey !== dependency.key\n )\n throw new Error(\"Artifact dependency producer mismatch\");\n return readStoredArtifact(store, contract, reference, {\n signal: context.signal,\n });\n}\n"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ArtifactContract, ArtifactReference, ArtifactStore } from "../domain/artifact.types.ts";
|
|
2
|
+
import type { TaskContext, TaskOptions } from "../domain/workflow.types.ts";
|
|
3
|
+
export type ArtifactTaskOptions<T> = Omit<TaskOptions<ArtifactReference>, "perform"> & {
|
|
4
|
+
readonly store: ArtifactStore;
|
|
5
|
+
readonly contract: ArtifactContract<T>;
|
|
6
|
+
readonly produce: (context: TaskContext) => T | Promise<T>;
|
|
7
|
+
readonly parents?: (context: TaskContext) => readonly ArtifactReference[];
|
|
8
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"artifact-tasks.types.js","sourceRoot":"","sources":["../../src/application/artifact-tasks.types.ts"],"names":[],"mappings":"","sourcesContent":["import type {\n ArtifactContract,\n ArtifactReference,\n ArtifactStore,\n} from \"../domain/artifact.types.ts\";\nimport type { TaskContext, TaskOptions } from \"../domain/workflow.types.ts\";\n\nexport type ArtifactTaskOptions<T> = Omit<\n TaskOptions<ArtifactReference>,\n \"perform\"\n> & {\n readonly store: ArtifactStore;\n readonly contract: ArtifactContract<T>;\n readonly produce: (context: TaskContext) => T | Promise<T>;\n readonly parents?: (context: TaskContext) => readonly ArtifactReference[];\n};\n"]}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { OutpostError } from "../domain/errors.js";
|
|
2
|
+
import { executeProcess } from "../infrastructure/process.js";
|
|
3
|
+
import { doctorDefaults } from "./doctor.constants.js";
|
|
4
|
+
export async function diagnosticProbe(probe, execute = executeProcess) {
|
|
5
|
+
const failure = (reason) => ({
|
|
6
|
+
id: probe.id,
|
|
7
|
+
status: probe.failureStatus,
|
|
8
|
+
message: `${reason}. ${probe.remedy}`,
|
|
9
|
+
});
|
|
10
|
+
try {
|
|
11
|
+
const result = await execute({
|
|
12
|
+
...probe.command,
|
|
13
|
+
deadlineMs: doctorDefaults.deadlineMs,
|
|
14
|
+
retain: probe.command.retain ?? doctorDefaults.retain,
|
|
15
|
+
});
|
|
16
|
+
if (result.status !== 0)
|
|
17
|
+
return failure(`Exited with status ${result.status}`);
|
|
18
|
+
if (!probe.readVersion)
|
|
19
|
+
return {
|
|
20
|
+
id: probe.id,
|
|
21
|
+
status: "pass",
|
|
22
|
+
message: "Check succeeded.",
|
|
23
|
+
};
|
|
24
|
+
const version = /\bv?(\d+\.\d+\.\d+(?:-[\w.-]+)?(?:\+[\w.-]+)?)\b/.exec(result.stdout || result.stderr)?.[1];
|
|
25
|
+
if (!version)
|
|
26
|
+
return failure("Version could not be identified");
|
|
27
|
+
if (probe.referenceVersion)
|
|
28
|
+
return {
|
|
29
|
+
id: probe.id,
|
|
30
|
+
status: version === probe.referenceVersion ? "pass" : "warn",
|
|
31
|
+
version,
|
|
32
|
+
referenceVersion: probe.referenceVersion,
|
|
33
|
+
message: version === probe.referenceVersion
|
|
34
|
+
? "Matches the version pinned by Outpost; protocol and authentication are not tested."
|
|
35
|
+
: "Differs from the version pinned by Outpost; compatibility is unverified.",
|
|
36
|
+
};
|
|
37
|
+
return {
|
|
38
|
+
id: probe.id,
|
|
39
|
+
status: "pass",
|
|
40
|
+
version,
|
|
41
|
+
message: "Version identified.",
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
catch (error) {
|
|
45
|
+
if (error instanceof OutpostError && error.code === "timeout")
|
|
46
|
+
return failure("Check timed out");
|
|
47
|
+
if (error &&
|
|
48
|
+
typeof error === "object" &&
|
|
49
|
+
"code" in error &&
|
|
50
|
+
error.code === "ENOENT")
|
|
51
|
+
return failure("Executable not found on PATH");
|
|
52
|
+
return failure("Command could not be executed");
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=diagnostic-probe.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diagnostic-probe.js","sourceRoot":"","sources":["../../src/application/diagnostic-probe.ts"],"names":[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,CAAC,gBAAgB,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM;gBAC5D,OAAO;gBACP,gBAAgB,EAAE,KAAK,CAAC,gBAAgB;gBACxC,OAAO,EACL,OAAO,KAAK,KAAK,CAAC,gBAAgB;oBAChC,CAAC,CAAC,oFAAoF;oBACtF,CAAC,CAAC,0EAA0E;aACjF,CAAC;QACJ,OAAO;YACL,EAAE,EAAE,KAAK,CAAC,EAAE;YACZ,MAAM,EAAE,MAAM;YACd,OAAO;YACP,OAAO,EAAE,qBAAqB;SAC/B,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,KAAK,YAAY,YAAY,IAAI,KAAK,CAAC,IAAI,KAAK,SAAS;YAC3D,OAAO,OAAO,CAAC,iBAAiB,CAAC,CAAC;QACpC,IACE,KAAK;YACL,OAAO,KAAK,KAAK,QAAQ;YACzB,MAAM,IAAI,KAAK;YACf,KAAK,CAAC,IAAI,KAAK,QAAQ;YAEvB,OAAO,OAAO,CAAC,8BAA8B,CAAC,CAAC;QACjD,OAAO,OAAO,CAAC,+BAA+B,CAAC,CAAC;IAClD,CAAC;AACH,CAAC","sourcesContent":["import { OutpostError } from \"../domain/errors.ts\";\nimport { executeProcess } from \"../infrastructure/process.ts\";\nimport type { Executor } from \"../infrastructure/process.types.ts\";\nimport { doctorDefaults } from \"./doctor.constants.ts\";\nimport type { DiagnosticCheck, DiagnosticProbe } from \"./doctor.types.ts\";\n\nexport async function diagnosticProbe(\n probe: DiagnosticProbe,\n execute: Executor = executeProcess,\n): Promise<DiagnosticCheck> {\n const failure = (reason: string): DiagnosticCheck => ({\n id: probe.id,\n status: probe.failureStatus,\n message: `${reason}. ${probe.remedy}`,\n });\n try {\n const result = await execute({\n ...probe.command,\n deadlineMs: doctorDefaults.deadlineMs,\n retain: probe.command.retain ?? doctorDefaults.retain,\n });\n if (result.status !== 0)\n return failure(`Exited with status ${result.status}`);\n if (!probe.readVersion)\n return {\n id: probe.id,\n status: \"pass\",\n message: \"Check succeeded.\",\n };\n const version = /\\bv?(\\d+\\.\\d+\\.\\d+(?:-[\\w.-]+)?(?:\\+[\\w.-]+)?)\\b/.exec(\n result.stdout || result.stderr,\n )?.[1];\n if (!version) return failure(\"Version could not be identified\");\n if (probe.referenceVersion)\n return {\n id: probe.id,\n status: version === probe.referenceVersion ? \"pass\" : \"warn\",\n version,\n referenceVersion: probe.referenceVersion,\n message:\n version === probe.referenceVersion\n ? \"Matches the version pinned by Outpost; protocol and authentication are not tested.\"\n : \"Differs from the version pinned by Outpost; compatibility is unverified.\",\n };\n return {\n id: probe.id,\n status: \"pass\",\n version,\n message: \"Version identified.\",\n };\n } catch (error) {\n if (error instanceof OutpostError && error.code === \"timeout\")\n return failure(\"Check timed out\");\n if (\n error &&\n typeof error === \"object\" &&\n \"code\" in error &&\n error.code === \"ENOENT\"\n )\n return failure(\"Executable not found on PATH\");\n return failure(\"Command could not be executed\");\n }\n}\n"]}
|
|
@@ -22,6 +22,8 @@ export function validateDispatch(options) {
|
|
|
22
22
|
}
|
|
23
23
|
export async function preflightDispatch(options, _repository, agent) {
|
|
24
24
|
validateDispatch(options);
|
|
25
|
+
if (options.continuation)
|
|
26
|
+
invariant(agent?.resumable !== false, `${agent?.name} does not support continuation or fork in Outpost`);
|
|
25
27
|
if (!options.response)
|
|
26
28
|
return;
|
|
27
29
|
if (options.response.repairs > 0)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dispatch-validation.js","sourceRoot":"","sources":["../../src/application/dispatch-validation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAE,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AAE,OAAO;IAC9B,IAAI,OAAO,CAAC,QAAQ,CAAC,OAAO,GAAG,CAAC;QAC9B,SAAS,CACP,KAAK,EAAE,SAAS,IAAI,CAAC,CAAC,CAAC,KAAK,EAAE,aAAa,IAAI,KAAK,EAAE,OAAO,CAAC,EAC9D,gEAAgE,CACjE,CAAC;IACJ,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;IAC5B,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,IAAI,CAAC,MAAM,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,IAAK,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;IAC1E,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,sBAAsB,EAAE,CAAC,KAAK,EAAE,GAAW,EAAE,EAAE,CAC3E,KAAK,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CACtE,CAAC;IACF,SAAS,CACP,QAAQ,CAAC,QAAQ,CAAC,IAAI,OAAO,CAAC,QAAQ,CAAC,GAAG,GAAG,CAAC,EAC9C,kCAAkC,OAAO,CAAC,QAAQ,CAAC,GAAG,OAAO,CAC9D,CAAC;AACJ,CAAC","sourcesContent":["import { readFile } from \"node:fs/promises\";\nimport { resolve } from \"node:path\";\nimport type { AgentAdapter } from \"../domain/agent.types.ts\";\nimport { invariant, positive } from \"../domain/errors.ts\";\nimport { validateBrief } from \"../domain/prompts.ts\";\nimport { dispatchDeadlines, executionDefaults } from \"./execution.constants.ts\";\nimport type { DispatchOptions } from \"./execution.types.ts\";\n\nexport function validateDispatch(options: DispatchOptions<unknown>): void {\n options.signal?.throwIfAborted();\n validateBrief(options.brief);\n positive(options.passes ?? executionDefaults.passes, \"passes\");\n invariant(\n Number.isSafeInteger(options.passes ?? executionDefaults.passes),\n \"passes must be an integer\",\n );\n for (const key of dispatchDeadlines)\n if (options[key] !== undefined) positive(options[key], key);\n if (options.response || options.continuation)\n invariant(\n (options.passes ?? executionDefaults.passes) === 1,\n \"Structured responses and continuations require one pass\",\n );\n const markers =\n options.until === undefined\n ? []\n : typeof options.until === \"string\"\n ? [options.until]\n : options.until;\n invariant(\n markers.every((marker) => marker.length > 0),\n \"Completion markers cannot be empty\",\n );\n}\n\nexport async function preflightDispatch(\n options: DispatchOptions<unknown>,\n _repository: string,\n agent?: AgentAdapter,\n): Promise<void> {\n validateDispatch(options);\n if (!options.response) return;\n if (options.response.repairs > 0)\n invariant(\n agent?.resumable ?? !!(agent?.conversations || agent?.storage),\n \"Response repair requires an adapter that supports continuation\",\n );\n const brief = options.brief;\n const text = brief.text ?? (await readFile(resolve(brief.file!), \"utf8\"));\n const resolved = text.replace(/\\{\\{\\s*(\\w+)\\s*\\}\\}/g, (token, key: string) =>\n brief.values?.[key] === undefined ? token : String(brief.values[key]),\n );\n invariant(\n resolved.includes(`<${options.response.tag}>`),\n `Brief must request an opening <${options.response.tag}> tag`,\n );\n}\n"]}
|
|
1
|
+
{"version":3,"file":"dispatch-validation.js","sourceRoot":"","sources":["../../src/application/dispatch-validation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAGhF,MAAM,UAAU,gBAAgB,CAAC,OAAiC;IAChE,OAAO,CAAC,MAAM,EAAE,cAAc,EAAE,CAAC;IACjC,aAAa,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAC7B,QAAQ,CAAC,OAAO,CAAC,MAAM,IAAI,iBAAi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AE,SAAS,IAAI,CAAC,CAAC,CAAC,KAAK,EAAE,aAAa,IAAI,KAAK,EAAE,OAAO,CAAC,EAC9D,gEAAgE,CACjE,CAAC;IACJ,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;IAC5B,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,IAAI,CAAC,MAAM,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,IAAK,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;IAC1E,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,sBAAsB,EAAE,CAAC,KAAK,EAAE,GAAW,EAAE,EAAE,CAC3E,KAAK,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CACtE,CAAC;IACF,SAAS,CACP,QAAQ,CAAC,QAAQ,CAAC,IAAI,OAAO,CAAC,QAAQ,CAAC,GAAG,GAAG,CAAC,EAC9C,kCAAkC,OAAO,CAAC,QAAQ,CAAC,GAAG,OAAO,CAC9D,CAAC;AACJ,CAAC","sourcesContent":["import { readFile } from \"node:fs/promises\";\nimport { resolve } from \"node:path\";\nimport type { AgentAdapter } from \"../domain/agent.types.ts\";\nimport { invariant, positive } from \"../domain/errors.ts\";\nimport { validateBrief } from \"../domain/prompts.ts\";\nimport { dispatchDeadlines, executionDefaults } from \"./execution.constants.ts\";\nimport type { DispatchOptions } from \"./execution.types.ts\";\n\nexport function validateDispatch(options: DispatchOptions<unknown>): void {\n options.signal?.throwIfAborted();\n validateBrief(options.brief);\n positive(options.passes ?? executionDefaults.passes, \"passes\");\n invariant(\n Number.isSafeInteger(options.passes ?? executionDefaults.passes),\n \"passes must be an integer\",\n );\n for (const key of dispatchDeadlines)\n if (options[key] !== undefined) positive(options[key], key);\n if (options.response || options.continuation)\n invariant(\n (options.passes ?? executionDefaults.passes) === 1,\n \"Structured responses and continuations require one pass\",\n );\n const markers =\n options.until === undefined\n ? []\n : typeof options.until === \"string\"\n ? [options.until]\n : options.until;\n invariant(\n markers.every((marker) => marker.length > 0),\n \"Completion markers cannot be empty\",\n );\n}\n\nexport async function preflightDispatch(\n options: DispatchOptions<unknown>,\n _repository: string,\n agent?: AgentAdapter,\n): Promise<void> {\n validateDispatch(options);\n if (options.continuation)\n invariant(\n agent?.resumable !== false,\n `${agent?.name} does not support continuation or fork in Outpost`,\n );\n if (!options.response) return;\n if (options.response.repairs > 0)\n invariant(\n agent?.resumable ?? !!(agent?.conversations || agent?.storage),\n \"Response repair requires an adapter that supports continuation\",\n );\n const brief = options.brief;\n const text = brief.text ?? (await readFile(resolve(brief.file!), \"utf8\"));\n const resolved = text.replace(/\\{\\{\\s*(\\w+)\\s*\\}\\}/g, (token, key: string) =>\n brief.values?.[key] === undefined ? token : String(brief.values[key]),\n );\n invariant(\n resolved.includes(`<${options.response.tag}>`),\n `Brief must request an opening <${options.response.tag}> tag`,\n );\n}\n"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { claudeDiagnostics } from "../adapters/agents/claude-diagnostics.ts";
|
|
2
|
+
import { codexDiagnostics } from "../adapters/agents/codex-diagnostics.ts";
|
|
3
|
+
import { geminiDiagnostics } from "../adapters/agents/gemini-diagnostics.ts";
|
|
4
|
+
export declare const agentDiagnosticPlans: {
|
|
5
|
+
readonly gemini: typeof geminiDiagnostics;
|
|
6
|
+
readonly claude: typeof claudeDiagnostics;
|
|
7
|
+
readonly codex: typeof codexDiagnostics;
|
|
8
|
+
};
|
|
9
|
+
export declare const agentDiagnosticDefaults: Readonly<{
|
|
10
|
+
retain: 65536;
|
|
11
|
+
}>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { claudeDiagnostics } from "../adapters/agents/claude-diagnostics.js";
|
|
2
|
+
import { codexDiagnostics } from "../adapters/agents/codex-diagnostics.js";
|
|
3
|
+
import { geminiDiagnostics } from "../adapters/agents/gemini-diagnostics.js";
|
|
4
|
+
export const agentDiagnosticPlans = {
|
|
5
|
+
gemini: geminiDiagnostics,
|
|
6
|
+
claude: claudeDiagnostics,
|
|
7
|
+
codex: codexDiagnostics,
|
|
8
|
+
};
|
|
9
|
+
export const agentDiagnosticDefaults = Object.freeze({ retain: 65_536 });
|
|
10
|
+
//# sourceMappingURL=doctor-agent.constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"doctor-agent.constants.js","sourceRoot":"","sources":["../../src/application/doctor-agent.constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,0CAA0C,CAAC;AAC7E,OAAO,EAAE,gBAAgB,EAAE,MAAM,yCAAyC,CAAC;AAC3E,OAAO,EAAE,iBAAiB,EAAE,MAAM,0CAA0C,CAAC;AAE7E,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,MAAM,EAAE,iBAAiB;IACzB,MAAM,EAAE,iBAAiB;IACzB,KAAK,EAAE,gBAAgB;CACf,CAAC;AACX,MAAM,CAAC,MAAM,uBAAuB,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC","sourcesContent":["import { claudeDiagnostics } from \"../adapters/agents/claude-diagnostics.ts\";\nimport { codexDiagnostics } from \"../adapters/agents/codex-diagnostics.ts\";\nimport { geminiDiagnostics } from \"../adapters/agents/gemini-diagnostics.ts\";\n\nexport const agentDiagnosticPlans = {\n gemini: geminiDiagnostics,\n claude: claudeDiagnostics,\n codex: codexDiagnostics,\n} as const;\nexport const agentDiagnosticDefaults = Object.freeze({ retain: 65_536 });\n"]}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { stripVTControlCharacters } from "node:util";
|
|
2
|
+
import { diagnosticProbe } from "./diagnostic-probe.js";
|
|
3
|
+
import { agentDiagnosticDefaults, agentDiagnosticPlans, } from "./doctor-agent.constants.js";
|
|
4
|
+
export async function diagnoseAgentCli(agent, execute) {
|
|
5
|
+
const checks = [];
|
|
6
|
+
for (const plan of agentDiagnosticPlans[agent]()) {
|
|
7
|
+
let help = "";
|
|
8
|
+
const check = await diagnosticProbe({
|
|
9
|
+
id: `agent.cli.${plan.mode}`,
|
|
10
|
+
command: { ...plan.command, retain: agentDiagnosticDefaults.retain },
|
|
11
|
+
failureStatus: "fail",
|
|
12
|
+
remedy: "The agent CLI help command failed. Check the agent CLI in this image and rebuild it if needed.",
|
|
13
|
+
}, async (command) => {
|
|
14
|
+
const result = await execute(command);
|
|
15
|
+
help = stripVTControlCharacters(`${result.stdout}\n${result.stderr}`);
|
|
16
|
+
return result;
|
|
17
|
+
});
|
|
18
|
+
if (check.status !== "pass") {
|
|
19
|
+
checks.push(check);
|
|
20
|
+
continue;
|
|
21
|
+
}
|
|
22
|
+
const usage = help
|
|
23
|
+
.split(/\r?\n/)
|
|
24
|
+
.some((line) => line.trim().startsWith(`Usage: ${plan.usage} [`));
|
|
25
|
+
if (!usage) {
|
|
26
|
+
checks.push({
|
|
27
|
+
id: check.id,
|
|
28
|
+
status: "warn",
|
|
29
|
+
message: "Command exited successfully but the expected help could not be identified; CLI support is unverified.",
|
|
30
|
+
});
|
|
31
|
+
continue;
|
|
32
|
+
}
|
|
33
|
+
const declared = new Set([
|
|
34
|
+
...help.matchAll(/^\s*(?:-[A-Za-z0-9?],?\s+)?(--[A-Za-z][\w-]*)\b/gm),
|
|
35
|
+
].map((match) => match[1]));
|
|
36
|
+
const missing = plan.options.filter((option) => !declared.has(option));
|
|
37
|
+
if (missing.length) {
|
|
38
|
+
checks.push({
|
|
39
|
+
id: check.id,
|
|
40
|
+
status: "fail",
|
|
41
|
+
message: `Help does not declare required options: ${missing.join(", ")}. Rebuild the image with a CLI supporting Outpost's default invocation.`,
|
|
42
|
+
});
|
|
43
|
+
continue;
|
|
44
|
+
}
|
|
45
|
+
checks.push({
|
|
46
|
+
id: check.id,
|
|
47
|
+
status: "pass",
|
|
48
|
+
message: "Help identifies the command and declares the options used by Outpost's default invocation. Conversation execution and event decoding are not tested.",
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
return checks;
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=doctor-agent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"doctor-agent.js","sourceRoot":"","sources":["../../src/application/doctor-agent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAC;AAErD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EACL,uBAAuB,EACvB,oBAAoB,GACrB,MAAM,6BAA6B,CAAC;AAGrC,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACpC,KAAkB,EAClB,OAAiB;IAEjB,MAAM,MAAM,GAAsB,EAAE,CAAC;IACrC,KAAK,MAAM,IAAI,IAAI,oBAAoB,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC;QACjD,IAAI,IAAI,GAAG,EAAE,CAAC;QACd,MAAM,KAAK,GAAG,MAAM,eAAe,CACjC;YACE,EAAE,EAAE,aAAa,IAAI,CAAC,IAAI,EAAE;YAC5B,OAAO,EAAE,EAAE,GAAG,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,uBAAuB,CAAC,MAAM,EAAE;YACpE,aAAa,EAAE,MAAM;YACrB,MAAM,EACJ,gGAAgG;SACnG,EACD,KAAK,EAAE,OAAO,EAAE,EAAE;YAChB,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;YACtC,IAAI,GAAG,wBAAwB,CAAC,GAAG,MAAM,CAAC,MAAM,KAAK,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC;YACtE,OAAO,MAAM,CAAC;QAChB,CAAC,CACF,CAAC;QACF,IAAI,KAAK,CAAC,MAAM,KAAK,MAAM,EAAE,CAAC;YAC5B,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YACnB,SAAS;QACX,CAAC;QACD,MAAM,KAAK,GAAG,IAAI;aACf,KAAK,CAAC,OAAO,CAAC;aACd,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,UAAU,CAAC,UAAU,IAAI,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC;QACpE,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,MAAM,CAAC,IAAI,CAAC;gBACV,EAAE,EAAE,KAAK,CAAC,EAAE;gBACZ,MAAM,EAAE,MAAM;gBACd,OAAO,EACL,uGAAuG;aAC1G,CAAC,CAAC;YACH,SAAS;QACX,CAAC;QACD,MAAM,QAAQ,GAAG,IAAI,GAAG,CACtB;YACE,GAAG,IAAI,CAAC,QAAQ,CAAC,mDAAmD,CAAC;SACtE,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAC3B,CAAC;QACF,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC;QACvE,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;YACnB,MAAM,CAAC,IAAI,CAAC;gBACV,EAAE,EAAE,KAAK,CAAC,EAAE;gBACZ,MAAM,EAAE,MAAM;gBACd,OAAO,EAAE,2CAA2C,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,yEAAyE;aAChJ,CAAC,CAAC;YACH,SAAS;QACX,CAAC;QACD,MAAM,CAAC,IAAI,CAAC;YACV,EAAE,EAAE,KAAK,CAAC,EAAE;YACZ,MAAM,EAAE,MAAM;YACd,OAAO,EACL,sJAAsJ;SACzJ,CAAC,CAAC;IACL,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["import { stripVTControlCharacters } from \"node:util\";\nimport type { Executor } from \"../infrastructure/process.types.ts\";\nimport { diagnosticProbe } from \"./diagnostic-probe.ts\";\nimport {\n agentDiagnosticDefaults,\n agentDiagnosticPlans,\n} from \"./doctor-agent.constants.ts\";\nimport type { DiagnosticCheck, DoctorAgent } from \"./doctor.types.ts\";\n\nexport async function diagnoseAgentCli(\n agent: DoctorAgent,\n execute: Executor,\n): Promise<readonly DiagnosticCheck[]> {\n const checks: DiagnosticCheck[] = [];\n for (const plan of agentDiagnosticPlans[agent]()) {\n let help = \"\";\n const check = await diagnosticProbe(\n {\n id: `agent.cli.${plan.mode}`,\n command: { ...plan.command, retain: agentDiagnosticDefaults.retain },\n failureStatus: \"fail\",\n remedy:\n \"The agent CLI help command failed. Check the agent CLI in this image and rebuild it if needed.\",\n },\n async (command) => {\n const result = await execute(command);\n help = stripVTControlCharacters(`${result.stdout}\\n${result.stderr}`);\n return result;\n },\n );\n if (check.status !== \"pass\") {\n checks.push(check);\n continue;\n }\n const usage = help\n .split(/\\r?\\n/)\n .some((line) => line.trim().startsWith(`Usage: ${plan.usage} [`));\n if (!usage) {\n checks.push({\n id: check.id,\n status: \"warn\",\n message:\n \"Command exited successfully but the expected help could not be identified; CLI support is unverified.\",\n });\n continue;\n }\n const declared = new Set(\n [\n ...help.matchAll(/^\\s*(?:-[A-Za-z0-9?],?\\s+)?(--[A-Za-z][\\w-]*)\\b/gm),\n ].map((match) => match[1]),\n );\n const missing = plan.options.filter((option) => !declared.has(option));\n if (missing.length) {\n checks.push({\n id: check.id,\n status: \"fail\",\n message: `Help does not declare required options: ${missing.join(\", \")}. Rebuild the image with a CLI supporting Outpost's default invocation.`,\n });\n continue;\n }\n checks.push({\n id: check.id,\n status: \"pass\",\n message:\n \"Help identifies the command and declares the options used by Outpost's default invocation. Conversation execution and event decoding are not tested.\",\n });\n }\n return checks;\n}\n"]}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { mkdtemp, rm } from "node:fs/promises";
|
|
2
|
+
import { tmpdir } from "node:os";
|
|
3
|
+
import { join } from "node:path";
|
|
4
|
+
import { OutpostError } from "../domain/errors.js";
|
|
5
|
+
import { executeProcess } from "../infrastructure/process.js";
|
|
6
|
+
import { registerCleanup } from "../infrastructure/shutdown.js";
|
|
7
|
+
import { diagnosticContainer } from "../providers/diagnostic-container.js";
|
|
8
|
+
import { agentVersions } from "../providers/versions.constants.js";
|
|
9
|
+
import { diagnoseAgentCli } from "./doctor-agent.js";
|
|
10
|
+
import { diagnosticProbe } from "./diagnostic-probe.js";
|
|
11
|
+
import { doctorDefaults } from "./doctor.constants.js";
|
|
12
|
+
export async function diagnoseImage(options, execute = executeProcess) {
|
|
13
|
+
const stop = new AbortController();
|
|
14
|
+
const pending = inspectImage(options, execute, stop.signal);
|
|
15
|
+
const unregister = registerCleanup(async () => {
|
|
16
|
+
stop.abort(new OutpostError("aborted", "Image diagnostics interrupted"));
|
|
17
|
+
await pending;
|
|
18
|
+
});
|
|
19
|
+
try {
|
|
20
|
+
return await pending;
|
|
21
|
+
}
|
|
22
|
+
finally {
|
|
23
|
+
unregister();
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
async function inspectImage({ provider, agent, image }, execute, signal) {
|
|
27
|
+
const directory = await mkdtemp(join(tmpdir(), "outpost-doctor-"));
|
|
28
|
+
const checks = [];
|
|
29
|
+
let lease;
|
|
30
|
+
let retained = false;
|
|
31
|
+
let container;
|
|
32
|
+
const tracked = (command) => {
|
|
33
|
+
if (command.arguments?.[0] === "create") {
|
|
34
|
+
const index = command.arguments.indexOf("--name");
|
|
35
|
+
container = command.arguments[index + 1];
|
|
36
|
+
}
|
|
37
|
+
return execute(command);
|
|
38
|
+
};
|
|
39
|
+
try {
|
|
40
|
+
lease = await diagnosticContainer(provider, image, doctorDefaults.deadlineMs, tracked).acquire({
|
|
41
|
+
repository: directory,
|
|
42
|
+
directory,
|
|
43
|
+
gitDirectories: [],
|
|
44
|
+
variables: {},
|
|
45
|
+
signal,
|
|
46
|
+
});
|
|
47
|
+
checks.push({
|
|
48
|
+
id: "image.runtime",
|
|
49
|
+
status: "pass",
|
|
50
|
+
message: "Temporary sandbox started with network disabled and an empty workspace.",
|
|
51
|
+
});
|
|
52
|
+
const sandbox = lease;
|
|
53
|
+
const invoke = (command) => sandbox.invoke({ ...command, signal });
|
|
54
|
+
for (const executable of ["node", "git"]) {
|
|
55
|
+
checks.push(await diagnosticProbe({
|
|
56
|
+
id: `image.${executable}`,
|
|
57
|
+
command: { executable, arguments: ["--version"] },
|
|
58
|
+
failureStatus: "fail",
|
|
59
|
+
readVersion: true,
|
|
60
|
+
remedy: `Install ${executable} in the image and rebuild it.`,
|
|
61
|
+
}, invoke));
|
|
62
|
+
}
|
|
63
|
+
checks.push(await diagnosticProbe({
|
|
64
|
+
id: "image.home",
|
|
65
|
+
command: {
|
|
66
|
+
executable: "sh",
|
|
67
|
+
arguments: ["-c", 'test -d "$HOME" && test -w "$HOME"'],
|
|
68
|
+
},
|
|
69
|
+
failureStatus: "fail",
|
|
70
|
+
remedy: "Check the image user and permissions of the private agent home.",
|
|
71
|
+
}, invoke));
|
|
72
|
+
const agentVersion = await diagnosticProbe({
|
|
73
|
+
id: "agent.sandbox",
|
|
74
|
+
command: { executable: agent, arguments: ["--version"] },
|
|
75
|
+
failureStatus: "fail",
|
|
76
|
+
readVersion: true,
|
|
77
|
+
referenceVersion: agentVersions[agent],
|
|
78
|
+
remedy: `Install ${agent} in the image and rebuild it. This check does not bootstrap agents.`,
|
|
79
|
+
}, invoke);
|
|
80
|
+
checks.push(agentVersion);
|
|
81
|
+
if (agentVersion.status === "fail")
|
|
82
|
+
checks.push({
|
|
83
|
+
id: "agent.cli",
|
|
84
|
+
status: "skipped",
|
|
85
|
+
message: "CLI help checks require a successful agent version probe.",
|
|
86
|
+
});
|
|
87
|
+
else
|
|
88
|
+
checks.push(...(await diagnoseAgentCli(agent, invoke)));
|
|
89
|
+
}
|
|
90
|
+
catch (error) {
|
|
91
|
+
retained = error instanceof AggregateError;
|
|
92
|
+
checks.push({
|
|
93
|
+
id: "image.runtime",
|
|
94
|
+
status: "fail",
|
|
95
|
+
message: "Image diagnostics could not start. Check that the image exists locally, its UID matches the host, and sh, sleep, setsid, kill, tar and cp are installed. No image is downloaded.",
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
finally {
|
|
99
|
+
if (lease) {
|
|
100
|
+
try {
|
|
101
|
+
await lease.release();
|
|
102
|
+
checks.push({
|
|
103
|
+
id: "image.cleanup",
|
|
104
|
+
status: "pass",
|
|
105
|
+
message: "Diagnostic container removed.",
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
catch {
|
|
109
|
+
retained = true;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
if (retained)
|
|
113
|
+
checks.push({
|
|
114
|
+
id: "image.cleanup",
|
|
115
|
+
status: "fail",
|
|
116
|
+
message: `Cleanup could not be confirmed. Inspect container ${container ?? "creation state"} with ${provider}; temporary workspace retained at ${directory}.`,
|
|
117
|
+
});
|
|
118
|
+
if (!retained) {
|
|
119
|
+
try {
|
|
120
|
+
await rm(directory, { recursive: true, force: true });
|
|
121
|
+
}
|
|
122
|
+
catch {
|
|
123
|
+
checks.push({
|
|
124
|
+
id: "image.workspace",
|
|
125
|
+
status: "fail",
|
|
126
|
+
message: `Could not remove temporary workspace ${directory}.`,
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
return checks;
|
|
132
|
+
}
|
|
133
|
+
//# sourceMappingURL=doctor-image.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"doctor-image.js","sourceRoot":"","sources":["../../src/application/doctor-image.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,YAAY,EAAE,MAAM,qB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eAAe;oBACnB,MAAM,EAAE,MAAM;oBACd,OAAO,EAAE,+BAA+B;iBACzC,CAAC,CAAC;YACL,CAAC;YAAC,MAAM,CAAC;gBACP,QAAQ,GAAG,IAAI,CAAC;YAClB,CAAC;QACH,CAAC;QACD,IAAI,QAAQ;YACV,MAAM,CAAC,IAAI,CAAC;gBACV,EAAE,EAAE,eAAe;gBACnB,MAAM,EAAE,MAAM;gBACd,OAAO,EAAE,qDAAqD,SAAS,IAAI,gBAAgB,SAAS,QAAQ,qCAAqC,SAAS,GAAG;aAC9J,CAAC,CAAC;QACL,IAAI,CAAC,QAAQ,EAAE,CAAC;YACd,IAAI,CAAC;gBACH,MAAM,EAAE,CAAC,SAAS,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;YACxD,CAAC;YAAC,MAAM,CAAC;gBACP,MAAM,CAAC,IAAI,CAAC;oBACV,EAAE,EAAE,iBAAiB;oBACrB,MAAM,EAAE,MAAM;oBACd,OAAO,EAAE,wCAAwC,SAAS,GAAG;iBAC9D,CAAC,CAAC;YACL,CAAC;QACH,CAAC;IACH,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["import { mkdtemp, rm } from \"node:fs/promises\";\nimport { tmpdir } from \"node:os\";\nimport { join } from \"node:path\";\nimport { OutpostError } from \"../domain/errors.ts\";\nimport type { SandboxLease } from \"../domain/sandbox.types.ts\";\nimport { executeProcess } from \"../infrastructure/process.ts\";\nimport type { Executor } from \"../infrastructure/process.types.ts\";\nimport { registerCleanup } from \"../infrastructure/shutdown.ts\";\nimport { diagnosticContainer } from \"../providers/diagnostic-container.ts\";\nimport { agentVersions } from \"../providers/versions.constants.ts\";\nimport { diagnoseAgentCli } from \"./doctor-agent.ts\";\nimport { diagnosticProbe } from \"./diagnostic-probe.ts\";\nimport { doctorDefaults } from \"./doctor.constants.ts\";\nimport type { DiagnosticCheck, DoctorImageOptions } from \"./doctor.types.ts\";\n\nexport async function diagnoseImage(\n options: DoctorImageOptions,\n execute: Executor = executeProcess,\n): Promise<readonly DiagnosticCheck[]> {\n const stop = new AbortController();\n const pending = inspectImage(options, execute, stop.signal);\n const unregister = registerCleanup(async () => {\n stop.abort(new OutpostError(\"aborted\", \"Image diagnostics interrupted\"));\n await pending;\n });\n try {\n return await pending;\n } finally {\n unregister();\n }\n}\n\nasync function inspectImage(\n { provider, agent, image }: DoctorImageOptions,\n execute: Executor,\n signal: AbortSignal,\n): Promise<readonly DiagnosticCheck[]> {\n const directory = await mkdtemp(join(tmpdir(), \"outpost-doctor-\"));\n const checks: DiagnosticCheck[] = [];\n let lease: SandboxLease | undefined;\n let retained = false;\n let container: string | undefined;\n const tracked: Executor = (command) => {\n if (command.arguments?.[0] === \"create\") {\n const index = command.arguments.indexOf(\"--name\");\n container = command.arguments[index + 1];\n }\n return execute(command);\n };\n try {\n lease = await diagnosticContainer(\n provider,\n image,\n doctorDefaults.deadlineMs,\n tracked,\n ).acquire({\n repository: directory,\n directory,\n gitDirectories: [],\n variables: {},\n signal,\n });\n checks.push({\n id: \"image.runtime\",\n status: \"pass\",\n message:\n \"Temporary sandbox started with network disabled and an empty workspace.\",\n });\n const sandbox = lease;\n const invoke: Executor = (command) =>\n sandbox.invoke({ ...command, signal });\n for (const executable of [\"node\", \"git\"]) {\n checks.push(\n await diagnosticProbe(\n {\n id: `image.${executable}`,\n command: { executable, arguments: [\"--version\"] },\n failureStatus: \"fail\",\n readVersion: true,\n remedy: `Install ${executable} in the image and rebuild it.`,\n },\n invoke,\n ),\n );\n }\n checks.push(\n await diagnosticProbe(\n {\n id: \"image.home\",\n command: {\n executable: \"sh\",\n arguments: [\"-c\", 'test -d \"$HOME\" && test -w \"$HOME\"'],\n },\n failureStatus: \"fail\",\n remedy:\n \"Check the image user and permissions of the private agent home.\",\n },\n invoke,\n ),\n );\n const agentVersion = await diagnosticProbe(\n {\n id: \"agent.sandbox\",\n command: { executable: agent, arguments: [\"--version\"] },\n failureStatus: \"fail\",\n readVersion: true,\n referenceVersion: agentVersions[agent],\n remedy: `Install ${agent} in the image and rebuild it. This check does not bootstrap agents.`,\n },\n invoke,\n );\n checks.push(agentVersion);\n if (agentVersion.status === \"fail\")\n checks.push({\n id: \"agent.cli\",\n status: \"skipped\",\n message: \"CLI help checks require a successful agent version probe.\",\n });\n else checks.push(...(await diagnoseAgentCli(agent, invoke)));\n } catch (error) {\n retained = error instanceof AggregateError;\n checks.push({\n id: \"image.runtime\",\n status: \"fail\",\n message:\n \"Image diagnostics could not start. Check that the image exists locally, its UID matches the host, and sh, sleep, setsid, kill, tar and cp are installed. No image is downloaded.\",\n });\n } finally {\n if (lease) {\n try {\n await lease.release();\n checks.push({\n id: \"image.cleanup\",\n status: \"pass\",\n message: \"Diagnostic container removed.\",\n });\n } catch {\n retained = true;\n }\n }\n if (retained)\n checks.push({\n id: \"image.cleanup\",\n status: \"fail\",\n message: `Cleanup could not be confirmed. Inspect container ${container ?? \"creation state\"} with ${provider}; temporary workspace retained at ${directory}.`,\n });\n if (!retained) {\n try {\n await rm(directory, { recursive: true, force: true });\n } catch {\n checks.push({\n id: \"image.workspace\",\n status: \"fail\",\n message: `Could not remove temporary workspace ${directory}.`,\n });\n }\n }\n }\n return checks;\n}\n"]}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { isDeepStrictEqual } from "node:util";
|
|
2
|
+
import { claude } from "../adapters/agents/claude-adapter.js";
|
|
3
|
+
import { codex } from "../adapters/agents/codex-adapter.js";
|
|
4
|
+
import { gemini } from "../adapters/agents/gemini-adapter.js";
|
|
5
|
+
import { protocolFixtures } from "../adapters/agents/protocol-fixtures.constants.js";
|
|
6
|
+
import { agentVersions } from "../providers/versions.constants.js";
|
|
7
|
+
export function diagnoseAgentProtocol(agent) {
|
|
8
|
+
const adapter = { claude, codex, gemini }[agent]();
|
|
9
|
+
const checks = protocolFixtures[agent].map((fixture) => {
|
|
10
|
+
const events = fixture.lines.flatMap((line) => adapter.events(line));
|
|
11
|
+
const passed = isDeepStrictEqual(events, fixture.expected);
|
|
12
|
+
return {
|
|
13
|
+
id: `protocol.fixture.${fixture.name}`,
|
|
14
|
+
status: passed ? "pass" : "fail",
|
|
15
|
+
message: passed
|
|
16
|
+
? "Bundled synthetic events decode to the expected structural observations. No installed CLI or model was invoked."
|
|
17
|
+
: "Bundled synthetic events do not match the expected structural observations.",
|
|
18
|
+
};
|
|
19
|
+
});
|
|
20
|
+
return {
|
|
21
|
+
scope: "bundled-protocol-fixtures",
|
|
22
|
+
agent,
|
|
23
|
+
referenceVersion: agentVersions[agent],
|
|
24
|
+
installedCli: "unverified",
|
|
25
|
+
modelCompatibility: "unverified",
|
|
26
|
+
checks,
|
|
27
|
+
hasFailures: checks.some((check) => check.status === "fail"),
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=doctor-protocol.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"doctor-protocol.js","sourceRoot":"","sources":["../../src/application/doctor-protocol.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,sCAAsC,CAAC;AAC9D,OAAO,EAAE,KAAK,EAAE,MAAM,qCAAqC,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,sCAAsC,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,mDAAmD,CAAC;AACrF,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AAInE,MAAM,UAAU,qBAAqB,CAAC,KAAkB;IACtD,MAAM,OAAO,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC;IACnD,MAAM,MAAM,GAAsB,gBAAgB,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE;QACxE,MAAM,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;QACrE,MAAM,MAAM,GAAG,iBAAiB,CAAC,MAAM,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC;QAC3D,OAAO;YACL,EAAE,EAAE,oBAAoB,OAAO,CAAC,IAAI,EAAE;YACtC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM;YAChC,OAAO,EAAE,MAAM;gBACb,CAAC,CAAC,iHAAiH;gBACnH,CAAC,CAAC,6EAA6E;SAClF,CAAC;IACJ,CAAC,CAAC,CAAC;IACH,OAAO;QACL,KAAK,EAAE,2BAA2B;QAClC,KAAK;QACL,gBAAgB,EAAE,aAAa,CAAC,KAAK,CAAC;QACtC,YAAY,EAAE,YAAY;QAC1B,kBAAkB,EAAE,YAAY;QAChC,MAAM;QACN,WAAW,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,KAAK,MAAM,CAAC;KAC7D,CAAC;AACJ,CAAC","sourcesContent":["import { isDeepStrictEqual } from \"node:util\";\nimport { claude } from \"../adapters/agents/claude-adapter.ts\";\nimport { codex } from \"../adapters/agents/codex-adapter.ts\";\nimport { gemini } from \"../adapters/agents/gemini-adapter.ts\";\nimport { protocolFixtures } from \"../adapters/agents/protocol-fixtures.constants.ts\";\nimport { agentVersions } from \"../providers/versions.constants.ts\";\nimport type { AgentProtocolReport } from \"./doctor-protocol.types.ts\";\nimport type { DiagnosticCheck, DoctorAgent } from \"./doctor.types.ts\";\n\nexport function diagnoseAgentProtocol(agent: DoctorAgent): AgentProtocolReport {\n const adapter = { claude, codex, gemini }[agent]();\n const checks: DiagnosticCheck[] = protocolFixtures[agent].map((fixture) => {\n const events = fixture.lines.flatMap((line) => adapter.events(line));\n const passed = isDeepStrictEqual(events, fixture.expected);\n return {\n id: `protocol.fixture.${fixture.name}`,\n status: passed ? \"pass\" : \"fail\",\n message: passed\n ? \"Bundled synthetic events decode to the expected structural observations. No installed CLI or model was invoked.\"\n : \"Bundled synthetic events do not match the expected structural observations.\",\n };\n });\n return {\n scope: \"bundled-protocol-fixtures\",\n agent,\n referenceVersion: agentVersions[agent],\n installedCli: \"unverified\",\n modelCompatibility: \"unverified\",\n checks,\n hasFailures: checks.some((check) => check.status === \"fail\"),\n };\n}\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { DiagnosticCheck, DoctorAgent } from "./doctor.types.ts";
|
|
2
|
+
export interface AgentProtocolReport {
|
|
3
|
+
readonly scope: "bundled-protocol-fixtures";
|
|
4
|
+
readonly agent: DoctorAgent;
|
|
5
|
+
readonly referenceVersion: string;
|
|
6
|
+
readonly installedCli: "unverified";
|
|
7
|
+
readonly modelCompatibility: "unverified";
|
|
8
|
+
readonly checks: readonly DiagnosticCheck[];
|
|
9
|
+
readonly hasFailures: boolean;
|
|
10
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"doctor-protocol.types.js","sourceRoot":"","sources":["../../src/application/doctor-protocol.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { DiagnosticCheck, DoctorAgent } from \"./doctor.types.ts\";\n\nexport interface AgentProtocolReport {\n readonly scope: \"bundled-protocol-fixtures\";\n readonly agent: DoctorAgent;\n readonly referenceVersion: string;\n readonly installedCli: \"unverified\";\n readonly modelCompatibility: \"unverified\";\n readonly checks: readonly DiagnosticCheck[];\n readonly hasFailures: boolean;\n}\n"]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const sandboxDiagnosticDefaults: Readonly<{
|
|
2
|
+
maximumDeadlineMs: 60000;
|
|
3
|
+
command: "process.stdout.write('outpost-stdout'); process.stderr.write('outpost-stderr'); process.exitCode = 7";
|
|
4
|
+
home: "const fs = require('node:fs'); fs.accessSync(process.argv[1], fs.constants.R_OK | fs.constants.W_OK); if (!fs.statSync(process.argv[1]).isDirectory()) process.exit(1)";
|
|
5
|
+
}>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export const sandboxDiagnosticDefaults = Object.freeze({
|
|
2
|
+
maximumDeadlineMs: 60_000,
|
|
3
|
+
command: "process.stdout.write('outpost-stdout'); process.stderr.write('outpost-stderr'); process.exitCode = 7",
|
|
4
|
+
home: "const fs = require('node:fs'); fs.accessSync(process.argv[1], fs.constants.R_OK | fs.constants.W_OK); if (!fs.statSync(process.argv[1]).isDirectory()) process.exit(1)",
|
|
5
|
+
});
|
|
6
|
+
//# sourceMappingURL=doctor-sandbox.constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"doctor-sandbox.constants.js","sourceRoot":"","sources":["../../src/application/doctor-sandbox.constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,yBAAyB,GAAG,MAAM,CAAC,MAAM,CAAC;IACrD,iBAAiB,EAAE,MAAM;IACzB,OAAO,EACL,sGAAsG;IACxG,IAAI,EAAE,wKAAwK;CAC/K,CAAC,CAAC","sourcesContent":["export const sandboxDiagnosticDefaults = Object.freeze({\n maximumDeadlineMs: 60_000,\n command:\n \"process.stdout.write('outpost-stdout'); process.stderr.write('outpost-stderr'); process.exitCode = 7\",\n home: \"const fs = require('node:fs'); fs.accessSync(process.argv[1], fs.constants.R_OK | fs.constants.W_OK); if (!fs.statSync(process.argv[1]).isDirectory()) process.exit(1)\",\n});\n"]}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { SandboxLease } from "../domain/sandbox.types.ts";
|
|
2
|
+
import type { SandboxDiagnosticOptions, SandboxDiagnosticReport } from "./doctor-sandbox.types.ts";
|
|
3
|
+
import type { Sandbox } from "./outpost.types.ts";
|
|
4
|
+
export declare function diagnoseSandbox(target: Sandbox | SandboxLease, options?: SandboxDiagnosticOptions): Promise<SandboxDiagnosticReport>;
|