@elie-laloum/outpost 1.1.4 → 3.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 +35 -0
- package/README.md +12 -6
- 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/protocol-fixtures.constants.d.ts +2 -0
- package/dist/adapters/agents/protocol-fixtures.constants.js +68 -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/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/doctor-agent.constants.d.ts +9 -0
- package/dist/application/doctor-agent.constants.js +8 -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 +29 -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 +2 -0
- package/dist/application/outpost.types.js.map +1 -1
- 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 +27 -0
- package/dist/application/recovery-inspection.js.map +1 -0
- package/dist/application/recovery-inspection.types.d.ts +15 -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-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 +202 -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 +2 -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 +24 -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 +36 -4
- package/dist/application/remote-download.js.map +1 -1
- package/dist/application/remote-validation.js +19 -0
- 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 +6 -0
- 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.js +11 -0
- package/dist/application/sandbox.js.map +1 -1
- 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/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/image.js +1 -1
- package/dist/cli/image.js.map +1 -1
- package/dist/cli/init-command.js +4 -3
- package/dist/cli/init-command.js.map +1 -1
- package/dist/cli/main.constants.d.ts +29 -8
- package/dist/cli/main.constants.js +19 -7
- package/dist/cli/main.constants.js.map +1 -1
- package/dist/cli/project-settings.js +8 -2
- package/dist/cli/project-settings.js.map +1 -1
- package/dist/cli/recovery-command.d.ts +2 -0
- package/dist/cli/recovery-command.js +69 -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-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.d.ts +1 -1
- package/dist/cli/scaffold-files.js +26 -20
- package/dist/cli/scaffold-files.js.map +1 -1
- package/dist/cli/scaffold-validation.js +2 -5
- package/dist/cli/scaffold-validation.js.map +1 -1
- package/dist/cli/scaffold.constants.d.ts +0 -2
- package/dist/cli/scaffold.constants.js +1 -13
- package/dist/cli/scaffold.constants.js.map +1 -1
- package/dist/cli/scaffold.d.ts +1 -1
- package/dist/cli/scaffold.js +37 -29
- package/dist/cli/scaffold.js.map +1 -1
- package/dist/cli/scaffold.types.d.ts +3 -5
- package/dist/cli/scaffold.types.js.map +1 -1
- package/dist/cli/starters.d.ts +1 -2
- package/dist/cli/starters.js +42 -30
- package/dist/cli/starters.js.map +1 -1
- package/dist/domain/ports.d.ts +1 -1
- package/dist/domain/ports.js.map +1 -1
- package/dist/domain/sandbox.types.d.ts +12 -0
- package/dist/domain/sandbox.types.js.map +1 -1
- 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 +67 -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/task-runner.js +8 -1
- package/dist/domain/workflow/task-runner.js.map +1 -1
- package/dist/domain/workflow/workflow-scheduler.js +4 -2
- package/dist/domain/workflow/workflow-scheduler.js.map +1 -1
- package/dist/domain/workflow/workflow-state.js +29 -0
- 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 +10 -1
- package/dist/domain/workflow.types.js.map +1 -1
- package/dist/index.d.ts +12 -8
- package/dist/index.js +5 -3
- package/dist/index.js.map +1 -1
- package/dist/infrastructure/file-manifest.d.ts +6 -0
- package/dist/infrastructure/file-manifest.js +91 -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 +36 -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/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/transfer.js +12 -0
- package/dist/infrastructure/transfer.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-plan.js +3 -1
- package/dist/providers/container-plan.js.map +1 -1
- package/dist/providers/container.js +31 -1
- package/dist/providers/container.js.map +1 -1
- package/dist/providers/container.types.d.ts +2 -0
- package/dist/providers/container.types.js.map +1 -1
- package/dist/providers/daytona-command.js +7 -4
- package/dist/providers/daytona-command.js.map +1 -1
- package/dist/providers/daytona.js +13 -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 +1 -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 +151 -0
- package/dist/providers/file-batches.js.map +1 -0
- package/dist/providers/podman.d.ts +1 -0
- package/dist/providers/podman.js.map +1 -1
- package/dist/providers/vercel.js +3 -1
- package/dist/providers/vercel.js.map +1 -1
- package/package.json +12 -1
- package/dist/adapters/backlogs/backlog.constants.d.ts +0 -4
- package/dist/adapters/backlogs/backlog.constants.js +0 -5
- package/dist/adapters/backlogs/backlog.constants.js.map +0 -1
- package/dist/adapters/backlogs/beads-adapter.d.ts +0 -4
- package/dist/adapters/backlogs/beads-adapter.js +0 -31
- package/dist/adapters/backlogs/beads-adapter.js.map +0 -1
- package/dist/adapters/backlogs/cli.d.ts +0 -3
- package/dist/adapters/backlogs/cli.js +0 -20
- package/dist/adapters/backlogs/cli.js.map +0 -1
- package/dist/adapters/backlogs/github-adapter.d.ts +0 -4
- package/dist/adapters/backlogs/github-adapter.js +0 -28
- package/dist/adapters/backlogs/github-adapter.js.map +0 -1
- package/dist/adapters/backlogs/issue.d.ts +0 -2
- package/dist/adapters/backlogs/issue.js +0 -13
- package/dist/adapters/backlogs/issue.js.map +0 -1
- package/dist/adapters/backlogs/settings.types.d.ts +0 -5
- package/dist/adapters/backlogs/settings.types.js +0 -2
- package/dist/adapters/backlogs/settings.types.js.map +0 -1
- package/dist/application/campaign-integration.d.ts +0 -2
- package/dist/application/campaign-integration.js +0 -44
- package/dist/application/campaign-integration.js.map +0 -1
- package/dist/application/campaign-planner.d.ts +0 -3
- package/dist/application/campaign-planner.js +0 -35
- package/dist/application/campaign-planner.js.map +0 -1
- package/dist/application/campaign-worker.d.ts +0 -3
- package/dist/application/campaign-worker.js +0 -54
- package/dist/application/campaign-worker.js.map +0 -1
- package/dist/application/campaign.constants.d.ts +0 -7
- package/dist/application/campaign.constants.js +0 -8
- package/dist/application/campaign.constants.js.map +0 -1
- package/dist/application/campaign.d.ts +0 -3
- package/dist/application/campaign.js +0 -96
- package/dist/application/campaign.js.map +0 -1
- package/dist/application/campaign.types.d.ts +0 -43
- package/dist/application/campaign.types.js +0 -2
- package/dist/application/campaign.types.js.map +0 -1
- package/dist/domain/backlog.d.ts +0 -3
- package/dist/domain/backlog.js +0 -23
- package/dist/domain/backlog.js.map +0 -1
- package/dist/domain/backlog.types.d.ts +0 -15
- package/dist/domain/backlog.types.js +0 -2
- package/dist/domain/backlog.types.js.map +0 -1
- package/dist/providers/backlogs.d.ts +0 -3
- package/dist/providers/backlogs.js +0 -3
- package/dist/providers/backlogs.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,40 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 3.0.0
|
|
4
|
+
|
|
5
|
+
- Canonicalize temporary recovery verification directories across platforms and reuse existing Podman cache volumes without recreation.
|
|
6
|
+
- Breaking: custom implementations of `Sandbox`, `TaskContext` and `WorkflowResult` must provide `diagnose`, `reportUsage` and `usage`, respectively; exhaustive workflow observers must handle the new `attempt` and `usage` events. Factory-created objects provide these members automatically.
|
|
7
|
+
- Treat uncertain or legacy lock ownership conservatively; simultaneous writers to the same configured journal now conflict instead of sharing the file.
|
|
8
|
+
- Add shared workflow attempt and observed usage budgets, including retries and agent repairs, with graceful admission draining and cooperative token-limit cancellation.
|
|
9
|
+
- Add structured workflow usage/lifecycle events and an optional OpenTelemetry entry point with injected tracer/meter, fixed span names, counters and duration histograms without task contents or identifiers.
|
|
10
|
+
- Diagnose caller-owned sandboxes through an exclusive operation, with optional binary transfer probes and cleanup; report observed capabilities separately from advertised contracts and bundled agent protocol fixture checks.
|
|
11
|
+
- Add credential-free cloud contract fixtures and explicitly enabled scheduled Vercel/Daytona checks with sanitized reports, independent cleanup and optional live CLI syntax probes; authenticated model turns remain outside this suite.
|
|
12
|
+
- Wait for Daytona command exit status after output closes, and register allocation cleanup before discovering the sandbox home.
|
|
13
|
+
- Add explicit recovery retention plans, revalidated cleanup and quota admission; protect recovery artifacts, uncertain logs and workspaces containing ignored files.
|
|
14
|
+
- Observe lock ownership using Linux host, boot, namespace and process-start identity; serialize stale-lock reclamation and refuse uncertain owners.
|
|
15
|
+
- Verify retained Git bundles, objects and patch applicability in an isolated copy without inherited Git filters or changes to the source repository.
|
|
16
|
+
- Add opt-in Docker/Podman dependency caches with explicit invalidation keys and repository, image and user scoping; add pinned agent-image build tooling and a gated publication workflow with signed provenance verification.
|
|
17
|
+
- Download changed untracked files from Vercel/Daytona using SHA-256 manifests and bounded gzip batches; reuse verified unchanged files while retaining complete recovery payloads and protecting ignored host files.
|
|
18
|
+
- Record atomic SHA-256 manifests for new remote transfer backups before host apply; add opt-in `recovery verify --checksums` with bounded streaming verification, explicit missing/mismatched results and preserved host state on capture failure.
|
|
19
|
+
- Add read-only `recovery verify --directory` checks for retained transfer metadata and required backup files, with bounded state parsing and explicit separation from content integrity or restoration validation.
|
|
20
|
+
- Add optional `recovery inspect --locks` with bounded lock metadata reads and local PID observations; report invalid or unverifiable records explicitly without claiming ownership or deleting locks.
|
|
21
|
+
- Add optional `recovery inspect --git` workspace reports with branch/detached HEAD, clean/dirty status, Git locks and explicit unregistered/unavailable states, without refreshing indexes or pruning registrations.
|
|
22
|
+
- Add read-only `outpost recovery inspect` reports for recovery files, logs, locks and managed workspaces, with metadata-only logical sizes, symlink protection and explicit partial results when traversal limits or filesystem errors prevent a complete inventory.
|
|
23
|
+
- Check default agent start/resume/fork CLI help inside diagnostic images, verifying command usage and declared options instead of trusting a successful help exit; keep real execution and protocol compatibility explicitly unverified.
|
|
24
|
+
- Extend `doctor --image` to check a local Docker/Podman image in a temporary sandbox, without image downloads or networking; report image agent versions and cleanup failures separately from host checks.
|
|
25
|
+
- Add `outpost doctor` with bounded host prerequisite checks, Docker/Podman connectivity, host agent version comparison, explicit unchecked capabilities and JSON reports.
|
|
26
|
+
|
|
27
|
+
## 2.0.0
|
|
28
|
+
|
|
29
|
+
- Normalize the workflow test directory before computing relative repository paths, fixing macOS CI with symlinked temporary directories.
|
|
30
|
+
- Show live agent progress in generated starters and report cancellation recovery details without an uncaught error stack trace.
|
|
31
|
+
- Document workflow directories, repository path resolution and multi-repository task ownership in English and French.
|
|
32
|
+
- Generate standalone workflow projects directly in the chosen directory, with `run.ts`, a default package manifest and preserved existing package/ignore files.
|
|
33
|
+
- Add `init --repository` for external repositories; resolve generated brief/environment paths from the script and pin the workflow container image independently of the target repository.
|
|
34
|
+
- Read image build recipes from the workflow root; older layouts can use `--file .outpost/Dockerfile`.
|
|
35
|
+
- Remove issue campaigns, GitHub/Beads/custom backlog connectors and their public types.
|
|
36
|
+
- Simplify initialization to a dispatch starter; remove campaign templates, `--template`, `--tracker`, `--label`, tracker files and GitHub/Beads CLI installation.
|
|
37
|
+
|
|
3
38
|
## 1.1.4
|
|
4
39
|
|
|
5
40
|
- Wait for noninteractive container commands and preserve their real exit status; reuse the runtime terminal for interactive commands.
|
package/README.md
CHANGED
|
@@ -6,20 +6,23 @@ Outpost is a TypeScript library for running coding agents in reusable sandboxes,
|
|
|
6
6
|
|
|
7
7
|
## Get started
|
|
8
8
|
|
|
9
|
-
Requires Node.js **24+**, Git,
|
|
9
|
+
Requires Node.js **24+**, Git, a target repository with a commit, and the credentials of your chosen agent. The workflow can live in its own directory. This example uses Docker.
|
|
10
10
|
|
|
11
11
|
```sh
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
mkdir workflow1
|
|
13
|
+
cd workflow1
|
|
14
|
+
npx @elie-laloum/outpost init --yes --repository /path1/repository --install --build
|
|
14
15
|
```
|
|
15
16
|
|
|
16
|
-
Copy `.
|
|
17
|
+
Copy `.env.example` to `.env` and declare `OPENAI_API_KEY`. An empty declaration inherits the matching process variable. Then run the generated script:
|
|
17
18
|
|
|
18
19
|
```sh
|
|
19
|
-
node
|
|
20
|
+
node run.ts "Add validation, run tests and commit the change"
|
|
20
21
|
```
|
|
21
22
|
|
|
22
|
-
|
|
23
|
+
`init` creates `package.json`, `run.ts`, `brief.md`, `.env.example`, `.gitignore` and a container recipe directly in the workflow directory. Existing package manifests are preserved; explicit CommonJS projects get `run.mts` for compatibility. The script resolves its brief, environment and relative repository paths from its own directory. See [multi-repository workflows](https://elie-laloum.github.io/outpost/workflows/sandbox-tasks/) to orchestrate several repositories.
|
|
24
|
+
|
|
25
|
+
For Codex API-key authentication, add the login hook from [Connect Codex](https://elie-laloum.github.io/outpost/agents/connect-codex/) before dispatching.
|
|
23
26
|
|
|
24
27
|
## Use the library
|
|
25
28
|
|
|
@@ -27,6 +30,7 @@ Use `run.ts` for a project with `"type": "module"`; initialization prints the ex
|
|
|
27
30
|
import { dispatch, codex } from "@elie-laloum/outpost";
|
|
28
31
|
|
|
29
32
|
const result = await dispatch({
|
|
33
|
+
repository: "/path1/repository",
|
|
30
34
|
agent: codex(),
|
|
31
35
|
branch: { mode: "integrate" },
|
|
32
36
|
brief: { text: "Fix the failing tests, verify and commit." },
|
|
@@ -34,6 +38,8 @@ const result = await dispatch({
|
|
|
34
38
|
console.log(result.branch, result.commits);
|
|
35
39
|
```
|
|
36
40
|
|
|
41
|
+
`repository` selects a local Git checkout; without it, library calls use the current working directory. See [repository paths](https://elie-laloum.github.io/outpost/sandboxes/repositories/) for external checkouts and paths relative to the workflow script.
|
|
42
|
+
|
|
37
43
|
Learn about [sandboxes](https://elie-laloum.github.io/outpost/sandboxes/lifecycle/), [workflows](https://elie-laloum.github.io/outpost/workflows/graph/), [providers](https://elie-laloum.github.io/outpost/providers/overview/) and [recovery](https://elie-laloum.github.io/outpost/operations/recovery/) in the English/French documentation. The [roadmap](https://elie-laloum.github.io/outpost/project/roadmap/) describes future work.
|
|
38
44
|
|
|
39
45
|
## Development
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function claudeDiagnostics(): readonly import("./cli-diagnostics.types.ts").AgentCliDiagnostic[];
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { claudeDiagnosticUsage } from "./cli-diagnostics.constants.js";
|
|
2
|
+
import { cliDiagnostics } from "./cli-diagnostics.js";
|
|
3
|
+
import { claudeRequest } from "./claude-request.js";
|
|
4
|
+
export function claudeDiagnostics() {
|
|
5
|
+
return cliDiagnostics((input) => claudeRequest({}, input), claudeDiagnosticUsage);
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=claude-diagnostics.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claude-diagnostics.js","sourceRoot":"","sources":["../../../src/adapters/agents/claude-diagnostics.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AACvE,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,MAAM,UAAU,iBAAiB;IAC/B,OAAO,cAAc,CACnB,CAAC,KAAK,EAAE,EAAE,CAAC,aAAa,CAAC,EAAE,EAAE,KAAK,CAAC,EACnC,qBAAqB,CACtB,CAAC;AACJ,CAAC","sourcesContent":["import { claudeDiagnosticUsage } from \"./cli-diagnostics.constants.ts\";\nimport { cliDiagnostics } from \"./cli-diagnostics.ts\";\nimport { claudeRequest } from \"./claude-request.ts\";\n\nexport function claudeDiagnostics() {\n return cliDiagnostics(\n (input) => claudeRequest({}, input),\n claudeDiagnosticUsage,\n );\n}\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { AgentCliScenario } from "./cli-diagnostics.types.ts";
|
|
2
|
+
export declare const cliDiagnosticScenarios: readonly AgentCliScenario[];
|
|
3
|
+
export declare const codexDiagnosticUsage: {
|
|
4
|
+
readonly start: "codex exec";
|
|
5
|
+
readonly resume: "codex exec resume";
|
|
6
|
+
readonly fork: "codex exec fork";
|
|
7
|
+
};
|
|
8
|
+
export declare const claudeDiagnosticUsage: {
|
|
9
|
+
readonly start: "claude";
|
|
10
|
+
readonly resume: "claude";
|
|
11
|
+
readonly fork: "claude";
|
|
12
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export const cliDiagnosticScenarios = [
|
|
2
|
+
{ mode: "start", input: {} },
|
|
3
|
+
{
|
|
4
|
+
mode: "resume",
|
|
5
|
+
input: { continuation: { id: "00000000-0000-0000-0000-000000000000" } },
|
|
6
|
+
},
|
|
7
|
+
{
|
|
8
|
+
mode: "fork",
|
|
9
|
+
input: {
|
|
10
|
+
continuation: { id: "00000000-0000-0000-0000-000000000000", fork: true },
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
];
|
|
14
|
+
export const codexDiagnosticUsage = {
|
|
15
|
+
start: "codex exec",
|
|
16
|
+
resume: "codex exec resume",
|
|
17
|
+
fork: "codex exec fork",
|
|
18
|
+
};
|
|
19
|
+
export const claudeDiagnosticUsage = {
|
|
20
|
+
start: "claude",
|
|
21
|
+
resume: "claude",
|
|
22
|
+
fork: "claude",
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=cli-diagnostics.constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-diagnostics.constants.js","sourceRoot":"","sources":["../../../src/adapters/agents/cli-diagnostics.constants.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,sBAAsB,GAAgC;IACjE,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE;IAC5B;QACE,IAAI,EAAE,QAAQ;QACd,KAAK,EAAE,EAAE,YAAY,EAAE,EAAE,EAAE,EAAE,sCAAsC,EAAE,EAAE;KACxE;IACD;QACE,IAAI,EAAE,MAAM;QACZ,KAAK,EAAE;YACL,YAAY,EAAE,EAAE,EAAE,EAAE,sCAAsC,EAAE,IAAI,EAAE,IAAI,EAAE;SACzE;KACF;CACF,CAAC;AACF,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,KAAK,EAAE,YAAY;IACnB,MAAM,EAAE,mBAAmB;IAC3B,IAAI,EAAE,iBAAiB;CACf,CAAC;AACX,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,KAAK,EAAE,QAAQ;IACf,MAAM,EAAE,QAAQ;IAChB,IAAI,EAAE,QAAQ;CACN,CAAC","sourcesContent":["import type { AgentCliScenario } from \"./cli-diagnostics.types.ts\";\n\nexport const cliDiagnosticScenarios: readonly AgentCliScenario[] = [\n { mode: \"start\", input: {} },\n {\n mode: \"resume\",\n input: { continuation: { id: \"00000000-0000-0000-0000-000000000000\" } },\n },\n {\n mode: \"fork\",\n input: {\n continuation: { id: \"00000000-0000-0000-0000-000000000000\", fork: true },\n },\n },\n];\nexport const codexDiagnosticUsage = {\n start: \"codex exec\",\n resume: \"codex exec resume\",\n fork: \"codex exec fork\",\n} as const;\nexport const claudeDiagnosticUsage = {\n start: \"claude\",\n resume: \"claude\",\n fork: \"claude\",\n} as const;\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 { AgentCliDiagnostic, AgentCliMode } from "./cli-diagnostics.types.ts";
|
|
4
|
+
export declare function cliDiagnostics(request: (input: AgentInput) => Command, usage: Readonly<Record<AgentCliMode, string>>): readonly AgentCliDiagnostic[];
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { cliDiagnosticScenarios } from "./cli-diagnostics.constants.js";
|
|
2
|
+
export function cliDiagnostics(request, usage) {
|
|
3
|
+
return cliDiagnosticScenarios.map(({ mode, input }) => {
|
|
4
|
+
const command = request(input);
|
|
5
|
+
const args = command.arguments ?? [];
|
|
6
|
+
return {
|
|
7
|
+
mode,
|
|
8
|
+
usage: usage[mode],
|
|
9
|
+
options: args.filter((argument) => argument.startsWith("--")),
|
|
10
|
+
command: { ...command, arguments: [...args, "--help"] },
|
|
11
|
+
};
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=cli-diagnostics.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-diagnostics.js","sourceRoot":"","sources":["../../../src/adapters/agents/cli-diagnostics.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AAMxE,MAAM,UAAU,cAAc,CAC5B,OAAuC,EACvC,KAA6C;IAE7C,OAAO,sBAAsB,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,EAAE;QACpD,MAAM,OAAO,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;QAC/B,MAAM,IAAI,GAAG,OAAO,CAAC,SAAS,IAAI,EAAE,CAAC;QACrC,OAAO;YACL,IAAI;YACJ,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC;YAClB,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;YAC7D,OAAO,EAAE,EAAE,GAAG,OAAO,EAAE,SAAS,EAAE,CAAC,GAAG,IAAI,EAAE,QAAQ,CAAC,EAAE;SACxD,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import type { AgentInput } from \"../../domain/agent.types.ts\";\nimport type { Command } from \"../../domain/command.types.ts\";\nimport { cliDiagnosticScenarios } from \"./cli-diagnostics.constants.ts\";\nimport type {\n AgentCliDiagnostic,\n AgentCliMode,\n} from \"./cli-diagnostics.types.ts\";\n\nexport function cliDiagnostics(\n request: (input: AgentInput) => Command,\n usage: Readonly<Record<AgentCliMode, string>>,\n): readonly AgentCliDiagnostic[] {\n return cliDiagnosticScenarios.map(({ mode, input }) => {\n const command = request(input);\n const args = command.arguments ?? [];\n return {\n mode,\n usage: usage[mode],\n options: args.filter((argument) => argument.startsWith(\"--\")),\n command: { ...command, arguments: [...args, \"--help\"] },\n };\n });\n}\n"]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { AgentInput } from "../../domain/agent.types.ts";
|
|
2
|
+
import type { Command } from "../../domain/command.types.ts";
|
|
3
|
+
export type AgentCliMode = "start" | "resume" | "fork";
|
|
4
|
+
export interface AgentCliScenario {
|
|
5
|
+
readonly mode: AgentCliMode;
|
|
6
|
+
readonly input: AgentInput;
|
|
7
|
+
}
|
|
8
|
+
export interface AgentCliDiagnostic {
|
|
9
|
+
readonly mode: AgentCliMode;
|
|
10
|
+
readonly command: Command;
|
|
11
|
+
readonly usage: string;
|
|
12
|
+
readonly options: readonly string[];
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-diagnostics.types.js","sourceRoot":"","sources":["../../../src/adapters/agents/cli-diagnostics.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { AgentInput } from \"../../domain/agent.types.ts\";\nimport type { Command } from \"../../domain/command.types.ts\";\n\nexport type AgentCliMode = \"start\" | \"resume\" | \"fork\";\nexport interface AgentCliScenario {\n readonly mode: AgentCliMode;\n readonly input: AgentInput;\n}\nexport interface AgentCliDiagnostic {\n readonly mode: AgentCliMode;\n readonly command: Command;\n readonly usage: string;\n readonly options: readonly string[];\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function codexDiagnostics(): readonly import("./cli-diagnostics.types.ts").AgentCliDiagnostic[];
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { codexDiagnosticUsage } from "./cli-diagnostics.constants.js";
|
|
2
|
+
import { cliDiagnostics } from "./cli-diagnostics.js";
|
|
3
|
+
import { codexRequest } from "./codex-request.js";
|
|
4
|
+
export function codexDiagnostics() {
|
|
5
|
+
return cliDiagnostics((input) => codexRequest({}, input), codexDiagnosticUsage);
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=codex-diagnostics.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codex-diagnostics.js","sourceRoot":"","sources":["../../../src/adapters/agents/codex-diagnostics.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AACtE,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,MAAM,UAAU,gBAAgB;IAC9B,OAAO,cAAc,CACnB,CAAC,KAAK,EAAE,EAAE,CAAC,YAAY,CAAC,EAAE,EAAE,KAAK,CAAC,EAClC,oBAAoB,CACrB,CAAC;AACJ,CAAC","sourcesContent":["import { codexDiagnosticUsage } from \"./cli-diagnostics.constants.ts\";\nimport { cliDiagnostics } from \"./cli-diagnostics.ts\";\nimport { codexRequest } from \"./codex-request.ts\";\n\nexport function codexDiagnostics() {\n return cliDiagnostics(\n (input) => codexRequest({}, input),\n codexDiagnosticUsage,\n );\n}\n"]}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
export const protocolFixtures = {
|
|
2
|
+
codex: [
|
|
3
|
+
{
|
|
4
|
+
name: "turn",
|
|
5
|
+
lines: [
|
|
6
|
+
'{"type":"thread.started","thread_id":"fixture-conversation"}',
|
|
7
|
+
'{"type":"item.started","item":{"type":"command_execution","command":"fixture-command"}}',
|
|
8
|
+
'{"type":"item.completed","item":{"type":"agent_message","text":"fixture-result"}}',
|
|
9
|
+
'{"type":"turn.completed","usage":{"input_tokens":10,"cached_input_tokens":2,"output_tokens":3}}',
|
|
10
|
+
],
|
|
11
|
+
expected: [
|
|
12
|
+
{ kind: "conversation", id: "fixture-conversation" },
|
|
13
|
+
{ kind: "tool", name: "command", input: "fixture-command" },
|
|
14
|
+
{ kind: "text", text: "fixture-result" },
|
|
15
|
+
{ kind: "usage", tokens: { input: 10, cached: 2, output: 3 } },
|
|
16
|
+
{ kind: "finished" },
|
|
17
|
+
],
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
name: "failure",
|
|
21
|
+
lines: ['{"type":"turn.failed","error":{"message":"fixture-failure"}}'],
|
|
22
|
+
expected: [{ kind: "failure", message: "fixture-failure" }],
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
name: "unknown",
|
|
26
|
+
lines: ['{"type":"future.event"}', "invalid-json"],
|
|
27
|
+
expected: [
|
|
28
|
+
{ kind: "raw", value: { type: "future.event" } },
|
|
29
|
+
{ kind: "raw", value: "invalid-json" },
|
|
30
|
+
],
|
|
31
|
+
},
|
|
32
|
+
],
|
|
33
|
+
claude: [
|
|
34
|
+
{
|
|
35
|
+
name: "turn",
|
|
36
|
+
lines: [
|
|
37
|
+
'{"type":"system","session_id":"fixture-conversation"}',
|
|
38
|
+
'{"type":"assistant","message":{"content":[{"type":"tool_use","name":"command","input":"fixture-command"},{"type":"text","text":"fixture-result"}]}}',
|
|
39
|
+
'{"type":"result","result":"fixture-result","usage":{"input_tokens":10,"cache_creation_input_tokens":1,"cache_read_input_tokens":2,"output_tokens":3}}',
|
|
40
|
+
],
|
|
41
|
+
expected: [
|
|
42
|
+
{ kind: "conversation", id: "fixture-conversation" },
|
|
43
|
+
{ kind: "tool", name: "command", input: "fixture-command" },
|
|
44
|
+
{ kind: "text", text: "fixture-result" },
|
|
45
|
+
{ kind: "result", text: "fixture-result" },
|
|
46
|
+
{
|
|
47
|
+
kind: "usage",
|
|
48
|
+
tokens: { input: 10, cached: 2, cacheCreated: 1, output: 3 },
|
|
49
|
+
},
|
|
50
|
+
{ kind: "finished" },
|
|
51
|
+
],
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
name: "failure",
|
|
55
|
+
lines: ['{"type":"result","is_error":true,"result":"fixture-failure"}'],
|
|
56
|
+
expected: [{ kind: "failure", message: "fixture-failure" }],
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
name: "unknown",
|
|
60
|
+
lines: ['{"type":"future.event"}', "invalid-json"],
|
|
61
|
+
expected: [
|
|
62
|
+
{ kind: "raw", value: { type: "future.event" } },
|
|
63
|
+
{ kind: "raw", value: "invalid-json" },
|
|
64
|
+
],
|
|
65
|
+
},
|
|
66
|
+
],
|
|
67
|
+
};
|
|
68
|
+
//# sourceMappingURL=protocol-fixtures.constants.js.map
|
|
@@ -0,0 +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"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"protocol-fixtures.types.js","sourceRoot":"","sources":["../../../src/adapters/agents/protocol-fixtures.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { AgentEvent } from \"../../domain/agent.types.ts\";\n\nexport interface AgentProtocolFixture {\n readonly name: string;\n readonly lines: readonly string[];\n readonly expected: readonly AgentEvent[];\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":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAE9D,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAGvD,MAAM,CAAC,KAAK,UAAU,eAAe,CACnC,KAAsB,EACtB,UAAoB,cAAc;IAElC,MAAM,OAAO,GAAG,CAAC,MAAc,EAAmB,EAAE,CAAC,CAAC;QACpD,EAAE,EAAE,KAAK,CAAC,EAAE;QACZ,MAAM,EAAE,KAAK,CAAC,aAAa;QAC3B,OAAO,EAAE,GAAG,MAAM,KAAK,KAAK,CAAC,MAAM,EAAE;KACtC,CAAC,CAAC;IACH,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC;YAC3B,GAAG,KAAK,CAAC,OAAO;YAChB,UAAU,EAAE,cAAc,CAAC,UAAU;YACrC,MAAM,EAAE,KAAK,CAAC,OAAO,CAAC,MAAM,IAAI,cAAc,CAAC,MAAM;SACtD,CAAC,CAAC;QACH,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC;YACrB,OAAO,OAAO,CAAC,sBAAsB,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC;QACxD,IAAI,CAAC,KAAK,CAAC,WAAW;YACpB,OAAO;gBACL,EAAE,EAAE,KAAK,CAAC,EAAE;gBACZ,MAAM,EAAE,MAAM;gBACd,OAAO,EAAE,kBAAkB;aAC5B,CAAC;QACJ,MAAM,OAAO,GAAG,kDAAkD,CAAC,IAAI,CACrE,MAAM,CAAC,MAAM,IAAI,MAAM,CAAC,MAAM,CAC/B,EAAE,CAAC,CAAC,CAAC,CAAC;QACP,IAAI,CAAC,OAAO;YAAE,OAAO,OAAO,CAAC,iCAAiC,CAAC,CAAC;QAChE,IAAI,KAAK,CAAC,gBAAgB;YACxB,OAAO;gBACL,EAAE,EAAE,KAAK,CAAC,EAAE;gBACZ,MAAM,EAAE,OAAO,KAAK,KAAK,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"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { claudeDiagnostics } from "../adapters/agents/claude-diagnostics.ts";
|
|
2
|
+
import { codexDiagnostics } from "../adapters/agents/codex-diagnostics.ts";
|
|
3
|
+
export declare const agentDiagnosticPlans: {
|
|
4
|
+
readonly claude: typeof claudeDiagnostics;
|
|
5
|
+
readonly codex: typeof codexDiagnostics;
|
|
6
|
+
};
|
|
7
|
+
export declare const agentDiagnosticDefaults: Readonly<{
|
|
8
|
+
retain: 65536;
|
|
9
|
+
}>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { claudeDiagnostics } from "../adapters/agents/claude-diagnostics.js";
|
|
2
|
+
import { codexDiagnostics } from "../adapters/agents/codex-diagnostics.js";
|
|
3
|
+
export const agentDiagnosticPlans = {
|
|
4
|
+
claude: claudeDiagnostics,
|
|
5
|
+
codex: codexDiagnostics,
|
|
6
|
+
};
|
|
7
|
+
export const agentDiagnosticDefaults = Object.freeze({ retain: 65_536 });
|
|
8
|
+
//# 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;AAE3E,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,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\";\n\nexport const agentDiagnosticPlans = {\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 default Outpost invocation with --help 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,gHAAgH;SACnH,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 default Outpost invocation with --help 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"]}
|