@elie-laloum/outpost 1.1.0 → 1.1.3
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 +22 -0
- package/README.md +19 -191
- package/dist/adapters/agents/claude-adapter.d.ts +3 -0
- package/dist/adapters/agents/claude-adapter.js +15 -0
- package/dist/adapters/agents/claude-adapter.js.map +1 -0
- package/dist/adapters/agents/claude-events.d.ts +3 -0
- package/dist/adapters/agents/claude-events.js +63 -0
- package/dist/adapters/agents/claude-events.js.map +1 -0
- package/dist/adapters/agents/claude-request.d.ts +4 -0
- package/dist/adapters/agents/claude-request.js +30 -0
- package/dist/adapters/agents/claude-request.js.map +1 -0
- package/dist/adapters/agents/codex-adapter.d.ts +3 -0
- package/dist/adapters/agents/codex-adapter.js +14 -0
- package/dist/adapters/agents/codex-adapter.js.map +1 -0
- package/dist/adapters/agents/codex-events.d.ts +2 -0
- package/dist/adapters/agents/codex-events.js +58 -0
- package/dist/adapters/agents/codex-events.js.map +1 -0
- package/dist/adapters/agents/codex-request.d.ts +4 -0
- package/dist/adapters/agents/codex-request.js +29 -0
- package/dist/adapters/agents/codex-request.js.map +1 -0
- package/dist/adapters/agents/continuation.d.ts +2 -0
- package/dist/adapters/agents/continuation.js +6 -0
- package/dist/adapters/agents/continuation.js.map +1 -0
- package/dist/adapters/agents/event-decoder.d.ts +4 -0
- package/dist/adapters/agents/event-decoder.js +15 -0
- package/dist/adapters/agents/event-decoder.js.map +1 -0
- package/dist/adapters/agents/protocol.d.ts +3 -0
- package/dist/adapters/agents/protocol.js +17 -0
- package/dist/adapters/agents/protocol.js.map +1 -0
- package/dist/adapters/agents/protocol.types.d.ts +4 -0
- package/dist/adapters/agents/protocol.types.js +2 -0
- package/dist/adapters/agents/protocol.types.js.map +1 -0
- package/dist/adapters/agents/settings.types.d.ts +14 -0
- package/dist/adapters/agents/settings.types.js +2 -0
- package/dist/adapters/agents/settings.types.js.map +1 -0
- package/dist/adapters/backlogs/backlog.constants.d.ts +4 -0
- package/dist/adapters/backlogs/backlog.constants.js +5 -0
- package/dist/adapters/backlogs/backlog.constants.js.map +1 -0
- package/dist/adapters/backlogs/beads-adapter.d.ts +4 -0
- package/dist/adapters/backlogs/beads-adapter.js +31 -0
- package/dist/adapters/backlogs/beads-adapter.js.map +1 -0
- package/dist/adapters/backlogs/cli.d.ts +3 -0
- package/dist/adapters/backlogs/cli.js +20 -0
- package/dist/adapters/backlogs/cli.js.map +1 -0
- package/dist/adapters/backlogs/github-adapter.d.ts +4 -0
- package/dist/adapters/backlogs/github-adapter.js +28 -0
- package/dist/adapters/backlogs/github-adapter.js.map +1 -0
- package/dist/adapters/backlogs/issue.d.ts +2 -0
- package/dist/adapters/backlogs/issue.js +13 -0
- package/dist/adapters/backlogs/issue.js.map +1 -0
- package/dist/adapters/backlogs/settings.types.d.ts +5 -0
- package/dist/adapters/backlogs/settings.types.js +2 -0
- package/dist/adapters/backlogs/settings.types.js.map +1 -0
- package/dist/application/activity-watchdog.d.ts +2 -0
- package/dist/application/activity-watchdog.js +38 -0
- package/dist/application/activity-watchdog.js.map +1 -0
- package/dist/application/agent-bootstrap.constants.d.ts +4 -0
- package/dist/application/agent-bootstrap.constants.js +6 -0
- package/dist/application/agent-bootstrap.constants.js.map +1 -0
- package/dist/application/agent-bootstrap.d.ts +3 -0
- package/dist/application/agent-bootstrap.js +28 -0
- package/dist/application/agent-bootstrap.js.map +1 -0
- package/dist/application/agent-output.d.ts +3 -0
- package/dist/application/agent-output.js +72 -0
- package/dist/application/agent-output.js.map +1 -0
- package/dist/application/agent-storage.d.ts +2 -0
- package/dist/application/agent-storage.js +4 -0
- package/dist/application/agent-storage.js.map +1 -0
- package/dist/application/agent-turn.d.ts +4 -0
- package/dist/application/agent-turn.js +58 -0
- package/dist/application/agent-turn.js.map +1 -0
- package/dist/application/attach.d.ts +3 -0
- package/dist/application/attach.js +42 -0
- package/dist/application/attach.js.map +1 -0
- package/dist/application/brief-renderer.d.ts +5 -0
- package/dist/application/brief-renderer.js +55 -0
- package/dist/application/brief-renderer.js.map +1 -0
- package/dist/application/campaign-integration.d.ts +2 -0
- package/dist/application/campaign-integration.js +44 -0
- package/dist/application/campaign-integration.js.map +1 -0
- package/dist/application/campaign-planner.d.ts +3 -0
- package/dist/application/campaign-planner.js +35 -0
- package/dist/application/campaign-planner.js.map +1 -0
- package/dist/application/campaign-worker.d.ts +3 -0
- package/dist/application/campaign-worker.js +54 -0
- package/dist/application/campaign-worker.js.map +1 -0
- package/dist/application/campaign.constants.d.ts +7 -0
- package/dist/application/campaign.constants.js +8 -0
- package/dist/application/campaign.constants.js.map +1 -0
- package/dist/application/campaign.d.ts +2 -32
- package/dist/application/campaign.js +23 -122
- package/dist/application/campaign.js.map +1 -1
- package/dist/application/campaign.types.d.ts +43 -0
- package/dist/application/campaign.types.js +2 -0
- package/dist/application/campaign.types.js.map +1 -0
- package/dist/application/continuation.d.ts +3 -0
- package/dist/application/continuation.js +16 -0
- package/dist/application/continuation.js.map +1 -0
- package/dist/application/dispatch-validation.d.ts +4 -0
- package/dist/application/dispatch-validation.js +34 -0
- package/dist/application/dispatch-validation.js.map +1 -0
- package/dist/application/dispatch.d.ts +4 -0
- package/dist/application/dispatch.js +85 -0
- package/dist/application/dispatch.js.map +1 -0
- package/dist/application/execution.constants.d.ts +13 -0
- package/dist/application/execution.constants.js +20 -0
- package/dist/application/execution.constants.js.map +1 -0
- package/dist/application/execution.d.ts +8 -47
- package/dist/application/execution.js +18 -228
- package/dist/application/execution.js.map +1 -1
- package/dist/application/execution.types.d.ts +54 -0
- package/dist/application/execution.types.js +2 -0
- package/dist/application/execution.types.js.map +1 -0
- package/dist/application/interactive-brief.d.ts +3 -2
- package/dist/application/interactive-brief.js.map +1 -1
- package/dist/application/interactive-brief.types.d.ts +1 -0
- package/dist/application/interactive-brief.types.js +2 -0
- package/dist/application/interactive-brief.types.js.map +1 -0
- package/dist/application/lifecycle-hooks.d.ts +3 -0
- package/dist/application/lifecycle-hooks.js +26 -0
- package/dist/application/lifecycle-hooks.js.map +1 -0
- package/dist/application/lifecycle.constants.d.ts +2 -0
- package/dist/application/lifecycle.constants.js +14 -0
- package/dist/application/lifecycle.constants.js.map +1 -0
- package/dist/application/observation.d.ts +1 -0
- package/dist/application/observation.js +7 -0
- package/dist/application/observation.js.map +1 -0
- package/dist/application/operation-gate.d.ts +2 -0
- package/dist/application/operation-gate.js +23 -0
- package/dist/application/operation-gate.js.map +1 -0
- package/dist/application/outpost.d.ts +5 -91
- package/dist/application/outpost.js +4 -628
- package/dist/application/outpost.js.map +1 -1
- package/dist/application/outpost.types.d.ts +86 -0
- package/dist/application/outpost.types.js +2 -0
- package/dist/application/outpost.types.js.map +1 -0
- package/dist/application/remote-apply.d.ts +2 -0
- package/dist/application/remote-apply.js +46 -0
- package/dist/application/remote-apply.js.map +1 -0
- package/dist/application/remote-backup.d.ts +2 -0
- package/dist/application/remote-backup.js +38 -0
- package/dist/application/remote-backup.js.map +1 -0
- package/dist/application/remote-download.d.ts +2 -0
- package/dist/application/remote-download.js +24 -0
- package/dist/application/remote-download.js.map +1 -0
- package/dist/application/remote-validation.d.ts +2 -0
- package/dist/application/remote-validation.js +62 -0
- package/dist/application/remote-validation.js.map +1 -0
- package/dist/application/remote-workspace.d.ts +4 -10
- package/dist/application/remote-workspace.js +28 -167
- package/dist/application/remote-workspace.js.map +1 -1
- package/dist/application/remote-workspace.types.d.ts +32 -0
- package/dist/application/remote-workspace.types.js +2 -0
- package/dist/application/remote-workspace.types.js.map +1 -0
- package/dist/application/sandbox-agents.d.ts +2 -0
- package/dist/application/sandbox-agents.js +54 -0
- package/dist/application/sandbox-agents.js.map +1 -0
- package/dist/application/sandbox-attach.d.ts +3 -0
- package/dist/application/sandbox-attach.js +48 -0
- package/dist/application/sandbox-attach.js.map +1 -0
- package/dist/application/sandbox-dispatch.d.ts +4 -0
- package/dist/application/sandbox-dispatch.js +124 -0
- package/dist/application/sandbox-dispatch.js.map +1 -0
- package/dist/application/sandbox-provision.d.ts +3 -0
- package/dist/application/sandbox-provision.js +108 -0
- package/dist/application/sandbox-provision.js.map +1 -0
- package/dist/application/sandbox-session.types.d.ts +38 -0
- package/dist/application/sandbox-session.types.js +2 -0
- package/dist/application/sandbox-session.types.js.map +1 -0
- package/dist/application/sandbox.d.ts +2 -0
- package/dist/application/sandbox.js +83 -0
- package/dist/application/sandbox.js.map +1 -0
- package/dist/application/startup-recovery.d.ts +3 -0
- package/dist/application/startup-recovery.js +25 -0
- package/dist/application/startup-recovery.js.map +1 -0
- package/dist/application/startup-recovery.types.d.ts +5 -0
- package/dist/application/startup-recovery.types.js +2 -0
- package/dist/application/startup-recovery.types.js.map +1 -0
- package/dist/application/tasks.d.ts +7 -17
- package/dist/application/tasks.js +1 -1
- package/dist/application/tasks.js.map +1 -1
- package/dist/application/tasks.types.d.ts +18 -0
- package/dist/application/tasks.types.js +2 -0
- package/dist/application/tasks.types.js.map +1 -0
- package/dist/application/workspace-fingerprint.d.ts +2 -0
- package/dist/application/workspace-fingerprint.js +25 -0
- package/dist/application/workspace-fingerprint.js.map +1 -0
- package/dist/application/workspace-registry.d.ts +3 -0
- package/dist/application/workspace-registry.js +2 -0
- package/dist/application/workspace-registry.js.map +1 -0
- package/dist/application/workspace.d.ts +2 -0
- package/dist/application/workspace.js +50 -0
- package/dist/application/workspace.js.map +1 -0
- package/dist/cli/commands.d.ts +1 -0
- package/dist/cli/commands.js +24 -0
- package/dist/cli/commands.js.map +1 -0
- package/dist/cli/image-command.d.ts +2 -0
- package/dist/cli/image-command.js +13 -0
- package/dist/cli/image-command.js.map +1 -0
- package/dist/cli/image.constants.d.ts +9 -0
- package/dist/cli/image.constants.js +10 -0
- package/dist/cli/image.constants.js.map +1 -0
- package/dist/cli/image.d.ts +3 -0
- package/dist/cli/image.js +39 -0
- package/dist/cli/image.js.map +1 -0
- package/dist/cli/image.types.d.ts +8 -0
- package/dist/cli/image.types.js +2 -0
- package/dist/cli/image.types.js.map +1 -0
- package/dist/cli/init-command.d.ts +2 -0
- package/dist/cli/init-command.js +29 -0
- package/dist/cli/init-command.js.map +1 -0
- package/dist/cli/main.constants.d.ts +57 -0
- package/dist/cli/main.constants.js +35 -0
- package/dist/cli/main.constants.js.map +1 -0
- package/dist/cli/main.js +2 -86
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/main.types.d.ts +9 -0
- package/dist/cli/main.types.js +2 -0
- package/dist/cli/main.types.js.map +1 -0
- package/dist/cli/project-settings.d.ts +2 -0
- package/dist/cli/project-settings.js +36 -0
- package/dist/cli/project-settings.js.map +1 -0
- package/dist/cli/scaffold-files.d.ts +2 -0
- package/dist/cli/scaffold-files.js +27 -0
- package/dist/cli/scaffold-files.js.map +1 -0
- package/dist/cli/scaffold-validation.d.ts +2 -0
- package/dist/cli/scaffold-validation.js +11 -0
- package/dist/cli/scaffold-validation.js.map +1 -0
- package/dist/cli/scaffold.constants.d.ts +14 -0
- package/dist/cli/scaffold.constants.js +51 -0
- package/dist/cli/scaffold.constants.js.map +1 -0
- package/dist/cli/scaffold.d.ts +6 -28
- package/dist/cli/scaffold.js +14 -116
- package/dist/cli/scaffold.js.map +1 -1
- package/dist/cli/scaffold.types.d.ts +26 -0
- package/dist/cli/scaffold.types.js +2 -0
- package/dist/cli/scaffold.types.js.map +1 -0
- package/dist/cli/starters.d.ts +1 -1
- package/dist/cli/starters.js.map +1 -1
- package/dist/domain/agent-events.d.ts +2 -0
- package/dist/domain/agent-events.js +5 -0
- package/dist/domain/agent-events.js.map +1 -0
- package/dist/domain/agent.types.d.ts +81 -0
- package/dist/domain/agent.types.js +2 -0
- package/dist/domain/agent.types.js.map +1 -0
- package/dist/domain/backlog.d.ts +2 -15
- package/dist/domain/backlog.js.map +1 -1
- package/dist/domain/backlog.types.d.ts +15 -0
- package/dist/domain/backlog.types.js +2 -0
- package/dist/domain/backlog.types.js.map +1 -0
- package/dist/domain/command.types.d.ts +26 -0
- package/dist/domain/command.types.js +2 -0
- package/dist/domain/command.types.js.map +1 -0
- package/dist/domain/conversation.types.d.ts +20 -0
- package/dist/domain/conversation.types.js +2 -0
- package/dist/domain/conversation.types.js.map +1 -0
- package/dist/domain/errors.d.ts +2 -1
- package/dist/domain/errors.js.map +1 -1
- package/dist/domain/errors.types.d.ts +1 -0
- package/dist/domain/errors.types.js +2 -0
- package/dist/domain/errors.types.js.map +1 -0
- package/dist/domain/ports.d.ts +5 -183
- package/dist/domain/ports.js.map +1 -1
- package/dist/domain/prompts.d.ts +3 -21
- package/dist/domain/prompts.js.map +1 -1
- package/dist/domain/prompts.types.d.ts +22 -0
- package/dist/domain/prompts.types.js +2 -0
- package/dist/domain/prompts.types.js.map +1 -0
- package/dist/domain/response.d.ts +4 -29
- package/dist/domain/response.js.map +1 -1
- package/dist/domain/response.types.d.ts +29 -0
- package/dist/domain/response.types.js +2 -0
- package/dist/domain/response.types.js.map +1 -0
- package/dist/domain/sandbox.types.d.ts +31 -0
- package/dist/domain/sandbox.types.js +2 -0
- package/dist/domain/sandbox.types.js.map +1 -0
- package/dist/domain/usage.d.ts +2 -0
- package/dist/domain/usage.js +11 -0
- package/dist/domain/usage.js.map +1 -0
- package/dist/domain/workflow/failure.d.ts +5 -0
- package/dist/domain/workflow/failure.js +11 -0
- package/dist/domain/workflow/failure.js.map +1 -0
- package/dist/domain/workflow/task-runner.d.ts +2 -0
- package/dist/domain/workflow/task-runner.js +56 -0
- package/dist/domain/workflow/task-runner.js.map +1 -0
- package/dist/domain/workflow/task.d.ts +2 -0
- package/dist/domain/workflow/task.js +19 -0
- package/dist/domain/workflow/task.js.map +1 -0
- package/dist/domain/workflow/validation.d.ts +3 -0
- package/dist/domain/workflow/validation.js +30 -0
- package/dist/domain/workflow/validation.js.map +1 -0
- package/dist/domain/workflow/workflow-scheduler.d.ts +2 -0
- package/dist/domain/workflow/workflow-scheduler.js +71 -0
- package/dist/domain/workflow/workflow-scheduler.js.map +1 -0
- package/dist/domain/workflow/workflow-state.d.ts +2 -0
- package/dist/domain/workflow/workflow-state.js +69 -0
- package/dist/domain/workflow/workflow-state.js.map +1 -0
- package/dist/domain/workflow.d.ts +4 -67
- package/dist/domain/workflow.js +4 -224
- package/dist/domain/workflow.js.map +1 -1
- package/dist/domain/workflow.types.d.ts +77 -0
- package/dist/domain/workflow.types.js +2 -0
- package/dist/domain/workflow.types.js.map +1 -0
- package/dist/domain/workspace.types.d.ts +38 -0
- package/dist/domain/workspace.types.js +2 -0
- package/dist/domain/workspace.types.js.map +1 -0
- package/dist/index.d.ts +10 -10
- package/dist/index.js +5 -5
- package/dist/index.js.map +1 -1
- package/dist/infrastructure/conversations/capture.d.ts +4 -0
- package/dist/infrastructure/conversations/capture.js +77 -0
- package/dist/infrastructure/conversations/capture.js.map +1 -0
- package/dist/infrastructure/conversations/capture.types.d.ts +5 -0
- package/dist/infrastructure/conversations/capture.types.js +2 -0
- package/dist/infrastructure/conversations/capture.types.js.map +1 -0
- package/dist/infrastructure/conversations/claude-layout.d.ts +2 -0
- package/dist/infrastructure/conversations/claude-layout.js +18 -0
- package/dist/infrastructure/conversations/claude-layout.js.map +1 -0
- package/dist/infrastructure/conversations/codex-layout.d.ts +2 -0
- package/dist/infrastructure/conversations/codex-layout.js +17 -0
- package/dist/infrastructure/conversations/codex-layout.js.map +1 -0
- package/dist/infrastructure/conversations/conversation.constants.d.ts +1 -0
- package/dist/infrastructure/conversations/conversation.constants.js +2 -0
- package/dist/infrastructure/conversations/conversation.constants.js.map +1 -0
- package/dist/infrastructure/conversations/files.d.ts +1 -0
- package/dist/infrastructure/conversations/files.js +21 -0
- package/dist/infrastructure/conversations/files.js.map +1 -0
- package/dist/infrastructure/conversations/identity.d.ts +2 -0
- package/dist/infrastructure/conversations/identity.js +8 -0
- package/dist/infrastructure/conversations/identity.js.map +1 -0
- package/dist/infrastructure/conversations/layout.d.ts +3 -0
- package/dist/infrastructure/conversations/layout.js +7 -0
- package/dist/infrastructure/conversations/layout.js.map +1 -0
- package/dist/infrastructure/conversations/layout.types.d.ts +12 -0
- package/dist/infrastructure/conversations/layout.types.js +2 -0
- package/dist/infrastructure/conversations/layout.types.js.map +1 -0
- package/dist/infrastructure/conversations/locate.d.ts +2 -0
- package/dist/infrastructure/conversations/locate.js +18 -0
- package/dist/infrastructure/conversations/locate.js.map +1 -0
- package/dist/infrastructure/conversations/native-store.d.ts +3 -0
- package/dist/infrastructure/conversations/native-store.js +20 -0
- package/dist/infrastructure/conversations/native-store.js.map +1 -0
- package/dist/infrastructure/conversations/paths.d.ts +4 -0
- package/dist/infrastructure/conversations/paths.js +8 -0
- package/dist/infrastructure/conversations/paths.js.map +1 -0
- package/dist/infrastructure/conversations/relocate.d.ts +1 -0
- package/dist/infrastructure/conversations/relocate.js +44 -0
- package/dist/infrastructure/conversations/relocate.js.map +1 -0
- package/dist/infrastructure/conversations/restore.d.ts +3 -0
- package/dist/infrastructure/conversations/restore.js +35 -0
- package/dist/infrastructure/conversations/restore.js.map +1 -0
- package/dist/infrastructure/conversations.d.ts +14 -19
- package/dist/infrastructure/conversations.js +15 -205
- package/dist/infrastructure/conversations.js.map +1 -1
- package/dist/infrastructure/conversations.types.d.ts +6 -0
- package/dist/infrastructure/conversations.types.js +2 -0
- package/dist/infrastructure/conversations.types.js.map +1 -0
- package/dist/infrastructure/files.js +1 -1
- package/dist/infrastructure/files.js.map +1 -1
- package/dist/infrastructure/git/command.d.ts +1 -0
- package/dist/infrastructure/git/command.js +19 -0
- package/dist/infrastructure/git/command.js.map +1 -0
- package/dist/infrastructure/git/git.constants.d.ts +7 -0
- package/dist/infrastructure/git/git.constants.js +13 -0
- package/dist/infrastructure/git/git.constants.js.map +1 -0
- package/dist/infrastructure/git/history.d.ts +2 -0
- package/dist/infrastructure/git/history.js +13 -0
- package/dist/infrastructure/git/history.js.map +1 -0
- package/dist/infrastructure/git/lock.d.ts +1 -0
- package/dist/infrastructure/git/lock.js +36 -0
- package/dist/infrastructure/git/lock.js.map +1 -0
- package/dist/infrastructure/git/lock.types.d.ts +3 -0
- package/dist/infrastructure/git/lock.types.js +2 -0
- package/dist/infrastructure/git/lock.types.js.map +1 -0
- package/dist/infrastructure/git/managed-worktree.d.ts +2 -0
- package/dist/infrastructure/git/managed-worktree.js +79 -0
- package/dist/infrastructure/git/managed-worktree.js.map +1 -0
- package/dist/infrastructure/git/refresh-worktree.d.ts +1 -0
- package/dist/infrastructure/git/refresh-worktree.js +24 -0
- package/dist/infrastructure/git/refresh-worktree.js.map +1 -0
- package/dist/infrastructure/git/repository.d.ts +2 -0
- package/dist/infrastructure/git/repository.js +25 -0
- package/dist/infrastructure/git/repository.js.map +1 -0
- package/dist/infrastructure/git/workspace-lease.d.ts +3 -0
- package/dist/infrastructure/git/workspace-lease.js +66 -0
- package/dist/infrastructure/git/workspace-lease.js.map +1 -0
- package/dist/infrastructure/git/workspace.d.ts +2 -0
- package/dist/infrastructure/git/workspace.js +72 -0
- package/dist/infrastructure/git/workspace.js.map +1 -0
- package/dist/infrastructure/git/workspace.types.d.ts +24 -0
- package/dist/infrastructure/git/workspace.types.js +2 -0
- package/dist/infrastructure/git/workspace.types.js.map +1 -0
- package/dist/infrastructure/git.d.ts +4 -14
- package/dist/infrastructure/git.js +3 -303
- package/dist/infrastructure/git.js.map +1 -1
- package/dist/infrastructure/journal.d.ts +3 -10
- package/dist/infrastructure/journal.js +1 -1
- package/dist/infrastructure/journal.js.map +1 -1
- package/dist/infrastructure/journal.types.d.ts +10 -0
- package/dist/infrastructure/journal.types.js +2 -0
- package/dist/infrastructure/journal.types.js.map +1 -0
- package/dist/infrastructure/process.constants.d.ts +6 -0
- package/dist/infrastructure/process.constants.js +7 -0
- package/dist/infrastructure/process.constants.js.map +1 -0
- package/dist/infrastructure/process.d.ts +3 -2
- package/dist/infrastructure/process.js +5 -4
- package/dist/infrastructure/process.js.map +1 -1
- package/dist/infrastructure/process.types.d.ts +2 -0
- package/dist/infrastructure/process.types.js +2 -0
- package/dist/infrastructure/process.types.js.map +1 -0
- package/dist/infrastructure/reporter.d.ts +4 -10
- package/dist/infrastructure/reporter.js.map +1 -1
- package/dist/infrastructure/reporter.types.d.ts +9 -0
- package/dist/infrastructure/reporter.types.js +2 -0
- package/dist/infrastructure/reporter.types.js.map +1 -0
- package/dist/infrastructure/settings.d.ts +1 -1
- package/dist/infrastructure/settings.js.map +1 -1
- package/dist/infrastructure/shutdown.js +2 -6
- package/dist/infrastructure/shutdown.js.map +1 -1
- package/dist/infrastructure/terminal.d.ts +2 -10
- package/dist/infrastructure/terminal.js +2 -6
- package/dist/infrastructure/terminal.js.map +1 -1
- package/dist/infrastructure/terminal.types.d.ts +10 -0
- package/dist/infrastructure/terminal.types.js +2 -0
- package/dist/infrastructure/terminal.types.js.map +1 -0
- package/dist/infrastructure/transfer.constants.d.ts +3 -0
- package/dist/infrastructure/transfer.constants.js +2 -0
- package/dist/infrastructure/transfer.constants.js.map +1 -0
- package/dist/infrastructure/transfer.d.ts +1 -1
- package/dist/infrastructure/transfer.js +2 -1
- package/dist/infrastructure/transfer.js.map +1 -1
- package/dist/providers/agents.d.ts +3 -17
- package/dist/providers/agents.js +2 -203
- package/dist/providers/agents.js.map +1 -1
- package/dist/providers/backlogs.d.ts +3 -9
- package/dist/providers/backlogs.js +2 -81
- package/dist/providers/backlogs.js.map +1 -1
- package/dist/providers/cloud-files.constants.d.ts +1 -0
- package/dist/providers/cloud-files.constants.js +2 -0
- package/dist/providers/cloud-files.constants.js.map +1 -0
- package/dist/providers/cloud-files.d.ts +1 -1
- package/dist/providers/cloud-files.js +8 -6
- package/dist/providers/cloud-files.js.map +1 -1
- package/dist/providers/cloud.constants.d.ts +9 -0
- package/dist/providers/cloud.constants.js +10 -0
- package/dist/providers/cloud.constants.js.map +1 -0
- package/dist/providers/container-command.d.ts +3 -0
- package/dist/providers/container-command.js +77 -0
- package/dist/providers/container-command.js.map +1 -0
- package/dist/providers/container-files.d.ts +3 -0
- package/dist/providers/container-files.js +17 -0
- package/dist/providers/container-files.js.map +1 -0
- package/dist/providers/container-mounts.d.ts +3 -0
- package/dist/providers/container-mounts.js +63 -0
- package/dist/providers/container-mounts.js.map +1 -0
- package/dist/providers/container-plan.d.ts +2 -0
- package/dist/providers/container-plan.js +44 -0
- package/dist/providers/container-plan.js.map +1 -0
- package/dist/providers/container-preflight.d.ts +2 -0
- package/dist/providers/container-preflight.js +23 -0
- package/dist/providers/container-preflight.js.map +1 -0
- package/dist/providers/container.constants.d.ts +10 -0
- package/dist/providers/container.constants.js +11 -0
- package/dist/providers/container.constants.js.map +1 -0
- package/dist/providers/container.d.ts +5 -20
- package/dist/providers/container.js +42 -209
- package/dist/providers/container.js.map +1 -1
- package/dist/providers/container.types.d.ts +51 -0
- package/dist/providers/container.types.js +2 -0
- package/dist/providers/container.types.js.map +1 -0
- package/dist/providers/daytona-command.d.ts +3 -0
- package/dist/providers/daytona-command.js +86 -0
- package/dist/providers/daytona-command.js.map +1 -0
- package/dist/providers/daytona-files.d.ts +3 -0
- package/dist/providers/daytona-files.js +39 -0
- package/dist/providers/daytona-files.js.map +1 -0
- package/dist/providers/daytona.d.ts +4 -9
- package/dist/providers/daytona.js +12 -112
- package/dist/providers/daytona.js.map +1 -1
- package/dist/providers/daytona.types.d.ts +17 -0
- package/dist/providers/daytona.types.js +2 -0
- package/dist/providers/daytona.types.js.map +1 -0
- package/dist/providers/docker.d.ts +1 -1
- package/dist/providers/docker.js.map +1 -1
- package/dist/providers/factories.d.ts +2 -7
- package/dist/providers/factories.js.map +1 -1
- package/dist/providers/factories.types.d.ts +7 -0
- package/dist/providers/factories.types.js +2 -0
- package/dist/providers/factories.types.js.map +1 -0
- package/dist/providers/local.d.ts +3 -4
- package/dist/providers/local.js +1 -1
- package/dist/providers/local.js.map +1 -1
- package/dist/providers/local.types.d.ts +4 -0
- package/dist/providers/local.types.js +2 -0
- package/dist/providers/local.types.js.map +1 -0
- package/dist/providers/podman.d.ts +1 -1
- package/dist/providers/podman.js.map +1 -1
- package/dist/providers/vercel-command.d.ts +3 -0
- package/dist/providers/vercel-command.js +69 -0
- package/dist/providers/vercel-command.js.map +1 -0
- package/dist/providers/vercel-files.d.ts +3 -0
- package/dist/providers/vercel-files.js +54 -0
- package/dist/providers/vercel-files.js.map +1 -0
- package/dist/providers/vercel.d.ts +3 -7
- package/dist/providers/vercel.js +12 -111
- package/dist/providers/vercel.js.map +1 -1
- package/dist/providers/vercel.types.d.ts +16 -0
- package/dist/providers/vercel.types.js +2 -0
- package/dist/providers/vercel.types.js.map +1 -0
- package/dist/providers/versions.constants.d.ts +4 -0
- package/dist/providers/versions.constants.js +5 -0
- package/dist/providers/versions.constants.js.map +1 -0
- package/dist/providers/versions.d.ts +1 -4
- package/dist/providers/versions.js +1 -4
- package/dist/providers/versions.js.map +1 -1
- package/package.json +17 -13
- package/README.fr.md +0 -251
- package/ROADMAP.md +0 -34
- package/docs/api.md +0 -147
- package/docs/architecture.md +0 -21
- package/docs/migration-1.1.fr.md +0 -44
- package/docs/migration-1.1.md +0 -38
- package/docs/operations.md +0 -101
- package/docs/providers.md +0 -119
- package/docs/workflows.md +0 -101
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.1.3
|
|
4
|
+
|
|
5
|
+
- Replace the flat documentation with an Astro Starlight site in English and French, with English as the default language.
|
|
6
|
+
- Organize usage into focused guides and generate checked reference pages for every public API export and supporting contract.
|
|
7
|
+
- Validate translations, TypeScript examples, rendered links, navigation and search assets in CI.
|
|
8
|
+
- Deploy one GitHub Pages site after successful stable releases, protecting it from older release deployments.
|
|
9
|
+
- Move the French getting-started content and roadmap into the documentation, retain the root changelog and remove obsolete migration and contribution files.
|
|
10
|
+
- Keep documentation tooling out of the published library archive.
|
|
11
|
+
|
|
12
|
+
## 1.1.2
|
|
13
|
+
|
|
14
|
+
- Match npm package repository metadata to the GitHub build origin for provenance verification. GitLab remains the canonical source repository.
|
|
15
|
+
|
|
16
|
+
## 1.1.1
|
|
17
|
+
|
|
18
|
+
- Separate Claude and Codex adapters, request builders and protocol decoders; preserve unknown events as raw observations.
|
|
19
|
+
- Split sandbox provisioning, operation ownership, dispatch, attachment, conversation storage and recovery into dedicated services.
|
|
20
|
+
- Separate campaign planning, issue execution and integration; isolate workflow state, retries and scheduling.
|
|
21
|
+
- Isolate container planning, mounts, commands and transfers, cloud command/file adapters, Git worktree management and remote synchronization stages.
|
|
22
|
+
- Extract contracts into `.types.ts` modules and configuration defaults into `.constants.ts` modules, without changing public entry points.
|
|
23
|
+
- Enforce dependency boundaries and type placement in CI, reject unused implementation declarations, and document the structure in English and French.
|
|
24
|
+
|
|
3
25
|
## 1.1.0
|
|
4
26
|
|
|
5
27
|
- Add typed issue campaigns with dynamic planning, bounded concurrency, per-issue branches, warm review, verified integration and tracker closure.
|
package/README.md
CHANGED
|
@@ -1,226 +1,54 @@
|
|
|
1
1
|
# Outpost
|
|
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.
|
|
5
|
+
Outpost is a TypeScript library for running coding agents in reusable sandboxes, managing their Git workspaces and composing typed workflows. Claude Code and Codex adapters work with Docker, Podman, Vercel, Daytona or explicit host execution.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
## Get started
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
- Node.js **24 or later**, Git, and an existing repository with at least one commit.
|
|
12
|
-
- Docker or Podman for local isolation; the appropriate account and optional SDK for a cloud sandbox.
|
|
13
|
-
- An authenticated coding agent or its API key. Git hosting credentials are not model credentials.
|
|
14
|
-
- ESM imports. TypeScript declarations ship with the package; Node can execute the generated `.ts`/`.mts` scripts directly.
|
|
15
|
-
|
|
16
|
-
## Install and run
|
|
17
|
-
|
|
18
|
-
Build from the source checkout:
|
|
19
|
-
|
|
20
|
-
```sh
|
|
21
|
-
npm ci
|
|
22
|
-
npm run build
|
|
23
|
-
npm pack
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
Install the resulting tarball in your target repository, or use the package from [GitHub Packages](https://github.com/elie-laloum/outpost/packages). Registry configuration is documented in [Operations](docs/operations.md).
|
|
9
|
+
Requires Node.js **24+**, Git, an existing repository with a commit, and the credentials of your chosen agent. This example uses Docker.
|
|
27
10
|
|
|
28
11
|
```sh
|
|
29
|
-
npm install --save-dev
|
|
12
|
+
npm install --save-dev @elie-laloum/outpost
|
|
30
13
|
npx outpost init --yes --agent codex --provider docker --template blank --build
|
|
31
14
|
```
|
|
32
15
|
|
|
33
|
-
Copy `.outpost/.env.example` to `.outpost/.env
|
|
16
|
+
Copy `.outpost/.env.example` to `.outpost/.env` and declare `OPENAI_API_KEY`. An empty declaration inherits the matching process variable. Then run the generated script:
|
|
34
17
|
|
|
35
18
|
```sh
|
|
36
|
-
node .outpost/run.mts "Add validation
|
|
19
|
+
node .outpost/run.mts "Add validation, run tests and commit the change"
|
|
37
20
|
```
|
|
38
21
|
|
|
39
|
-
|
|
22
|
+
Use `run.ts` for a project with `"type": "module"`; initialization prints the exact command.
|
|
40
23
|
|
|
41
|
-
##
|
|
24
|
+
## Use the library
|
|
42
25
|
|
|
43
26
|
```ts
|
|
44
27
|
import { dispatch, codex } from "@elie-laloum/outpost";
|
|
45
|
-
import { docker } from "@elie-laloum/outpost/providers/docker";
|
|
46
28
|
|
|
47
29
|
const result = await dispatch({
|
|
48
30
|
agent: codex(),
|
|
49
|
-
provider: docker(),
|
|
50
31
|
branch: { mode: "integrate" },
|
|
51
|
-
brief: { text: "Fix the failing tests, verify
|
|
52
|
-
});
|
|
53
|
-
|
|
54
|
-
console.log(result.branch, result.commits, result.conversation);
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
`dispatch` provisions a sandbox, executes the agent, collects changes and native conversation files, integrates commits when requested, and closes owned resources. Uncommitted work is retained. Failure paths preserve separate workspaces for inspection.
|
|
58
|
-
|
|
59
|
-
| Branch policy | Behavior |
|
|
60
|
-
| ------------------------------------------------------------- | -------------------------------------------------------------------------------- |
|
|
61
|
-
| `{ mode: "current" }` | Uses the current checkout. This is the mounted/host default. |
|
|
62
|
-
| `{ mode: "named", name: "feature/validation", from: "main" }` | Creates or reuses a managed worktree for that branch. |
|
|
63
|
-
| `{ mode: "integrate", from: "main" }` | Creates a temporary branch and merges its commits into the original host branch. |
|
|
64
|
-
|
|
65
|
-
Remote providers require `named` or `integrate`. `from` is optional. Integration refuses a changed host branch and retains the workspace on conflict. A branch checked out elsewhere produces an actionable error.
|
|
66
|
-
|
|
67
|
-
## Keep a sandbox warm
|
|
68
|
-
|
|
69
|
-
```ts
|
|
70
|
-
import { createSandbox, claude } from "@elie-laloum/outpost";
|
|
71
|
-
|
|
72
|
-
await using sandbox = await createSandbox({
|
|
73
|
-
agent: claude({ model: "sonnet", reasoning: "high" }),
|
|
74
|
-
branch: { mode: "named", name: "feature/settings" },
|
|
75
|
-
});
|
|
76
|
-
|
|
77
|
-
const first = await sandbox.dispatch({
|
|
78
|
-
brief: { text: "Implement settings validation." },
|
|
79
|
-
});
|
|
80
|
-
const tests = await sandbox.command({ executable: "npm", arguments: ["test"] });
|
|
81
|
-
if (tests.status !== 0)
|
|
82
|
-
await first.resume({ brief: { text: "Fix the failing tests." } });
|
|
83
|
-
await sandbox.attach();
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
Commands return nonzero statuses; agent dispatches throw on agent failure. `AbortSignal`, command deadlines and idle watchdogs stop the current operation while leaving a warm sandbox usable. A sandbox accepts one active operation at a time. Use separate sandboxes for parallel work.
|
|
87
|
-
|
|
88
|
-
The default agent is optional for a warm sandbox. Pass `agent` to individual `sandbox.dispatch` or `sandbox.attach` calls to switch between Codex and Claude, or change models, without recreating the environment. Each job receives only its selected adapter's variables.
|
|
89
|
-
|
|
90
|
-
## Own the workspace separately
|
|
91
|
-
|
|
92
|
-
```ts
|
|
93
|
-
import { openWorkspace, codex, claude } from "@elie-laloum/outpost";
|
|
94
|
-
|
|
95
|
-
await using workspace = await openWorkspace({
|
|
96
|
-
branch: { mode: "named", name: "feature/shared-work" },
|
|
97
|
-
copies: [".env.test"],
|
|
98
|
-
});
|
|
99
|
-
|
|
100
|
-
await workspace.dispatch({
|
|
101
|
-
agent: codex(),
|
|
102
|
-
brief: { text: "Implement the feature and commit." },
|
|
103
|
-
});
|
|
104
|
-
await workspace.dispatch({
|
|
105
|
-
agent: claude(),
|
|
106
|
-
brief: { text: "Review the implementation, test and commit fixes." },
|
|
107
|
-
});
|
|
108
|
-
```
|
|
109
|
-
|
|
110
|
-
A supplied workspace outlives each sandbox. Its owner closes it. Closing a dirty workspace returns `retainedDirectory`; closing a clean managed workspace removes the worktree. Named branches remain. `workspace.sandbox()` and `workspace.attach()` provide the other lifecycles. Warm integration workspaces can call `sandbox.workspace.integrate()` explicitly.
|
|
111
|
-
|
|
112
|
-
## Prompts and iteration
|
|
113
|
-
|
|
114
|
-
Provide exactly one `brief`: literal `text`, or a `file` with optional primitive `values`. Files are reread each pass; inline text is never expanded.
|
|
115
|
-
|
|
116
|
-
```ts
|
|
117
|
-
const result = await dispatch({
|
|
118
|
-
agent: codex(),
|
|
119
|
-
brief: { file: ".outpost/brief.md", values: { OBJECTIVE: "Fix validation" } },
|
|
120
|
-
passes: 5,
|
|
121
|
-
until: ["<outpost>done</outpost>"],
|
|
122
|
-
idleMs: 600_000,
|
|
123
|
-
settleMs: 60_000,
|
|
32
|
+
brief: { text: "Fix the failing tests, verify and commit." },
|
|
124
33
|
});
|
|
34
|
+
console.log(result.branch, result.commits);
|
|
125
35
|
```
|
|
126
36
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
Completion markers stop the loop. If the process hangs after a marker, the completion grace period resets on subsequent output and then stops that command. Every turn includes its duration, native transcript path when available and raw token counts (input, cache read, cache creation, output); the result includes aggregate usage and the matched completion marker.
|
|
37
|
+
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.
|
|
130
38
|
|
|
131
|
-
##
|
|
132
|
-
|
|
133
|
-
```ts
|
|
134
|
-
import { response } from "@elie-laloum/outpost";
|
|
135
|
-
|
|
136
|
-
const result = await dispatch({
|
|
137
|
-
agent: codex(),
|
|
138
|
-
brief: {
|
|
139
|
-
text: "Analyze the repository. Return <report>JSON with an ok boolean</report>.",
|
|
140
|
-
},
|
|
141
|
-
response: response.json({
|
|
142
|
-
tag: "report",
|
|
143
|
-
repairs: 2,
|
|
144
|
-
schema(input) {
|
|
145
|
-
if (
|
|
146
|
-
!input ||
|
|
147
|
-
typeof input !== "object" ||
|
|
148
|
-
!("ok" in input) ||
|
|
149
|
-
typeof input.ok !== "boolean"
|
|
150
|
-
) {
|
|
151
|
-
throw new Error("Expected an ok boolean");
|
|
152
|
-
}
|
|
153
|
-
return { ok: input.ok };
|
|
154
|
-
},
|
|
155
|
-
}),
|
|
156
|
-
});
|
|
157
|
-
|
|
158
|
-
console.log(result.value.ok);
|
|
159
|
-
await result.resume({ brief: { text: "Explain the result." } });
|
|
160
|
-
await result.fork({ brief: { text: "Explore a different solution." } });
|
|
161
|
-
```
|
|
162
|
-
|
|
163
|
-
`response.text` extracts tagged text. `response.json` accepts a function or a Standard Schema validator, including asynchronous validation. Structured responses and conversation continuations require one pass. Repairs resume the same conversation. `ResponseError.recovery` exposes the conversation, commits and recovery paths. `recoveryDetails(error)` also retrieves recovery metadata for other failures without replacing cancellation reasons.
|
|
164
|
-
|
|
165
|
-
Native conversation capture is enabled by default. Transcripts are saved to the host agent's own storage and working-directory fields are rewritten for host resumption. Claude child transcripts are copied on a best-effort basis. Set `saveConversations: false` on an adapter to opt out. Forks create a new conversation; use a separate workspace when filesystem isolation is also required.
|
|
166
|
-
|
|
167
|
-
Each cold `dispatch({ passes })` provisions a fresh sandbox per pass. `sandbox.dispatch({ passes })` deliberately reuses its environment. Relative brief filenames resolve from the caller’s working directory. Cold result `resume`/`fork` accepts new branch/provider/hook settings; warm result methods retain the sandbox’s settings. See [1.1 migration notes](docs/migration-1.1.md).
|
|
168
|
-
|
|
169
|
-
## Typed workflows
|
|
170
|
-
|
|
171
|
-
```ts
|
|
172
|
-
import { task, workflow } from "@elie-laloum/outpost";
|
|
173
|
-
|
|
174
|
-
const inspect = task({
|
|
175
|
-
key: "inspect",
|
|
176
|
-
perform: async () => ({ ready: true }),
|
|
177
|
-
});
|
|
178
|
-
const implement = task({
|
|
179
|
-
key: "implement",
|
|
180
|
-
after: [inspect],
|
|
181
|
-
retry: { attempts: 2, delayMs: 500 },
|
|
182
|
-
perform: async (context) => context.value(inspect).ready,
|
|
183
|
-
});
|
|
184
|
-
const result = await workflow("delivery", [inspect, implement]).start({
|
|
185
|
-
concurrency: 2,
|
|
186
|
-
});
|
|
187
|
-
result.unwrap();
|
|
188
|
-
console.log(result.value(implement));
|
|
189
|
-
```
|
|
190
|
-
|
|
191
|
-
The graph validates dependencies and cycles before running. Results are typed and scoped to one execution. Conditions, cooperative cancellation, retries, concurrency limits, observer events and Mermaid diagrams are built in. `agentTask`, `commandTask` and `isolatedTask` connect workflows to sandbox operations. [Workflow guide](docs/workflows.md).
|
|
192
|
-
|
|
193
|
-
## Issue campaigns
|
|
194
|
-
|
|
195
|
-
`campaign({ agent, provider, backlog })` loads a backlog, validates a typed plan, allocates a branch per issue and bounds parallel implementation. Review shares each issue sandbox. A merge phase validates the combined work; issue closure occurs only after integration into the host branch. The backlog is refreshed for the next cycle. GitHub and Beads connectors expose list, detail and close operations; custom trackers implement `Backlog`.
|
|
196
|
-
|
|
197
|
-
[Campaign configuration and starter examples](docs/workflows.md#issue-campaigns).
|
|
198
|
-
|
|
199
|
-
## Configuration and extension
|
|
200
|
-
|
|
201
|
-
Provider settings cover environment variables, file/directory mounts, networks, resource limits, devices, extra groups and SELinux labels. Hooks run at workspace readiness and after sandbox creation. The two post-creation hook groups run concurrently. Host commands run in order; sandbox commands run concurrently and cancel their siblings on failure. [Complete API](docs/api.md) and [provider reference](docs/providers.md).
|
|
202
|
-
|
|
203
|
-
Outpost reads only `.outpost/.env`. Nonempty file values win; empty declarations inherit matching process values. The repository-root `.env` is not imported. Explicit provider and adapter variables override those values. The same variable cannot be declared by both provider and adapter. Logs default to `.outpost/logs`, with `false`, `"stdout"`, custom files and verbose modes available.
|
|
204
|
-
|
|
205
|
-
Implement `AgentAdapter` to add an agent. Implement `SandboxProvider` directly or use `mountedProvider`/`remoteProvider` to add an execution backend. Domain contracts do not depend on a specific cloud SDK. [Architecture](docs/architecture.md).
|
|
206
|
-
|
|
207
|
-
## Verification and releases
|
|
39
|
+
## Development
|
|
208
40
|
|
|
209
41
|
```sh
|
|
210
42
|
npm ci
|
|
211
43
|
npm run check
|
|
212
44
|
npm run coverage
|
|
213
45
|
npm run test:package
|
|
46
|
+
npm ci --prefix docs
|
|
47
|
+
npm run docs:sync
|
|
48
|
+
npm run docs:build
|
|
49
|
+
npm run docs:test
|
|
214
50
|
```
|
|
215
51
|
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
Version tags are created on GitLab and mirrored. The release workflow validates the tag, runs CI, publishes GitHub Packages and attaches the installable tarball to a GitHub release. Optional npm publication uses trusted publishing when enabled. [Release procedure and registry setup](docs/operations.md).
|
|
219
|
-
|
|
220
|
-
## Execution boundary
|
|
221
|
-
|
|
222
|
-
Docker and Podman mount the selected worktree and Git metadata. Agents can edit that repository and its Git state. This protects unrelated host paths but is not a boundary against a hostile agent attacking the shared repository. Mount only what the task needs. `local()` runs directly on your machine without isolation. Cloud providers synchronize via Git bundles and file transfers; concurrent host changes cause a recovery error instead of being overwritten.
|
|
223
|
-
|
|
224
|
-
Logs, conversation files and recovery files can contain private prompts or source. Runtime folders and `.env` are excluded from version control. See [Security](SECURITY.md) for the precise boundaries.
|
|
52
|
+
[GitLab](https://gitlab.elielaloum.com/elielaloum/outpost) is the canonical repository. [GitHub](https://github.com/elie-laloum/outpost) is the mirror running tests, package releases and GitHub Pages. Documentation is validated on main and deployed only after a successful stable release.
|
|
225
53
|
|
|
226
|
-
|
|
54
|
+
See [SECURITY.md](SECURITY.md) for execution boundaries and [LICENSE](LICENSE) for the MIT license.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { claudeEvents, claudeTranscriptUsage } from "./claude-events.js";
|
|
2
|
+
import { claudeRequest } from "./claude-request.js";
|
|
3
|
+
export function claude(settings = {}) {
|
|
4
|
+
return Object.freeze({
|
|
5
|
+
name: "claude",
|
|
6
|
+
conversations: "claude",
|
|
7
|
+
resumable: true,
|
|
8
|
+
capture: settings.saveConversations ?? true,
|
|
9
|
+
variables: Object.freeze({ ...settings.variables }),
|
|
10
|
+
request: (input) => claudeRequest(settings, input),
|
|
11
|
+
events: claudeEvents,
|
|
12
|
+
transcriptUsage: claudeTranscriptUsage,
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=claude-adapter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claude-adapter.js","sourceRoot":"","sources":["../../../src/adapters/agents/claude-adapter.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AACzE,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,aAAa,EAAE,QAAQ;QACvB,SAAS,EAAE,IAAI;QACf,OAAO,EAAE,QAAQ,CAAC,iBAAiB,IAAI,IAAI;QAC3C,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;QACpB,eAAe,EAAE,qBAAqB;KAChB,CAAC,CAAC;AAC5B,CAAC","sourcesContent":["import type { AgentAdapter } from \"../../domain/agent.types.ts\";\nimport { claudeEvents, claudeTranscriptUsage } from \"./claude-events.ts\";\nimport { claudeRequest } from \"./claude-request.ts\";\nimport type { ClaudeSettings } from \"./settings.types.ts\";\n\nexport function claude(settings: ClaudeSettings = {}): AgentAdapter {\n return Object.freeze({\n name: \"claude\",\n conversations: \"claude\",\n resumable: true,\n capture: settings.saveConversations ?? true,\n variables: Object.freeze({ ...settings.variables }),\n request: (input) => claudeRequest(settings, input),\n events: claudeEvents,\n transcriptUsage: claudeTranscriptUsage,\n } satisfies AgentAdapter);\n}\n"]}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { decodeEvent, decodeLine } from "./event-decoder.js";
|
|
2
|
+
import { asRecord, decodeRecord, numberOrZero } from "./protocol.js";
|
|
3
|
+
function tokens(value) {
|
|
4
|
+
const usage = asRecord(value);
|
|
5
|
+
return {
|
|
6
|
+
input: numberOrZero(usage.input_tokens),
|
|
7
|
+
cacheCreated: numberOrZero(usage.cache_creation_input_tokens),
|
|
8
|
+
cached: numberOrZero(usage.cache_read_input_tokens),
|
|
9
|
+
output: numberOrZero(usage.output_tokens),
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
function system(event) {
|
|
13
|
+
return typeof event.session_id === "string"
|
|
14
|
+
? [{ kind: "conversation", id: event.session_id }]
|
|
15
|
+
: [];
|
|
16
|
+
}
|
|
17
|
+
function assistant(event) {
|
|
18
|
+
const content = asRecord(event.message).content;
|
|
19
|
+
if (!Array.isArray(content))
|
|
20
|
+
return [];
|
|
21
|
+
return content.flatMap((part) => decodeEvent(asRecord(part), {
|
|
22
|
+
text: (block) => typeof block.text === "string"
|
|
23
|
+
? [{ kind: "text", text: block.text }]
|
|
24
|
+
: [],
|
|
25
|
+
tool_use: (block) => [
|
|
26
|
+
{ kind: "tool", name: String(block.name), input: block.input },
|
|
27
|
+
],
|
|
28
|
+
}));
|
|
29
|
+
}
|
|
30
|
+
function result(event) {
|
|
31
|
+
const events = [];
|
|
32
|
+
if (!event.is_error && typeof event.result === "string")
|
|
33
|
+
events.push({ kind: "result", text: event.result });
|
|
34
|
+
if (event.usage)
|
|
35
|
+
events.push({ kind: "usage", tokens: tokens(event.usage) });
|
|
36
|
+
events.push(event.is_error
|
|
37
|
+
? {
|
|
38
|
+
kind: "failure",
|
|
39
|
+
message: String(event.result ?? JSON.stringify(event.errors) ?? "Agent failed"),
|
|
40
|
+
}
|
|
41
|
+
: { kind: "finished" });
|
|
42
|
+
return events;
|
|
43
|
+
}
|
|
44
|
+
export function claudeEvents(line) {
|
|
45
|
+
return decodeLine(line, {
|
|
46
|
+
system,
|
|
47
|
+
assistant,
|
|
48
|
+
result,
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
export function claudeTranscriptUsage(text) {
|
|
52
|
+
let usage;
|
|
53
|
+
for (const line of text.split(/\r?\n/)) {
|
|
54
|
+
const event = decodeRecord(line);
|
|
55
|
+
if (event?.type !== "assistant")
|
|
56
|
+
continue;
|
|
57
|
+
const message = asRecord(event.message);
|
|
58
|
+
if (message.usage)
|
|
59
|
+
usage = tokens(message.usage);
|
|
60
|
+
}
|
|
61
|
+
return usage;
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=claude-events.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claude-events.js","sourceRoot":"","sources":["../../../src/adapters/agents/claude-events.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,YAAY,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AC,OAAO,CAAC,CAAC;QACxC,IAAI,OAAO,CAAC,KAAK;YAAE,KAAK,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IACnD,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["import type { AgentEvent, Usage } from \"../../domain/agent.types.ts\";\nimport { decodeEvent, decodeLine } from \"./event-decoder.ts\";\nimport { asRecord, decodeRecord, numberOrZero } from \"./protocol.ts\";\nimport type { EventDecoders, ProtocolRecord } from \"./protocol.types.ts\";\n\nfunction tokens(value: unknown): Usage {\n const usage = asRecord(value);\n return {\n input: numberOrZero(usage.input_tokens),\n cacheCreated: numberOrZero(usage.cache_creation_input_tokens),\n cached: numberOrZero(usage.cache_read_input_tokens),\n output: numberOrZero(usage.output_tokens),\n };\n}\n\nfunction system(event: ProtocolRecord): AgentEvent[] {\n return typeof event.session_id === \"string\"\n ? [{ kind: \"conversation\", id: event.session_id }]\n : [];\n}\n\nfunction assistant(event: ProtocolRecord): AgentEvent[] {\n const content = asRecord(event.message).content;\n if (!Array.isArray(content)) return [];\n return content.flatMap((part) =>\n decodeEvent(asRecord(part), {\n text: (block) =>\n typeof block.text === \"string\"\n ? [{ kind: \"text\", text: block.text }]\n : [],\n tool_use: (block) => [\n { kind: \"tool\", name: String(block.name), input: block.input },\n ],\n }),\n );\n}\n\nfunction result(event: ProtocolRecord): AgentEvent[] {\n const events: AgentEvent[] = [];\n if (!event.is_error && typeof event.result === \"string\")\n events.push({ kind: \"result\", text: event.result });\n if (event.usage) events.push({ kind: \"usage\", tokens: tokens(event.usage) });\n events.push(\n event.is_error\n ? {\n kind: \"failure\",\n message: String(\n event.result ?? JSON.stringify(event.errors) ?? \"Agent failed\",\n ),\n }\n : { kind: \"finished\" },\n );\n return events;\n}\n\nexport function claudeEvents(line: string): AgentEvent[] {\n return decodeLine(line, {\n system,\n assistant,\n result,\n } satisfies EventDecoders);\n}\n\nexport function claudeTranscriptUsage(text: string): Usage | undefined {\n let usage: Usage | undefined;\n for (const line of text.split(/\\r?\\n/)) {\n const event = decodeRecord(line);\n if (event?.type !== \"assistant\") continue;\n const message = asRecord(event.message);\n if (message.usage) usage = tokens(message.usage);\n }\n return usage;\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 { ClaudeSettings } from "./settings.types.ts";
|
|
4
|
+
export declare function claudeRequest(settings: ClaudeSettings, input: AgentInput): Command;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { validateContinuation } from "./continuation.js";
|
|
2
|
+
export function claudeRequest(settings, input) {
|
|
3
|
+
validateContinuation(input);
|
|
4
|
+
const args = [];
|
|
5
|
+
if (!input.interactive)
|
|
6
|
+
args.push("--print", "--verbose", "--output-format", "stream-json");
|
|
7
|
+
if (settings.model)
|
|
8
|
+
args.push("--model", settings.model);
|
|
9
|
+
if (settings.reasoning)
|
|
10
|
+
args.push("--effort", settings.reasoning);
|
|
11
|
+
if (settings.permissions)
|
|
12
|
+
args.push("--permission-mode", settings.permissions);
|
|
13
|
+
if (!settings.permissions && !input.interactive)
|
|
14
|
+
args.push("--dangerously-skip-permissions");
|
|
15
|
+
if (input.continuation) {
|
|
16
|
+
args.push("--resume", input.continuation.id);
|
|
17
|
+
if (input.continuation.fork)
|
|
18
|
+
args.push("--fork-session");
|
|
19
|
+
}
|
|
20
|
+
if (input.interactive && input.text !== undefined)
|
|
21
|
+
args.push("--", input.text);
|
|
22
|
+
return {
|
|
23
|
+
executable: "claude",
|
|
24
|
+
arguments: args,
|
|
25
|
+
...(input.interactive
|
|
26
|
+
? { interactive: true }
|
|
27
|
+
: { stdin: input.text ?? "" }),
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=claude-request.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claude-request.js","sourceRoot":"","s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AC,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 { validateContinuation } from \"./continuation.ts\";\nimport type { ClaudeSettings } from \"./settings.types.ts\";\n\nexport function claudeRequest(\n settings: ClaudeSettings,\n input: AgentInput,\n): Command {\n validateContinuation(input);\n const args: string[] = [];\n if (!input.interactive)\n args.push(\"--print\", \"--verbose\", \"--output-format\", \"stream-json\");\n if (settings.model) args.push(\"--model\", settings.model);\n if (settings.reasoning) args.push(\"--effort\", settings.reasoning);\n if (settings.permissions)\n args.push(\"--permission-mode\", settings.permissions);\n if (!settings.permissions && !input.interactive)\n args.push(\"--dangerously-skip-permissions\");\n if (input.continuation) {\n args.push(\"--resume\", input.continuation.id);\n if (input.continuation.fork) args.push(\"--fork-session\");\n }\n if (input.interactive && input.text !== undefined)\n args.push(\"--\", input.text);\n return {\n executable: \"claude\",\n arguments: args,\n ...(input.interactive\n ? { interactive: true }\n : { stdin: input.text ?? \"\" }),\n };\n}\n"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { codexEvents } from "./codex-events.js";
|
|
2
|
+
import { codexRequest } from "./codex-request.js";
|
|
3
|
+
export function codex(settings = {}) {
|
|
4
|
+
return Object.freeze({
|
|
5
|
+
name: "codex",
|
|
6
|
+
conversations: "codex",
|
|
7
|
+
resumable: true,
|
|
8
|
+
capture: settings.saveConversations ?? true,
|
|
9
|
+
variables: Object.freeze({ ...settings.variables }),
|
|
10
|
+
request: (input) => codexRequest(settings, input),
|
|
11
|
+
events: codexEvents,
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=codex-adapter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codex-adapter.js","sourceRoot":"","sources":["../../../src/adapters/agents/codex-adapter.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAGlD,MAAM,UAAU,KAAK,CAAC,WAA0B,EAAE;IAChD,OAAO,MAAM,CAAC,MAAM,CAAC;QACnB,IAAI,EAAE,OAAO;QACb,aAAa,EAAE,OAAO;QACtB,SAAS,EAAE,IAAI;QACf,OAAO,EAAE,QAAQ,CAAC,iBAAiB,IAAI,IAAI;QAC3C,SAAS,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,GAAG,QAAQ,CAAC,SAAS,EAAE,CAAC;QACnD,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,YAAY,CAAC,QAAQ,EAAE,KAAK,CAAC;QACjD,MAAM,EAAE,WAAW;KACG,CAAC,CAAC;AAC5B,CAAC","sourcesContent":["import type { AgentAdapter } from \"../../domain/agent.types.ts\";\nimport { codexEvents } from \"./codex-events.ts\";\nimport { codexRequest } from \"./codex-request.ts\";\nimport type { CodexSettings } from \"./settings.types.ts\";\n\nexport function codex(settings: CodexSettings = {}): AgentAdapter {\n return Object.freeze({\n name: \"codex\",\n conversations: \"codex\",\n resumable: true,\n capture: settings.saveConversations ?? true,\n variables: Object.freeze({ ...settings.variables }),\n request: (input) => codexRequest(settings, input),\n events: codexEvents,\n } satisfies AgentAdapter);\n}\n"]}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { decodeEvent, decodeLine } from "./event-decoder.js";
|
|
2
|
+
import { asRecord, numberOrZero } from "./protocol.js";
|
|
3
|
+
function conversation(event) {
|
|
4
|
+
return typeof event.thread_id === "string"
|
|
5
|
+
? [{ kind: "conversation", id: event.thread_id }]
|
|
6
|
+
: [];
|
|
7
|
+
}
|
|
8
|
+
function completedItem(event) {
|
|
9
|
+
return decodeEvent(asRecord(event.item), {
|
|
10
|
+
agent_message: (item) => typeof item.text === "string" ? [{ kind: "text", text: item.text }] : [],
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
function startedItem(event) {
|
|
14
|
+
return decodeEvent(asRecord(event.item), {
|
|
15
|
+
command_execution: (item) => [
|
|
16
|
+
{ kind: "tool", name: "command", input: item.command },
|
|
17
|
+
],
|
|
18
|
+
mcp_tool_call: (item) => [
|
|
19
|
+
{ kind: "tool", name: String(item.tool), input: item.arguments },
|
|
20
|
+
],
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
function completedTurn(event) {
|
|
24
|
+
const usage = asRecord(event.usage);
|
|
25
|
+
return [
|
|
26
|
+
{
|
|
27
|
+
kind: "usage",
|
|
28
|
+
tokens: {
|
|
29
|
+
input: numberOrZero(usage.input_tokens),
|
|
30
|
+
cached: numberOrZero(usage.cached_input_tokens),
|
|
31
|
+
output: numberOrZero(usage.output_tokens),
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
{ kind: "finished" },
|
|
35
|
+
];
|
|
36
|
+
}
|
|
37
|
+
function failure(event) {
|
|
38
|
+
const error = typeof event.error === "string"
|
|
39
|
+
? event.error
|
|
40
|
+
: asRecord(event.error).message;
|
|
41
|
+
return [
|
|
42
|
+
{
|
|
43
|
+
kind: "failure",
|
|
44
|
+
message: String(event.message ?? error ?? "Agent failed"),
|
|
45
|
+
},
|
|
46
|
+
];
|
|
47
|
+
}
|
|
48
|
+
export function codexEvents(line) {
|
|
49
|
+
return decodeLine(line, {
|
|
50
|
+
"thread.started": conversation,
|
|
51
|
+
"item.completed": completedItem,
|
|
52
|
+
"item.started": startedItem,
|
|
53
|
+
"turn.completed": completedTurn,
|
|
54
|
+
error: failure,
|
|
55
|
+
"turn.failed": failure,
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=codex-events.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codex-events.js","sour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AAK,GAAG,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACpC,OAAO;QACL;YACE,IAAI,EAAE,OAAO;YACb,MAAM,EAAE;gBACN,KAAK,EAAE,YAAY,CAAC,KAAK,CAAC,YAAY,CAAC;gBACvC,MAAM,EAAE,YAAY,CAAC,KAAK,CAAC,mBAAmB,CAAC;gBAC/C,MAAM,EAAE,YAAY,CAAC,KAAK,CAAC,aAAa,CAAC;aAC1C;SACF;QACD,EAAE,IAAI,EAAE,UAAU,EAAE;KACrB,CAAC;AACJ,CAAC;AAED,SAAS,OAAO,CAAC,KAAqB;IACpC,MAAM,KAAK,GACT,OAAO,KAAK,CAAC,KAAK,KAAK,QAAQ;QAC7B,CAAC,CAAC,KAAK,CAAC,KAAK;QACb,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC;IACpC,OAAO;QACL;YACE,IAAI,EAAE,SAAS;YACf,OAAO,EAAE,MAAM,CAAC,KAAK,CAAC,OAAO,IAAI,KAAK,IAAI,cAAc,CAAC;SAC1D;KACF,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,IAAY;IACtC,OAAO,UAAU,CAAC,IAAI,EAAE;QACtB,gBAAgB,EAAE,YAAY;QAC9B,gBAAgB,EAAE,aAAa;QAC/B,cAAc,EAAE,WAAW;QAC3B,gBAAgB,EAAE,aAAa;QAC/B,KAAK,EAAE,OAAO;QACd,aAAa,EAAE,OAAO;KACvB,CAAC,CAAC;AACL,CAAC","sourcesContent":["import type { AgentEvent } from \"../../domain/agent.types.ts\";\nimport { decodeEvent, decodeLine } from \"./event-decoder.ts\";\nimport { asRecord, numberOrZero } from \"./protocol.ts\";\nimport type { ProtocolRecord } from \"./protocol.types.ts\";\n\nfunction conversation(event: ProtocolRecord): AgentEvent[] {\n return typeof event.thread_id === \"string\"\n ? [{ kind: \"conversation\", id: event.thread_id }]\n : [];\n}\n\nfunction completedItem(event: ProtocolRecord): AgentEvent[] {\n return decodeEvent(asRecord(event.item), {\n agent_message: (item) =>\n typeof item.text === \"string\" ? [{ kind: \"text\", text: item.text }] : [],\n });\n}\n\nfunction startedItem(event: ProtocolRecord): AgentEvent[] {\n return decodeEvent(asRecord(event.item), {\n command_execution: (item) => [\n { kind: \"tool\", name: \"command\", input: item.command },\n ],\n mcp_tool_call: (item) => [\n { kind: \"tool\", name: String(item.tool), input: item.arguments },\n ],\n });\n}\n\nfunction completedTurn(event: ProtocolRecord): AgentEvent[] {\n const usage = asRecord(event.usage);\n return [\n {\n kind: \"usage\",\n tokens: {\n input: numberOrZero(usage.input_tokens),\n cached: numberOrZero(usage.cached_input_tokens),\n output: numberOrZero(usage.output_tokens),\n },\n },\n { kind: \"finished\" },\n ];\n}\n\nfunction failure(event: ProtocolRecord): AgentEvent[] {\n const error =\n typeof event.error === \"string\"\n ? event.error\n : asRecord(event.error).message;\n return [\n {\n kind: \"failure\",\n message: String(event.message ?? error ?? \"Agent failed\"),\n },\n ];\n}\n\nexport function codexEvents(line: string): AgentEvent[] {\n return decodeLine(line, {\n \"thread.started\": conversation,\n \"item.completed\": completedItem,\n \"item.started\": startedItem,\n \"turn.completed\": completedTurn,\n error: failure,\n \"turn.failed\": failure,\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 { CodexSettings } from "./settings.types.ts";
|
|
4
|
+
export declare function codexRequest(settings: CodexSettings, input: AgentInput): Command;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { validateContinuation } from "./continuation.js";
|
|
2
|
+
export function codexRequest(settings, input) {
|
|
3
|
+
validateContinuation(input);
|
|
4
|
+
const args = [];
|
|
5
|
+
if (settings.approvalReviewer === "auto_review")
|
|
6
|
+
args.push("-a", "on-request", "-s", "danger-full-access", "-c", 'approvals_reviewer="auto_review"');
|
|
7
|
+
if (settings.approvalReviewer !== "auto_review" && !input.interactive)
|
|
8
|
+
args.push("--dangerously-bypass-approvals-and-sandbox");
|
|
9
|
+
if (settings.model)
|
|
10
|
+
args.push("--model", settings.model);
|
|
11
|
+
if (settings.reasoning)
|
|
12
|
+
args.push("-c", `model_reasoning_effort="${settings.reasoning}"`);
|
|
13
|
+
if (!input.interactive)
|
|
14
|
+
args.push("exec");
|
|
15
|
+
if (input.continuation)
|
|
16
|
+
args.push(input.continuation.fork ? "fork" : "resume", input.continuation.id);
|
|
17
|
+
if (!input.interactive)
|
|
18
|
+
args.push("--json", "-");
|
|
19
|
+
if (input.interactive && input.text !== undefined)
|
|
20
|
+
args.push("--", input.text);
|
|
21
|
+
return {
|
|
22
|
+
executable: "codex",
|
|
23
|
+
arguments: args,
|
|
24
|
+
...(input.interactive
|
|
25
|
+
? { interactive: true }
|
|
26
|
+
: { stdin: input.text ?? "" }),
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=codex-request.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codex-request.js","sourceRoot":"","sources":["../../../src/adapters/agents/codex-request.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAGzD,MAAM,UAAU,YAAY,CAC1B,QAAuB,EACvB,KAAiB;IAEjB,oBAAoB,CAAC,KAAK,CAAC,CAAC;IAC5B,MAAM,IAAI,GAAa,EAAE,CAAC;IAC1B,IAAI,QAAQ,CAAC,gBAAgB,KAAK,aAAa;QAC7C,IAAI,CAAC,IAAI,CACP,IAAI,EACJ,YAAY,EACZ,IAAI,EACJ,oBAAoB,EACpB,IAAI,EACJ,kCAAkC,CACnC,CAAC;IACJ,IAAI,QAAQ,CAAC,gBAAgB,KAAK,aAAa,IAAI,CAAC,KAAK,CAAC,WAAW;QACnE,IAAI,CAAC,IAAI,CAAC,4CAA4C,CAAC,CAAC;IAC1D,IAAI,QAAQ,CAAC,KAAK;QAAE,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC;IACzD,IAAI,QAAQ,CAAC,SAAS;QACpB,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,2BAA2B,QAAQ,CAAC,SAAS,GAAG,CAAC,CAAC;IACpE,IAAI,CAAC,KAAK,CAAC,WAAW;QAAE,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC1C,IAAI,KAAK,CAAC,YAAY;QACpB,IAAI,CAAC,IAAI,CACP,KAAK,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,EAC3C,KAAK,CAAC,YAAY,CAAC,EAAE,CACtB,CAAC;IACJ,IAAI,CAAC,KAAK,CAAC,WAAW;QAAE,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;IACjD,IAAI,KAAK,CAAC,WAAW,IAAI,KAAK,CAAC,IAAI,KAAK,SAAS;QAC/C,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;IAC9B,OAAO;QACL,UAAU,EAAE,OAAO;QACnB,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 { validateContinuation } from \"./continuation.ts\";\nimport type { CodexSettings } from \"./settings.types.ts\";\n\nexport function codexRequest(\n settings: CodexSettings,\n input: AgentInput,\n): Command {\n validateContinuation(input);\n const args: string[] = [];\n if (settings.approvalReviewer === \"auto_review\")\n args.push(\n \"-a\",\n \"on-request\",\n \"-s\",\n \"danger-full-access\",\n \"-c\",\n 'approvals_reviewer=\"auto_review\"',\n );\n if (settings.approvalReviewer !== \"auto_review\" && !input.interactive)\n args.push(\"--dangerously-bypass-approvals-and-sandbox\");\n if (settings.model) args.push(\"--model\", settings.model);\n if (settings.reasoning)\n args.push(\"-c\", `model_reasoning_effort=\"${settings.reasoning}\"`);\n if (!input.interactive) args.push(\"exec\");\n if (input.continuation)\n args.push(\n input.continuation.fork ? \"fork\" : \"resume\",\n input.continuation.id,\n );\n if (!input.interactive) args.push(\"--json\", \"-\");\n if (input.interactive && input.text !== undefined)\n args.push(\"--\", input.text);\n return {\n executable: \"codex\",\n arguments: args,\n ...(input.interactive\n ? { interactive: true }\n : { stdin: input.text ?? \"\" }),\n };\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"continuation.js","sourceRoot":"","sources":["../../../src/adapters/agents/continuation.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEnD,MAAM,UAAU,oBAAoB,CAAC,KAAiB;IACpD,IAAI,KAAK,CAAC,YAAY;QACpB,SAAS,CACP,kBAAkB,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,EAAE,CAAC,EAC9C,iCAAiC,CAClC,CAAC;AACN,CAAC","sourcesContent":["import type { AgentInput } from \"../../domain/agent.types.ts\";\nimport { invariant } from \"../../domain/errors.ts\";\n\nexport function validateContinuation(input: AgentInput): void {\n if (input.continuation)\n invariant(\n /^[A-Za-z0-9_-]+$/.test(input.continuation.id),\n \"Invalid conversation identifier\",\n );\n}\n"]}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { AgentEvent } from "../../domain/agent.types.ts";
|
|
2
|
+
import type { EventDecoders, ProtocolRecord } from "./protocol.types.ts";
|
|
3
|
+
export declare function decodeEvent(event: ProtocolRecord, handlers: EventDecoders): AgentEvent[];
|
|
4
|
+
export declare function decodeLine(line: string, handlers: EventDecoders): AgentEvent[];
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { decodeRecord } from "./protocol.js";
|
|
2
|
+
export function decodeEvent(event, handlers) {
|
|
3
|
+
const handler = typeof event.type === "string" && Object.hasOwn(handlers, event.type)
|
|
4
|
+
? handlers[event.type]
|
|
5
|
+
: undefined;
|
|
6
|
+
return handler?.(event) ?? [];
|
|
7
|
+
}
|
|
8
|
+
export function decodeLine(line, handlers) {
|
|
9
|
+
const event = decodeRecord(line);
|
|
10
|
+
if (!event)
|
|
11
|
+
return [{ kind: "raw", value: line }];
|
|
12
|
+
const events = decodeEvent(event, handlers);
|
|
13
|
+
return events.length ? events : [{ kind: "raw", value: event }];
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=event-decoder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event-decoder.js","sourceRoot":"","sources":["../../../src/adapters/agents/event-decoder.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAG7C,MAAM,UAAU,WAAW,CACzB,KAAqB,EACrB,QAAuB;IAEvB,MAAM,OAAO,GACX,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ,IAAI,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE,KAAK,CAAC,IAAI,CAAC;QACnE,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC;QACtB,CAAC,CAAC,SAAS,CAAC;IAChB,OAAO,OAAO,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;AAChC,CAAC;AAED,MAAM,UAAU,UAAU,CACxB,IAAY,EACZ,QAAuB;IAEvB,MAAM,KAAK,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC;IACjC,IAAI,CAAC,KAAK;QAAE,OAAO,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;IAClD,MAAM,MAAM,GAAG,WAAW,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;IAC5C,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;AAClE,CAAC","sourcesContent":["import type { AgentEvent } from \"../../domain/agent.types.ts\";\nimport { decodeRecord } from \"./protocol.ts\";\nimport type { EventDecoders, ProtocolRecord } from \"./protocol.types.ts\";\n\nexport function decodeEvent(\n event: ProtocolRecord,\n handlers: EventDecoders,\n): AgentEvent[] {\n const handler =\n typeof event.type === \"string\" && Object.hasOwn(handlers, event.type)\n ? handlers[event.type]\n : undefined;\n return handler?.(event) ?? [];\n}\n\nexport function decodeLine(\n line: string,\n handlers: EventDecoders,\n): AgentEvent[] {\n const event = decodeRecord(line);\n if (!event) return [{ kind: \"raw\", value: line }];\n const events = decodeEvent(event, handlers);\n return events.length ? events : [{ kind: \"raw\", value: event }];\n}\n"]}
|