@elie-laloum/outpost 3.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 +18 -0
- package/README.md +3 -1
- package/SECURITY.md +3 -1
- 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 +1 -1
- package/dist/adapters/agents/protocol-fixtures.constants.js +37 -0
- package/dist/adapters/agents/protocol-fixtures.constants.js.map +1 -1
- 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/dispatch-validation.js +2 -0
- package/dist/application/dispatch-validation.js.map +1 -1
- package/dist/application/doctor-agent.constants.d.ts +2 -0
- package/dist/application/doctor-agent.constants.js +2 -0
- package/dist/application/doctor-agent.constants.js.map +1 -1
- package/dist/application/doctor-agent.js +1 -1
- package/dist/application/doctor-agent.js.map +1 -1
- package/dist/application/doctor-protocol.js +2 -1
- package/dist/application/doctor-protocol.js.map +1 -1
- package/dist/application/doctor.constants.js +1 -1
- package/dist/application/doctor.constants.js.map +1 -1
- package/dist/application/doctor.types.d.ts +1 -1
- package/dist/application/doctor.types.js.map +1 -1
- package/dist/application/outpost.types.d.ts +2 -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-inspection.js +5 -0
- package/dist/application/recovery-inspection.js.map +1 -1
- package/dist/application/recovery-inspection.types.d.ts +3 -0
- package/dist/application/recovery-inspection.types.js.map +1 -1
- 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.js +5 -0
- package/dist/application/recovery-retention.js.map +1 -1
- package/dist/application/recovery-verification.d.ts +2 -1
- package/dist/application/recovery-verification.js +1 -1
- package/dist/application/recovery-verification.js.map +1 -1
- package/dist/application/remote-apply.js +6 -0
- package/dist/application/remote-apply.js.map +1 -1
- package/dist/application/remote-download.js +2 -2
- 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 +20 -28
- package/dist/application/remote-validation.js.map +1 -1
- package/dist/application/remote-workspace.js +4 -10
- package/dist/application/remote-workspace.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 +23 -11
- 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 +1 -1
- package/dist/application/task-usage.js.map +1 -1
- package/dist/application/tasks.js +1 -1
- 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/doctor-command.js +1 -1
- package/dist/cli/doctor-command.js.map +1 -1
- package/dist/cli/main.constants.d.ts +11 -2
- package/dist/cli/main.constants.js +8 -4
- package/dist/cli/main.constants.js.map +1 -1
- package/dist/cli/recovery-command.js +28 -4
- package/dist/cli/recovery-command.js.map +1 -1
- 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/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/sandbox.types.d.ts +1 -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.d.ts +2 -2
- package/dist/domain/workflow/budget.js +5 -3
- package/dist/domain/workflow/budget.js.map +1 -1
- 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 +14 -2
- 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 +65 -32
- 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 +91 -16
- package/dist/domain/workflow/workflow-state.js.map +1 -1
- package/dist/domain/workflow.types.d.ts +13 -2
- package/dist/domain/workflow.types.js.map +1 -1
- package/dist/index.d.ts +32 -2
- package/dist/index.js +14 -1
- 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 +1 -1
- package/dist/infrastructure/file-manifest.js +3 -2
- package/dist/infrastructure/file-manifest.js.map +1 -1
- package/dist/infrastructure/git/verification-command.d.ts +1 -1
- package/dist/infrastructure/git/verification-command.js +3 -2
- package/dist/infrastructure/git/verification-command.js.map +1 -1
- package/dist/infrastructure/opentelemetry.js +1 -1
- package/dist/infrastructure/opentelemetry.js.map +1 -1
- 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-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 +5 -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/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 +4 -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 +19 -2
- package/dist/providers/container.js.map +1 -1
- package/dist/providers/container.types.d.ts +3 -0
- package/dist/providers/container.types.js.map +1 -1
- package/dist/providers/daytona-command.js +3 -2
- 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 +2 -0
- package/dist/providers/daytona.js.map +1 -1
- package/dist/providers/docker.d.ts +1 -0
- package/dist/providers/docker.js.map +1 -1
- package/dist/providers/file-batches.d.ts +1 -1
- package/dist/providers/file-batches.js +9 -0
- package/dist/providers/file-batches.js.map +1 -1
- 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 +1 -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 +5 -1
- 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 +5 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 4.0.0
|
|
4
|
+
|
|
5
|
+
This major release extends public workflow status unions. Exhaustive consumers must handle task statuses `paused` and `rejected`, and workflow result status `paused`. Research features remain explicitly opt-in with their documented limitations.
|
|
6
|
+
|
|
7
|
+
- Allocate isolated container workspaces under a writable private parent for rootless Podman, and publish file artifacts without recreating Windows drive roots. Document manual checkpoint lock recovery when process ownership cannot be verified.
|
|
8
|
+
- Create missing Vercel workspace and transfer parent directories recursively before writing files.
|
|
9
|
+
|
|
10
|
+
- Add cooperative storage reservations with workspace ownership, isolated restoration of retained previous/incoming transfer state, and local sandbox/resource activity inspection.
|
|
11
|
+
- Batch and verify incremental file/symlink uploads; transfer verified Git history deltas while retaining complete recovery bundles. Directory copies keep their existing transfer behavior.
|
|
12
|
+
- Persist workflow checkpoints with JSON outputs, explicit replay and cumulative usage. Add approval/pause gates and typed immutable artifacts with unsigned lineage.
|
|
13
|
+
- Add SQLite durable task queues, authenticated HTTP transport and fenced workers. Replays can repeat side effects; terminal usage receipts prevent double accounting without guaranteeing real-time billing caps.
|
|
14
|
+
- Extend task statuses with `paused` and `rejected`, and workflow result status with `paused`; exhaustive status consumers must handle these values. Add optional checkpoint flushing and usage-receipt methods to task contexts.
|
|
15
|
+
- Support Daytona native PTY attachment with cancellation, resize and reuse; live account validation remains outstanding.
|
|
16
|
+
- Add the Gemini CLI adapter, bootstrap, diagnostics and image installation pinned to 0.61.0. Gemini supports fresh sessions only, without native conversation capture, continuation or automatic response repairs.
|
|
17
|
+
- Add opt-in research prototypes for isolated Docker/Podman Git checkouts, prepared-host Firecracker microVMs, container deny-all/Vercel egress policies, and bounded speculative candidates with explicit validation and no automatic integration.
|
|
18
|
+
- Attribute cloud reports to source commit/runtime/time and retain successful image-attestation verification artifacts. Live cloud campaigns, signed publication and real Firecracker boot remain separately gated validation, not implied successes.
|
|
19
|
+
- Synchronize the complete public API reference, bilingual guides and roadmap with implemented behavior and remaining prototype limits.
|
|
20
|
+
|
|
3
21
|
## 3.0.0
|
|
4
22
|
|
|
5
23
|
- Canonicalize temporary recovery verification directories across platforms and reuse existing Podman cache volumes without recreation.
|
package/README.md
CHANGED
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
[Documentation](https://elie-laloum.github.io/outpost/) · [Français](https://elie-laloum.github.io/outpost/fr/) · [API](https://elie-laloum.github.io/outpost/reference/) · [Changelog](CHANGELOG.md)
|
|
4
4
|
|
|
5
|
-
Outpost is a TypeScript library for running coding agents in reusable sandboxes, managing their Git workspaces and composing typed workflows. Claude Code and
|
|
5
|
+
Outpost is a TypeScript library for running coding agents in reusable sandboxes, managing their Git workspaces and composing typed workflows. Claude Code, Codex and Gemini CLI adapters work with Docker, Podman, Vercel, Daytona or explicit host execution. Gemini supports fresh sessions only; native conversation capture, resume and fork are available for Claude Code and Codex.
|
|
6
|
+
|
|
7
|
+
Version 4.0.0 adds durable orchestration, recovery and transfer improvements, Gemini CLI and native Daytona terminals. Research prototypes remain opt-in; see the [changelog](CHANGELOG.md#400) for public contract changes and the [roadmap](https://elie-laloum.github.io/outpost/project/roadmap/) for capabilities, limits and remaining work.
|
|
6
8
|
|
|
7
9
|
## Get started
|
|
8
10
|
|
package/SECURITY.md
CHANGED
|
@@ -2,10 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
Outpost runs coding agents that execute arbitrary project commands. Use it with repositories and credentials appropriate for that task.
|
|
4
4
|
|
|
5
|
-
Docker/Podman expose
|
|
5
|
+
By default, Docker/Podman expose the selected checkout, Git metadata and explicit volumes. The Docker socket is not mounted by default. Containers use a chosen UID/GID, dropped capabilities, no-new-privileges and a private home. Extra devices, writable mounts and elevated hooks expand the boundary deliberately.
|
|
6
6
|
|
|
7
7
|
Shared Git metadata is writable by the agent. A mounted sandbox is not an adversarial boundary protecting the host repository or its configuration. Outpost disables host Git hooks for its own Git commands, but a malicious repository can contain other executable configuration or project tooling. Do not run untrusted repositories with valuable host credentials. Host `local()` provides no isolation.
|
|
8
8
|
|
|
9
|
+
The opt-in Docker/Podman `repositoryMode: "isolated"` prototype uses a private container checkout and Git directory, without mounting the host checkout or Git metadata. Bundle transfer and validated synchronization import changes into the host workspace; host hooks, configuration and unrelated refs are not copied back. Explicit mounts overlapping canonical host repository/workspace/Git paths or container workspace/control paths are rejected, including read-only mounts. Dependency caches remain separate engine-managed volumes. Trust the container image, engine and host mount configuration: custom devices, external mounts, credentials, network access and shared caches expand the boundary. This is not a certified hostile-agent sandbox or protection against container/kernel escapes, malicious host path replacement during allocation, or dangerous project code later executed on the host.
|
|
10
|
+
|
|
9
11
|
Remote providers upload repository history and inputs to the selected cloud account. Explicit credentials and environment files are sent to that environment. Review the cloud provider's own storage/network policy. Concurrent host changes stop synchronization; recovery files preserve prior and incoming state when available.
|
|
10
12
|
|
|
11
13
|
Prompt command expansion only recognizes commands present in the original prompt file. Substitution cannot introduce new expansion fragments. Values substituted inside an original shell command still have shell semantics and must be trusted or quoted by the prompt author.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { geminiEvents } from "./gemini-events.js";
|
|
2
|
+
import { geminiRequest } from "./gemini-request.js";
|
|
3
|
+
export function gemini(settings = {}) {
|
|
4
|
+
return Object.freeze({
|
|
5
|
+
name: "gemini",
|
|
6
|
+
bootstrap: "gemini",
|
|
7
|
+
resumable: false,
|
|
8
|
+
capture: false,
|
|
9
|
+
requiresFinishedEvent: true,
|
|
10
|
+
variables: Object.freeze({ ...settings.variables }),
|
|
11
|
+
request: (input) => geminiRequest(settings, input),
|
|
12
|
+
events: geminiEvents,
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=gemini-adapter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gemini-adapter.js","sourceRoot":"","sources":["../../../src/adapters/agents/gemini-adapter.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAGpD,MAAM,UAAU,MAAM,CAAC,WAA2B,EAAE;IAClD,OAAO,MAAM,CAAC,MAAM,CAAC;QACnB,IAAI,EAAE,QAAQ;QACd,SAAS,EAAE,QAAQ;QACnB,SAAS,EAAE,KAAK;QAChB,OAAO,EAAE,KAAK;QACd,qBAAqB,EAAE,IAAI;QAC3B,SAAS,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,GAAG,QAAQ,CAAC,SAAS,EAAE,CAAC;QACnD,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,aAAa,CAAC,QAAQ,EAAE,KAAK,CAAC;QAClD,MAAM,EAAE,YAAY;KACE,CAAC,CAAC;AAC5B,CAAC","sourcesContent":["import type { AgentAdapter } from \"../../domain/agent.types.ts\";\nimport { geminiEvents } from \"./gemini-events.ts\";\nimport { geminiRequest } from \"./gemini-request.ts\";\nimport type { GeminiSettings } from \"./gemini.types.ts\";\n\nexport function gemini(settings: GeminiSettings = {}): AgentAdapter {\n return Object.freeze({\n name: \"gemini\",\n bootstrap: \"gemini\",\n resumable: false,\n capture: false,\n requiresFinishedEvent: true,\n variables: Object.freeze({ ...settings.variables }),\n request: (input) => geminiRequest(settings, input),\n events: geminiEvents,\n } satisfies AgentAdapter);\n}\n"]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { geminiRequest } from "./gemini-request.js";
|
|
2
|
+
export function geminiDiagnostics() {
|
|
3
|
+
const command = geminiRequest({}, {});
|
|
4
|
+
const args = command.arguments ?? [];
|
|
5
|
+
return [
|
|
6
|
+
{
|
|
7
|
+
mode: "start",
|
|
8
|
+
usage: "gemini",
|
|
9
|
+
options: args.filter((argument) => argument.startsWith("--")),
|
|
10
|
+
// Gemini omits supplied options from its help output.
|
|
11
|
+
command: { ...command, arguments: ["--help"] },
|
|
12
|
+
},
|
|
13
|
+
];
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=gemini-diagnostics.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gemini-diagnostics.js","sourceRoot":"","sources":["../../../src/adapters/agents/gemini-diagnostics.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,MAAM,UAAU,iBAAiB;IAC/B,MAAM,OAAO,GAAG,aAAa,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;IACtC,MAAM,IAAI,GAAG,OAAO,CAAC,SAAS,IAAI,EAAE,CAAC;IACrC,OAAO;QACL;YACE,IAAI,EAAE,OAAO;YACb,KAAK,EAAE,QAAQ;YACf,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;YAC7D,sDAAsD;YACtD,OAAO,EAAE,EAAE,GAAG,OAAO,EAAE,SAAS,EAAE,CAAC,QAAQ,CAAC,EAAE;SAC/C;KACF,CAAC;AACJ,CAAC","sourcesContent":["import type { AgentCliDiagnostic } from \"./cli-diagnostics.types.ts\";\nimport { geminiRequest } from \"./gemini-request.ts\";\n\nexport function geminiDiagnostics(): readonly AgentCliDiagnostic[] {\n const command = geminiRequest({}, {});\n const args = command.arguments ?? [];\n return [\n {\n mode: \"start\",\n usage: \"gemini\",\n options: args.filter((argument) => argument.startsWith(\"--\")),\n // Gemini omits supplied options from its help output.\n command: { ...command, arguments: [\"--help\"] },\n },\n ];\n}\n"]}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { decodeLine } from "./event-decoder.js";
|
|
2
|
+
import { asRecord, numberOrZero } from "./protocol.js";
|
|
3
|
+
function message(event) {
|
|
4
|
+
if (event.role !== "assistant" || typeof event.content !== "string")
|
|
5
|
+
return [];
|
|
6
|
+
return [{ kind: "text", text: event.content }];
|
|
7
|
+
}
|
|
8
|
+
function result(event) {
|
|
9
|
+
const events = [];
|
|
10
|
+
if (event.stats) {
|
|
11
|
+
const stats = asRecord(event.stats);
|
|
12
|
+
events.push({
|
|
13
|
+
kind: "usage",
|
|
14
|
+
tokens: {
|
|
15
|
+
input: numberOrZero(stats.input_tokens),
|
|
16
|
+
cached: numberOrZero(stats.cached),
|
|
17
|
+
output: numberOrZero(stats.output_tokens),
|
|
18
|
+
},
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
if (event.status === "success")
|
|
22
|
+
events.push({ kind: "finished" });
|
|
23
|
+
if (event.status === "error")
|
|
24
|
+
events.push({
|
|
25
|
+
kind: "failure",
|
|
26
|
+
message: String(asRecord(event.error).message ?? "Gemini failed"),
|
|
27
|
+
});
|
|
28
|
+
return events;
|
|
29
|
+
}
|
|
30
|
+
export function geminiEvents(line) {
|
|
31
|
+
return decodeLine(line, {
|
|
32
|
+
init: (event) => typeof event.session_id === "string"
|
|
33
|
+
? [{ kind: "conversation", id: event.session_id }]
|
|
34
|
+
: [],
|
|
35
|
+
message,
|
|
36
|
+
tool_use: (event) => typeof event.tool_name === "string"
|
|
37
|
+
? [{ kind: "tool", name: event.tool_name, input: event.parameters }]
|
|
38
|
+
: [],
|
|
39
|
+
error: (event) => typeof event.message === "string"
|
|
40
|
+
? [
|
|
41
|
+
{
|
|
42
|
+
kind: event.severity === "warning" ? "warning" : "failure",
|
|
43
|
+
message: event.message,
|
|
44
|
+
},
|
|
45
|
+
]
|
|
46
|
+
: [],
|
|
47
|
+
result,
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=gemini-events.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gemini-events.js","sourceRoot":"","sources":["../../../src/adapters/agents/gemini-events.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAGvD,SAAS,OAAO,CAAC,KAAqB;IACpC,IAAI,KAAK,CAAC,IAAI,KAAK,WAAW,IAAI,OAAO,KAAK,CAAC,OAAO,KAAK,QAAQ;QACjE,OAAO,EAAE,CAAC;IACZ,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;AACjD,CAAC;AAED,SAAS,MAAM,CAAC,KAAqB;IACnC,MAAM,MAAM,GAAiB,EAAE,CAAC;IAChC,IAAI,KAAK,CAAC,KAAK,EAAE,CAAC;QAChB,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QACpC,MAAM,CAAC,IAAI,CAAC;YACV,IAAI,EAAE,OAAO;YACb,MAAM,EAAE;gBACN,KAAK,EAAE,YAAY,CAAC,KAAK,CAAC,YAAY,CAAC;gBACvC,MAAM,EAAE,YAAY,CAAC,KAAK,CAAC,MAAM,CAAC;gBAClC,MAAM,EAAE,YAAY,CAAC,KAA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KACP,CAAC,CAAC;AACL,CAAC","sourcesContent":["import type { AgentEvent } from \"../../domain/agent.types.ts\";\nimport { decodeLine } from \"./event-decoder.ts\";\nimport { asRecord, numberOrZero } from \"./protocol.ts\";\nimport type { ProtocolRecord } from \"./protocol.types.ts\";\n\nfunction message(event: ProtocolRecord): AgentEvent[] {\n if (event.role !== \"assistant\" || typeof event.content !== \"string\")\n return [];\n return [{ kind: \"text\", text: event.content }];\n}\n\nfunction result(event: ProtocolRecord): AgentEvent[] {\n const events: AgentEvent[] = [];\n if (event.stats) {\n const stats = asRecord(event.stats);\n events.push({\n kind: \"usage\",\n tokens: {\n input: numberOrZero(stats.input_tokens),\n cached: numberOrZero(stats.cached),\n output: numberOrZero(stats.output_tokens),\n },\n });\n }\n if (event.status === \"success\") events.push({ kind: \"finished\" });\n if (event.status === \"error\")\n events.push({\n kind: \"failure\",\n message: String(asRecord(event.error).message ?? \"Gemini failed\"),\n });\n return events;\n}\n\nexport function geminiEvents(line: string): AgentEvent[] {\n return decodeLine(line, {\n init: (event) =>\n typeof event.session_id === \"string\"\n ? [{ kind: \"conversation\", id: event.session_id }]\n : [],\n message,\n tool_use: (event) =>\n typeof event.tool_name === \"string\"\n ? [{ kind: \"tool\", name: event.tool_name, input: event.parameters }]\n : [],\n error: (event) =>\n typeof event.message === \"string\"\n ? [\n {\n kind: event.severity === \"warning\" ? \"warning\" : \"failure\",\n message: event.message,\n },\n ]\n : [],\n result,\n });\n}\n"]}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { AgentInput } from "../../domain/agent.types.ts";
|
|
2
|
+
import type { Command } from "../../domain/command.types.ts";
|
|
3
|
+
import type { GeminiSettings } from "./gemini.types.ts";
|
|
4
|
+
export declare function geminiRequest(settings: GeminiSettings, input: AgentInput): Command;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { invariant } from "../../domain/errors.js";
|
|
2
|
+
export function geminiRequest(settings, input) {
|
|
3
|
+
invariant(!input.continuation, "Gemini does not support continuation or fork in Outpost");
|
|
4
|
+
const args = [];
|
|
5
|
+
if (settings.model)
|
|
6
|
+
args.push("--model", settings.model);
|
|
7
|
+
const approvalMode = settings.approvalMode ?? (input.interactive ? "default" : "yolo");
|
|
8
|
+
args.push("--approval-mode", approvalMode);
|
|
9
|
+
if (!input.interactive)
|
|
10
|
+
args.push("--output-format", "stream-json");
|
|
11
|
+
if (input.interactive && input.text !== undefined)
|
|
12
|
+
args.push("--prompt-interactive", input.text);
|
|
13
|
+
return {
|
|
14
|
+
executable: "gemini",
|
|
15
|
+
arguments: args,
|
|
16
|
+
...(input.interactive
|
|
17
|
+
? { interactive: true }
|
|
18
|
+
: { stdin: input.text ?? "" }),
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=gemini-request.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gemini-request.js","sourceRoot":"","sources":["../../../src/adapters/agents/gemini-request.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAGnD,MAAM,UAAU,aAAa,CAC3B,QAAwB,EACxB,KAAiB;IAEjB,SAAS,CACP,CAAC,KAAK,CAAC,YAAY,EACnB,yDAAyD,CAC1D,CAAC;IACF,MAAM,IAAI,GAAa,EAAE,CAAC;IAC1B,IAAI,QAAQ,CAAC,KAAK;QAAE,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC;IACzD,MAAM,YAAY,GAChB,QAAQ,CAAC,YAAY,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;IACpE,IAAI,CAAC,IAAI,CAAC,iBAAiB,EAAE,YAAY,CAAC,CAAC;IAC3C,IAAI,CAAC,KAAK,CAAC,WAAW;QAAE,IAAI,CAAC,IAAI,CAAC,iBAAiB,EAAE,aAAa,CAAC,CAAC;IACpE,IAAI,KAAK,CAAC,WAAW,IAAI,KAAK,CAAC,IAAI,KAAK,SAAS;QAC/C,IAAI,CAAC,IAAI,CAAC,sBAAsB,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;IAChD,OAAO;QACL,UAAU,EAAE,QAAQ;QACpB,SAAS,EAAE,IAAI;QACf,GAAG,CAAC,KAAK,CAAC,WAAW;YACnB,CAAC,CAAC,EAAE,WAAW,EAAE,IAAI,EAAE;YACvB,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,IAAI,IAAI,EAAE,EAAE,CAAC;KACjC,CAAC;AACJ,CAAC","sourcesContent":["import type { AgentInput } from \"../../domain/agent.types.ts\";\nimport type { Command } from \"../../domain/command.types.ts\";\nimport { invariant } from \"../../domain/errors.ts\";\nimport type { GeminiSettings } from \"./gemini.types.ts\";\n\nexport function geminiRequest(\n settings: GeminiSettings,\n input: AgentInput,\n): Command {\n invariant(\n !input.continuation,\n \"Gemini does not support continuation or fork in Outpost\",\n );\n const args: string[] = [];\n if (settings.model) args.push(\"--model\", settings.model);\n const approvalMode =\n settings.approvalMode ?? (input.interactive ? \"default\" : \"yolo\");\n args.push(\"--approval-mode\", approvalMode);\n if (!input.interactive) args.push(\"--output-format\", \"stream-json\");\n if (input.interactive && input.text !== undefined)\n args.push(\"--prompt-interactive\", input.text);\n return {\n executable: \"gemini\",\n arguments: args,\n ...(input.interactive\n ? { interactive: true }\n : { stdin: input.text ?? \"\" }),\n };\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gemini.types.js","sourceRoot":"","sources":["../../../src/adapters/agents/gemini.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { Variables } from \"../../domain/command.types.ts\";\n\nexport interface GeminiSettings {\n readonly model?: string;\n readonly variables?: Variables;\n readonly approvalMode?: \"default\" | \"auto_edit\" | \"yolo\" | \"plan\";\n}\n"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { AgentProtocolFixture } from "./protocol-fixtures.types.ts";
|
|
2
|
-
export declare const protocolFixtures: Readonly<Record<"claude" | "codex", readonly AgentProtocolFixture[]>>;
|
|
2
|
+
export declare const protocolFixtures: Readonly<Record<"claude" | "codex" | "gemini", readonly AgentProtocolFixture[]>>;
|
|
@@ -1,4 +1,41 @@
|
|
|
1
1
|
export const protocolFixtures = {
|
|
2
|
+
gemini: [
|
|
3
|
+
{
|
|
4
|
+
name: "turn",
|
|
5
|
+
lines: [
|
|
6
|
+
'{"type":"init","session_id":"fixture-conversation","model":"fixture-model"}',
|
|
7
|
+
'{"type":"tool_use","tool_name":"command","tool_id":"call-1","parameters":{"command":"fixture-command"}}',
|
|
8
|
+
'{"type":"message","role":"assistant","content":"fixture-result","delta":true}',
|
|
9
|
+
'{"type":"result","status":"success","stats":{"input_tokens":10,"cached":2,"output_tokens":3}}',
|
|
10
|
+
],
|
|
11
|
+
expected: [
|
|
12
|
+
{ kind: "conversation", id: "fixture-conversation" },
|
|
13
|
+
{
|
|
14
|
+
kind: "tool",
|
|
15
|
+
name: "command",
|
|
16
|
+
input: { command: "fixture-command" },
|
|
17
|
+
},
|
|
18
|
+
{ kind: "text", text: "fixture-result" },
|
|
19
|
+
{ kind: "usage", tokens: { input: 10, cached: 2, output: 3 } },
|
|
20
|
+
{ kind: "finished" },
|
|
21
|
+
],
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
name: "failure",
|
|
25
|
+
lines: [
|
|
26
|
+
'{"type":"result","status":"error","error":{"message":"fixture-failure"}}',
|
|
27
|
+
],
|
|
28
|
+
expected: [{ kind: "failure", message: "fixture-failure" }],
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
name: "unknown",
|
|
32
|
+
lines: ['{"type":"future.event"}', "invalid-json"],
|
|
33
|
+
expected: [
|
|
34
|
+
{ kind: "raw", value: { type: "future.event" } },
|
|
35
|
+
{ kind: "raw", value: "invalid-json" },
|
|
36
|
+
],
|
|
37
|
+
},
|
|
38
|
+
],
|
|
2
39
|
codex: [
|
|
3
40
|
{
|
|
4
41
|
name: "turn",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"protocol-fixtures.constants.js","sourceRoot":"","sources":["../../../src/adapters/agents/protocol-fixtures.constants.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,gBAAgB,GAEzB;IACF,KAAK,EAAE;QACL;YACE,IAAI,EAAE,MAAM;YACZ,KAAK,EAAE;gBACL,8DAA8D;gBAC9D,yFAAyF;gBACzF,mFAAmF;gBACnF,iGAAiG;aAClG;YACD,QAAQ,EAAE;gBACR,EAAE,IAAI,EAAE,cAAc,EAAE,EAAE,EAAE,sBAAsB,EAAE;gBACpD,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,iBAAiB,EAAE;gBAC3D,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,gBAAgB,EAAE;gBACxC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,EAAE;gBAC9D,EAAE,IAAI,EAAE,UAAU,EAAE;aACrB;SACF;QACD;YACE,IAAI,EAAE,SAAS;YACf,KAAK,EAAE,CAAC,8DAA8D,CAAC;YACvE,QAAQ,EAAE,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,iBAAiB,EAAE,CAAC;SAC5D;QACD;YACE,IAAI,EAAE,SAAS;YACf,KAAK,EAAE,CAAC,yBAAyB,EAAE,cAAc,CAAC;YAClD,QAAQ,EAAE;gBACR,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,cAAc,EAAE,EAAE;gBAChD,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,cAAc,EAAE;aACvC;SACF;KACF;IACD,MAAM,EAAE;QACN;YACE,IAAI,EAAE,MAAM;YACZ,KAAK,EAAE;gBACL,uDAAuD;gBACvD,qJAAqJ;gBACrJ,uJAAuJ;aACxJ;YACD,QAAQ,EAAE;gBACR,EAAE,IAAI,EAAE,cAAc,EAAE,EAAE,EAAE,sBAAsB,EAAE;gBACpD,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,iBAAiB,EAAE;gBAC3D,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,gBAAgB,EAAE;gBACxC,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,gBAAgB,EAAE;gBAC1C;oBACE,IAAI,EAAE,OAAO;oBACb,MAAM,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,YAAY,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE;iBAC7D;gBACD,EAAE,IAAI,EAAE,UAAU,EAAE;aACrB;SACF;QACD;YACE,IAAI,EAAE,SAAS;YACf,KAAK,EAAE,CAAC,8DAA8D,CAAC;YACvE,QAAQ,EAAE,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,iBAAiB,EAAE,CAAC;SAC5D;QACD;YACE,IAAI,EAAE,SAAS;YACf,KAAK,EAAE,CAAC,yBAAyB,EAAE,cAAc,CAAC;YAClD,QAAQ,EAAE;gBACR,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,cAAc,EAAE,EAAE;gBAChD,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,cAAc,EAAE;aACvC;SACF;KACF;CACF,CAAC","sourcesContent":["import type { AgentProtocolFixture } from \"./protocol-fixtures.types.ts\";\n\nexport const protocolFixtures: Readonly<\n Record<\"claude\" | \"codex\", readonly AgentProtocolFixture[]>\n> = {\n codex: [\n {\n name: \"turn\",\n lines: [\n '{\"type\":\"thread.started\",\"thread_id\":\"fixture-conversation\"}',\n '{\"type\":\"item.started\",\"item\":{\"type\":\"command_execution\",\"command\":\"fixture-command\"}}',\n '{\"type\":\"item.completed\",\"item\":{\"type\":\"agent_message\",\"text\":\"fixture-result\"}}',\n '{\"type\":\"turn.completed\",\"usage\":{\"input_tokens\":10,\"cached_input_tokens\":2,\"output_tokens\":3}}',\n ],\n expected: [\n { kind: \"conversation\", id: \"fixture-conversation\" },\n { kind: \"tool\", name: \"command\", input: \"fixture-command\" },\n { kind: \"text\", text: \"fixture-result\" },\n { kind: \"usage\", tokens: { input: 10, cached: 2, output: 3 } },\n { kind: \"finished\" },\n ],\n },\n {\n name: \"failure\",\n lines: ['{\"type\":\"turn.failed\",\"error\":{\"message\":\"fixture-failure\"}}'],\n expected: [{ kind: \"failure\", message: \"fixture-failure\" }],\n },\n {\n name: \"unknown\",\n lines: ['{\"type\":\"future.event\"}', \"invalid-json\"],\n expected: [\n { kind: \"raw\", value: { type: \"future.event\" } },\n { kind: \"raw\", value: \"invalid-json\" },\n ],\n },\n ],\n claude: [\n {\n name: \"turn\",\n lines: [\n '{\"type\":\"system\",\"session_id\":\"fixture-conversation\"}',\n '{\"type\":\"assistant\",\"message\":{\"content\":[{\"type\":\"tool_use\",\"name\":\"command\",\"input\":\"fixture-command\"},{\"type\":\"text\",\"text\":\"fixture-result\"}]}}',\n '{\"type\":\"result\",\"result\":\"fixture-result\",\"usage\":{\"input_tokens\":10,\"cache_creation_input_tokens\":1,\"cache_read_input_tokens\":2,\"output_tokens\":3}}',\n ],\n expected: [\n { kind: \"conversation\", id: \"fixture-conversation\" },\n { kind: \"tool\", name: \"command\", input: \"fixture-command\" },\n { kind: \"text\", text: \"fixture-result\" },\n { kind: \"result\", text: \"fixture-result\" },\n {\n kind: \"usage\",\n tokens: { input: 10, cached: 2, cacheCreated: 1, output: 3 },\n },\n { kind: \"finished\" },\n ],\n },\n {\n name: \"failure\",\n lines: ['{\"type\":\"result\",\"is_error\":true,\"result\":\"fixture-failure\"}'],\n expected: [{ kind: \"failure\", message: \"fixture-failure\" }],\n },\n {\n name: \"unknown\",\n lines: ['{\"type\":\"future.event\"}', \"invalid-json\"],\n expected: [\n { kind: \"raw\", value: { type: \"future.event\" } },\n { kind: \"raw\", value: \"invalid-json\" },\n ],\n },\n ],\n};\n"]}
|
|
1
|
+
{"version":3,"file":"protocol-fixtures.constants.js","sourceRoot":"","sources":["../../../src/adapters/agents/protocol-fixtures.constants.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,gBAAgB,GAEzB;IACF,MAAM,EAAE;QACN;YACE,IAAI,EAAE,MAAM;YACZ,KAAK,EAAE;gBACL,6EAA6E;gBAC7E,yGAAyG;gBACzG,+EAA+E;gBAC/E,+FAA+F;aAChG;YACD,QAAQ,EAAE;gBACR,EAAE,IAAI,EAAE,cAAc,EAAE,EAAE,EAAE,sBAAsB,EAAE;gBACpD;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,SAAS;oBACf,KAAK,EAAE,EAAE,OAAO,EAAE,iBAAiB,EAAE;iBACtC;gBACD,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,gBAAgB,EAAE;gBACxC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,EAAE;gBAC9D,EAAE,IAAI,EAAE,UAAU,EAAE;aACrB;SACF;QACD;YACE,IAAI,EAAE,SAAS;YACf,KAAK,EAAE;gBACL,0EAA0E;aAC3E;YACD,QAAQ,EAAE,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,iBAAiB,EAAE,CAAC;SAC5D;QACD;YACE,IAAI,EAAE,SAAS;YACf,KAAK,EAAE,CAAC,yBAAyB,EAAE,cAAc,CAAC;YAClD,QAAQ,EAAE;gBACR,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,cAAc,EAAE,EAAE;gBAChD,EAAE,IAAI,EAAE,KAAK,EAAE,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AM,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,iBAAiB,EAAE;gBAC3D,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,gBAAgB,EAAE;gBACxC,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,gBAAgB,EAAE;gBAC1C;oBACE,IAAI,EAAE,OAAO;oBACb,MAAM,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,YAAY,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE;iBAC7D;gBACD,EAAE,IAAI,EAAE,UAAU,EAAE;aACrB;SACF;QACD;YACE,IAAI,EAAE,SAAS;YACf,KAAK,EAAE,CAAC,8DAA8D,CAAC;YACvE,QAAQ,EAAE,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,iBAAiB,EAAE,CAAC;SAC5D;QACD;YACE,IAAI,EAAE,SAAS;YACf,KAAK,EAAE,CAAC,yBAAyB,EAAE,cAAc,CAAC;YAClD,QAAQ,EAAE;gBACR,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,cAAc,EAAE,EAAE;gBAChD,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,cAAc,EAAE;aACvC;SACF;KACF;CACF,CAAC","sourcesContent":["import type { AgentProtocolFixture } from \"./protocol-fixtures.types.ts\";\n\nexport const protocolFixtures: Readonly<\n Record<\"claude\" | \"codex\" | \"gemini\", readonly AgentProtocolFixture[]>\n> = {\n gemini: [\n {\n name: \"turn\",\n lines: [\n '{\"type\":\"init\",\"session_id\":\"fixture-conversation\",\"model\":\"fixture-model\"}',\n '{\"type\":\"tool_use\",\"tool_name\":\"command\",\"tool_id\":\"call-1\",\"parameters\":{\"command\":\"fixture-command\"}}',\n '{\"type\":\"message\",\"role\":\"assistant\",\"content\":\"fixture-result\",\"delta\":true}',\n '{\"type\":\"result\",\"status\":\"success\",\"stats\":{\"input_tokens\":10,\"cached\":2,\"output_tokens\":3}}',\n ],\n expected: [\n { kind: \"conversation\", id: \"fixture-conversation\" },\n {\n kind: \"tool\",\n name: \"command\",\n input: { command: \"fixture-command\" },\n },\n { kind: \"text\", text: \"fixture-result\" },\n { kind: \"usage\", tokens: { input: 10, cached: 2, output: 3 } },\n { kind: \"finished\" },\n ],\n },\n {\n name: \"failure\",\n lines: [\n '{\"type\":\"result\",\"status\":\"error\",\"error\":{\"message\":\"fixture-failure\"}}',\n ],\n expected: [{ kind: \"failure\", message: \"fixture-failure\" }],\n },\n {\n name: \"unknown\",\n lines: ['{\"type\":\"future.event\"}', \"invalid-json\"],\n expected: [\n { kind: \"raw\", value: { type: \"future.event\" } },\n { kind: \"raw\", value: \"invalid-json\" },\n ],\n },\n ],\n codex: [\n {\n name: \"turn\",\n lines: [\n '{\"type\":\"thread.started\",\"thread_id\":\"fixture-conversation\"}',\n '{\"type\":\"item.started\",\"item\":{\"type\":\"command_execution\",\"command\":\"fixture-command\"}}',\n '{\"type\":\"item.completed\",\"item\":{\"type\":\"agent_message\",\"text\":\"fixture-result\"}}',\n '{\"type\":\"turn.completed\",\"usage\":{\"input_tokens\":10,\"cached_input_tokens\":2,\"output_tokens\":3}}',\n ],\n expected: [\n { kind: \"conversation\", id: \"fixture-conversation\" },\n { kind: \"tool\", name: \"command\", input: \"fixture-command\" },\n { kind: \"text\", text: \"fixture-result\" },\n { kind: \"usage\", tokens: { input: 10, cached: 2, output: 3 } },\n { kind: \"finished\" },\n ],\n },\n {\n name: \"failure\",\n lines: ['{\"type\":\"turn.failed\",\"error\":{\"message\":\"fixture-failure\"}}'],\n expected: [{ kind: \"failure\", message: \"fixture-failure\" }],\n },\n {\n name: \"unknown\",\n lines: ['{\"type\":\"future.event\"}', \"invalid-json\"],\n expected: [\n { kind: \"raw\", value: { type: \"future.event\" } },\n { kind: \"raw\", value: \"invalid-json\" },\n ],\n },\n ],\n claude: [\n {\n name: \"turn\",\n lines: [\n '{\"type\":\"system\",\"session_id\":\"fixture-conversation\"}',\n '{\"type\":\"assistant\",\"message\":{\"content\":[{\"type\":\"tool_use\",\"name\":\"command\",\"input\":\"fixture-command\"},{\"type\":\"text\",\"text\":\"fixture-result\"}]}}',\n '{\"type\":\"result\",\"result\":\"fixture-result\",\"usage\":{\"input_tokens\":10,\"cache_creation_input_tokens\":1,\"cache_read_input_tokens\":2,\"output_tokens\":3}}',\n ],\n expected: [\n { kind: \"conversation\", id: \"fixture-conversation\" },\n { kind: \"tool\", name: \"command\", input: \"fixture-command\" },\n { kind: \"text\", text: \"fixture-result\" },\n { kind: \"result\", text: \"fixture-result\" },\n {\n kind: \"usage\",\n tokens: { input: 10, cached: 2, cacheCreated: 1, output: 3 },\n },\n { kind: \"finished\" },\n ],\n },\n {\n name: \"failure\",\n lines: ['{\"type\":\"result\",\"is_error\":true,\"result\":\"fixture-failure\"}'],\n expected: [{ kind: \"failure\", message: \"fixture-failure\" }],\n },\n {\n name: \"unknown\",\n lines: ['{\"type\":\"future.event\"}', \"invalid-json\"],\n expected: [\n { kind: \"raw\", value: { type: \"future.event\" } },\n { kind: \"raw\", value: \"invalid-json\" },\n ],\n },\n ],\n};\n"]}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { agentVersions } from "../providers/versions.js";
|
|
2
2
|
export const agentPackages = Object.freeze({
|
|
3
3
|
claude: `@anthropic-ai/claude-code@${agentVersions.claude}`,
|
|
4
|
+
gemini: `@google/gemini-cli@${agentVersions.gemini}`,
|
|
4
5
|
codex: `@openai/codex@${agentVersions.codex}`,
|
|
5
6
|
});
|
|
6
7
|
//# sourceMappingURL=agent-bootstrap.constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-bootstrap.constants.js","sourceRoot":"","sources":["../../src/application/agent-bootstrap.constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAEzD,MAAM,CAAC,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,CAAC;IACzC,MAAM,EAAE,6BAA6B,aAAa,CAAC,MAAM,EAAE;IAC3D,KAAK,EAAE,iBAAiB,aAAa,CAAC,KAAK,EAAE;CAC9C,CAAC,CAAC","sourcesContent":["import { agentVersions } from \"../providers/versions.ts\";\n\nexport const agentPackages = Object.freeze({\n claude: `@anthropic-ai/claude-code@${agentVersions.claude}`,\n codex: `@openai/codex@${agentVersions.codex}`,\n});\n"]}
|
|
1
|
+
{"version":3,"file":"agent-bootstrap.constants.js","sourceRoot":"","sources":["../../src/application/agent-bootstrap.constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAEzD,MAAM,CAAC,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,CAAC;IACzC,MAAM,EAAE,6BAA6B,aAAa,CAAC,MAAM,EAAE;IAC3D,MAAM,EAAE,sBAAsB,aAAa,CAAC,MAAM,EAAE;IACpD,KAAK,EAAE,iBAAiB,aAAa,CAAC,KAAK,EAAE;CAC9C,CAAC,CAAC","sourcesContent":["import { agentVersions } from \"../providers/versions.ts\";\n\nexport const agentPackages = Object.freeze({\n claude: `@anthropic-ai/claude-code@${agentVersions.claude}`,\n gemini: `@google/gemini-cli@${agentVersions.gemini}`,\n codex: `@openai/codex@${agentVersions.codex}`,\n});\n"]}
|
|
@@ -2,10 +2,14 @@ import { posix } from "node:path";
|
|
|
2
2
|
import { invariant } from "../domain/errors.js";
|
|
3
3
|
import { quote, requireSuccess } from "../infrastructure/process.js";
|
|
4
4
|
import { agentPackages } from "./agent-bootstrap.constants.js";
|
|
5
|
+
function isBootstrapAgent(name) {
|
|
6
|
+
return Object.hasOwn(agentPackages, name);
|
|
7
|
+
}
|
|
5
8
|
export async function prepareAdapter(agent, runtime, signal) {
|
|
6
|
-
|
|
9
|
+
const executable = agent.bootstrap ?? agent.conversations;
|
|
10
|
+
if (!executable)
|
|
7
11
|
return agent;
|
|
8
|
-
|
|
12
|
+
invariant(isBootstrapAgent(executable), `Unknown agent bootstrap: ${executable}`);
|
|
9
13
|
const cli = agentPackages[executable];
|
|
10
14
|
const prefix = posix.join(runtime.home, ".outpost-tools"), target = posix.join(prefix, "bin", executable);
|
|
11
15
|
const installed = await requireSuccess({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-bootstrap.js","sourceRoot":"","sources":["../../src/application/agent-bootstrap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAElC,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAEhD,OAAO,EAAE,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAE/D,MAAM,CAAC,KAAK,UAAU,cAAc,CAClC,KAAmB,EACnB,OAAqB,EACrB,MAAmB;IAEnB,
|
|
1
|
+
{"version":3,"file":"agent-bootstrap.js","sourceRoot":"","sources":["../../src/application/agent-bootstrap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAElC,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAEhD,OAAO,EAAE,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAE/D,SAAS,gBAAgB,CAAC,IAAY;IACpC,OAAO,MAAM,CAAC,MAAM,CAAC,aAAa,EAAE,IAAI,CAAC,CAAC;AAC5C,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,cAAc,CAClC,KAAmB,EACnB,OAAqB,EACrB,MAAmB;IAEnB,MAAM,UAAU,GAAG,KAAK,CAAC,SAAS,IAAI,KAAK,CAAC,aAAa,CAAC;IAC1D,IAAI,CAAC,UAAU;QAAE,OAAO,KAAK,CAAC;IAC9B,SAAS,CACP,gBAAgB,CAAC,UAAU,CAAC,EAC5B,4BAA4B,UAAU,EAAE,CACzC,CAAC;IACF,MAAM,GAAG,GAAG,aAAa,CAAC,UAAU,CAAC,CAAC;IACtC,MAAM,MAAM,GAAG,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,gBAAgB,CAAC,EACvD,MAAM,GAAG,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC;IACjD,MAAM,SAAS,GAAG,MAAM,cAAc,CACpC;QACE,UAAU,EAAE,IAAI;QAChB,SAAS,EAAE;YACT,IAAI;YACJ,iBAAiB,UAAU,qCAAqC,UAAU,kBAAkB,KAAK,CAAC,MAAM,CAAC,yBAAyB,KAAK,CAAC,MAAM,CAAC,kFAAkF,KAAK,CAAC,MAAM,CAAC,IAAI,GAAG,0BAA0B,KAAK,CAAC,MAAM,CAAC,MAAM;SACnS;QACD,MAAM;KACP,EACD,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAC7B,CAAC;IACF,MAAM,MAAM,GAAG,SAAS,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;IACvC,SAAS,CACP,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,EAChD,qDAAqD,CACtD,CAAC;IACF,OAAO;QACL,GAAG,KAAK;QACR,OAAO,CAAC,KAAK;YACX,OAAO,EAAE,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,UAAU,EAAE,MAAM,EAAE,CAAC;QACzD,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["import { posix } from \"node:path\";\nimport type { AgentAdapter } from \"../domain/agent.types.ts\";\nimport { invariant } from \"../domain/errors.ts\";\nimport type { SandboxLease } from \"../domain/sandbox.types.ts\";\nimport { quote, requireSuccess } from \"../infrastructure/process.ts\";\nimport { agentPackages } from \"./agent-bootstrap.constants.ts\";\n\nfunction isBootstrapAgent(name: string): name is keyof typeof agentPackages {\n return Object.hasOwn(agentPackages, name);\n}\n\nexport async function prepareAdapter(\n agent: AgentAdapter,\n runtime: SandboxLease,\n signal: AbortSignal,\n): Promise<AgentAdapter> {\n const executable = agent.bootstrap ?? agent.conversations;\n if (!executable) return agent;\n invariant(\n isBootstrapAgent(executable),\n `Unknown agent bootstrap: ${executable}`,\n );\n const cli = agentPackages[executable];\n const prefix = posix.join(runtime.home, \".outpost-tools\"),\n target = posix.join(prefix, \"bin\", executable);\n const installed = await requireSuccess(\n {\n executable: \"sh\",\n arguments: [\n \"-c\",\n `if command -v ${executable} >/dev/null 2>&1; then command -v ${executable}; elif test -x ${quote(target)}; then printf '%s\\\\n' ${quote(target)}; else npm install --global --allow-scripts=@anthropic-ai/claude-code --prefix ${quote(prefix)} ${cli} >&2 && printf '%s\\\\n' ${quote(target)}; fi`,\n ],\n signal,\n },\n runtime.invoke.bind(runtime),\n );\n const binary = installed.stdout.trim();\n invariant(\n binary.startsWith(\"/\") && !binary.includes(\"\\n\"),\n \"Agent bootstrap returned an invalid executable path\",\n );\n return {\n ...agent,\n request(input) {\n return { ...agent.request(input), executable: binary };\n },\n };\n}\n"]}
|
|
@@ -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,qBAAqB,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAE7D,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE1C,MAAM,UAAU,WAAW,CACzB,KAAmB,EACnB,OAAiC,EACjC,OAA0B,EAC1B,IAAY;IAEZ,IAAI,OAAO,GAAG,EAAE,EACd,IAAI,GAAG,EAAE,EACT,OAAO,GAAG,EAAE,CAAC;IACf,IAAI,SAA6B,EAC/B,YAAgC,EAChC,OAA2B,CAAC;IAC9B,IAAI,KAAK,GAAU,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,CAA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,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC;gBAC1C,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC;gBAC/B,OAAO,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC;YACnC,CAAC;YACD,IAAI,OAAO,CAAC,MAAM,GAAG,iBAAiB,CAAC,UAAU;gBAC/C,MAAM,IAAI,YAAY,CAAC,SAAS,EAAE,kCAAkC,CAAC,CAAC;QAC1E,CAAC;QACD,KAAK;YACH,IAAI,OAAO;gBAAE,OAAO,CAAC,OAAO,CAAC,CAAC;YAC9B,OAAO,GAAG,EAAE,CAAC;QACf,CAAC;QACD,MAAM;YACJ,IAAI,OAAO;gBAAE,MAAM,IAAI,YAAY,CAAC,SAAS,EAAE,OAAO,EAAE,EAAE,YAAY,EAAE,CAAC,CAAC;YAC1E,IAAI,KAAK,CAAC,qBAAqB,IAAI,CAAC,QAAQ;gBAC1C,MAAM,IAAI,YAAY,CACpB,SAAS,EACT,+CAA+C,EAC/C,EAAE,YAAY,EAAE,CACjB,CAAC;YACJ,OAAO;gBACL,IAAI,EAAE,SAAS,IAAI,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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esContent":["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"]}
|
|
@@ -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,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,iBAAiB,CAAC,MAAM,EAAE,QAAQ,CAAC,CAA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AAM,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,iBAAiB,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IAC/D,SAAS,CACP,MAAM,CAAC,aAAa,CAAC,OAAO,CAAC,MAAM,IAAI,iBAAiB,CAAC,MAAM,CAAC,EAChE,2BAA2B,CAC5B,CAAC;IACF,KAAK,MAAM,GAAG,IAAI,iBAAiB;QACjC,IAAI,OAAO,CAAC,GAAG,CAAC,KAAK,SAAS;YAAE,QAAQ,C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K,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"]}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { claudeDiagnostics } from "../adapters/agents/claude-diagnostics.ts";
|
|
2
2
|
import { codexDiagnostics } from "../adapters/agents/codex-diagnostics.ts";
|
|
3
|
+
import { geminiDiagnostics } from "../adapters/agents/gemini-diagnostics.ts";
|
|
3
4
|
export declare const agentDiagnosticPlans: {
|
|
5
|
+
readonly gemini: typeof geminiDiagnostics;
|
|
4
6
|
readonly claude: typeof claudeDiagnostics;
|
|
5
7
|
readonly codex: typeof codexDiagnostics;
|
|
6
8
|
};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { claudeDiagnostics } from "../adapters/agents/claude-diagnostics.js";
|
|
2
2
|
import { codexDiagnostics } from "../adapters/agents/codex-diagnostics.js";
|
|
3
|
+
import { geminiDiagnostics } from "../adapters/agents/gemini-diagnostics.js";
|
|
3
4
|
export const agentDiagnosticPlans = {
|
|
5
|
+
gemini: geminiDiagnostics,
|
|
4
6
|
claude: claudeDiagnostics,
|
|
5
7
|
codex: codexDiagnostics,
|
|
6
8
|
};
|
|
@@ -1 +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;
|
|
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"]}
|
|
@@ -9,7 +9,7 @@ export async function diagnoseAgentCli(agent, execute) {
|
|
|
9
9
|
id: `agent.cli.${plan.mode}`,
|
|
10
10
|
command: { ...plan.command, retain: agentDiagnosticDefaults.retain },
|
|
11
11
|
failureStatus: "fail",
|
|
12
|
-
remedy: "The
|
|
12
|
+
remedy: "The agent CLI help command failed. Check the agent CLI in this image and rebuild it if needed.",
|
|
13
13
|
}, async (command) => {
|
|
14
14
|
const result = await execute(command);
|
|
15
15
|
help = stripVTControlCharacters(`${result.stdout}\n${result.stderr}`);
|