@elie-laloum/outpost 4.1.0 → 5.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 +38 -0
- package/README.md +13 -7
- package/SECURITY.md +2 -0
- package/dist/{cli/init-authentication.constants.js → adapters/agents/authentication.constants.js} +1 -1
- package/dist/adapters/agents/authentication.constants.js.map +1 -0
- package/dist/adapters/agents/authentication.d.ts +2 -0
- package/dist/adapters/agents/authentication.js +52 -0
- package/dist/adapters/agents/authentication.js.map +1 -0
- package/dist/adapters/agents/claude-adapter.d.ts +2 -2
- package/dist/adapters/agents/claude-adapter.js +30 -2
- package/dist/adapters/agents/claude-adapter.js.map +1 -1
- package/dist/adapters/agents/claude-request.d.ts +2 -2
- package/dist/adapters/agents/claude-request.js +3 -3
- package/dist/adapters/agents/claude-request.js.map +1 -1
- package/dist/adapters/agents/codex-adapter.d.ts +2 -2
- package/dist/adapters/agents/codex-adapter.js +17 -1
- package/dist/adapters/agents/codex-adapter.js.map +1 -1
- package/dist/adapters/agents/codex-provider.d.ts +2 -2
- package/dist/adapters/agents/codex-provider.js +1 -1
- package/dist/adapters/agents/codex-provider.js.map +1 -1
- package/dist/adapters/agents/codex-request.d.ts +2 -2
- package/dist/adapters/agents/codex-request.js +3 -3
- package/dist/adapters/agents/codex-request.js.map +1 -1
- package/dist/adapters/agents/gemini-adapter.d.ts +2 -2
- package/dist/adapters/agents/gemini-adapter.js +20 -1
- package/dist/adapters/agents/gemini-adapter.js.map +1 -1
- package/dist/adapters/agents/gemini-request.d.ts +2 -1
- package/dist/adapters/agents/gemini-request.js +1 -1
- package/dist/adapters/agents/gemini-request.js.map +1 -1
- package/dist/adapters/agents/gemini.types.d.ts +2 -1
- package/dist/adapters/agents/gemini.types.js.map +1 -1
- package/dist/adapters/agents/model-support.constants.d.ts +6 -0
- package/dist/adapters/agents/model-support.constants.js +18 -0
- package/dist/adapters/agents/model-support.constants.js.map +1 -0
- package/dist/adapters/agents/model-support.d.ts +4 -0
- package/dist/adapters/agents/model-support.js +11 -0
- package/dist/adapters/agents/model-support.js.map +1 -0
- package/dist/adapters/agents/settings.types.d.ts +11 -3
- package/dist/adapters/agents/settings.types.js.map +1 -1
- package/dist/adapters/models/anthropic-model-provider.constants.d.ts +3 -0
- package/dist/adapters/models/anthropic-model-provider.constants.js +17 -0
- package/dist/adapters/models/anthropic-model-provider.constants.js.map +1 -0
- package/dist/adapters/models/anthropic-model-provider.d.ts +3 -0
- package/dist/adapters/models/anthropic-model-provider.js +31 -0
- package/dist/adapters/models/anthropic-model-provider.js.map +1 -0
- package/dist/adapters/models/anthropic-model-provider.types.d.ts +7 -0
- package/dist/adapters/models/anthropic-model-provider.types.js +2 -0
- package/dist/adapters/models/anthropic-model-provider.types.js.map +1 -0
- package/dist/adapters/models/anthropic-request.d.ts +4 -0
- package/dist/adapters/models/anthropic-request.js +81 -0
- package/dist/adapters/models/anthropic-request.js.map +1 -0
- package/dist/adapters/models/anthropic-response.d.ts +3 -0
- package/dist/adapters/models/anthropic-response.js +55 -0
- package/dist/adapters/models/anthropic-response.js.map +1 -0
- package/dist/adapters/models/anthropic-stream.d.ts +2 -0
- package/dist/adapters/models/anthropic-stream.js +96 -0
- package/dist/adapters/models/anthropic-stream.js.map +1 -0
- package/dist/adapters/models/http-provider.d.ts +3 -0
- package/dist/adapters/models/http-provider.js +113 -0
- package/dist/adapters/models/http-provider.js.map +1 -0
- package/dist/adapters/models/model-http.d.ts +1 -0
- package/dist/adapters/models/model-http.js +30 -0
- package/dist/adapters/models/model-http.js.map +1 -0
- package/dist/adapters/models/model-protocol.types.d.ts +41 -0
- package/dist/adapters/models/model-protocol.types.js +2 -0
- package/dist/adapters/models/model-protocol.types.js.map +1 -0
- package/dist/adapters/models/model-request.d.ts +2 -0
- package/dist/adapters/models/model-request.js +18 -0
- package/dist/adapters/models/model-request.js.map +1 -0
- package/dist/adapters/models/model-response.d.ts +7 -0
- package/dist/adapters/models/model-response.js +41 -0
- package/dist/adapters/models/model-response.js.map +1 -0
- package/dist/adapters/models/model.constants.d.ts +4 -0
- package/dist/adapters/models/model.constants.js +15 -0
- package/dist/adapters/models/model.constants.js.map +1 -0
- package/dist/adapters/models/openai-chat-stream.d.ts +2 -0
- package/dist/adapters/models/openai-chat-stream.js +66 -0
- package/dist/adapters/models/openai-chat-stream.js.map +1 -0
- package/dist/adapters/models/openai-chat.d.ts +4 -0
- package/dist/adapters/models/openai-chat.js +108 -0
- package/dist/adapters/models/openai-chat.js.map +1 -0
- package/dist/adapters/models/openai-model-provider.d.ts +3 -0
- package/dist/adapters/models/openai-model-provider.js +13 -0
- package/dist/adapters/models/openai-model-provider.js.map +1 -0
- package/dist/adapters/models/openai-model-provider.types.d.ts +4 -0
- package/dist/adapters/models/openai-model-provider.types.js +2 -0
- package/dist/adapters/models/openai-model-provider.types.js.map +1 -0
- package/dist/adapters/models/openai-protocols.d.ts +2 -0
- package/dist/adapters/models/openai-protocols.js +22 -0
- package/dist/adapters/models/openai-protocols.js.map +1 -0
- package/dist/adapters/models/openai-responses-stream.d.ts +2 -0
- package/dist/adapters/models/openai-responses-stream.js +35 -0
- package/dist/adapters/models/openai-responses-stream.js.map +1 -0
- package/dist/adapters/models/openai-responses.d.ts +4 -0
- package/dist/adapters/models/openai-responses.js +107 -0
- package/dist/adapters/models/openai-responses.js.map +1 -0
- package/dist/adapters/models/openai-usage.d.ts +3 -0
- package/dist/adapters/models/openai-usage.js +20 -0
- package/dist/adapters/models/openai-usage.js.map +1 -0
- package/dist/adapters/models/stop-reasons.constants.d.ts +4 -0
- package/dist/adapters/models/stop-reasons.constants.js +19 -0
- package/dist/adapters/models/stop-reasons.constants.js.map +1 -0
- package/dist/adapters/models/stream-events.d.ts +3 -0
- package/dist/adapters/models/stream-events.js +22 -0
- package/dist/adapters/models/stream-events.js.map +1 -0
- package/dist/adapters/tools/edit-tools.d.ts +2 -0
- package/dist/adapters/tools/edit-tools.js +84 -0
- package/dist/adapters/tools/edit-tools.js.map +1 -0
- package/dist/adapters/tools/file-tools.d.ts +2 -0
- package/dist/adapters/tools/file-tools.js +97 -0
- package/dist/adapters/tools/file-tools.js.map +1 -0
- package/dist/adapters/tools/git-tools.d.ts +2 -0
- package/dist/adapters/tools/git-tools.js +54 -0
- package/dist/adapters/tools/git-tools.js.map +1 -0
- package/dist/adapters/tools/sandbox-files.d.ts +10 -0
- package/dist/adapters/tools/sandbox-files.js +60 -0
- package/dist/adapters/tools/sandbox-files.js.map +1 -0
- package/dist/adapters/tools/search-tools.d.ts +2 -0
- package/dist/adapters/tools/search-tools.js +65 -0
- package/dist/adapters/tools/search-tools.js.map +1 -0
- package/dist/adapters/tools/shell-tools.d.ts +3 -0
- package/dist/adapters/tools/shell-tools.js +38 -0
- package/dist/adapters/tools/shell-tools.js.map +1 -0
- package/dist/adapters/tools/tools.constants.d.ts +11 -0
- package/dist/adapters/tools/tools.constants.js +17 -0
- package/dist/adapters/tools/tools.constants.js.map +1 -0
- package/dist/adapters/tools/tools.types.d.ts +41 -0
- package/dist/adapters/tools/tools.types.js +2 -0
- package/dist/adapters/tools/tools.types.js.map +1 -0
- package/dist/application/activity-watchdog.js +15 -2
- package/dist/application/activity-watchdog.js.map +1 -1
- package/dist/application/agent-bootstrap.d.ts +2 -2
- package/dist/application/agent-bootstrap.js +2 -0
- package/dist/application/agent-bootstrap.js.map +1 -1
- package/dist/application/agent-storage.d.ts +3 -2
- package/dist/application/agent-storage.js +9 -2
- package/dist/application/agent-storage.js.map +1 -1
- package/dist/application/agent-turn.d.ts +3 -3
- package/dist/application/agent-turn.js +7 -1
- package/dist/application/agent-turn.js.map +1 -1
- package/dist/application/attach.js +1 -0
- package/dist/application/attach.js.map +1 -1
- package/dist/application/custom-turn.d.ts +5 -0
- package/dist/application/custom-turn.js +190 -0
- package/dist/application/custom-turn.js.map +1 -0
- package/dist/application/dispatch-observation.d.ts +3 -0
- package/dist/application/dispatch-observation.js +51 -0
- package/dist/application/dispatch-observation.js.map +1 -0
- package/dist/application/dispatch-observation.types.d.ts +5 -0
- package/dist/application/dispatch-observation.types.js +2 -0
- package/dist/application/dispatch-observation.types.js.map +1 -0
- package/dist/application/dispatch-validation.d.ts +2 -2
- package/dist/application/dispatch-validation.js.map +1 -1
- package/dist/application/dispatch.js +8 -3
- package/dist/application/dispatch.js.map +1 -1
- package/dist/application/doctor-image.js +3 -3
- package/dist/application/doctor-image.js.map +1 -1
- package/dist/application/doctor-protocol.js +9 -4
- package/dist/application/doctor-protocol.js.map +1 -1
- package/dist/application/doctor-sandbox.js +4 -4
- package/dist/application/doctor-sandbox.js.map +1 -1
- package/dist/application/doctor-sandbox.types.d.ts +2 -2
- package/dist/application/doctor-sandbox.types.js.map +1 -1
- package/dist/application/doctor.constants.d.ts +1 -1
- package/dist/application/doctor.constants.js +1 -1
- package/dist/application/doctor.constants.js.map +1 -1
- package/dist/application/doctor.js +10 -9
- package/dist/application/doctor.js.map +1 -1
- package/dist/application/doctor.types.d.ts +3 -3
- package/dist/application/doctor.types.js.map +1 -1
- package/dist/application/execution.d.ts +2 -2
- package/dist/application/execution.js +1 -1
- package/dist/application/execution.js.map +1 -1
- package/dist/application/execution.types.d.ts +11 -2
- package/dist/application/execution.types.js.map +1 -1
- package/dist/application/harness-context.d.ts +2 -0
- package/dist/application/harness-context.js +54 -0
- package/dist/application/harness-context.js.map +1 -0
- package/dist/application/harness-history.d.ts +3 -0
- package/dist/application/harness-history.js +17 -0
- package/dist/application/harness-history.js.map +1 -0
- package/dist/application/harness-hooks.d.ts +9 -0
- package/dist/application/harness-hooks.js +90 -0
- package/dist/application/harness-hooks.js.map +1 -0
- package/dist/application/harness-loop.d.ts +2 -0
- package/dist/application/harness-loop.js +132 -0
- package/dist/application/harness-loop.js.map +1 -0
- package/dist/application/harness.types.d.ts +55 -0
- package/dist/application/harness.types.js +2 -0
- package/dist/application/harness.types.js.map +1 -0
- package/dist/application/lifecycle.constants.d.ts +1 -1
- package/dist/application/lifecycle.constants.js +1 -1
- package/dist/application/lifecycle.constants.js.map +1 -1
- package/dist/application/outpost.types.d.ts +11 -6
- package/dist/application/outpost.types.js.map +1 -1
- package/dist/application/recovery-archive.d.ts +4 -0
- package/dist/application/recovery-archive.js +29 -0
- package/dist/application/recovery-archive.js.map +1 -0
- package/dist/application/recovery-archive.types.d.ts +10 -0
- package/dist/application/recovery-archive.types.js +2 -0
- package/dist/application/recovery-archive.types.js.map +1 -0
- package/dist/application/recovery-inspection.js +3 -0
- package/dist/application/recovery-inspection.js.map +1 -1
- package/dist/application/recovery-inspection.types.d.ts +2 -0
- package/dist/application/recovery-inspection.types.js.map +1 -1
- package/dist/application/recovery-retention.d.ts +2 -1
- package/dist/application/recovery-retention.js +9 -1
- package/dist/application/recovery-retention.js.map +1 -1
- package/dist/application/recovery-retention.types.d.ts +6 -0
- package/dist/application/recovery-retention.types.js.map +1 -1
- package/dist/application/remote-backup.js +8 -0
- package/dist/application/remote-backup.js.map +1 -1
- package/dist/application/remote-download.js +1 -1
- package/dist/application/remote-download.js.map +1 -1
- package/dist/application/remote-workspace.types.d.ts +2 -0
- package/dist/application/remote-workspace.types.js.map +1 -1
- package/dist/application/sandbox-agents.js +13 -4
- package/dist/application/sandbox-agents.js.map +1 -1
- package/dist/application/sandbox-attach.js +5 -2
- package/dist/application/sandbox-attach.js.map +1 -1
- package/dist/application/sandbox-dispatch.js +12 -3
- package/dist/application/sandbox-dispatch.js.map +1 -1
- package/dist/application/sandbox-provision.js +19 -10
- package/dist/application/sandbox-provision.js.map +1 -1
- package/dist/application/sandbox-session.types.d.ts +8 -8
- package/dist/application/sandbox-session.types.js.map +1 -1
- package/dist/application/sandbox.js +6 -3
- package/dist/application/sandbox.js.map +1 -1
- package/dist/application/speculation.js +1 -1
- package/dist/application/speculation.js.map +1 -1
- package/dist/application/speculation.types.d.ts +3 -3
- package/dist/application/speculation.types.js.map +1 -1
- package/dist/application/storage-reservation.js +3 -0
- package/dist/application/storage-reservation.js.map +1 -1
- package/dist/application/tasks.types.d.ts +2 -2
- package/dist/application/tasks.types.js.map +1 -1
- package/dist/application/tool-execution.d.ts +3 -0
- package/dist/application/tool-execution.js +211 -0
- package/dist/application/tool-execution.js.map +1 -0
- package/dist/application/transport-inspection.constants.d.ts +2 -0
- package/dist/application/transport-inspection.constants.js +10 -0
- package/dist/application/transport-inspection.constants.js.map +1 -0
- package/dist/application/transport-inspection.d.ts +2 -0
- package/dist/application/transport-inspection.js +103 -0
- package/dist/application/transport-inspection.js.map +1 -0
- package/dist/application/transport-retention.d.ts +4 -0
- package/dist/application/transport-retention.js +153 -0
- package/dist/application/transport-retention.js.map +1 -0
- package/dist/cli/commands.js +4 -2
- package/dist/cli/commands.js.map +1 -1
- package/dist/cli/doctor-command.js +6 -6
- package/dist/cli/doctor-command.js.map +1 -1
- package/dist/cli/init-authentication.js +6 -7
- package/dist/cli/init-authentication.js.map +1 -1
- package/dist/cli/init-command.js +3 -3
- package/dist/cli/init-command.js.map +1 -1
- package/dist/cli/main.constants.d.ts +4 -4
- package/dist/cli/main.constants.js +4 -4
- package/dist/cli/main.constants.js.map +1 -1
- package/dist/cli/recovery-command.js +1 -1
- package/dist/cli/recovery-command.js.map +1 -1
- package/dist/cli/scaffold-files.js +5 -4
- package/dist/cli/scaffold-files.js.map +1 -1
- package/dist/cli/scaffold-validation.js +13 -10
- package/dist/cli/scaffold-validation.js.map +1 -1
- package/dist/cli/scaffold.js +8 -4
- package/dist/cli/scaffold.js.map +1 -1
- package/dist/cli/scaffold.types.d.ts +1 -1
- package/dist/cli/scaffold.types.js.map +1 -1
- package/dist/cli/starters.js +8 -8
- package/dist/cli/starters.js.map +1 -1
- package/dist/domain/agent-model.d.ts +3 -0
- package/dist/domain/agent-model.js +22 -0
- package/dist/domain/agent-model.js.map +1 -0
- package/dist/domain/agent.d.ts +4 -0
- package/dist/domain/agent.js +32 -0
- package/dist/domain/agent.js.map +1 -0
- package/dist/domain/agent.types.d.ts +69 -2
- package/dist/domain/agent.types.js.map +1 -1
- package/dist/domain/context.constants.d.ts +7 -0
- package/dist/domain/context.constants.js +8 -0
- package/dist/domain/context.constants.js.map +1 -0
- package/dist/domain/context.d.ts +4 -0
- package/dist/domain/context.js +81 -0
- package/dist/domain/context.js.map +1 -0
- package/dist/domain/context.types.d.ts +26 -0
- package/dist/domain/context.types.js +2 -0
- package/dist/domain/context.types.js.map +1 -0
- package/dist/domain/conversation.types.d.ts +2 -0
- package/dist/domain/conversation.types.js.map +1 -1
- package/dist/domain/dispatch-telemetry.types.d.ts +12 -0
- package/dist/domain/dispatch-telemetry.types.js +2 -0
- package/dist/domain/dispatch-telemetry.types.js.map +1 -0
- package/dist/domain/errors.types.d.ts +1 -1
- package/dist/domain/errors.types.js.map +1 -1
- package/dist/domain/glob.d.ts +2 -0
- package/dist/domain/glob.js +25 -0
- package/dist/domain/glob.js.map +1 -0
- package/dist/domain/glob.types.d.ts +1 -0
- package/dist/domain/glob.types.js +2 -0
- package/dist/domain/glob.types.js.map +1 -0
- package/dist/domain/harness.constants.d.ts +11 -0
- package/dist/domain/harness.constants.js +24 -0
- package/dist/domain/harness.constants.js.map +1 -0
- package/dist/domain/harness.d.ts +2 -0
- package/dist/domain/harness.js +89 -0
- package/dist/domain/harness.js.map +1 -0
- package/dist/domain/harness.types.d.ts +60 -0
- package/dist/domain/harness.types.js +2 -0
- package/dist/domain/harness.types.js.map +1 -0
- package/dist/domain/hook.constants.d.ts +3 -0
- package/dist/domain/hook.constants.js +10 -0
- package/dist/domain/hook.constants.js.map +1 -0
- package/dist/domain/hook.d.ts +3 -0
- package/dist/domain/hook.js +25 -0
- package/dist/domain/hook.js.map +1 -0
- package/dist/domain/hook.types.d.ts +66 -0
- package/dist/domain/hook.types.js +2 -0
- package/dist/domain/hook.types.js.map +1 -0
- package/dist/domain/instructions.d.ts +3 -0
- package/dist/domain/instructions.js +25 -0
- package/dist/domain/instructions.js.map +1 -0
- package/dist/domain/model-messages.d.ts +5 -0
- package/dist/domain/model-messages.js +81 -0
- package/dist/domain/model-messages.js.map +1 -0
- package/dist/domain/model-messages.types.d.ts +6 -0
- package/dist/domain/model-messages.types.js +2 -0
- package/dist/domain/model-messages.types.js.map +1 -0
- package/dist/domain/model.constants.d.ts +4 -0
- package/dist/domain/model.constants.js +16 -0
- package/dist/domain/model.constants.js.map +1 -0
- package/dist/domain/model.types.d.ts +72 -0
- package/dist/domain/model.types.js +2 -0
- package/dist/domain/model.types.js.map +1 -0
- package/dist/domain/permissions.d.ts +3 -0
- package/dist/domain/permissions.js +92 -0
- package/dist/domain/permissions.js.map +1 -0
- package/dist/domain/permissions.types.d.ts +34 -0
- package/dist/domain/permissions.types.js +2 -0
- package/dist/domain/permissions.types.js.map +1 -0
- package/dist/domain/response.js +3 -2
- package/dist/domain/response.js.map +1 -1
- package/dist/domain/response.types.d.ts +12 -0
- package/dist/domain/response.types.js.map +1 -1
- package/dist/domain/skill.constants.d.ts +2 -0
- package/dist/domain/skill.constants.js +8 -0
- package/dist/domain/skill.constants.js.map +1 -0
- package/dist/domain/skill.d.ts +8 -0
- package/dist/domain/skill.js +79 -0
- package/dist/domain/skill.js.map +1 -0
- package/dist/domain/skill.types.d.ts +18 -0
- package/dist/domain/skill.types.js +2 -0
- package/dist/domain/skill.types.js.map +1 -0
- package/dist/domain/standard-schema.d.ts +6 -0
- package/dist/domain/standard-schema.js +45 -0
- package/dist/domain/standard-schema.js.map +1 -0
- package/dist/domain/tool-schema.d.ts +3 -0
- package/dist/domain/tool-schema.js +109 -0
- package/dist/domain/tool-schema.js.map +1 -0
- package/dist/domain/tool.constants.d.ts +4 -0
- package/dist/domain/tool.constants.js +36 -0
- package/dist/domain/tool.constants.js.map +1 -0
- package/dist/domain/tool.d.ts +4 -0
- package/dist/domain/tool.js +66 -0
- package/dist/domain/tool.js.map +1 -0
- package/dist/domain/tool.types.d.ts +62 -0
- package/dist/domain/tool.types.js +2 -0
- package/dist/domain/tool.types.js.map +1 -0
- package/dist/domain/transcript.d.ts +4 -0
- package/dist/domain/transcript.js +48 -0
- package/dist/domain/transcript.js.map +1 -0
- package/dist/domain/transcript.types.d.ts +15 -0
- package/dist/domain/transcript.types.js +2 -0
- package/dist/domain/transcript.types.js.map +1 -0
- package/dist/domain/transport.constants.d.ts +2 -0
- package/dist/domain/transport.constants.js +3 -0
- package/dist/domain/transport.constants.js.map +1 -0
- package/dist/domain/transport.d.ts +6 -0
- package/dist/domain/transport.js +21 -0
- package/dist/domain/transport.js.map +1 -0
- package/dist/domain/transport.types.d.ts +31 -0
- package/dist/domain/transport.types.js +2 -0
- package/dist/domain/transport.types.js.map +1 -0
- package/dist/domain/workflow/workflow-state.js +13 -6
- package/dist/domain/workflow/workflow-state.js.map +1 -1
- package/dist/domain/workflow.d.ts +1 -1
- package/dist/domain/workflow.js.map +1 -1
- package/dist/domain/workflow.types.d.ts +4 -0
- package/dist/domain/workflow.types.js.map +1 -1
- package/dist/index.d.ts +48 -5
- package/dist/index.js +26 -3
- package/dist/index.js.map +1 -1
- package/dist/infrastructure/artifact-store.js +10 -0
- package/dist/infrastructure/artifact-store.js.map +1 -1
- package/dist/infrastructure/artifact-store.types.d.ts +3 -1
- package/dist/infrastructure/artifact-store.types.js.map +1 -1
- package/dist/infrastructure/conversations/capture.js +1 -1
- package/dist/infrastructure/conversations/capture.js.map +1 -1
- package/dist/infrastructure/conversations/harness-store.d.ts +3 -0
- package/dist/infrastructure/conversations/harness-store.js +27 -0
- package/dist/infrastructure/conversations/harness-store.js.map +1 -0
- package/dist/infrastructure/conversations/harness-transcript.d.ts +2 -0
- package/dist/infrastructure/conversations/harness-transcript.js +50 -0
- package/dist/infrastructure/conversations/harness-transcript.js.map +1 -0
- package/dist/infrastructure/conversations/harness-transcript.types.d.ts +18 -0
- package/dist/infrastructure/conversations/harness-transcript.types.js +2 -0
- package/dist/infrastructure/conversations/harness-transcript.types.js.map +1 -0
- package/dist/infrastructure/conversations.d.ts +6 -1
- package/dist/infrastructure/conversations.js +5 -0
- package/dist/infrastructure/conversations.js.map +1 -1
- package/dist/infrastructure/conversations.types.d.ts +1 -0
- package/dist/infrastructure/conversations.types.js.map +1 -1
- package/dist/infrastructure/custom-reporter.d.ts +2 -0
- package/dist/infrastructure/custom-reporter.js +33 -0
- package/dist/infrastructure/custom-reporter.js.map +1 -0
- package/dist/infrastructure/custom-reporter.types.d.ts +13 -0
- package/dist/infrastructure/custom-reporter.types.js +2 -0
- package/dist/infrastructure/custom-reporter.types.js.map +1 -0
- package/dist/infrastructure/git/git.constants.d.ts +1 -1
- package/dist/infrastructure/git/git.constants.js +1 -0
- package/dist/infrastructure/git/git.constants.js.map +1 -1
- package/dist/infrastructure/inspection-file.js +3 -3
- package/dist/infrastructure/inspection-file.js.map +1 -1
- package/dist/infrastructure/inspection-hash.js +4 -3
- package/dist/infrastructure/inspection-hash.js.map +1 -1
- package/dist/infrastructure/inspection-path.d.ts +1 -0
- package/dist/infrastructure/inspection-path.js +18 -0
- package/dist/infrastructure/inspection-path.js.map +1 -0
- package/dist/infrastructure/journal.constants.d.ts +1 -0
- package/dist/infrastructure/journal.constants.js +2 -0
- package/dist/infrastructure/journal.constants.js.map +1 -0
- package/dist/infrastructure/journal.js +10 -1
- package/dist/infrastructure/journal.js.map +1 -1
- package/dist/infrastructure/journal.types.d.ts +3 -0
- package/dist/infrastructure/journal.types.js.map +1 -1
- package/dist/infrastructure/local-transport.d.ts +3 -0
- package/dist/infrastructure/local-transport.js +146 -0
- package/dist/infrastructure/local-transport.js.map +1 -0
- package/dist/infrastructure/local-transport.types.d.ts +3 -0
- package/dist/infrastructure/local-transport.types.js +2 -0
- package/dist/infrastructure/local-transport.types.js.map +1 -0
- package/dist/infrastructure/opentelemetry-dispatch.d.ts +6 -0
- package/dist/infrastructure/opentelemetry-dispatch.js +70 -0
- package/dist/infrastructure/opentelemetry-dispatch.js.map +1 -0
- package/dist/infrastructure/opentelemetry.constants.d.ts +3 -0
- package/dist/infrastructure/opentelemetry.constants.js +3 -0
- package/dist/infrastructure/opentelemetry.constants.js.map +1 -1
- package/dist/infrastructure/opentelemetry.js +4 -0
- package/dist/infrastructure/opentelemetry.js.map +1 -1
- package/dist/infrastructure/opentelemetry.types.d.ts +3 -3
- package/dist/infrastructure/opentelemetry.types.js.map +1 -1
- package/dist/infrastructure/reporter.js +27 -2
- package/dist/infrastructure/reporter.js.map +1 -1
- package/dist/infrastructure/resource-activity-inspection.d.ts +2 -1
- package/dist/infrastructure/resource-activity-inspection.js +5 -4
- package/dist/infrastructure/resource-activity-inspection.js.map +1 -1
- package/dist/infrastructure/resource-activity.js +44 -16
- package/dist/infrastructure/resource-activity.js.map +1 -1
- package/dist/infrastructure/resource-activity.types.d.ts +4 -2
- package/dist/infrastructure/resource-activity.types.js.map +1 -1
- package/dist/infrastructure/s3-transport.d.ts +4 -0
- package/dist/infrastructure/s3-transport.js +144 -0
- package/dist/infrastructure/s3-transport.js.map +1 -0
- package/dist/infrastructure/s3-transport.types.d.ts +6 -0
- package/dist/infrastructure/s3-transport.types.js +2 -0
- package/dist/infrastructure/s3-transport.types.js.map +1 -0
- package/dist/infrastructure/settings.d.ts +1 -1
- package/dist/infrastructure/settings.js +3 -3
- package/dist/infrastructure/settings.js.map +1 -1
- package/dist/infrastructure/sse.d.ts +2 -0
- package/dist/infrastructure/sse.js +64 -0
- package/dist/infrastructure/sse.js.map +1 -0
- package/dist/infrastructure/sse.types.d.ts +4 -0
- package/dist/infrastructure/sse.types.js +2 -0
- package/dist/infrastructure/sse.types.js.map +1 -0
- package/dist/infrastructure/storage-inventory.types.d.ts +2 -1
- package/dist/infrastructure/storage-inventory.types.js.map +1 -1
- package/dist/infrastructure/storage-reservations.types.d.ts +2 -0
- package/dist/infrastructure/storage-reservations.types.js.map +1 -1
- package/dist/infrastructure/task-queue-bullmq-resources.d.ts +13 -0
- package/dist/infrastructure/task-queue-bullmq-resources.js +118 -0
- package/dist/infrastructure/task-queue-bullmq-resources.js.map +1 -0
- package/dist/infrastructure/task-queue-bullmq-state.d.ts +5 -0
- package/dist/infrastructure/task-queue-bullmq-state.js +26 -0
- package/dist/infrastructure/task-queue-bullmq-state.js.map +1 -0
- package/dist/infrastructure/task-queue-bullmq.constants.d.ts +7 -0
- package/dist/infrastructure/task-queue-bullmq.constants.js +79 -0
- package/dist/infrastructure/task-queue-bullmq.constants.js.map +1 -0
- package/dist/infrastructure/task-queue-bullmq.d.ts +3 -0
- package/dist/infrastructure/task-queue-bullmq.js +124 -0
- package/dist/infrastructure/task-queue-bullmq.js.map +1 -0
- package/dist/infrastructure/task-queue-bullmq.types.d.ts +17 -0
- package/dist/infrastructure/task-queue-bullmq.types.js +2 -0
- package/dist/infrastructure/task-queue-bullmq.types.js.map +1 -0
- package/dist/infrastructure/transport-archive.constants.d.ts +6 -0
- package/dist/infrastructure/transport-archive.constants.js +7 -0
- package/dist/infrastructure/transport-archive.constants.js.map +1 -0
- package/dist/infrastructure/transport-archive.d.ts +5 -0
- package/dist/infrastructure/transport-archive.js +157 -0
- package/dist/infrastructure/transport-archive.js.map +1 -0
- package/dist/infrastructure/transport-archive.types.d.ts +17 -0
- package/dist/infrastructure/transport-archive.types.js +2 -0
- package/dist/infrastructure/transport-archive.types.js.map +1 -0
- package/dist/infrastructure/transport-artifact-store.d.ts +3 -0
- package/dist/infrastructure/transport-artifact-store.js +31 -0
- package/dist/infrastructure/transport-artifact-store.js.map +1 -0
- package/dist/infrastructure/transport-artifact-store.types.d.ts +4 -0
- package/dist/infrastructure/transport-artifact-store.types.js +2 -0
- package/dist/infrastructure/transport-artifact-store.types.js.map +1 -0
- package/dist/infrastructure/transport-checkpoint.d.ts +5 -0
- package/dist/infrastructure/transport-checkpoint.js +105 -0
- package/dist/infrastructure/transport-checkpoint.js.map +1 -0
- package/dist/infrastructure/transport-checkpoint.types.d.ts +9 -0
- package/dist/infrastructure/transport-checkpoint.types.js +2 -0
- package/dist/infrastructure/transport-checkpoint.types.js.map +1 -0
- package/dist/infrastructure/transport-conversations.d.ts +4 -0
- package/dist/infrastructure/transport-conversations.js +76 -0
- package/dist/infrastructure/transport-conversations.js.map +1 -0
- package/dist/infrastructure/transport-conversations.types.d.ts +4 -0
- package/dist/infrastructure/transport-conversations.types.js +2 -0
- package/dist/infrastructure/transport-conversations.types.js.map +1 -0
- package/dist/infrastructure/transport-envelope.d.ts +7 -0
- package/dist/infrastructure/transport-envelope.js +47 -0
- package/dist/infrastructure/transport-envelope.js.map +1 -0
- package/dist/infrastructure/transport-journal.d.ts +6 -0
- package/dist/infrastructure/transport-journal.js +94 -0
- package/dist/infrastructure/transport-journal.js.map +1 -0
- package/dist/infrastructure/transport-journal.types.d.ts +10 -0
- package/dist/infrastructure/transport-journal.types.js +2 -0
- package/dist/infrastructure/transport-journal.types.js.map +1 -0
- package/dist/infrastructure/transport-json.d.ts +6 -0
- package/dist/infrastructure/transport-json.js +46 -0
- package/dist/infrastructure/transport-json.js.map +1 -0
- package/dist/infrastructure/transport-reservations.d.ts +5 -0
- package/dist/infrastructure/transport-reservations.js +89 -0
- package/dist/infrastructure/transport-reservations.js.map +1 -0
- package/dist/infrastructure/transport-reservations.types.d.ts +4 -0
- package/dist/infrastructure/transport-reservations.types.js +2 -0
- package/dist/infrastructure/transport-reservations.types.js.map +1 -0
- package/dist/infrastructure/transport.constants.d.ts +8 -0
- package/dist/infrastructure/transport.constants.js +9 -0
- package/dist/infrastructure/transport.constants.js.map +1 -0
- package/dist/infrastructure/workflow-checkpoint.js +7 -0
- package/dist/infrastructure/workflow-checkpoint.js.map +1 -1
- package/dist/infrastructure/workflow-checkpoint.types.d.ts +3 -1
- package/dist/infrastructure/workflow-checkpoint.types.js.map +1 -1
- package/dist/providers/agents.d.ts +3 -3
- package/dist/providers/agents.js +3 -3
- package/dist/providers/agents.js.map +1 -1
- package/dist/providers/daytona.d.ts +1 -1
- package/dist/providers/daytona.js +1 -1
- package/dist/providers/daytona.js.map +1 -1
- package/dist/providers/docker.d.ts +1 -1
- package/dist/providers/docker.js +1 -1
- package/dist/providers/docker.js.map +1 -1
- package/dist/providers/factories.d.ts +2 -2
- package/dist/providers/factories.js +3 -3
- package/dist/providers/factories.js.map +1 -1
- package/dist/providers/firecracker.d.ts +1 -1
- package/dist/providers/firecracker.js +1 -1
- package/dist/providers/firecracker.js.map +1 -1
- package/dist/providers/local.d.ts +1 -1
- package/dist/providers/local.js +1 -1
- package/dist/providers/local.js.map +1 -1
- package/dist/providers/podman.d.ts +1 -1
- package/dist/providers/podman.js +1 -1
- package/dist/providers/podman.js.map +1 -1
- package/dist/providers/vercel.d.ts +1 -1
- package/dist/providers/vercel.js +1 -1
- package/dist/providers/vercel.js.map +1 -1
- package/package.json +26 -5
- package/dist/cli/init-authentication.constants.js.map +0 -1
- /package/dist/{cli/init-authentication.constants.d.ts → adapters/agents/authentication.constants.d.ts} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,43 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 5.0.0
|
|
4
|
+
|
|
5
|
+
Breaking changes, without compatibility aliases:
|
|
6
|
+
|
|
7
|
+
- Replace agent factories with `agent({ harness, model })` and the `codexHarness()`, `claudeHarness()` and `geminiHarness()` presets.
|
|
8
|
+
- Accept the model as a name or an `AgentModel` object with `reasoning` and `maxOutputTokens`; `agent.model` is now a normalized object. `reasoning` leaves `claudeHarness()` and `codexHarness()`, and `maxOutputTokens` leaves `anthropicModelProvider()`. The CLI harness or model provider rejects unsupported settings when the agent is composed: Claude Code maps them to `--effort` and `CLAUDE_CODE_MAX_OUTPUT_TOKENS`, Codex accepts reasoning only, Gemini CLI accepts neither, Anthropic requires an output limit and OpenAI forwards reasoning effort.
|
|
9
|
+
- Rename sandbox factories to `*SandboxProvider`, configuration to `sandboxProvider` and the CLI option to `--sandbox-provider`. Legacy resource records are reported as incompatible and are not deleted.
|
|
10
|
+
- Replace the experimental direct text client with `openaiModelProvider` and add `anthropicModelProvider`.
|
|
11
|
+
|
|
12
|
+
Experimental built-in harness engine:
|
|
13
|
+
|
|
14
|
+
- `harness({ modelProvider, instructions, tools, hooks, permissions, context, conversations, skills, limits, toolExecution, cache })` lets Outpost drive a model itself. The engine runs tools through the borrowed sandbox with input validation, read-only concurrency, per-call deadlines and ordered results, returns tool errors to the model and fails with the new `limit` error code on step, tool-call, token or output limits.
|
|
15
|
+
- Model providers exchange messages, tool calls, opaque reasoning replayed only to their provider identity and model, a normalized `stopReason`, system-prefix and history caching, and optional streaming through `stream()`, with `timeoutMs` measuring inactivity between chunks. Truncated or refused answers are reported instead of rejected.
|
|
16
|
+
- Add `defineHarnessTool()` (JSON Schema subset or Standard Schema inputs), `defineHarnessToolset()` and `defineHarnessInstructions()`.
|
|
17
|
+
- Add `defineHarnessHook()` for `session-start`, `before-model`, `after-model`, `before-tool`, `after-tool` and `stop`, and `defineHarnessPermissions()` for ordered allow/deny rules over tool names, commands and repository paths declared by a tool's `resources()`. Hook exceptions fail the turn.
|
|
18
|
+
- Add built-in toolsets: `harnessFileTools()`, `harnessEditTools()` with conflict-checked exact replacement, `harnessSearchTools()`, `harnessGitTools()` and `harnessShellTools()`.
|
|
19
|
+
- Record custom harness turns as append-only transcripts in `.outpost/conversations/harness/`, excluded from Git, with `harnessConversations()` by default or `transportConversations("harness", …)`. Custom harnesses support continuation, fork and response repairs. Add `defineHarnessContextStrategy()`, `truncateToolResults()` and `summarizeHistory()`.
|
|
20
|
+
- Add `defineHarnessSkill()` for instructions and tools loaded on demand through a reserved `load_skill` tool.
|
|
21
|
+
- Dispatch observers receive `step`, `tool-result`, `tool-denied`, `stop-prevented`, `compaction` and `text-delta` events; journals keep `text-delta` only in verbose mode.
|
|
22
|
+
- These APIs are tested with scripted providers, local simulated HTTP services and the local sandbox provider; no authenticated service campaign is implied.
|
|
23
|
+
|
|
24
|
+
Other changes:
|
|
25
|
+
|
|
26
|
+
- Add `workflow.start({ telemetry })` with an SDK-independent `WorkflowTelemetry` contract, independent custom observers and isolated callback errors. Preserve `observe: telemetry.observe` compatibility.
|
|
27
|
+
- Instrument complete dispatch operations with optional OpenTelemetry telemetry and add `createReporter()` with typed asynchronous handlers and explicit `flush()`.
|
|
28
|
+
- Share explicit CLI authentication preparation between library harnesses and generated workflows. Update package checks, examples and the English/French reference.
|
|
29
|
+
|
|
30
|
+
## 4.2.0
|
|
31
|
+
|
|
32
|
+
- Add experimental `openaiCompatible()` and typed model-provider contracts for direct, non-streaming Chat Completions or Responses calls without Codex. Bound requests and response sizes, support cancellation and optional reported usage, and reject incomplete or unsupported outputs. Tool execution and the agent harness remain planned for phase two; live service compatibility is unvalidated.
|
|
33
|
+
- Add a bilingual Model providers reference family with experimental icons and generated warning banners explaining the limitations. Add the same warning treatment to Firecracker and FirecrackerOptions.
|
|
34
|
+
- Add local/S3 object transports for artifacts, exclusively owned checkpoints, segmented journals, native conversation snapshots, verified recovery archives, shared storage reservations, resource activity and remote inventory/retention/quota operations. Preserve existing directory stores and local execution paths; AWS SDK loading remains optional. Remote ownership recovery is explicit and authenticated live storage campaigns remain outstanding.
|
|
35
|
+
- Add the optional `@elie-laloum/outpost/queues/bullmq` adapter for standalone Redis and BullMQ 5, preserving queue identity, lossless JSON results, fenced leases, cancellation and deadlines. Include asynchronous connection cleanup, real Redis integration tests and bilingual reference and operational guidance.
|
|
36
|
+
|
|
37
|
+
- Rebuild the bilingual documentation with separate Guide and Reference navigation, family overviews, contextual API descriptions, preserved symbol URLs and redirects for moved guides. Add complete runnable preparations and a schema-validation guide covering Zod, Valibot and JSON Schema.
|
|
38
|
+
- Group reference families under five fixed sections with short English labels in both locales, localized overview links with house icons, and keyboard-accessible desktop/mobile navigation. Group egress policies with sandbox providers.
|
|
39
|
+
- Avoid recreating filesystem roots when initializing local transports on Windows, and accept native short/case aliases during inspection without allowing symlink traversal. Preserve child transcripts when capturing Windows conversations, verify relocated paths as decoded JSON, and build the library before running documented Docker/Podman examples in CI.
|
|
40
|
+
|
|
3
41
|
## 4.1.0
|
|
4
42
|
|
|
5
43
|
- Replace global CLI parsing and manual help with Commander subcommands and command-specific options; use Clack selection prompts for interactive initialization. Previously ignored options belonging to other commands are now rejected. Headless and JSON output remain plain.
|
package/README.md
CHANGED
|
@@ -4,10 +4,12 @@
|
|
|
4
4
|
|
|
5
5
|
Outpost is a TypeScript library for running coding agents in reusable sandboxes, managing their Git workspaces and composing typed workflows. Claude Code, Codex and Gemini CLI adapters work with Docker, Podman, Vercel, Daytona or explicit host execution. Gemini supports fresh sessions only; native conversation capture, resume and fork are available for Claude Code and Codex.
|
|
6
6
|
|
|
7
|
-
Version
|
|
7
|
+
Version 5.0.0 composes every agent with `agent({ harness, model })`, moves reasoning and output limits onto the agent model, and adds an experimental built-in harness engine: Outpost drives a model provider with tools, hooks, permissions, persisted conversations, context strategies, skills and streaming. It contains breaking API changes. See the [changelog](CHANGELOG.md#500) for details and migration notes, and the [roadmap](https://elie-laloum.github.io/outpost/project/roadmap/) for remaining validation and upcoming priorities.
|
|
8
8
|
|
|
9
9
|
## Get started
|
|
10
10
|
|
|
11
|
+
New to Outpost? Follow the [complete first-run workshop](https://elie-laloum.github.io/outpost/guide/start/quickstart/): choose Codex or Claude and account or API-key access, create a disposable TypeScript repository, then fix and verify a real test. The [Guide](https://elie-laloum.github.io/outpost/guide/) teaches the concepts; the [Reference](https://elie-laloum.github.io/outpost/reference/) explains exact contracts. Every [cookbook recipe](https://elie-laloum.github.io/outpost/guide/cookbook/) includes its own preparation and runnable code.
|
|
12
|
+
|
|
11
13
|
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.
|
|
12
14
|
|
|
13
15
|
```sh
|
|
@@ -22,27 +24,31 @@ Copy `.env.example` to `.env` and declare `OPENAI_API_KEY`. An empty declaration
|
|
|
22
24
|
node run.ts "Add validation, run tests and commit the change"
|
|
23
25
|
```
|
|
24
26
|
|
|
25
|
-
`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.
|
|
27
|
+
`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/guide/workflows/sandbox-tasks/) to orchestrate several repositories.
|
|
26
28
|
|
|
27
|
-
Generated Codex API-key workflows prepare login inside the sandbox. For account login and credential storage, see [Connect Codex](https://elie-laloum.github.io/outpost/agents/connect-codex/) before dispatching.
|
|
29
|
+
Generated Codex API-key workflows prepare login inside the sandbox. For account login and credential storage, see [Connect Codex](https://elie-laloum.github.io/outpost/guide/agents/connect-codex/) before dispatching.
|
|
28
30
|
|
|
29
31
|
## Use the library
|
|
30
32
|
|
|
33
|
+
After preparing the selected agent credentials and provider, library calls follow this shape. For a fully runnable version with explicit authentication, use the [dispatch workshop](https://elie-laloum.github.io/outpost/guide/agents/dispatch/).
|
|
34
|
+
|
|
31
35
|
```ts
|
|
32
|
-
import { dispatch,
|
|
36
|
+
import { agent, dispatch, codexHarness } from "@elie-laloum/outpost";
|
|
33
37
|
|
|
34
38
|
const result = await dispatch({
|
|
35
39
|
repository: "/path1/repository",
|
|
36
|
-
agent:
|
|
40
|
+
agent: agent({ harness: codexHarness({}) }),
|
|
37
41
|
branch: { mode: "integrate" },
|
|
38
42
|
brief: { text: "Fix the failing tests, verify and commit." },
|
|
39
43
|
});
|
|
40
44
|
console.log(result.branch, result.commits);
|
|
41
45
|
```
|
|
42
46
|
|
|
43
|
-
`repository` selects a local Git checkout; without it, library calls use the current working directory. See [repository paths](https://elie-laloum.github.io/outpost/
|
|
47
|
+
`repository` selects a local Git checkout; without it, library calls use the current working directory. See [repository paths](https://elie-laloum.github.io/outpost/guide/environment/repositories/) for external checkouts and paths relative to the workflow script.
|
|
48
|
+
|
|
49
|
+
Let Outpost drive a model itself with `harness({ modelProvider, tools, instructions, limits })` and tools from `defineHarnessTool()`, then compose it with `agent({ harness, model })`. See [build a custom harness](https://elie-laloum.github.io/outpost/guide/agents/harness/) for a complete example.
|
|
44
50
|
|
|
45
|
-
Learn about [sandboxes](https://elie-laloum.github.io/outpost/
|
|
51
|
+
Learn about [sandboxes](https://elie-laloum.github.io/outpost/guide/environment/lifecycle/), [workflows](https://elie-laloum.github.io/outpost/guide/workflows/graph/), [providers](https://elie-laloum.github.io/outpost/guide/environment/providers/overview/) and [recovery](https://elie-laloum.github.io/outpost/guide/operations/recovery/) in the English/French documentation. The [roadmap](https://elie-laloum.github.io/outpost/project/roadmap/) describes future work.
|
|
46
52
|
|
|
47
53
|
## Development
|
|
48
54
|
|
package/SECURITY.md
CHANGED
|
@@ -15,3 +15,5 @@ Prompt command expansion only recognizes commands present in the original prompt
|
|
|
15
15
|
Conversation transcripts, logs, bundles and patches may contain secrets. Runtime files are ignored by Git and sensitive files are created with restrictive permissions where supported. Keep API keys in environment variables or ignored `.env` files. Never embed tokens in tracked configuration, remote URLs or examples.
|
|
16
16
|
|
|
17
17
|
Report vulnerabilities privately using the repository's security reporting channel when enabled, or contact the maintainer through the hosting profile. Do not include live credentials in reports. V1 receives fixes for reproducible security defects.
|
|
18
|
+
|
|
19
|
+
Explicit storage transports can send artifacts, journals, transcripts, recovery payloads and operational metadata to the configured object store. The caller owns the S3 client and credentials; they are not forwarded to agents. Use a dedicated private bucket prefix and access policy. Object revisions fence cooperating writers but do not authenticate artifact producers or operators. Stop an abandoned runner independently before releasing its checkpoint ownership; a remote PID is not proof of inactivity.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authentication.constants.js","sourceRoot":"","sources":["../../../src/adapters/agents/authentication.constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,KAAK,EAAE;QACL,WAAW,EAAE,mBAAmB;QAChC,KAAK,EACH,iZAAiZ;QACnZ,IAAI,EAAE,sWAAsW;KAC7W;IACD,MAAM,EAAE,EAAE,WAAW,EAAE,sBAAsB,EAAE;IAC/C,MAAM,EAAE,EAAE,WAAW,EAAE,mBAAmB,EAAE;CACpC,CAAC","sourcesContent":["export const authenticationRecipes = {\n codex: {\n environment: \"OPENAI_API_KEY=\\n\",\n login:\n 'const {spawnSync}=require(\"node:child_process\"); const {existsSync}=require(\"node:fs\"); const {join}=require(\"node:path\"); const {homedir}=require(\"node:os\"); const installed=join(homedir(),\".outpost-tools\",\"bin\",\"codex\"); const result=spawnSync(existsSync(installed)?installed:\"codex\",[\"login\",\"--with-api-key\"],{stdio:\"inherit\",shell:process.platform===\"win32\"}); process.exit(result.status ?? 1);',\n seed: 'const {mkdirSync,writeFileSync,readFileSync,chmodSync}=require(\"node:fs\"); const {join}=require(\"node:path\"); const {homedir}=require(\"node:os\"); const directory=join(homedir(),\".codex\"); mkdirSync(directory,{recursive:true,mode:0o700}); const target=join(directory,\"auth.json\"); writeFileSync(target,readFileSync(0),{mode:0o600}); chmodSync(target,0o600);',\n },\n claude: { environment: \"ANTHROPIC_API_KEY=\\n\" },\n gemini: { environment: \"GEMINI_API_KEY=\\n\" },\n} as const;\n"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import type { AgentAdapter, AgentAuthentication } from "../../domain/agent.types.ts";
|
|
2
|
+
export declare function authenticationCommand(name: "codex" | "claude" | "gemini", authentication: AgentAuthentication | undefined, externalModel?: boolean): NonNullable<AgentAdapter["authenticate"]>;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { invariant } from "../../domain/errors.js";
|
|
2
|
+
import { authenticationRecipes } from "./authentication.constants.js";
|
|
3
|
+
export function authenticationCommand(name, authentication, externalModel = false) {
|
|
4
|
+
if (!authentication)
|
|
5
|
+
return () => undefined;
|
|
6
|
+
const mode = authentication.mode;
|
|
7
|
+
invariant(mode === "api-key" ||
|
|
8
|
+
(mode === "oauth-token" && name === "claude") ||
|
|
9
|
+
(mode === "login" && name === "codex" && !externalModel), "Unsupported harness authentication mode");
|
|
10
|
+
if (mode === "login") {
|
|
11
|
+
const credentials = authentication.credentials;
|
|
12
|
+
if (credentials === undefined)
|
|
13
|
+
return () => undefined;
|
|
14
|
+
try {
|
|
15
|
+
JSON.parse(credentials);
|
|
16
|
+
}
|
|
17
|
+
catch {
|
|
18
|
+
throw new Error("Invalid Codex credential JSON");
|
|
19
|
+
}
|
|
20
|
+
return () => ({
|
|
21
|
+
executable: "node",
|
|
22
|
+
arguments: ["-e", authenticationRecipes.codex.seed],
|
|
23
|
+
stdin: credentials,
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
const environment = mode === "oauth-token"
|
|
27
|
+
? "CLAUDE_CODE_OAUTH_TOKEN"
|
|
28
|
+
: (authentication.environment ??
|
|
29
|
+
authenticationRecipes[name].environment.trim().replace("=", ""));
|
|
30
|
+
invariant(/^[A-Za-z_][A-Za-z0-9_]*$/.test(environment), "Invalid authentication environment variable");
|
|
31
|
+
invariant(name === "codex" ||
|
|
32
|
+
mode === "oauth-token" ||
|
|
33
|
+
environment ===
|
|
34
|
+
authenticationRecipes[name].environment.trim().replace("=", ""), "This CLI requires its standard authentication environment variable");
|
|
35
|
+
return (variables) => {
|
|
36
|
+
invariant(variables[environment], `Missing ${environment}. Declare the selected credential explicitly.`);
|
|
37
|
+
if (name === "claude") {
|
|
38
|
+
const conflict = mode === "oauth-token"
|
|
39
|
+
? "ANTHROPIC_API_KEY"
|
|
40
|
+
: "CLAUDE_CODE_OAUTH_TOKEN";
|
|
41
|
+
invariant(!variables[conflict], "Conflicting Claude authentication methods");
|
|
42
|
+
}
|
|
43
|
+
if (name !== "codex" || externalModel)
|
|
44
|
+
return undefined;
|
|
45
|
+
return {
|
|
46
|
+
executable: "node",
|
|
47
|
+
arguments: ["-e", authenticationRecipes.codex.login],
|
|
48
|
+
stdin: variables[environment],
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=authentication.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authentication.js","sourceRoot":"","sources":["../../../src/adapters/agents/authentication.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAKnD,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAEtE,MAAM,UAAU,qBAAqB,CACnC,IAAmC,EACnC,cAA+C,EAC/C,aAAa,GAAG,KAAK;IAErB,IAAI,CAAC,cAAc;QAAE,OAAO,GAAG,EAAE,CAAC,SAAS,CAAC;IAC5C,MAAM,IAAI,GAAG,cAAc,CAAC,IAAI,CAAC;IACjC,SAAS,CACP,IAAI,KAAK,SAAS;QAChB,CAAC,IAAI,KAAK,aAAa,IAAI,IAAI,KAAK,QAAQ,CAAC;QAC7C,CAAC,IAAI,KAAK,OAAO,IAAI,IAAI,KAAK,OAAO,IAAI,CAAC,aAAa,CAAC,EAC1D,yCAAyC,CAC1C,CAAC;IACF,IAAI,IAAI,KAAK,OAAO,EAAE,CAAC;QACrB,MAAM,WAAW,GAAG,cAAc,CAAC,WAAW,CAAC;QAC/C,IAAI,WAAW,KAAK,SAAS;YAAE,OAAO,GAAG,EAAE,CAAC,SAAS,CAAC;QACtD,IAAI,CAAC;YACH,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;QAC1B,CAAC;QAAC,MAAM,CAAC;YACP,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAC;QACnD,CAAC;QACD,OAAO,GAAG,EAAE,CAAC,CAAC;YACZ,UAAU,EAAE,MAAM;YAClB,SAAS,EAAE,CAAC,IAAI,EAAE,qBAAqB,CAAC,KAAK,CAAC,IAAI,CAAC;YACnD,KAAK,EAAE,WAAW;SACnB,CAAC,CAAC;IACL,CAAC;IACD,MAAM,WAAW,GACf,IAAI,KAAK,aAAa;QACpB,CAAC,CAAC,yBAAyB;QAC3B,CAAC,CAAC,CAAC,cAAc,CAAC,WAAW;YAC3B,qBAAqB,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,CAAC;IACvE,SAAS,CACP,0BAA0B,CAAC,IAAI,CAAC,WAAW,CAAC,EAC5C,6CAA6C,CAC9C,CAAC;IACF,SAAS,CACP,IAAI,KAAK,OAAO;QACd,IAAI,KAAK,aAAa;QACtB,WAAW;YACT,qBAAqB,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,EACnE,oEAAoE,CACrE,CAAC;IACF,OAAO,CAAC,SAAS,EAAE,EAAE;QACnB,SAAS,CACP,SAAS,CAAC,WAAW,CAAC,EACtB,WAAW,WAAW,+CAA+C,CACtE,CAAC;QACF,IAAI,IAAI,KAAK,QAAQ,EAAE,CAAC;YACtB,MAAM,QAAQ,GACZ,IAAI,KAAK,aAAa;gBACpB,CAAC,CAAC,mBAAmB;gBACrB,CAAC,CAAC,yBAAyB,CAAC;YAChC,SAAS,CACP,CAAC,SAAS,CAAC,QAAQ,CAAC,EACpB,2CAA2C,CAC5C,CAAC;QACJ,CAAC;QACD,IAAI,IAAI,KAAK,OAAO,IAAI,aAAa;YAAE,OAAO,SAAS,CAAC;QACxD,OAAO;YACL,UAAU,EAAE,MAAM;YAClB,SAAS,EAAE,CAAC,IAAI,EAAE,qBAAqB,CAAC,KAAK,CAAC,KAAK,CAAC;YACpD,KAAK,EAAE,SAAS,CAAC,WAAW,CAAC;SAC9B,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import { invariant } from \"../../domain/errors.ts\";\nimport type {\n AgentAdapter,\n AgentAuthentication,\n} from \"../../domain/agent.types.ts\";\nimport { authenticationRecipes } from \"./authentication.constants.ts\";\n\nexport function authenticationCommand(\n name: \"codex\" | \"claude\" | \"gemini\",\n authentication: AgentAuthentication | undefined,\n externalModel = false,\n): NonNullable<AgentAdapter[\"authenticate\"]> {\n if (!authentication) return () => undefined;\n const mode = authentication.mode;\n invariant(\n mode === \"api-key\" ||\n (mode === \"oauth-token\" && name === \"claude\") ||\n (mode === \"login\" && name === \"codex\" && !externalModel),\n \"Unsupported harness authentication mode\",\n );\n if (mode === \"login\") {\n const credentials = authentication.credentials;\n if (credentials === undefined) return () => undefined;\n try {\n JSON.parse(credentials);\n } catch {\n throw new Error(\"Invalid Codex credential JSON\");\n }\n return () => ({\n executable: \"node\",\n arguments: [\"-e\", authenticationRecipes.codex.seed],\n stdin: credentials,\n });\n }\n const environment =\n mode === \"oauth-token\"\n ? \"CLAUDE_CODE_OAUTH_TOKEN\"\n : (authentication.environment ??\n authenticationRecipes[name].environment.trim().replace(\"=\", \"\"));\n invariant(\n /^[A-Za-z_][A-Za-z0-9_]*$/.test(environment),\n \"Invalid authentication environment variable\",\n );\n invariant(\n name === \"codex\" ||\n mode === \"oauth-token\" ||\n environment ===\n authenticationRecipes[name].environment.trim().replace(\"=\", \"\"),\n \"This CLI requires its standard authentication environment variable\",\n );\n return (variables) => {\n invariant(\n variables[environment],\n `Missing ${environment}. Declare the selected credential explicitly.`,\n );\n if (name === \"claude\") {\n const conflict =\n mode === \"oauth-token\"\n ? \"ANTHROPIC_API_KEY\"\n : \"CLAUDE_CODE_OAUTH_TOKEN\";\n invariant(\n !variables[conflict],\n \"Conflicting Claude authentication methods\",\n );\n }\n if (name !== \"codex\" || externalModel) return undefined;\n return {\n executable: \"node\",\n arguments: [\"-e\", authenticationRecipes.codex.login],\n stdin: variables[environment],\n };\n };\n}\n"]}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { CliHarness } from "../../domain/agent.types.ts";
|
|
2
2
|
import type { ClaudeSettings } from "./settings.types.ts";
|
|
3
|
-
export declare function
|
|
3
|
+
export declare function claudeHarness(settings?: ClaudeSettings): CliHarness;
|
|
@@ -1,15 +1,43 @@
|
|
|
1
|
+
import { invariant } from "../../domain/errors.js";
|
|
2
|
+
import { authenticationCommand } from "./authentication.js";
|
|
1
3
|
import { claudeEvents, claudeTranscriptUsage } from "./claude-events.js";
|
|
2
4
|
import { claudeRequest } from "./claude-request.js";
|
|
3
|
-
|
|
5
|
+
import { CLAUDE_MAX_OUTPUT_VARIABLE, claudeModelSupport, } from "./model-support.constants.js";
|
|
6
|
+
import { harnessSettings, supportModel } from "./model-support.js";
|
|
7
|
+
function bindClaude(settings) {
|
|
8
|
+
supportModel(claudeModelSupport, settings.model);
|
|
9
|
+
const maxOutputTokens = settings.model?.maxOutputTokens;
|
|
10
|
+
invariant(maxOutputTokens === undefined ||
|
|
11
|
+
!Object.hasOwn(settings.variables ?? {}, CLAUDE_MAX_OUTPUT_VARIABLE), `Set maxOutputTokens on the agent model or ${CLAUDE_MAX_OUTPUT_VARIABLE}, not both`);
|
|
4
12
|
return Object.freeze({
|
|
5
13
|
name: "claude",
|
|
14
|
+
authenticate: authenticationCommand("claude", settings.authentication),
|
|
6
15
|
conversations: "claude",
|
|
7
16
|
resumable: true,
|
|
8
17
|
capture: settings.saveConversations ?? true,
|
|
9
|
-
variables: Object.freeze({
|
|
18
|
+
variables: Object.freeze({
|
|
19
|
+
...settings.variables,
|
|
20
|
+
...(maxOutputTokens === undefined
|
|
21
|
+
? {}
|
|
22
|
+
: { [CLAUDE_MAX_OUTPUT_VARIABLE]: String(maxOutputTokens) }),
|
|
23
|
+
}),
|
|
10
24
|
request: (input) => claudeRequest(settings, input),
|
|
11
25
|
events: claudeEvents,
|
|
12
26
|
transcriptUsage: claudeTranscriptUsage,
|
|
13
27
|
});
|
|
14
28
|
}
|
|
29
|
+
export function claudeHarness(settings = {}) {
|
|
30
|
+
harnessSettings(settings);
|
|
31
|
+
const configured = Object.freeze({
|
|
32
|
+
...settings,
|
|
33
|
+
variables: Object.freeze({ ...settings.variables }),
|
|
34
|
+
});
|
|
35
|
+
return Object.freeze({
|
|
36
|
+
kind: "cli",
|
|
37
|
+
bind: (model) => bindClaude({
|
|
38
|
+
...configured,
|
|
39
|
+
...(model === undefined ? {} : { model }),
|
|
40
|
+
}),
|
|
41
|
+
});
|
|
42
|
+
}
|
|
15
43
|
//# sourceMappingURL=claude-adapter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claude-adapter.js","sourceRoot":"","sources":["../../../src/adapters/agents/claude-adapter.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"claude-adapter.js","sourceRoot":"","sources":["../../../src/adapters/agents/claude-adapter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEnD,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAE5D,OAAO,EAAE,YAAY,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AACzE,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EACL,0BAA0B,EAC1B,kBAAkB,GACnB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAGnE,SAAS,UAAU,CAAC,QAA+B;IACjD,YAAY,CAAC,kBAAkB,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC;IACjD,MAAM,eAAe,GAAG,QAAQ,CAAC,KAAK,EAAE,eAAe,CAAC;IACxD,SAAS,CACP,eAAe,KAAK,SAAS;QAC3B,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,SAAS,IAAI,EAAE,EAAE,0BAA0B,CAAC,EACtE,6CAA6C,0BAA0B,YAAY,CACpF,CAAC;IACF,OAAO,MAAM,CAAC,MAAM,CAAC;QACnB,IAAI,EAAE,QAAQ;QACd,YAAY,EAAE,qBAAqB,CAAC,QAAQ,EAAE,QAAQ,CAAC,cAAc,CAAC;QACtE,aAAa,EAAE,QAAQ;QACvB,SAAS,EAAE,IAAI;QACf,OAAO,EAAE,QAAQ,CAAC,iBAAiB,IAAI,IAAI;QAC3C,SAAS,EAAE,MAAM,CAAC,MAAM,CAAC;YACvB,GAAG,QAAQ,CAAC,SAAS;YACrB,GAAG,CAAC,eAAe,KAAK,SAAS;gBAC/B,CAAC,CAAC,EAAE;gBACJ,CAAC,CAAC,EAAE,CAAC,0BAA0B,CAAC,EAAE,MAAM,CAAC,eAAe,CAAC,EAAE,CAAC;SAC/D,CAAC;QACF,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;AAED,MAAM,UAAU,aAAa,CAAC,WAA2B,EAAE;IACzD,eAAe,CAAC,QAAQ,CAAC,CAAC;IAC1B,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC;QAC/B,GAAG,QAAQ;QACX,SAAS,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,GAAG,QAAQ,CAAC,SAAS,EAAE,CAAC;KACpD,CAAC,CAAC;IACH,OAAO,MAAM,CAAC,MAAM,CAAC;QACnB,IAAI,EAAE,KAAK;QACX,IAAI,EAAE,CAAC,KAAkB,EAAE,EAAE,CAC3B,UAAU,CAAC;YACT,GAAG,UAAU;YACb,GAAG,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC;SAC1C,CAAC;KACL,CAAC,CAAC;AACL,CAAC","sourcesContent":["import { invariant } from \"../../domain/errors.ts\";\nimport type { AgentModel } from \"../../domain/model.types.ts\";\nimport { authenticationCommand } from \"./authentication.ts\";\nimport type { AgentAdapter, CliHarness } from \"../../domain/agent.types.ts\";\nimport { claudeEvents, claudeTranscriptUsage } from \"./claude-events.ts\";\nimport { claudeRequest } from \"./claude-request.ts\";\nimport {\n CLAUDE_MAX_OUTPUT_VARIABLE,\n claudeModelSupport,\n} from \"./model-support.constants.ts\";\nimport { harnessSettings, supportModel } from \"./model-support.ts\";\nimport type { Bound, ClaudeSettings } from \"./settings.types.ts\";\n\nfunction bindClaude(settings: Bound<ClaudeSettings>): AgentAdapter {\n supportModel(claudeModelSupport, settings.model);\n const maxOutputTokens = settings.model?.maxOutputTokens;\n invariant(\n maxOutputTokens === undefined ||\n !Object.hasOwn(settings.variables ?? {}, CLAUDE_MAX_OUTPUT_VARIABLE),\n `Set maxOutputTokens on the agent model or ${CLAUDE_MAX_OUTPUT_VARIABLE}, not both`,\n );\n return Object.freeze({\n name: \"claude\",\n authenticate: authenticationCommand(\"claude\", settings.authentication),\n conversations: \"claude\",\n resumable: true,\n capture: settings.saveConversations ?? true,\n variables: Object.freeze({\n ...settings.variables,\n ...(maxOutputTokens === undefined\n ? {}\n : { [CLAUDE_MAX_OUTPUT_VARIABLE]: String(maxOutputTokens) }),\n }),\n request: (input) => claudeRequest(settings, input),\n events: claudeEvents,\n transcriptUsage: claudeTranscriptUsage,\n } satisfies AgentAdapter);\n}\n\nexport function claudeHarness(settings: ClaudeSettings = {}): CliHarness {\n harnessSettings(settings);\n const configured = Object.freeze({\n ...settings,\n variables: Object.freeze({ ...settings.variables }),\n });\n return Object.freeze({\n kind: \"cli\",\n bind: (model?: AgentModel) =>\n bindClaude({\n ...configured,\n ...(model === undefined ? {} : { model }),\n }),\n });\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { AgentInput } from "../../domain/agent.types.ts";
|
|
2
2
|
import type { Command } from "../../domain/command.types.ts";
|
|
3
|
-
import type { ClaudeSettings } from "./settings.types.ts";
|
|
4
|
-
export declare function claudeRequest(settings: ClaudeSettings
|
|
3
|
+
import type { Bound, ClaudeSettings } from "./settings.types.ts";
|
|
4
|
+
export declare function claudeRequest(settings: Bound<ClaudeSettings>, input: AgentInput): Command;
|
|
@@ -5,9 +5,9 @@ export function claudeRequest(settings, input) {
|
|
|
5
5
|
if (!input.interactive)
|
|
6
6
|
args.push("--print", "--verbose", "--output-format", "stream-json");
|
|
7
7
|
if (settings.model)
|
|
8
|
-
args.push("--model", settings.model);
|
|
9
|
-
if (settings.reasoning)
|
|
10
|
-
args.push("--effort", settings.reasoning);
|
|
8
|
+
args.push("--model", settings.model.name);
|
|
9
|
+
if (settings.model?.reasoning)
|
|
10
|
+
args.push("--effort", settings.model.reasoning);
|
|
11
11
|
if (settings.permissions)
|
|
12
12
|
args.push("--permission-mode", settings.permissions);
|
|
13
13
|
if (!settings.permissions && !input.interactive)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claude-request.js","sourceRoot":"","sources":["../../../src/adapters/agents/claude-request.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAGzD,MAAM,UAAU,aAAa,CAC3B,
|
|
1
|
+
{"version":3,"file":"claude-request.js","sourceRoot":"","sources":["../../../src/adapters/agents/claude-request.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAGzD,MAAM,UAAU,aAAa,CAC3B,QAA+B,EAC/B,KAAiB;IAEjB,oBAAoB,CAAC,KAAK,CAAC,CAAC;IAC5B,MAAM,IAAI,GAAa,EAAE,CAAC;IAC1B,IAAI,CAAC,KAAK,CAAC,WAAW;QACpB,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,WAAW,EAAE,iBAAiB,EAAE,aAAa,CAAC,CAAC;IACtE,IAAI,QAAQ,CAAC,KAAK;QAAE,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC9D,IAAI,QAAQ,CAAC,KAAK,EAAE,SAAS;QAC3B,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,QAAQ,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;IAClD,IAAI,QAAQ,CAAC,WAAW;QACtB,IAAI,CAAC,IAAI,CAAC,mBAAmB,EAAE,QAAQ,CAAC,WAAW,CAAC,CAAC;IACvD,IAAI,CAAC,QAAQ,CAAC,WAAW,IAAI,CAAC,KAAK,CAAC,WAAW;QAC7C,IAAI,CAAC,IAAI,CAAC,gCAAgC,CAAC,CAAC;IAC9C,IAAI,KAAK,CAAC,YAAY,EAAE,CAAC;QACvB,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,KAAK,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC;QAC7C,IAAI,KAAK,CAAC,YAAY,CAAC,IAAI;YAAE,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;IAC3D,CAAC;IACD,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,QAAQ;QACpB,SAAS,EAAE,IAAI;QACf,GAAG,CAAC,KAAK,CAAC,WAAW;YACnB,CAAC,CAAC,EAAE,WAAW,EAAE,IAAI,EAAE;YACvB,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,IAAI,IAAI,EAAE,EAAE,CAAC;KACjC,CAAC;AACJ,CAAC","sourcesContent":["import type { AgentInput } from \"../../domain/agent.types.ts\";\nimport type { Command } from \"../../domain/command.types.ts\";\nimport { validateContinuation } from \"./continuation.ts\";\nimport type { Bound, ClaudeSettings } from \"./settings.types.ts\";\n\nexport function claudeRequest(\n settings: Bound<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.name);\n if (settings.model?.reasoning)\n args.push(\"--effort\", settings.model.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"]}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { CliHarness } from "../../domain/agent.types.ts";
|
|
2
2
|
import type { CodexSettings } from "./settings.types.ts";
|
|
3
|
-
export declare function
|
|
3
|
+
export declare function codexHarness(settings?: CodexSettings): CliHarness;
|
|
@@ -1,10 +1,15 @@
|
|
|
1
|
+
import { authenticationCommand } from "./authentication.js";
|
|
1
2
|
import { codexProvider } from "./codex-provider.js";
|
|
2
3
|
import { codexEvents } from "./codex-events.js";
|
|
3
4
|
import { codexRequest } from "./codex-request.js";
|
|
4
|
-
|
|
5
|
+
import { codexModelSupport } from "./model-support.constants.js";
|
|
6
|
+
import { harnessSettings, supportModel } from "./model-support.js";
|
|
7
|
+
function bindCodex(settings) {
|
|
8
|
+
supportModel(codexModelSupport, settings.model);
|
|
5
9
|
codexProvider(settings);
|
|
6
10
|
return Object.freeze({
|
|
7
11
|
name: "codex",
|
|
12
|
+
authenticate: authenticationCommand("codex", settings.authentication, settings.modelProvider !== undefined),
|
|
8
13
|
conversations: "codex",
|
|
9
14
|
resumable: true,
|
|
10
15
|
capture: settings.saveConversations ?? true,
|
|
@@ -13,4 +18,15 @@ export function codex(settings = {}) {
|
|
|
13
18
|
events: codexEvents,
|
|
14
19
|
});
|
|
15
20
|
}
|
|
21
|
+
export function codexHarness(settings = {}) {
|
|
22
|
+
harnessSettings(settings);
|
|
23
|
+
const configured = Object.freeze({
|
|
24
|
+
...settings,
|
|
25
|
+
variables: Object.freeze({ ...settings.variables }),
|
|
26
|
+
});
|
|
27
|
+
return Object.freeze({
|
|
28
|
+
kind: "cli",
|
|
29
|
+
bind: (model) => bindCodex({ ...configured, ...(model === undefined ? {} : { model }) }),
|
|
30
|
+
});
|
|
31
|
+
}
|
|
16
32
|
//# sourceMappingURL=codex-adapter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codex-adapter.js","sourceRoot":"","sources":["../../../src/adapters/agents/codex-adapter.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"codex-adapter.js","sourceRoot":"","sources":["../../../src/adapters/agents/codex-adapter.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAE5D,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAGnE,SAAS,SAAS,CAAC,QAA8B;IAC/C,YAAY,CAAC,iBAAiB,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC;IAChD,aAAa,CAAC,QAAQ,CAAC,CAAC;IACxB,OAAO,MAAM,CAAC,MAAM,CAAC;QACnB,IAAI,EAAE,OAAO;QACb,YAAY,EAAE,qBAAqB,CACjC,OAAO,EACP,QAAQ,CAAC,cAAc,EACvB,QAAQ,CAAC,aAAa,KAAK,SAAS,CACrC;QACD,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;AAED,MAAM,UAAU,YAAY,CAAC,WAA0B,EAAE;IACvD,eAAe,CAAC,QAAQ,CAAC,CAAC;IAC1B,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC;QAC/B,GAAG,QAAQ;QACX,SAAS,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,GAAG,QAAQ,CAAC,SAAS,EAAE,CAAC;KACpD,CAAC,CAAC;IACH,OAAO,MAAM,CAAC,MAAM,CAAC;QACnB,IAAI,EAAE,KAAK;QACX,IAAI,EAAE,CAAC,KAAkB,EAAE,EAAE,CAC3B,SAAS,CAAC,EAAE,GAAG,UAAU,EAAE,GAAG,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;KAC1E,CAAC,CAAC;AACL,CAAC","sourcesContent":["import type { AgentModel } from \"../../domain/model.types.ts\";\nimport { authenticationCommand } from \"./authentication.ts\";\nimport type { AgentAdapter, CliHarness } from \"../../domain/agent.types.ts\";\nimport { codexProvider } from \"./codex-provider.ts\";\nimport { codexEvents } from \"./codex-events.ts\";\nimport { codexRequest } from \"./codex-request.ts\";\nimport { codexModelSupport } from \"./model-support.constants.ts\";\nimport { harnessSettings, supportModel } from \"./model-support.ts\";\nimport type { Bound, CodexSettings } from \"./settings.types.ts\";\n\nfunction bindCodex(settings: Bound<CodexSettings>): AgentAdapter {\n supportModel(codexModelSupport, settings.model);\n codexProvider(settings);\n return Object.freeze({\n name: \"codex\",\n authenticate: authenticationCommand(\n \"codex\",\n settings.authentication,\n settings.modelProvider !== undefined,\n ),\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\nexport function codexHarness(settings: CodexSettings = {}): CliHarness {\n harnessSettings(settings);\n const configured = Object.freeze({\n ...settings,\n variables: Object.freeze({ ...settings.variables }),\n });\n return Object.freeze({\n kind: \"cli\",\n bind: (model?: AgentModel) =>\n bindCodex({ ...configured, ...(model === undefined ? {} : { model }) }),\n });\n}\n"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { CodexSettings } from "./settings.types.ts";
|
|
2
|
-
export declare function codexProvider(settings: CodexSettings): readonly string[];
|
|
1
|
+
import type { Bound, CodexSettings } from "./settings.types.ts";
|
|
2
|
+
export declare function codexProvider(settings: Bound<CodexSettings>): readonly string[];
|
|
@@ -3,7 +3,7 @@ export function codexProvider(settings) {
|
|
|
3
3
|
const provider = settings.modelProvider;
|
|
4
4
|
if (!provider)
|
|
5
5
|
return [];
|
|
6
|
-
invariant(settings.model?.trim(), "A custom model provider requires a model name");
|
|
6
|
+
invariant(settings.model?.name.trim(), "A custom model provider requires a model name");
|
|
7
7
|
let url;
|
|
8
8
|
try {
|
|
9
9
|
url = new URL(provider.baseUrl);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codex-provider.js","sourceRoot":"","sources":["../../../src/adapters/agents/codex-provider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAGnD,MAAM,UAAU,aAAa,
|
|
1
|
+
{"version":3,"file":"codex-provider.js","sourceRoot":"","sources":["../../../src/adapters/agents/codex-provider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAGnD,MAAM,UAAU,aAAa,CAC3B,QAA8B;IAE9B,MAAM,QAAQ,GAAG,QAAQ,CAAC,aAAa,CAAC;IACxC,IAAI,CAAC,QAAQ;QAAE,OAAO,EAAE,CAAC;IACzB,SAAS,CACP,QAAQ,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,EAAE,EAC3B,+CAA+C,CAChD,CAAC;IACF,IAAI,GAAQ,CAAC;IACb,IAAI,CAAC;QACH,GAAG,GAAG,IAAI,GAAG,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;IAClC,CAAC;IAAC,MAAM,CAAC;QACP,MAAM,IAAI,KAAK,CAAC,wDAAwD,CAAC,CAAC;IAC5E,CAAC;IACD,SAAS,CACP,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC;QACxC,CAAC,GAAG,CAAC,QAAQ;QACb,CAAC,GAAG,CAAC,QAAQ;QACb,CAAC,GAAG,CAAC,MAAM;QACX,CAAC,GAAG,CAAC,IAAI,EACX,yFAAyF,CAC1F,CAAC;IACF,MAAM,WAAW,GAAG,QAAQ,CAAC,iBAAiB,IAAI,gBAAgB,CAAC;IACnE,SAAS,CACP,WAAW,KAAK,KAAK,IAAI,0BAA0B,CAAC,IAAI,CAAC,WAAW,CAAC,EACrE,qDAAqD,CACtD,CAAC;IACF,MAAM,aAAa,GAAG;QACpB,qCAAqC;QACrC,6DAA6D;QAC7D,+CAA+C,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE;QACjF,yDAAyD;QACzD,+DAA+D;KAChE,CAAC;IACF,IAAI,WAAW,KAAK,KAAK;QACvB,aAAa,CAAC,IAAI,CAChB,8CAA8C,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,EAAE,CAC5E,CAAC;IACJ,OAAO,aAAa,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC;AACzD,CAAC","sourcesContent":["import { invariant } from \"../../domain/errors.ts\";\nimport type { Bound, CodexSettings } from \"./settings.types.ts\";\n\nexport function codexProvider(\n settings: Bound<CodexSettings>,\n): readonly string[] {\n const provider = settings.modelProvider;\n if (!provider) return [];\n invariant(\n settings.model?.name.trim(),\n \"A custom model provider requires a model name\",\n );\n let url: URL;\n try {\n url = new URL(provider.baseUrl);\n } catch {\n throw new Error(\"Model provider baseUrl must be an absolute HTTP(S) URL\");\n }\n invariant(\n [\"http:\", \"https:\"].includes(url.protocol) &&\n !url.username &&\n !url.password &&\n !url.search &&\n !url.hash,\n \"Model provider baseUrl must use HTTP(S) without embedded credentials, query or fragment\",\n );\n const environment = provider.apiKeyEnvironment ?? \"OPENAI_API_KEY\";\n invariant(\n environment === false || /^[A-Za-z_][A-Za-z0-9_]*$/.test(environment),\n \"Invalid model provider API-key environment variable\",\n );\n const configuration = [\n 'model_provider=\"outpost_compatible\"',\n 'model_providers.outpost_compatible.name=\"OpenAI compatible\"',\n `model_providers.outpost_compatible.base_url=${JSON.stringify(provider.baseUrl)}`,\n 'model_providers.outpost_compatible.wire_api=\"responses\"',\n \"model_providers.outpost_compatible.requires_openai_auth=false\",\n ];\n if (environment !== false)\n configuration.push(\n `model_providers.outpost_compatible.env_key=${JSON.stringify(environment)}`,\n );\n return configuration.flatMap((value) => [\"-c\", value]);\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { AgentInput } from "../../domain/agent.types.ts";
|
|
2
2
|
import type { Command } from "../../domain/command.types.ts";
|
|
3
|
-
import type { CodexSettings } from "./settings.types.ts";
|
|
4
|
-
export declare function codexRequest(settings: CodexSettings
|
|
3
|
+
import type { Bound, CodexSettings } from "./settings.types.ts";
|
|
4
|
+
export declare function codexRequest(settings: Bound<CodexSettings>, input: AgentInput): Command;
|
|
@@ -8,9 +8,9 @@ export function codexRequest(settings, input) {
|
|
|
8
8
|
if (settings.approvalReviewer !== "auto_review" && !input.interactive)
|
|
9
9
|
args.push("--dangerously-bypass-approvals-and-sandbox");
|
|
10
10
|
if (settings.model)
|
|
11
|
-
args.push("--model", settings.model);
|
|
12
|
-
if (settings.reasoning)
|
|
13
|
-
args.push("-c", `model_reasoning_effort="${settings.reasoning}"`);
|
|
11
|
+
args.push("--model", settings.model.name);
|
|
12
|
+
if (settings.model?.reasoning)
|
|
13
|
+
args.push("-c", `model_reasoning_effort="${settings.model.reasoning}"`);
|
|
14
14
|
if (!input.interactive)
|
|
15
15
|
args.push("exec");
|
|
16
16
|
if (input.continuation)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codex-request.js","sourceRoot":"","sources":["../../../src/adapters/agents/codex-request.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAGzD,MAAM,UAAU,YAAY,CAC1B,
|
|
1
|
+
{"version":3,"file":"codex-request.js","sourceRoot":"","sources":["../../../src/adapters/agents/codex-request.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAGzD,MAAM,UAAU,YAAY,CAC1B,QAA8B,EAC9B,KAAiB;IAEjB,oBAAoB,CAAC,KAAK,CAAC,CAAC;IAC5B,MAAM,IAAI,GAAa,CAAC,GAAG,aAAa,CAAC,QAAQ,CAAC,CAAC,CAAC;IACpD,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,IAAI,CAAC,CAAC;IAC9D,IAAI,QAAQ,CAAC,KAAK,EAAE,SAAS;QAC3B,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,2BAA2B,QAAQ,CAAC,KAAK,CAAC,SAAS,GAAG,CAAC,CAAC;IAC1E,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 { codexProvider } from \"./codex-provider.ts\";\nimport { validateContinuation } from \"./continuation.ts\";\nimport type { Bound, CodexSettings } from \"./settings.types.ts\";\n\nexport function codexRequest(\n settings: Bound<CodexSettings>,\n input: AgentInput,\n): Command {\n validateContinuation(input);\n const args: string[] = [...codexProvider(settings)];\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.name);\n if (settings.model?.reasoning)\n args.push(\"-c\", `model_reasoning_effort=\"${settings.model.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"]}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { CliHarness } from "../../domain/agent.types.ts";
|
|
2
2
|
import type { GeminiSettings } from "./gemini.types.ts";
|
|
3
|
-
export declare function
|
|
3
|
+
export declare function geminiHarness(settings?: GeminiSettings): CliHarness;
|
|
@@ -1,8 +1,13 @@
|
|
|
1
|
+
import { authenticationCommand } from "./authentication.js";
|
|
1
2
|
import { geminiEvents } from "./gemini-events.js";
|
|
2
3
|
import { geminiRequest } from "./gemini-request.js";
|
|
3
|
-
|
|
4
|
+
import { geminiModelSupport } from "./model-support.constants.js";
|
|
5
|
+
import { harnessSettings, supportModel } from "./model-support.js";
|
|
6
|
+
function bindGemini(settings) {
|
|
7
|
+
supportModel(geminiModelSupport, settings.model);
|
|
4
8
|
return Object.freeze({
|
|
5
9
|
name: "gemini",
|
|
10
|
+
authenticate: authenticationCommand("gemini", settings.authentication),
|
|
6
11
|
bootstrap: "gemini",
|
|
7
12
|
resumable: false,
|
|
8
13
|
capture: false,
|
|
@@ -12,4 +17,18 @@ export function gemini(settings = {}) {
|
|
|
12
17
|
events: geminiEvents,
|
|
13
18
|
});
|
|
14
19
|
}
|
|
20
|
+
export function geminiHarness(settings = {}) {
|
|
21
|
+
harnessSettings(settings);
|
|
22
|
+
const configured = Object.freeze({
|
|
23
|
+
...settings,
|
|
24
|
+
variables: Object.freeze({ ...settings.variables }),
|
|
25
|
+
});
|
|
26
|
+
return Object.freeze({
|
|
27
|
+
kind: "cli",
|
|
28
|
+
bind: (model) => bindGemini({
|
|
29
|
+
...configured,
|
|
30
|
+
...(model === undefined ? {} : { model }),
|
|
31
|
+
}),
|
|
32
|
+
});
|
|
33
|
+
}
|
|
15
34
|
//# sourceMappingURL=gemini-adapter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gemini-adapter.js","sourceRoot":"","sources":["../../../src/adapters/agents/gemini-adapter.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"gemini-adapter.js","sourceRoot":"","sources":["../../../src/adapters/agents/gemini-adapter.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAE5D,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAGnE,SAAS,UAAU,CAAC,QAA+B;IACjD,YAAY,CAAC,kBAAkB,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC;IACjD,OAAO,MAAM,CAAC,MAAM,CAAC;QACnB,IAAI,EAAE,QAAQ;QACd,YAAY,EAAE,qBAAqB,CAAC,QAAQ,EAAE,QAAQ,CAAC,cAAc,CAAC;QACtE,SAAS,EAAE,QAAQ;QACnB,SAAS,EAAE,KAAK;QAChB,OAAO,EAAE,KAAK;QACd,qBAAqB,EAAE,IAAI;QAC3B,SAAS,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,GAAG,QAAQ,CAAC,SAAS,EAAE,CAAC;QACnD,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,aAAa,CAAC,QAAQ,EAAE,KAAK,CAAC;QAClD,MAAM,EAAE,YAAY;KACE,CAAC,CAAC;AAC5B,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,WAA2B,EAAE;IACzD,eAAe,CAAC,QAAQ,CAAC,CAAC;IAC1B,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC;QAC/B,GAAG,QAAQ;QACX,SAAS,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,GAAG,QAAQ,CAAC,SAAS,EAAE,CAAC;KACpD,CAAC,CAAC;IACH,OAAO,MAAM,CAAC,MAAM,CAAC;QACnB,IAAI,EAAE,KAAK;QACX,IAAI,EAAE,CAAC,KAAkB,EAAE,EAAE,CAC3B,UAAU,CAAC;YACT,GAAG,UAAU;YACb,GAAG,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC;SAC1C,CAAC;KACL,CAAC,CAAC;AACL,CAAC","sourcesContent":["import type { AgentModel } from \"../../domain/model.types.ts\";\nimport { authenticationCommand } from \"./authentication.ts\";\nimport type { AgentAdapter, CliHarness } from \"../../domain/agent.types.ts\";\nimport { geminiEvents } from \"./gemini-events.ts\";\nimport { geminiRequest } from \"./gemini-request.ts\";\nimport type { GeminiSettings } from \"./gemini.types.ts\";\nimport { geminiModelSupport } from \"./model-support.constants.ts\";\nimport { harnessSettings, supportModel } from \"./model-support.ts\";\nimport type { Bound } from \"./settings.types.ts\";\n\nfunction bindGemini(settings: Bound<GeminiSettings>): AgentAdapter {\n supportModel(geminiModelSupport, settings.model);\n return Object.freeze({\n name: \"gemini\",\n authenticate: authenticationCommand(\"gemini\", settings.authentication),\n bootstrap: \"gemini\",\n resumable: false,\n capture: false,\n requiresFinishedEvent: true,\n variables: Object.freeze({ ...settings.variables }),\n request: (input) => geminiRequest(settings, input),\n events: geminiEvents,\n } satisfies AgentAdapter);\n}\n\nexport function geminiHarness(settings: GeminiSettings = {}): CliHarness {\n harnessSettings(settings);\n const configured = Object.freeze({\n ...settings,\n variables: Object.freeze({ ...settings.variables }),\n });\n return Object.freeze({\n kind: \"cli\",\n bind: (model?: AgentModel) =>\n bindGemini({\n ...configured,\n ...(model === undefined ? {} : { model }),\n }),\n });\n}\n"]}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { AgentInput } from "../../domain/agent.types.ts";
|
|
2
2
|
import type { Command } from "../../domain/command.types.ts";
|
|
3
3
|
import type { GeminiSettings } from "./gemini.types.ts";
|
|
4
|
-
|
|
4
|
+
import type { Bound } from "./settings.types.ts";
|
|
5
|
+
export declare function geminiRequest(settings: Bound<GeminiSettings>, input: AgentInput): Command;
|
|
@@ -3,7 +3,7 @@ export function geminiRequest(settings, input) {
|
|
|
3
3
|
invariant(!input.continuation, "Gemini does not support continuation or fork in Outpost");
|
|
4
4
|
const args = [];
|
|
5
5
|
if (settings.model)
|
|
6
|
-
args.push("--model", settings.model);
|
|
6
|
+
args.push("--model", settings.model.name);
|
|
7
7
|
const approvalMode = settings.approvalMode ?? (input.interactive ? "default" : "yolo");
|
|
8
8
|
args.push("--approval-mode", approvalMode);
|
|
9
9
|
if (!input.interactive && approvalMode === "yolo")
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gemini-request.js","sourceRoot":"","sources":["../../../src/adapters/agents/gemini-request.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"gemini-request.js","sourceRoot":"","sources":["../../../src/adapters/agents/gemini-request.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAInD,MAAM,UAAU,aAAa,CAC3B,QAA+B,EAC/B,KAAiB;IAEjB,SAAS,CACP,CAAC,KAAK,CAAC,YAAY,EACnB,yDAAyD,CAC1D,CAAC;IACF,MAAM,IAAI,GAAa,EAAE,CAAC;IAC1B,IAAI,QAAQ,CAAC,KAAK;QAAE,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC9D,MAAM,YAAY,GAChB,QAAQ,CAAC,YAAY,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;IACpE,IAAI,CAAC,IAAI,CAAC,iBAAiB,EAAE,YAAY,CAAC,CAAC;IAC3C,IAAI,CAAC,KAAK,CAAC,WAAW,IAAI,YAAY,KAAK,MAAM;QAAE,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;IAC7E,IAAI,CAAC,KAAK,CAAC,WAAW;QAAE,IAAI,CAAC,IAAI,CAAC,iBAAiB,EAAE,aAAa,CAAC,CAAC;IACpE,IAAI,KAAK,CAAC,WAAW,IAAI,KAAK,CAAC,IAAI,KAAK,SAAS;QAC/C,IAAI,CAAC,IAAI,CAAC,sBAAsB,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;IAChD,OAAO;QACL,UAAU,EAAE,QAAQ;QACpB,SAAS,EAAE,IAAI;QACf,GAAG,CAAC,KAAK,CAAC,WAAW;YACnB,CAAC,CAAC,EAAE,WAAW,EAAE,IAAI,EAAE;YACvB,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,IAAI,IAAI,EAAE,EAAE,CAAC;KACjC,CAAC;AACJ,CAAC","sourcesContent":["import type { AgentInput } from \"../../domain/agent.types.ts\";\nimport type { Command } from \"../../domain/command.types.ts\";\nimport { invariant } from \"../../domain/errors.ts\";\nimport type { GeminiSettings } from \"./gemini.types.ts\";\nimport type { Bound } from \"./settings.types.ts\";\n\nexport function geminiRequest(\n settings: Bound<GeminiSettings>,\n input: AgentInput,\n): Command {\n invariant(\n !input.continuation,\n \"Gemini does not support continuation or fork in Outpost\",\n );\n const args: string[] = [];\n if (settings.model) args.push(\"--model\", settings.model.name);\n const approvalMode =\n settings.approvalMode ?? (input.interactive ? \"default\" : \"yolo\");\n args.push(\"--approval-mode\", approvalMode);\n if (!input.interactive && approvalMode === \"yolo\") args.push(\"--skip-trust\");\n if (!input.interactive) args.push(\"--output-format\", \"stream-json\");\n if (input.interactive && input.text !== undefined)\n args.push(\"--prompt-interactive\", input.text);\n return {\n executable: \"gemini\",\n arguments: args,\n ...(input.interactive\n ? { interactive: true }\n : { stdin: input.text ?? \"\" }),\n };\n}\n"]}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import type { AgentAuthentication } from "../../domain/agent.types.ts";
|
|
1
2
|
import type { Variables } from "../../domain/command.types.ts";
|
|
2
3
|
export interface GeminiSettings {
|
|
3
|
-
readonly
|
|
4
|
+
readonly authentication?: AgentAuthentication;
|
|
4
5
|
readonly variables?: Variables;
|
|
5
6
|
readonly approvalMode?: "default" | "auto_edit" | "yolo" | "plan";
|
|
6
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gemini.types.js","sourceRoot":"","sources":["../../../src/adapters/agents/gemini.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { Variables } from \"../../domain/command.types.ts\";\n\nexport interface GeminiSettings {\n readonly
|
|
1
|
+
{"version":3,"file":"gemini.types.js","sourceRoot":"","sources":["../../../src/adapters/agents/gemini.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { AgentAuthentication } from \"../../domain/agent.types.ts\";\nimport type { Variables } from \"../../domain/command.types.ts\";\n\nexport interface GeminiSettings {\n readonly authentication?: AgentAuthentication;\n readonly variables?: Variables;\n readonly approvalMode?: \"default\" | \"auto_edit\" | \"yolo\" | \"plan\";\n}\n"]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { CliModelSupport } from "./settings.types.ts";
|
|
2
|
+
export declare const CLAUDE_MAX_OUTPUT_VARIABLE = "CLAUDE_CODE_MAX_OUTPUT_TOKENS";
|
|
3
|
+
export declare const claudeModelSupport: CliModelSupport;
|
|
4
|
+
export declare const codexModelSupport: CliModelSupport;
|
|
5
|
+
export declare const geminiModelSupport: CliModelSupport;
|
|
6
|
+
export declare const HARNESS_MODEL_KEYS: string[];
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export const CLAUDE_MAX_OUTPUT_VARIABLE = "CLAUDE_CODE_MAX_OUTPUT_TOKENS";
|
|
2
|
+
export const claudeModelSupport = {
|
|
3
|
+
agent: "Claude Code",
|
|
4
|
+
reasoning: new Set(["low", "medium", "high", "xhigh", "max"]),
|
|
5
|
+
maxOutputTokens: true,
|
|
6
|
+
};
|
|
7
|
+
export const codexModelSupport = {
|
|
8
|
+
agent: "Codex",
|
|
9
|
+
reasoning: new Set(["low", "medium", "high", "xhigh", "max"]),
|
|
10
|
+
maxOutputTokens: false,
|
|
11
|
+
};
|
|
12
|
+
export const geminiModelSupport = {
|
|
13
|
+
agent: "Gemini CLI",
|
|
14
|
+
reasoning: new Set(),
|
|
15
|
+
maxOutputTokens: false,
|
|
16
|
+
};
|
|
17
|
+
export const HARNESS_MODEL_KEYS = ["model", "reasoning", "maxOutputTokens"];
|
|
18
|
+
//# sourceMappingURL=model-support.constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model-support.constants.js","sourceRoot":"","sources":["../../../src/adapters/agents/model-support.constants.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,0BAA0B,GAAG,+BAA+B,CAAC;AAE1E,MAAM,CAAC,MAAM,kBAAkB,GAAoB;IACjD,KAAK,EAAE,aAAa;IACpB,SAAS,EAAE,IAAI,GAAG,CAAC,CAAC,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;IAC7D,eAAe,EAAE,IAAI;CACtB,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAoB;IAChD,KAAK,EAAE,OAAO;IACd,SAAS,EAAE,IAAI,GAAG,CAAC,CAAC,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;IAC7D,eAAe,EAAE,KAAK;CACvB,CAAC;AAEF,MAAM,CAAC,MAAM,kBAAkB,GAAoB;IACjD,KAAK,EAAE,YAAY;IACnB,SAAS,EAAE,IAAI,GAAG,EAAE;IACpB,eAAe,EAAE,KAAK;CACvB,CAAC;AAEF,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,OAAO,EAAE,WAAW,EAAE,iBAAiB,CAAC,CAAC","sourcesContent":["import type { CliModelSupport } from \"./settings.types.ts\";\n\nexport const CLAUDE_MAX_OUTPUT_VARIABLE = \"CLAUDE_CODE_MAX_OUTPUT_TOKENS\";\n\nexport const claudeModelSupport: CliModelSupport = {\n agent: \"Claude Code\",\n reasoning: new Set([\"low\", \"medium\", \"high\", \"xhigh\", \"max\"]),\n maxOutputTokens: true,\n};\n\nexport const codexModelSupport: CliModelSupport = {\n agent: \"Codex\",\n reasoning: new Set([\"low\", \"medium\", \"high\", \"xhigh\", \"max\"]),\n maxOutputTokens: false,\n};\n\nexport const geminiModelSupport: CliModelSupport = {\n agent: \"Gemini CLI\",\n reasoning: new Set(),\n maxOutputTokens: false,\n};\n\nexport const HARNESS_MODEL_KEYS = [\"model\", \"reasoning\", \"maxOutputTokens\"];\n"]}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { AgentModel } from "../../domain/model.types.ts";
|
|
2
|
+
import type { CliModelSupport } from "./settings.types.ts";
|
|
3
|
+
export declare function supportModel(support: CliModelSupport, model: AgentModel | undefined): void;
|
|
4
|
+
export declare function harnessSettings(settings: object): void;
|