@elie-laloum/outpost 5.0.0 → 7.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 +54 -0
- package/README.md +11 -11
- package/SECURITY.md +10 -0
- package/dist/adapters/agents/antigravity-adapter.d.ts +3 -0
- package/dist/adapters/agents/antigravity-adapter.js +41 -0
- package/dist/adapters/agents/antigravity-adapter.js.map +1 -0
- package/dist/adapters/agents/antigravity-authentication.d.ts +2 -0
- package/dist/adapters/agents/antigravity-authentication.js +27 -0
- package/dist/adapters/agents/antigravity-authentication.js.map +1 -0
- package/dist/adapters/agents/antigravity-diagnostics.d.ts +1 -0
- package/dist/adapters/agents/antigravity-diagnostics.js +6 -0
- package/dist/adapters/agents/antigravity-diagnostics.js.map +1 -0
- package/dist/adapters/agents/antigravity-events.d.ts +2 -0
- package/dist/adapters/agents/antigravity-events.js +75 -0
- package/dist/adapters/agents/antigravity-events.js.map +1 -0
- package/dist/adapters/agents/antigravity-request.d.ts +5 -0
- package/dist/adapters/agents/antigravity-request.js +37 -0
- package/dist/adapters/agents/antigravity-request.js.map +1 -0
- package/dist/adapters/agents/antigravity.constants.d.ts +3 -0
- package/dist/adapters/agents/antigravity.constants.js +4 -0
- package/dist/adapters/agents/antigravity.constants.js.map +1 -0
- package/dist/adapters/agents/{gemini.types.d.ts → antigravity.types.d.ts} +2 -2
- package/dist/adapters/agents/antigravity.types.js +2 -0
- package/dist/adapters/agents/antigravity.types.js.map +1 -0
- package/dist/adapters/agents/authentication.constants.d.ts +19 -9
- package/dist/adapters/agents/authentication.constants.js +12 -9
- package/dist/adapters/agents/authentication.constants.js.map +1 -1
- package/dist/adapters/agents/authentication.d.ts +11 -2
- package/dist/adapters/agents/authentication.js +70 -47
- package/dist/adapters/agents/authentication.js.map +1 -1
- package/dist/adapters/agents/authentication.types.d.ts +20 -0
- package/dist/adapters/agents/authentication.types.js +2 -0
- package/dist/adapters/agents/authentication.types.js.map +1 -0
- package/dist/adapters/agents/claude-adapter.js +4 -2
- package/dist/adapters/agents/claude-adapter.js.map +1 -1
- package/dist/adapters/agents/claude-authentication.d.ts +2 -0
- package/dist/adapters/agents/claude-authentication.js +34 -0
- package/dist/adapters/agents/claude-authentication.js.map +1 -0
- package/dist/adapters/agents/claude-events.js +52 -9
- package/dist/adapters/agents/claude-events.js.map +1 -1
- package/dist/adapters/agents/claude-request.js +2 -0
- package/dist/adapters/agents/claude-request.js.map +1 -1
- package/dist/adapters/agents/cli-diagnostics.constants.d.ts +6 -6
- package/dist/adapters/agents/cli-diagnostics.constants.js +6 -6
- package/dist/adapters/agents/cli-diagnostics.constants.js.map +1 -1
- package/dist/adapters/agents/cli-diagnostics.d.ts +1 -0
- package/dist/adapters/agents/cli-diagnostics.js +18 -0
- package/dist/adapters/agents/cli-diagnostics.js.map +1 -1
- package/dist/adapters/agents/codex-adapter.js +4 -2
- package/dist/adapters/agents/codex-adapter.js.map +1 -1
- package/dist/adapters/agents/codex-authentication.d.ts +3 -0
- package/dist/adapters/agents/codex-authentication.js +47 -0
- package/dist/adapters/agents/codex-authentication.js.map +1 -0
- package/dist/adapters/agents/codex-events.js +28 -2
- package/dist/adapters/agents/codex-events.js.map +1 -1
- package/dist/adapters/agents/copilot-adapter.d.ts +3 -0
- package/dist/adapters/agents/copilot-adapter.js +45 -0
- package/dist/adapters/agents/copilot-adapter.js.map +1 -0
- package/dist/adapters/agents/copilot-authentication.d.ts +2 -0
- package/dist/adapters/agents/copilot-authentication.js +46 -0
- package/dist/adapters/agents/copilot-authentication.js.map +1 -0
- package/dist/adapters/agents/copilot-diagnostics.d.ts +1 -0
- package/dist/adapters/agents/copilot-diagnostics.js +6 -0
- package/dist/adapters/agents/copilot-diagnostics.js.map +1 -0
- package/dist/adapters/agents/copilot-events.d.ts +2 -0
- package/dist/adapters/agents/copilot-events.js +66 -0
- package/dist/adapters/agents/copilot-events.js.map +1 -0
- package/dist/adapters/agents/copilot-request.d.ts +5 -0
- package/dist/adapters/agents/copilot-request.js +24 -0
- package/dist/adapters/agents/copilot-request.js.map +1 -0
- package/dist/adapters/agents/copilot-usage.d.ts +3 -0
- package/dist/adapters/agents/copilot-usage.js +19 -0
- package/dist/adapters/agents/copilot-usage.js.map +1 -0
- package/dist/adapters/agents/copilot.types.d.ts +6 -0
- package/dist/adapters/agents/copilot.types.js +2 -0
- package/dist/adapters/agents/copilot.types.js.map +1 -0
- package/dist/adapters/agents/event-decoder.d.ts +2 -2
- package/dist/adapters/agents/event-decoder.js +6 -5
- package/dist/adapters/agents/event-decoder.js.map +1 -1
- package/dist/adapters/agents/kimi-adapter.d.ts +3 -0
- package/dist/adapters/agents/kimi-adapter.js +51 -0
- package/dist/adapters/agents/kimi-adapter.js.map +1 -0
- package/dist/adapters/agents/kimi-authentication.d.ts +3 -0
- package/dist/adapters/agents/kimi-authentication.js +63 -0
- package/dist/adapters/agents/kimi-authentication.js.map +1 -0
- package/dist/adapters/agents/kimi-diagnostics.d.ts +2 -0
- package/dist/adapters/agents/kimi-diagnostics.js +14 -0
- package/dist/adapters/agents/kimi-diagnostics.js.map +1 -0
- package/dist/adapters/agents/kimi-events.d.ts +2 -0
- package/dist/adapters/agents/kimi-events.js +55 -0
- package/dist/adapters/agents/kimi-events.js.map +1 -0
- package/dist/adapters/agents/kimi-fork.d.ts +2 -0
- package/dist/adapters/agents/kimi-fork.js +11 -0
- package/dist/adapters/agents/kimi-fork.js.map +1 -0
- package/dist/adapters/agents/{gemini-request.d.ts → kimi-request.d.ts} +2 -2
- package/dist/adapters/agents/kimi-request.js +33 -0
- package/dist/adapters/agents/kimi-request.js.map +1 -0
- package/dist/adapters/agents/kimi-usage.d.ts +2 -0
- package/dist/adapters/agents/kimi-usage.js +7 -0
- package/dist/adapters/agents/kimi-usage.js.map +1 -0
- package/dist/adapters/agents/kimi.constants.d.ts +13 -0
- package/dist/adapters/agents/kimi.constants.js +14 -0
- package/dist/adapters/agents/kimi.constants.js.map +1 -0
- package/dist/adapters/agents/kimi.types.d.ts +7 -0
- package/dist/adapters/agents/kimi.types.js +2 -0
- package/dist/adapters/agents/kimi.types.js.map +1 -0
- package/dist/adapters/agents/model-support.constants.d.ts +3 -1
- package/dist/adapters/agents/model-support.constants.js +12 -2
- package/dist/adapters/agents/model-support.constants.js.map +1 -1
- package/dist/adapters/agents/protocol-fixtures.constants.d.ts +2 -2
- package/dist/adapters/agents/protocol-fixtures.constants.js +131 -9
- package/dist/adapters/agents/protocol-fixtures.constants.js.map +1 -1
- package/dist/adapters/agents/protocol-fixtures.types.d.ts +1 -0
- package/dist/adapters/agents/protocol-fixtures.types.js.map +1 -1
- package/dist/adapters/agents/protocol.d.ts +1 -0
- package/dist/adapters/agents/protocol.js +9 -0
- package/dist/adapters/agents/protocol.js.map +1 -1
- package/dist/adapters/agents/session-usage.constants.d.ts +10 -0
- package/dist/adapters/agents/session-usage.constants.js +110 -0
- package/dist/adapters/agents/session-usage.constants.js.map +1 -0
- package/dist/adapters/agents/session-usage.d.ts +5 -0
- package/dist/adapters/agents/session-usage.js +45 -0
- package/dist/adapters/agents/session-usage.js.map +1 -0
- package/dist/adapters/agents/settings.types.d.ts +1 -0
- package/dist/adapters/agents/settings.types.js.map +1 -1
- package/dist/adapters/agents/tool-result.d.ts +2 -0
- package/dist/adapters/agents/tool-result.js +17 -0
- package/dist/adapters/agents/tool-result.js.map +1 -0
- package/dist/adapters/models/anthropic-response.js +3 -0
- package/dist/adapters/models/anthropic-response.js.map +1 -1
- package/dist/adapters/models/http-provider.js +6 -1
- package/dist/adapters/models/http-provider.js.map +1 -1
- package/dist/adapters/models/openai-responses.js +10 -0
- package/dist/adapters/models/openai-responses.js.map +1 -1
- package/dist/adapters/models/retry-after.d.ts +1 -0
- package/dist/adapters/models/retry-after.js +16 -0
- package/dist/adapters/models/retry-after.js.map +1 -0
- package/dist/application/activity-watchdog.js +1 -2
- package/dist/application/activity-watchdog.js.map +1 -1
- package/dist/application/agent-authentication.d.ts +4 -0
- package/dist/application/agent-authentication.js +32 -0
- package/dist/application/agent-authentication.js.map +1 -0
- package/dist/application/agent-bootstrap.constants.d.ts +2 -5
- package/dist/application/agent-bootstrap.constants.js +27 -4
- package/dist/application/agent-bootstrap.constants.js.map +1 -1
- package/dist/application/agent-bootstrap.js +39 -12
- package/dist/application/agent-bootstrap.js.map +1 -1
- package/dist/application/agent-bootstrap.types.d.ts +19 -0
- package/dist/application/agent-bootstrap.types.js +2 -0
- package/dist/application/agent-bootstrap.types.js.map +1 -0
- package/dist/application/agent-output.js +74 -8
- package/dist/application/agent-output.js.map +1 -1
- package/dist/application/agent-request.d.ts +3 -0
- package/dist/application/agent-request.js +11 -0
- package/dist/application/agent-request.js.map +1 -0
- package/dist/application/agent-turn.js +74 -6
- package/dist/application/agent-turn.js.map +1 -1
- package/dist/application/agent-usage.d.ts +6 -0
- package/dist/application/agent-usage.js +57 -0
- package/dist/application/agent-usage.js.map +1 -0
- package/dist/application/attach.js +2 -0
- package/dist/application/attach.js.map +1 -1
- package/dist/application/credential-installer.constants.d.ts +1 -0
- package/dist/application/credential-installer.constants.js +22 -0
- package/dist/application/credential-installer.constants.js.map +1 -0
- package/dist/application/custom-turn.js +44 -49
- package/dist/application/custom-turn.js.map +1 -1
- package/dist/application/dispatch-observation.d.ts +1 -1
- package/dist/application/dispatch-observation.js +141 -21
- package/dist/application/dispatch-observation.js.map +1 -1
- package/dist/application/dispatch-observation.types.d.ts +2 -0
- package/dist/application/dispatch-observation.types.js.map +1 -1
- package/dist/application/dispatch-validation.js +2 -0
- package/dist/application/dispatch-validation.js.map +1 -1
- package/dist/application/dispatch.js +1 -1
- package/dist/application/dispatch.js.map +1 -1
- package/dist/application/doctor-agent.constants.d.ts +2 -8
- package/dist/application/doctor-agent.constants.js +43 -6
- package/dist/application/doctor-agent.constants.js.map +1 -1
- package/dist/application/doctor-agent.d.ts +2 -1
- package/dist/application/doctor-agent.js +15 -3
- package/dist/application/doctor-agent.js.map +1 -1
- package/dist/application/doctor-image.js +4 -6
- package/dist/application/doctor-image.js.map +1 -1
- package/dist/application/doctor-protocol.js +6 -11
- package/dist/application/doctor-protocol.js.map +1 -1
- package/dist/application/doctor-protocol.types.d.ts +1 -1
- package/dist/application/doctor-protocol.types.js.map +1 -1
- package/dist/application/doctor-sandbox.js +2 -5
- package/dist/application/doctor-sandbox.js.map +1 -1
- package/dist/application/doctor.js +28 -10
- package/dist/application/doctor.js.map +1 -1
- package/dist/application/doctor.types.d.ts +10 -1
- package/dist/application/doctor.types.js.map +1 -1
- package/dist/application/execution.constants.d.ts +2 -0
- package/dist/application/execution.constants.js +2 -0
- package/dist/application/execution.constants.js.map +1 -1
- package/dist/application/execution.types.d.ts +8 -0
- package/dist/application/execution.types.js.map +1 -1
- package/dist/application/harness-budget.d.ts +3 -0
- package/dist/application/harness-budget.js +42 -0
- package/dist/application/harness-budget.js.map +1 -0
- package/dist/application/harness-budget.types.d.ts +5 -0
- package/dist/application/harness-budget.types.js +2 -0
- package/dist/application/harness-budget.types.js.map +1 -0
- package/dist/application/harness-hooks.js +34 -3
- package/dist/application/harness-hooks.js.map +1 -1
- package/dist/application/harness-loop.js +52 -24
- package/dist/application/harness-loop.js.map +1 -1
- package/dist/application/harness-model-provider.d.ts +3 -0
- package/dist/application/harness-model-provider.js +49 -0
- package/dist/application/harness-model-provider.js.map +1 -0
- package/dist/application/harness-model-provider.types.d.ts +10 -0
- package/dist/application/harness-model-provider.types.js +2 -0
- package/dist/application/harness-model-provider.types.js.map +1 -0
- package/dist/application/harness-subagent.d.ts +4 -0
- package/dist/application/harness-subagent.js +110 -0
- package/dist/application/harness-subagent.js.map +1 -0
- package/dist/application/harness.types.d.ts +11 -0
- package/dist/application/harness.types.js.map +1 -1
- package/dist/application/lifecycle-hooks.d.ts +1 -1
- package/dist/application/lifecycle-hooks.js +5 -4
- package/dist/application/lifecycle-hooks.js.map +1 -1
- package/dist/application/observed-lease.d.ts +3 -0
- package/dist/application/observed-lease.js +26 -0
- package/dist/application/observed-lease.js.map +1 -0
- package/dist/application/outpost.types.d.ts +3 -1
- package/dist/application/outpost.types.js.map +1 -1
- package/dist/application/output-lines.d.ts +4 -0
- package/dist/application/output-lines.js +28 -0
- package/dist/application/output-lines.js.map +1 -0
- package/dist/application/queue-worker.js +1 -1
- package/dist/application/queue-worker.js.map +1 -1
- package/dist/application/queue-worker.types.d.ts +1 -0
- package/dist/application/queue-worker.types.js.map +1 -1
- package/dist/application/queued-task.js +24 -5
- package/dist/application/queued-task.js.map +1 -1
- package/dist/application/recovery-archive.d.ts +3 -2
- package/dist/application/recovery-archive.js +9 -2
- package/dist/application/recovery-archive.js.map +1 -1
- package/dist/application/recovery-restore.d.ts +3 -2
- package/dist/application/recovery-restore.js +9 -2
- package/dist/application/recovery-restore.js.map +1 -1
- package/dist/application/recovery-retention.d.ts +3 -2
- package/dist/application/recovery-retention.js +74 -26
- package/dist/application/recovery-retention.js.map +1 -1
- package/dist/application/remote-workspace.js +5 -4
- package/dist/application/remote-workspace.js.map +1 -1
- package/dist/application/remote-workspace.types.d.ts +1 -0
- package/dist/application/remote-workspace.types.js.map +1 -1
- package/dist/application/sandbox-agents.js +19 -19
- package/dist/application/sandbox-agents.js.map +1 -1
- package/dist/application/sandbox-attach.js +12 -3
- package/dist/application/sandbox-attach.js.map +1 -1
- package/dist/application/sandbox-dispatch.js +13 -27
- package/dist/application/sandbox-dispatch.js.map +1 -1
- package/dist/application/sandbox-provision.js +15 -9
- package/dist/application/sandbox-provision.js.map +1 -1
- package/dist/application/sandbox-session.types.d.ts +7 -2
- package/dist/application/sandbox-session.types.js.map +1 -1
- package/dist/application/sandbox.js +13 -6
- package/dist/application/sandbox.js.map +1 -1
- package/dist/application/speculation-checkpoint.d.ts +6 -0
- package/dist/application/speculation-checkpoint.js +206 -0
- package/dist/application/speculation-checkpoint.js.map +1 -0
- package/dist/application/speculation-checkpoint.types.d.ts +24 -0
- package/dist/application/speculation-checkpoint.types.js +2 -0
- package/dist/application/speculation-checkpoint.types.js.map +1 -0
- package/dist/application/speculation-integration.constants.d.ts +4 -0
- package/dist/application/speculation-integration.constants.js +5 -0
- package/dist/application/speculation-integration.constants.js.map +1 -0
- package/dist/application/speculation-integration.d.ts +2 -0
- package/dist/application/speculation-integration.js +67 -0
- package/dist/application/speculation-integration.js.map +1 -0
- package/dist/application/speculation-resume.d.ts +4 -0
- package/dist/application/speculation-resume.js +71 -0
- package/dist/application/speculation-resume.js.map +1 -0
- package/dist/application/speculation-run.d.ts +4 -0
- package/dist/application/speculation-run.js +320 -0
- package/dist/application/speculation-run.js.map +1 -0
- package/dist/application/speculation-timeout.d.ts +1 -0
- package/dist/application/speculation-timeout.js +15 -0
- package/dist/application/speculation-timeout.js.map +1 -0
- package/dist/application/speculation.constants.d.ts +1 -0
- package/dist/application/speculation.constants.js +5 -1
- package/dist/application/speculation.constants.js.map +1 -1
- package/dist/application/speculation.js +41 -149
- package/dist/application/speculation.js.map +1 -1
- package/dist/application/speculation.types.d.ts +23 -0
- package/dist/application/speculation.types.js.map +1 -1
- package/dist/application/startup-recovery.js +14 -1
- package/dist/application/startup-recovery.js.map +1 -1
- package/dist/application/startup-recovery.types.d.ts +1 -0
- package/dist/application/startup-recovery.types.js.map +1 -1
- package/dist/application/stop-reason.d.ts +2 -0
- package/dist/application/stop-reason.js +21 -0
- package/dist/application/stop-reason.js.map +1 -0
- package/dist/application/stop-reason.types.d.ts +4 -0
- package/dist/application/stop-reason.types.js +2 -0
- package/dist/application/stop-reason.types.js.map +1 -0
- package/dist/application/storage-reservation.js +9 -2
- package/dist/application/storage-reservation.js.map +1 -1
- package/dist/application/task-observation.d.ts +3 -0
- package/dist/application/task-observation.js +22 -0
- package/dist/application/task-observation.js.map +1 -0
- package/dist/application/task-usage.js +5 -12
- package/dist/application/task-usage.js.map +1 -1
- package/dist/application/tasks.js +41 -16
- package/dist/application/tasks.js.map +1 -1
- package/dist/application/tool-execution.js +42 -19
- package/dist/application/tool-execution.js.map +1 -1
- package/dist/application/workspace.js +6 -4
- package/dist/application/workspace.js.map +1 -1
- package/dist/cli/doctor-command.js +6 -2
- package/dist/cli/doctor-command.js.map +1 -1
- package/dist/cli/init-authentication.d.ts +4 -1
- package/dist/cli/init-authentication.js +28 -33
- 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 +50 -13
- package/dist/cli/main.constants.js +70 -8
- package/dist/cli/main.constants.js.map +1 -1
- package/dist/cli/main.js +2 -1
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/scaffold-files.js +1 -1
- package/dist/cli/scaffold-files.js.map +1 -1
- package/dist/cli/scaffold-validation.js +29 -22
- package/dist/cli/scaffold-validation.js.map +1 -1
- package/dist/cli/scaffold.constants.d.ts +0 -1
- package/dist/cli/scaffold.constants.js +6 -2
- package/dist/cli/scaffold.constants.js.map +1 -1
- package/dist/cli/scaffold.types.d.ts +8 -2
- package/dist/cli/scaffold.types.js.map +1 -1
- package/dist/cli/starters.js +1 -3
- package/dist/cli/starters.js.map +1 -1
- package/dist/domain/agent-observation.d.ts +4 -0
- package/dist/domain/agent-observation.js +27 -0
- package/dist/domain/agent-observation.js.map +1 -0
- package/dist/domain/agent.types.d.ts +122 -14
- package/dist/domain/agent.types.js.map +1 -1
- package/dist/domain/authentication.constants.d.ts +3 -0
- package/dist/domain/authentication.constants.js +11 -0
- package/dist/domain/authentication.constants.js.map +1 -0
- package/dist/domain/authentication.d.ts +3 -0
- package/dist/domain/authentication.js +22 -0
- package/dist/domain/authentication.js.map +1 -0
- package/dist/domain/authentication.types.d.ts +5 -0
- package/dist/domain/authentication.types.js +2 -0
- package/dist/domain/authentication.types.js.map +1 -0
- package/dist/domain/harness.d.ts +2 -2
- package/dist/domain/harness.js +6 -0
- package/dist/domain/harness.js.map +1 -1
- package/dist/domain/harness.types.d.ts +4 -3
- package/dist/domain/harness.types.js.map +1 -1
- package/dist/domain/model.types.d.ts +8 -0
- package/dist/domain/model.types.js.map +1 -1
- package/dist/domain/observation.constants.d.ts +8 -0
- package/dist/domain/observation.constants.js +9 -0
- package/dist/domain/observation.constants.js.map +1 -0
- package/dist/domain/observation.d.ts +2 -0
- package/dist/domain/observation.js +190 -0
- package/dist/domain/observation.js.map +1 -0
- package/dist/domain/observation.types.d.ts +84 -0
- package/dist/domain/observation.types.js +2 -0
- package/dist/domain/observation.types.js.map +1 -0
- package/dist/domain/observed-operation.d.ts +2 -0
- package/dist/domain/observed-operation.js +30 -0
- package/dist/domain/observed-operation.js.map +1 -0
- package/dist/domain/sandbox.types.d.ts +2 -0
- package/dist/domain/sandbox.types.js.map +1 -1
- package/dist/domain/subagent.constants.d.ts +13 -0
- package/dist/domain/subagent.constants.js +9 -0
- package/dist/domain/subagent.constants.js.map +1 -0
- package/dist/domain/subagent.d.ts +4 -0
- package/dist/domain/subagent.js +28 -0
- package/dist/domain/subagent.js.map +1 -0
- package/dist/domain/subagent.types.d.ts +13 -0
- package/dist/domain/subagent.types.js +2 -0
- package/dist/domain/subagent.types.js.map +1 -0
- package/dist/domain/transcript.types.d.ts +2 -0
- package/dist/domain/transcript.types.js.map +1 -1
- package/dist/domain/usage.d.ts +1 -0
- package/dist/domain/usage.js +16 -0
- package/dist/domain/usage.js.map +1 -1
- package/dist/domain/workflow/budget.d.ts +7 -3
- package/dist/domain/workflow/budget.js +26 -0
- package/dist/domain/workflow/budget.js.map +1 -1
- package/dist/domain/workflow/budget.types.d.ts +1 -1
- package/dist/domain/workflow/budget.types.js.map +1 -1
- package/dist/domain/workflow/checkpoint-validation.js +7 -1
- package/dist/domain/workflow/checkpoint-validation.js.map +1 -1
- package/dist/domain/workflow/checkpoint.js +3 -0
- package/dist/domain/workflow/checkpoint.js.map +1 -1
- package/dist/domain/workflow/gate-validation.js +14 -1
- package/dist/domain/workflow/gate-validation.js.map +1 -1
- package/dist/domain/workflow/gates.d.ts +1 -1
- package/dist/domain/workflow/gates.js +52 -4
- package/dist/domain/workflow/gates.js.map +1 -1
- package/dist/domain/workflow/gates.types.d.ts +15 -1
- package/dist/domain/workflow/gates.types.js.map +1 -1
- package/dist/domain/workflow/idempotency.d.ts +1 -0
- package/dist/domain/workflow/idempotency.js +7 -0
- package/dist/domain/workflow/idempotency.js.map +1 -0
- package/dist/domain/workflow/retry.constants.d.ts +2 -0
- package/dist/domain/workflow/retry.constants.js +3 -0
- package/dist/domain/workflow/retry.constants.js.map +1 -0
- package/dist/domain/workflow/retry.d.ts +4 -0
- package/dist/domain/workflow/retry.js +49 -0
- package/dist/domain/workflow/retry.js.map +1 -0
- package/dist/domain/workflow/task-runner.js +9 -5
- package/dist/domain/workflow/task-runner.js.map +1 -1
- package/dist/domain/workflow/task.js +6 -6
- package/dist/domain/workflow/task.js.map +1 -1
- package/dist/domain/workflow/workflow-scheduler.js +110 -72
- package/dist/domain/workflow/workflow-scheduler.js.map +1 -1
- package/dist/domain/workflow/workflow-state.js +28 -12
- package/dist/domain/workflow/workflow-state.js.map +1 -1
- package/dist/domain/workflow.d.ts +1 -1
- package/dist/domain/workflow.js +1 -1
- package/dist/domain/workflow.js.map +1 -1
- package/dist/domain/workflow.types.d.ts +13 -2
- package/dist/domain/workflow.types.js.map +1 -1
- package/dist/index.d.ts +16 -11
- package/dist/index.js +7 -4
- package/dist/index.js.map +1 -1
- package/dist/infrastructure/conversations/capture.js +10 -0
- package/dist/infrastructure/conversations/capture.js.map +1 -1
- package/dist/infrastructure/conversations/harness-transcript.js +6 -0
- package/dist/infrastructure/conversations/harness-transcript.js.map +1 -1
- package/dist/infrastructure/conversations/harness-transcript.types.d.ts +2 -0
- package/dist/infrastructure/conversations/harness-transcript.types.js.map +1 -1
- package/dist/infrastructure/conversations/layout.js +2 -0
- package/dist/infrastructure/conversations/layout.js.map +1 -1
- package/dist/infrastructure/conversations/locate.js +7 -1
- package/dist/infrastructure/conversations/locate.js.map +1 -1
- package/dist/infrastructure/conversations/native-store.js +8 -1
- package/dist/infrastructure/conversations/native-store.js.map +1 -1
- package/dist/infrastructure/conversations/paths.js +3 -0
- package/dist/infrastructure/conversations/paths.js.map +1 -1
- package/dist/infrastructure/conversations/restore.js +7 -0
- package/dist/infrastructure/conversations/restore.js.map +1 -1
- package/dist/infrastructure/conversations/session-bundle.constants.d.ts +5 -0
- package/dist/infrastructure/conversations/session-bundle.constants.js +173 -0
- package/dist/infrastructure/conversations/session-bundle.constants.js.map +1 -0
- package/dist/infrastructure/conversations/session-bundle.d.ts +6 -0
- package/dist/infrastructure/conversations/session-bundle.js +98 -0
- package/dist/infrastructure/conversations/session-bundle.js.map +1 -0
- package/dist/infrastructure/conversations/session-bundle.types.d.ts +1 -0
- package/dist/infrastructure/conversations/session-bundle.types.js +2 -0
- package/dist/infrastructure/conversations/session-bundle.types.js.map +1 -0
- package/dist/infrastructure/conversations.js +4 -2
- package/dist/infrastructure/conversations.js.map +1 -1
- package/dist/infrastructure/conversations.types.d.ts +1 -1
- package/dist/infrastructure/conversations.types.js.map +1 -1
- package/dist/infrastructure/custom-reporter.js +32 -24
- package/dist/infrastructure/custom-reporter.js.map +1 -1
- package/dist/infrastructure/custom-reporter.types.d.ts +2 -0
- package/dist/infrastructure/custom-reporter.types.js.map +1 -1
- 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/git/workspace-lease.js +4 -3
- package/dist/infrastructure/git/workspace-lease.js.map +1 -1
- package/dist/infrastructure/git/workspace.js +7 -6
- package/dist/infrastructure/git/workspace.js.map +1 -1
- package/dist/infrastructure/git/workspace.types.d.ts +1 -0
- package/dist/infrastructure/git/workspace.types.js.map +1 -1
- package/dist/infrastructure/host-credentials.constants.d.ts +1 -0
- package/dist/infrastructure/host-credentials.constants.js +2 -0
- package/dist/infrastructure/host-credentials.constants.js.map +1 -0
- package/dist/infrastructure/host-credentials.d.ts +4 -0
- package/dist/infrastructure/host-credentials.js +89 -0
- package/dist/infrastructure/host-credentials.js.map +1 -0
- package/dist/infrastructure/inspection-path.js +4 -3
- package/dist/infrastructure/inspection-path.js.map +1 -1
- package/dist/infrastructure/journal.constants.js +10 -1
- package/dist/infrastructure/journal.constants.js.map +1 -1
- package/dist/infrastructure/journal.d.ts +1 -1
- package/dist/infrastructure/journal.js +8 -75
- package/dist/infrastructure/journal.js.map +1 -1
- package/dist/infrastructure/journal.types.d.ts +2 -4
- package/dist/infrastructure/journal.types.js.map +1 -1
- package/dist/infrastructure/local-transport.js +9 -4
- package/dist/infrastructure/local-transport.js.map +1 -1
- package/dist/infrastructure/opentelemetry-dispatch.d.ts +3 -3
- package/dist/infrastructure/opentelemetry-dispatch.js +5 -4
- package/dist/infrastructure/opentelemetry-dispatch.js.map +1 -1
- package/dist/infrastructure/opentelemetry-observation.d.ts +5 -0
- package/dist/infrastructure/opentelemetry-observation.js +59 -0
- package/dist/infrastructure/opentelemetry-observation.js.map +1 -0
- package/dist/infrastructure/opentelemetry.js +15 -1
- package/dist/infrastructure/opentelemetry.js.map +1 -1
- package/dist/infrastructure/opentelemetry.types.d.ts +9 -1
- package/dist/infrastructure/opentelemetry.types.js.map +1 -1
- package/dist/infrastructure/reporter.d.ts +2 -2
- package/dist/infrastructure/reporter.js +5 -1
- package/dist/infrastructure/reporter.js.map +1 -1
- package/dist/infrastructure/repository-transport.constants.d.ts +1 -0
- package/dist/infrastructure/repository-transport.constants.js +2 -0
- package/dist/infrastructure/repository-transport.constants.js.map +1 -0
- package/dist/infrastructure/repository-transport.d.ts +2 -0
- package/dist/infrastructure/repository-transport.js +9 -0
- package/dist/infrastructure/repository-transport.js.map +1 -0
- package/dist/infrastructure/resource-activity-inspection.js +19 -24
- package/dist/infrastructure/resource-activity-inspection.js.map +1 -1
- package/dist/infrastructure/resource-activity.constants.d.ts +0 -1
- package/dist/infrastructure/resource-activity.constants.js +0 -1
- package/dist/infrastructure/resource-activity.constants.js.map +1 -1
- package/dist/infrastructure/resource-activity.js +20 -83
- package/dist/infrastructure/resource-activity.js.map +1 -1
- package/dist/infrastructure/s3-transport.constants.d.ts +2 -0
- package/dist/infrastructure/s3-transport.constants.js +3 -0
- package/dist/infrastructure/s3-transport.constants.js.map +1 -0
- package/dist/infrastructure/s3-transport.js +57 -3
- package/dist/infrastructure/s3-transport.js.map +1 -1
- package/dist/infrastructure/s3-transport.types.d.ts +1 -0
- package/dist/infrastructure/s3-transport.types.js.map +1 -1
- package/dist/infrastructure/speculation-store.constants.d.ts +3 -0
- package/dist/infrastructure/speculation-store.constants.js +2 -0
- package/dist/infrastructure/speculation-store.constants.js.map +1 -0
- package/dist/infrastructure/speculation-store.d.ts +4 -0
- package/dist/infrastructure/speculation-store.js +73 -0
- package/dist/infrastructure/speculation-store.js.map +1 -0
- package/dist/infrastructure/speculation-store.types.d.ts +12 -0
- package/dist/infrastructure/speculation-store.types.js +2 -0
- package/dist/infrastructure/speculation-store.types.js.map +1 -0
- package/dist/infrastructure/storage-inventory.constants.js +1 -0
- package/dist/infrastructure/storage-inventory.constants.js.map +1 -1
- package/dist/infrastructure/storage-inventory.types.d.ts +1 -1
- package/dist/infrastructure/storage-inventory.types.js.map +1 -1
- package/dist/infrastructure/storage-reservations.types.d.ts +0 -8
- package/dist/infrastructure/storage-reservations.types.js.map +1 -1
- package/dist/infrastructure/task-queue-bullmq-resources.js +3 -0
- package/dist/infrastructure/task-queue-bullmq-resources.js.map +1 -1
- package/dist/infrastructure/task-queue-http.js +29 -4
- package/dist/infrastructure/task-queue-http.js.map +1 -1
- package/dist/infrastructure/task-queue-http.types.d.ts +2 -2
- package/dist/infrastructure/task-queue-http.types.js.map +1 -1
- package/dist/infrastructure/transport-conversations.js +2 -0
- package/dist/infrastructure/transport-conversations.js.map +1 -1
- package/dist/infrastructure/transport-journal.d.ts +1 -1
- package/dist/infrastructure/transport-journal.js +8 -2
- package/dist/infrastructure/transport-journal.js.map +1 -1
- package/dist/infrastructure/transport-reservations.d.ts +1 -1
- package/dist/infrastructure/transport-reservations.js +14 -8
- package/dist/infrastructure/transport-reservations.js.map +1 -1
- package/dist/infrastructure/workflow-decision-signature.constants.d.ts +4 -0
- package/dist/infrastructure/workflow-decision-signature.constants.js +5 -0
- package/dist/infrastructure/workflow-decision-signature.constants.js.map +1 -0
- package/dist/infrastructure/workflow-decision-signature.d.ts +4 -0
- package/dist/infrastructure/workflow-decision-signature.js +83 -0
- package/dist/infrastructure/workflow-decision-signature.js.map +1 -0
- package/dist/infrastructure/workflow-decision-signature.types.d.ts +16 -0
- package/dist/infrastructure/workflow-decision-signature.types.js +2 -0
- package/dist/infrastructure/workflow-decision-signature.types.js.map +1 -0
- package/dist/providers/agents.d.ts +7 -2
- package/dist/providers/agents.js +4 -1
- package/dist/providers/agents.js.map +1 -1
- package/dist/providers/antigravity-install.constants.d.ts +2 -0
- package/dist/providers/antigravity-install.constants.js +28 -0
- package/dist/providers/antigravity-install.constants.js.map +1 -0
- package/dist/providers/antigravity-install.d.ts +2 -0
- package/dist/providers/antigravity-install.js +29 -0
- package/dist/providers/antigravity-install.js.map +1 -0
- package/dist/providers/antigravity-install.types.d.ts +4 -0
- package/dist/providers/antigravity-install.types.js +2 -0
- package/dist/providers/antigravity-install.types.js.map +1 -0
- package/dist/providers/container-recovery.d.ts +4 -0
- package/dist/providers/container-recovery.js +28 -0
- package/dist/providers/container-recovery.js.map +1 -0
- package/dist/providers/container.js +8 -0
- package/dist/providers/container.js.map +1 -1
- package/dist/providers/daytona-network.constants.d.ts +5 -0
- package/dist/providers/daytona-network.constants.js +8 -0
- package/dist/providers/daytona-network.constants.js.map +1 -0
- package/dist/providers/daytona-network.d.ts +4 -0
- package/dist/providers/daytona-network.js +33 -0
- package/dist/providers/daytona-network.js.map +1 -0
- package/dist/providers/daytona.d.ts +1 -0
- package/dist/providers/daytona.js +9 -3
- package/dist/providers/daytona.js.map +1 -1
- package/dist/providers/daytona.types.d.ts +2 -0
- package/dist/providers/daytona.types.js.map +1 -1
- package/dist/providers/firecracker-command.js +1 -1
- package/dist/providers/firecracker-command.js.map +1 -1
- package/dist/providers/firecracker-jailer.constants.d.ts +9 -0
- package/dist/providers/firecracker-jailer.constants.js +10 -0
- package/dist/providers/firecracker-jailer.constants.js.map +1 -0
- package/dist/providers/firecracker-jailer.d.ts +4 -0
- package/dist/providers/firecracker-jailer.js +171 -0
- package/dist/providers/firecracker-jailer.js.map +1 -0
- package/dist/providers/firecracker-machine.js +30 -8
- package/dist/providers/firecracker-machine.js.map +1 -1
- package/dist/providers/firecracker.types.d.ts +16 -0
- package/dist/providers/firecracker.types.js.map +1 -1
- package/dist/providers/vercel-network.js +1 -1
- package/dist/providers/vercel-network.js.map +1 -1
- package/dist/providers/vercel.js +6 -3
- package/dist/providers/vercel.js.map +1 -1
- package/dist/providers/versions.constants.d.ts +3 -1
- package/dist/providers/versions.constants.js +3 -1
- package/dist/providers/versions.constants.js.map +1 -1
- package/package.json +3 -3
- package/dist/adapters/agents/gemini-adapter.d.ts +0 -3
- package/dist/adapters/agents/gemini-adapter.js +0 -34
- package/dist/adapters/agents/gemini-adapter.js.map +0 -1
- package/dist/adapters/agents/gemini-diagnostics.d.ts +0 -2
- package/dist/adapters/agents/gemini-diagnostics.js +0 -15
- package/dist/adapters/agents/gemini-diagnostics.js.map +0 -1
- package/dist/adapters/agents/gemini-events.d.ts +0 -2
- package/dist/adapters/agents/gemini-events.js +0 -50
- package/dist/adapters/agents/gemini-events.js.map +0 -1
- package/dist/adapters/agents/gemini-request.js +0 -23
- package/dist/adapters/agents/gemini-request.js.map +0 -1
- package/dist/adapters/agents/gemini.types.js +0 -2
- package/dist/adapters/agents/gemini.types.js.map +0 -1
- package/dist/infrastructure/artifact-store.d.ts +0 -3
- package/dist/infrastructure/artifact-store.js +0 -110
- package/dist/infrastructure/artifact-store.js.map +0 -1
- package/dist/infrastructure/artifact-store.types.d.ts +0 -6
- package/dist/infrastructure/artifact-store.types.js +0 -2
- package/dist/infrastructure/artifact-store.types.js.map +0 -1
- package/dist/infrastructure/journal-retention.constants.d.ts +0 -4
- package/dist/infrastructure/journal-retention.constants.js +0 -5
- package/dist/infrastructure/journal-retention.constants.js.map +0 -1
- package/dist/infrastructure/journal-retention.d.ts +0 -2
- package/dist/infrastructure/journal-retention.js +0 -51
- package/dist/infrastructure/journal-retention.js.map +0 -1
- package/dist/infrastructure/storage-mutation-lock.constants.d.ts +0 -5
- package/dist/infrastructure/storage-mutation-lock.constants.js +0 -6
- package/dist/infrastructure/storage-mutation-lock.constants.js.map +0 -1
- package/dist/infrastructure/storage-mutation-lock.d.ts +0 -1
- package/dist/infrastructure/storage-mutation-lock.js +0 -21
- package/dist/infrastructure/storage-mutation-lock.js.map +0 -1
- package/dist/infrastructure/storage-reservations.constants.d.ts +0 -4
- package/dist/infrastructure/storage-reservations.constants.js +0 -5
- package/dist/infrastructure/storage-reservations.constants.js.map +0 -1
- package/dist/infrastructure/storage-reservations.d.ts +0 -2
- package/dist/infrastructure/storage-reservations.js +0 -150
- package/dist/infrastructure/storage-reservations.js.map +0 -1
- package/dist/infrastructure/workflow-checkpoint.d.ts +0 -3
- package/dist/infrastructure/workflow-checkpoint.js +0 -84
- package/dist/infrastructure/workflow-checkpoint.js.map +0 -1
- package/dist/infrastructure/workflow-checkpoint.types.d.ts +0 -6
- package/dist/infrastructure/workflow-checkpoint.types.js +0 -2
- package/dist/infrastructure/workflow-checkpoint.types.js.map +0 -1
|
@@ -1,52 +1,75 @@
|
|
|
1
|
+
import { authenticationForm } from "../../domain/authentication.js";
|
|
1
2
|
import { invariant } from "../../domain/errors.js";
|
|
2
|
-
import {
|
|
3
|
-
export function
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
(
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
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],
|
|
3
|
+
import { credentialRecipes } from "./authentication.constants.js";
|
|
4
|
+
export function credentialPlan(plan = {}) {
|
|
5
|
+
return Object.freeze({
|
|
6
|
+
variables: Object.freeze({ ...plan.variables }),
|
|
7
|
+
host: Object.freeze([...(plan.host ?? [])]),
|
|
8
|
+
files: Object.freeze([...(plan.files ?? [])]),
|
|
9
|
+
commands: Object.freeze([...(plan.commands ?? [])]),
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
export function toolCommand(binary, args, options = {}) {
|
|
13
|
+
return {
|
|
14
|
+
executable: "node",
|
|
15
|
+
arguments: ["-e", credentialRecipes.tool, binary, ...args],
|
|
16
|
+
...options,
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
export function requiredVariable(variables, name) {
|
|
20
|
+
const value = variables[name];
|
|
21
|
+
invariant(value, `Missing ${name}. Declare the selected credential explicitly.`);
|
|
22
|
+
return value;
|
|
23
|
+
}
|
|
24
|
+
export function variableCredential(options) {
|
|
25
|
+
const recipe = (read) => (input) => {
|
|
26
|
+
options.bind?.(input);
|
|
27
|
+
return (variables) => {
|
|
28
|
+
const secret = read(input.value, variables);
|
|
29
|
+
options.accept?.(secret);
|
|
30
|
+
const exposed = options.expose?.(secret, input) ?? {};
|
|
31
|
+
return credentialPlan({
|
|
32
|
+
...exposed,
|
|
33
|
+
variables: { [options.variable]: secret, ...exposed.variables },
|
|
34
|
+
});
|
|
49
35
|
};
|
|
50
36
|
};
|
|
37
|
+
return {
|
|
38
|
+
preset: recipe((_, variables) => requiredVariable(variables, options.variable)),
|
|
39
|
+
key: (input) => {
|
|
40
|
+
options.accept?.(input.value);
|
|
41
|
+
return recipe((value) => value)(input);
|
|
42
|
+
},
|
|
43
|
+
variable: recipe((value, variables) => requiredVariable(variables, value)),
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
export function hostFile(options) {
|
|
47
|
+
const { files, source, ...credential } = options;
|
|
48
|
+
const recipe = (path) => () => credentialPlan({
|
|
49
|
+
host: [{ ...credential, source: path }],
|
|
50
|
+
...(files ? { files } : {}),
|
|
51
|
+
});
|
|
52
|
+
return {
|
|
53
|
+
preset: () => recipe(source),
|
|
54
|
+
file: (input) => recipe({ path: input.value }),
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
export function excluding(recipe, variable, message) {
|
|
58
|
+
return (input) => {
|
|
59
|
+
const planFor = recipe(input);
|
|
60
|
+
return (variables) => {
|
|
61
|
+
invariant(!variables[variable], message);
|
|
62
|
+
return planFor(variables);
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
export function credentialPlanner(agent, strategy, authentication, model) {
|
|
67
|
+
if (authentication === undefined)
|
|
68
|
+
return undefined;
|
|
69
|
+
const { form, value = "" } = authenticationForm(authentication);
|
|
70
|
+
const recipe = Object.hasOwn(strategy, form) ? strategy[form] : undefined;
|
|
71
|
+
const accepted = Object.keys(strategy);
|
|
72
|
+
invariant(recipe, `${agent} does not support ${form} authentication. Accepted forms: ${accepted.length ? accepted.join(", ") : "none"}`);
|
|
73
|
+
return recipe(model === undefined ? { value } : { value, model });
|
|
51
74
|
}
|
|
52
75
|
//# sourceMappingURL=authentication.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authentication.js","sourceRoot":"","sources":["../../../src/adapters/agents/authentication.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"authentication.js","sourceRoot":"","sources":["../../../src/adapters/agents/authentication.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAEpE,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AASlE,MAAM,UAAU,cAAc,CAC5B,OAAgC,EAAE;IAElC,OAAO,MAAM,CAAC,MAAM,CAAC;QACnB,SAAS,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,GAAG,IAAI,CAAC,SAAS,EAAE,CAAC;QAC/C,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC;QAC3C,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,CAAC;QAC7C,QAAQ,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC,CAAC;KACpD,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,WAAW,CACzB,MAAc,EACd,IAAuB,EACvB,UAAiD,EAAE;IAEnD,OAAO;QACL,UAAU,EAAE,MAAM;QAClB,SAAS,EAAE,CAAC,IAAI,EAAE,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;QAC1D,GAAG,OAAO;KACX,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,SA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AAC;IAChE,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAC1E,MAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACvC,SAAS,CACP,MAAM,EACN,GAAG,KAAK,qBAAqB,IAAI,oCAAoC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,CACtH,CAAC;IACF,OAAO,MAAM,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;AACpE,CAAC","sourcesContent":["import type {\n AgentAdapter,\n AgentAuthentication,\n CredentialPlan,\n HostCredentialPath,\n} from \"../../domain/agent.types.ts\";\nimport { authenticationForm } from \"../../domain/authentication.ts\";\nimport type { Command, Variables } from \"../../domain/command.types.ts\";\nimport { invariant } from \"../../domain/errors.ts\";\nimport type { AgentModel } from \"../../domain/model.types.ts\";\nimport { credentialRecipes } from \"./authentication.constants.ts\";\nimport type {\n CredentialPlanner,\n CredentialRecipe,\n CredentialStrategy,\n HostFileOptions,\n VariableCredentialOptions,\n} from \"./authentication.types.ts\";\n\nexport function credentialPlan(\n plan: Partial<CredentialPlan> = {},\n): CredentialPlan {\n return Object.freeze({\n variables: Object.freeze({ ...plan.variables }),\n host: Object.freeze([...(plan.host ?? [])]),\n files: Object.freeze([...(plan.files ?? [])]),\n commands: Object.freeze([...(plan.commands ?? [])]),\n });\n}\n\nexport function toolCommand(\n binary: string,\n args: readonly string[],\n options: Pick<Command, \"stdin\" | \"deadlineMs\"> = {},\n): Command {\n return {\n executable: \"node\",\n arguments: [\"-e\", credentialRecipes.tool, binary, ...args],\n ...options,\n };\n}\n\nexport function requiredVariable(variables: Variables, name: string): string {\n const value = variables[name];\n invariant(\n value,\n `Missing ${name}. Declare the selected credential explicitly.`,\n );\n return value;\n}\n\nexport function variableCredential(\n options: VariableCredentialOptions,\n): Readonly<Record<\"preset\" | \"key\" | \"variable\", CredentialRecipe>> {\n const recipe =\n (read: (value: string, variables: Variables) => string): CredentialRecipe =>\n (input) => {\n options.bind?.(input);\n return (variables) => {\n const secret = read(input.value, variables);\n options.accept?.(secret);\n const exposed = options.expose?.(secret, input) ?? {};\n return credentialPlan({\n ...exposed,\n variables: { [options.variable]: secret, ...exposed.variables },\n });\n };\n };\n return {\n preset: recipe((_, variables) =>\n requiredVariable(variables, options.variable),\n ),\n key: (input) => {\n options.accept?.(input.value);\n return recipe((value) => value)(input);\n },\n variable: recipe((value, variables) => requiredVariable(variables, value)),\n };\n}\n\nexport function hostFile(\n options: HostFileOptions,\n): Readonly<Record<\"preset\" | \"file\", CredentialRecipe>> {\n const { files, source, ...credential } = options;\n const recipe =\n (path: HostCredentialPath): CredentialPlanner =>\n () =>\n credentialPlan({\n host: [{ ...credential, source: path }],\n ...(files ? { files } : {}),\n });\n return {\n preset: () => recipe(source),\n file: (input) => recipe({ path: input.value }),\n };\n}\n\nexport function excluding(\n recipe: CredentialRecipe,\n variable: string,\n message: string,\n): CredentialRecipe {\n return (input) => {\n const planFor = recipe(input);\n return (variables) => {\n invariant(!variables[variable], message);\n return planFor(variables);\n };\n };\n}\n\nexport function credentialPlanner(\n agent: string,\n strategy: CredentialStrategy,\n authentication: AgentAuthentication | undefined,\n model?: AgentModel,\n): AgentAdapter[\"credentials\"] {\n if (authentication === undefined) return undefined;\n const { form, value = \"\" } = authenticationForm(authentication);\n const recipe = Object.hasOwn(strategy, form) ? strategy[form] : undefined;\n const accepted = Object.keys(strategy);\n invariant(\n recipe,\n `${agent} does not support ${form} authentication. Accepted forms: ${accepted.length ? accepted.join(\", \") : \"none\"}`,\n );\n return recipe(model === undefined ? { value } : { value, model });\n}\n"]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { CredentialPlan, HostCredential } from "../../domain/agent.types.ts";
|
|
2
|
+
import type { AuthenticationForm } from "../../domain/authentication.types.ts";
|
|
3
|
+
import type { Variables } from "../../domain/command.types.ts";
|
|
4
|
+
import type { AgentModel } from "../../domain/model.types.ts";
|
|
5
|
+
export interface CredentialInput {
|
|
6
|
+
readonly value: string;
|
|
7
|
+
readonly model?: AgentModel;
|
|
8
|
+
}
|
|
9
|
+
export type CredentialPlanner = (variables: Variables) => CredentialPlan;
|
|
10
|
+
export type CredentialRecipe = (input: CredentialInput) => CredentialPlanner;
|
|
11
|
+
export type CredentialStrategy = Readonly<Partial<Record<AuthenticationForm, CredentialRecipe>>>;
|
|
12
|
+
export interface VariableCredentialOptions {
|
|
13
|
+
readonly variable: string;
|
|
14
|
+
accept?(secret: string): void;
|
|
15
|
+
bind?(input: CredentialInput): void;
|
|
16
|
+
expose?(secret: string, input: CredentialInput): Partial<CredentialPlan>;
|
|
17
|
+
}
|
|
18
|
+
export interface HostFileOptions extends HostCredential {
|
|
19
|
+
readonly files?: CredentialPlan["files"];
|
|
20
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authentication.types.js","sourceRoot":"","sources":["../../../src/adapters/agents/authentication.types.ts"],"names":[],"mappings":"","sourcesContent":["import type {\n CredentialPlan,\n HostCredential,\n} from \"../../domain/agent.types.ts\";\nimport type { AuthenticationForm } from \"../../domain/authentication.types.ts\";\nimport type { Variables } from \"../../domain/command.types.ts\";\nimport type { AgentModel } from \"../../domain/model.types.ts\";\n\nexport interface CredentialInput {\n readonly value: string;\n readonly model?: AgentModel;\n}\n\nexport type CredentialPlanner = (variables: Variables) => CredentialPlan;\n\nexport type CredentialRecipe = (input: CredentialInput) => CredentialPlanner;\n\nexport type CredentialStrategy = Readonly<\n Partial<Record<AuthenticationForm, CredentialRecipe>>\n>;\n\nexport interface VariableCredentialOptions {\n readonly variable: string;\n accept?(secret: string): void;\n bind?(input: CredentialInput): void;\n expose?(secret: string, input: CredentialInput): Partial<CredentialPlan>;\n}\n\nexport interface HostFileOptions extends HostCredential {\n readonly files?: CredentialPlan[\"files\"];\n}\n"]}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { invariant } from "../../domain/errors.js";
|
|
2
|
-
import {
|
|
2
|
+
import { credentialPlanner } from "./authentication.js";
|
|
3
|
+
import { claudeCredentials } from "./claude-authentication.js";
|
|
3
4
|
import { claudeEvents, claudeTranscriptUsage } from "./claude-events.js";
|
|
4
5
|
import { claudeRequest } from "./claude-request.js";
|
|
5
6
|
import { CLAUDE_MAX_OUTPUT_VARIABLE, claudeModelSupport, } from "./model-support.constants.js";
|
|
@@ -9,9 +10,10 @@ function bindClaude(settings) {
|
|
|
9
10
|
const maxOutputTokens = settings.model?.maxOutputTokens;
|
|
10
11
|
invariant(maxOutputTokens === undefined ||
|
|
11
12
|
!Object.hasOwn(settings.variables ?? {}, CLAUDE_MAX_OUTPUT_VARIABLE), `Set maxOutputTokens on the agent model or ${CLAUDE_MAX_OUTPUT_VARIABLE}, not both`);
|
|
13
|
+
const credentials = credentialPlanner("Claude Code", claudeCredentials, settings.authentication, settings.model);
|
|
12
14
|
return Object.freeze({
|
|
13
15
|
name: "claude",
|
|
14
|
-
|
|
16
|
+
...(credentials ? { credentials } : {}),
|
|
15
17
|
conversations: "claude",
|
|
16
18
|
resumable: true,
|
|
17
19
|
capture: settings.saveConversations ?? true,
|
|
@@ -1 +1 @@
|
|
|
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,
|
|
1
|
+
{"version":3,"file":"claude-adapter.js","sourceRoot":"","sources":["../../../src/adapters/agents/claude-adapter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EA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AC,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 { credentialPlanner } from \"./authentication.ts\";\nimport { claudeCredentials } from \"./claude-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 const credentials = credentialPlanner(\n \"Claude Code\",\n claudeCredentials,\n settings.authentication,\n settings.model,\n );\n return Object.freeze({\n name: \"claude\",\n ...(credentials ? { credentials } : {}),\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"]}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { invariant } from "../../domain/errors.js";
|
|
2
|
+
import { credentialVariables } from "./authentication.constants.js";
|
|
3
|
+
import { excluding, hostFile, variableCredential } from "./authentication.js";
|
|
4
|
+
import { asRecord, parseCredential } from "./protocol.js";
|
|
5
|
+
const { account: tokenVariable, usage: keyVariable } = credentialVariables.claude;
|
|
6
|
+
const token = variableCredential({ variable: tokenVariable });
|
|
7
|
+
const key = variableCredential({ variable: keyVariable });
|
|
8
|
+
function subscription(content) {
|
|
9
|
+
const login = asRecord(parseCredential(content, "Claude")).claudeAiOauth;
|
|
10
|
+
invariant(login && typeof login === "object", "The Claude credential file has no claudeAiOauth subscription login");
|
|
11
|
+
return JSON.stringify({ claudeAiOauth: login });
|
|
12
|
+
}
|
|
13
|
+
const file = hostFile({
|
|
14
|
+
source: {
|
|
15
|
+
path: "~/.claude/.credentials.json",
|
|
16
|
+
home: { variable: "CLAUDE_CONFIG_DIR", path: ".credentials.json" },
|
|
17
|
+
},
|
|
18
|
+
destination: { file: ".claude/.credentials.json" },
|
|
19
|
+
login: "claude and /login",
|
|
20
|
+
alternative: `{ account: { variable: "${tokenVariable}" } } with a token from claude setup-token`,
|
|
21
|
+
select: subscription,
|
|
22
|
+
});
|
|
23
|
+
const account = (recipe) => excluding(recipe, keyVariable, `Conflicting Claude authentication: ${keyVariable} takes precedence over account credentials. Remove it or select usage authentication.`);
|
|
24
|
+
const usage = (recipe) => excluding(recipe, tokenVariable, `Conflicting Claude authentication: remove ${tokenVariable} or select account authentication.`);
|
|
25
|
+
export const claudeCredentials = Object.freeze({
|
|
26
|
+
account: account(file.preset),
|
|
27
|
+
"account.file": account(file.file),
|
|
28
|
+
"account.key": account(token.key),
|
|
29
|
+
"account.variable": account(token.variable),
|
|
30
|
+
usage: usage(key.preset),
|
|
31
|
+
"usage.key": usage(key.key),
|
|
32
|
+
"usage.variable": usage(key.variable),
|
|
33
|
+
});
|
|
34
|
+
//# sourceMappingURL=claude-authentication.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claude-authentication.js","sourceRoot":"","sources":["../../../src/adapters/agents/claude-authentication.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAK9E,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAE1D,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,WAAW,EAAE,GAClD,mBAAmB,CAAC,MAAM,CAA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OAAO,CAAC,KAAK,CAAC,GAAG,CAAC;IACjC,kBAAkB,EAAE,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC;IAC3C,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC;IACxB,WAAW,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC;IAC3B,gBAAgB,EAAE,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC;CACtC,CAAC,CAAC","sourcesContent":["import { invariant } from \"../../domain/errors.ts\";\nimport { credentialVariables } from \"./authentication.constants.ts\";\nimport { excluding, hostFile, variableCredential } from \"./authentication.ts\";\nimport type {\n CredentialRecipe,\n CredentialStrategy,\n} from \"./authentication.types.ts\";\nimport { asRecord, parseCredential } from \"./protocol.ts\";\n\nconst { account: tokenVariable, usage: keyVariable } =\n credentialVariables.claude;\nconst token = variableCredential({ variable: tokenVariable });\nconst key = variableCredential({ variable: keyVariable });\n\nfunction subscription(content: string): string {\n const login = asRecord(parseCredential(content, \"Claude\")).claudeAiOauth;\n invariant(\n login && typeof login === \"object\",\n \"The Claude credential file has no claudeAiOauth subscription login\",\n );\n return JSON.stringify({ claudeAiOauth: login });\n}\n\nconst file = hostFile({\n source: {\n path: \"~/.claude/.credentials.json\",\n home: { variable: \"CLAUDE_CONFIG_DIR\", path: \".credentials.json\" },\n },\n destination: { file: \".claude/.credentials.json\" },\n login: \"claude and /login\",\n alternative: `{ account: { variable: \"${tokenVariable}\" } } with a token from claude setup-token`,\n select: subscription,\n});\n\nconst account = (recipe: CredentialRecipe) =>\n excluding(\n recipe,\n keyVariable,\n `Conflicting Claude authentication: ${keyVariable} takes precedence over account credentials. Remove it or select usage authentication.`,\n );\nconst usage = (recipe: CredentialRecipe) =>\n excluding(\n recipe,\n tokenVariable,\n `Conflicting Claude authentication: remove ${tokenVariable} or select account authentication.`,\n );\n\nexport const claudeCredentials: CredentialStrategy = Object.freeze({\n account: account(file.preset),\n \"account.file\": account(file.file),\n \"account.key\": account(token.key),\n \"account.variable\": account(token.variable),\n usage: usage(key.preset),\n \"usage.key\": usage(key.key),\n \"usage.variable\": usage(key.variable),\n});\n"]}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { toolResult } from "./tool-result.js";
|
|
1
2
|
import { decodeEvent, decodeLine } from "./event-decoder.js";
|
|
2
3
|
import { asRecord, decodeRecord, numberOrZero } from "./protocol.js";
|
|
3
4
|
function tokens(value) {
|
|
@@ -15,17 +16,50 @@ function system(event) {
|
|
|
15
16
|
: [];
|
|
16
17
|
}
|
|
17
18
|
function assistant(event) {
|
|
18
|
-
const
|
|
19
|
+
const message = asRecord(event.message);
|
|
20
|
+
const content = message.content;
|
|
19
21
|
if (!Array.isArray(content))
|
|
20
22
|
return [];
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
23
|
+
const usage = message.usage
|
|
24
|
+
? [
|
|
25
|
+
{
|
|
26
|
+
kind: "message-usage",
|
|
27
|
+
tokens: tokens(message.usage),
|
|
28
|
+
...(typeof message.id === "string" ? { messageId: message.id } : {}),
|
|
29
|
+
...(typeof event.parent_tool_use_id === "string"
|
|
30
|
+
? { parentCallId: event.parent_tool_use_id }
|
|
31
|
+
: {}),
|
|
32
|
+
},
|
|
33
|
+
]
|
|
34
|
+
: [];
|
|
35
|
+
return [
|
|
36
|
+
...usage,
|
|
37
|
+
...content.flatMap((part) => decodeEvent(asRecord(part), {
|
|
38
|
+
text: (block) => typeof block.text === "string"
|
|
39
|
+
? [{ kind: "text", text: block.text }]
|
|
40
|
+
: [],
|
|
41
|
+
thinking: (block) => typeof block.thinking === "string"
|
|
42
|
+
? [{ kind: "reasoning", text: block.thinking }]
|
|
43
|
+
: [],
|
|
44
|
+
tool_result: (block) => toolResult(block.tool_use_id, undefined, block.content, block.is_error === true).map((value) => ({
|
|
45
|
+
...value,
|
|
46
|
+
...(typeof event.parent_tool_use_id === "string"
|
|
47
|
+
? { parentCallId: event.parent_tool_use_id }
|
|
48
|
+
: {}),
|
|
49
|
+
})),
|
|
50
|
+
tool_use: (block) => [
|
|
51
|
+
{
|
|
52
|
+
kind: "tool",
|
|
53
|
+
name: String(block.name),
|
|
54
|
+
input: block.input,
|
|
55
|
+
...(typeof block.id === "string" ? { callId: block.id } : {}),
|
|
56
|
+
...(typeof event.parent_tool_use_id === "string"
|
|
57
|
+
? { parentCallId: event.parent_tool_use_id }
|
|
58
|
+
: {}),
|
|
59
|
+
},
|
|
60
|
+
],
|
|
61
|
+
})),
|
|
62
|
+
];
|
|
29
63
|
}
|
|
30
64
|
function result(event) {
|
|
31
65
|
const events = [];
|
|
@@ -45,6 +79,15 @@ export function claudeEvents(line) {
|
|
|
45
79
|
return decodeLine(line, {
|
|
46
80
|
system,
|
|
47
81
|
assistant,
|
|
82
|
+
user: assistant,
|
|
83
|
+
stream_event: (event) => {
|
|
84
|
+
const delta = asRecord(asRecord(event.event).delta);
|
|
85
|
+
if (delta.type === "text_delta" && typeof delta.text === "string")
|
|
86
|
+
return [{ kind: "text-delta", text: delta.text }];
|
|
87
|
+
if (delta.type === "thinking_delta" && typeof delta.thinking === "string")
|
|
88
|
+
return [{ kind: "reasoning", text: delta.thinking }];
|
|
89
|
+
return [];
|
|
90
|
+
},
|
|
48
91
|
result,
|
|
49
92
|
});
|
|
50
93
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claude-events.js","sourceRoot":"","sources":["../../../src/adapters/agents/claude-events.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"claude-events.js","sourceRoot":"","sources":["../../../src/adapters/agents/claude-events.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,eAAe,C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AK,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC;YACpD,IAAI,KAAK,CAAC,IAAI,KAAK,YAAY,IAAI,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ;gBAC/D,OAAO,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC;YACpD,IAAI,KAAK,CAAC,IAAI,KAAK,gBAAgB,IAAI,OAAO,KAAK,CAAC,QAAQ,KAAK,QAAQ;gBACvE,OAAO,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC;YACvD,OAAO,EAAE,CAAC;QACZ,CAAC;QACD,MAAM;KACiB,CAAC,CAAC;AAC7B,CAAC;AAED,MAAM,UAAU,qBAAqB,CAAC,IAAY;IAChD,IAAI,KAAwB,CAAC;IAC7B,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC;QACvC,MAAM,KAAK,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC;QACjC,IAAI,KAAK,EAAE,IAAI,KAAK,WAAW;YAAE,SAAS;QAC1C,MAAM,OAAO,GAAG,QAAQ,CAAC,KAAK,CAAC,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 { toolResult } from \"./tool-result.ts\";\nimport 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 message = asRecord(event.message);\n const content = message.content;\n if (!Array.isArray(content)) return [];\n const usage: AgentEvent[] = message.usage\n ? [\n {\n kind: \"message-usage\",\n tokens: tokens(message.usage),\n ...(typeof message.id === \"string\" ? { messageId: message.id } : {}),\n ...(typeof event.parent_tool_use_id === \"string\"\n ? { parentCallId: event.parent_tool_use_id }\n : {}),\n },\n ]\n : [];\n return [\n ...usage,\n ...content.flatMap((part) =>\n decodeEvent(asRecord(part), {\n text: (block) =>\n typeof block.text === \"string\"\n ? [{ kind: \"text\", text: block.text }]\n : [],\n thinking: (block) =>\n typeof block.thinking === \"string\"\n ? [{ kind: \"reasoning\", text: block.thinking }]\n : [],\n tool_result: (block) =>\n toolResult(\n block.tool_use_id,\n undefined,\n block.content,\n block.is_error === true,\n ).map((value) => ({\n ...value,\n ...(typeof event.parent_tool_use_id === \"string\"\n ? { parentCallId: event.parent_tool_use_id }\n : {}),\n })),\n tool_use: (block) => [\n {\n kind: \"tool\",\n name: String(block.name),\n input: block.input,\n ...(typeof block.id === \"string\" ? { callId: block.id } : {}),\n ...(typeof event.parent_tool_use_id === \"string\"\n ? { parentCallId: event.parent_tool_use_id }\n : {}),\n },\n ],\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 user: assistant,\n stream_event: (event) => {\n const delta = asRecord(asRecord(event.event).delta);\n if (delta.type === \"text_delta\" && typeof delta.text === \"string\")\n return [{ kind: \"text-delta\", text: delta.text }];\n if (delta.type === \"thinking_delta\" && typeof delta.thinking === \"string\")\n return [{ kind: \"reasoning\", text: delta.thinking }];\n return [];\n },\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"]}
|
|
@@ -4,6 +4,8 @@ export function claudeRequest(settings, input) {
|
|
|
4
4
|
const args = [];
|
|
5
5
|
if (!input.interactive)
|
|
6
6
|
args.push("--print", "--verbose", "--output-format", "stream-json");
|
|
7
|
+
if (!input.interactive && settings.partialMessages)
|
|
8
|
+
args.push("--include-partial-messages");
|
|
7
9
|
if (settings.model)
|
|
8
10
|
args.push("--model", settings.model.name);
|
|
9
11
|
if (settings.model?.reasoning)
|
|
@@ -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,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
|
+
{"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,CAAC,KAAK,CAAC,WAAW,IAAI,QAAQ,CAAC,eAAe;QAChD,IAAI,CAAC,IAAI,CAAC,4BAA4B,CAAC,CAAC;IAC1C,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 (!input.interactive && settings.partialMessages)\n args.push(\"--include-partial-messages\");\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,12 +1,12 @@
|
|
|
1
1
|
import type { AgentCliScenario } from "./cli-diagnostics.types.ts";
|
|
2
2
|
export declare const cliDiagnosticScenarios: readonly AgentCliScenario[];
|
|
3
3
|
export declare const codexDiagnosticUsage: {
|
|
4
|
-
readonly start: "codex exec";
|
|
5
|
-
readonly resume: "codex exec resume";
|
|
6
|
-
readonly fork: "codex exec fork";
|
|
4
|
+
readonly start: "Usage: codex exec [";
|
|
5
|
+
readonly resume: "Usage: codex exec resume [";
|
|
6
|
+
readonly fork: "Usage: codex exec fork [";
|
|
7
7
|
};
|
|
8
8
|
export declare const claudeDiagnosticUsage: {
|
|
9
|
-
readonly start: "claude";
|
|
10
|
-
readonly resume: "claude";
|
|
11
|
-
readonly fork: "claude";
|
|
9
|
+
readonly start: "Usage: claude [";
|
|
10
|
+
readonly resume: "Usage: claude [";
|
|
11
|
+
readonly fork: "Usage: claude [";
|
|
12
12
|
};
|
|
@@ -12,13 +12,13 @@ export const cliDiagnosticScenarios = [
|
|
|
12
12
|
},
|
|
13
13
|
];
|
|
14
14
|
export const codexDiagnosticUsage = {
|
|
15
|
-
start: "codex exec",
|
|
16
|
-
resume: "codex exec resume",
|
|
17
|
-
fork: "codex exec fork",
|
|
15
|
+
start: "Usage: codex exec [",
|
|
16
|
+
resume: "Usage: codex exec resume [",
|
|
17
|
+
fork: "Usage: codex exec fork [",
|
|
18
18
|
};
|
|
19
19
|
export const claudeDiagnosticUsage = {
|
|
20
|
-
start: "claude",
|
|
21
|
-
resume: "claude",
|
|
22
|
-
fork: "claude",
|
|
20
|
+
start: "Usage: claude [",
|
|
21
|
+
resume: "Usage: claude [",
|
|
22
|
+
fork: "Usage: claude [",
|
|
23
23
|
};
|
|
24
24
|
//# sourceMappingURL=cli-diagnostics.constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli-diagnostics.constants.js","sourceRoot":"","sources":["../../../src/adapters/agents/cli-diagnostics.constants.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,sBAAsB,GAAgC;IACjE,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE;IAC5B;QACE,IAAI,EAAE,QAAQ;QACd,KAAK,EAAE,EAAE,YAAY,EAAE,EAAE,EAAE,EAAE,sCAAsC,EAAE,EAAE;KACxE;IACD;QACE,IAAI,EAAE,MAAM;QACZ,KAAK,EAAE;YACL,YAAY,EAAE,EAAE,EAAE,EAAE,sCAAsC,EAAE,IAAI,EAAE,IAAI,EAAE;SACzE;KACF;CACF,CAAC;AACF,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"cli-diagnostics.constants.js","sourceRoot":"","sources":["../../../src/adapters/agents/cli-diagnostics.constants.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,sBAAsB,GAAgC;IACjE,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE;IAC5B;QACE,IAAI,EAAE,QAAQ;QACd,KAAK,EAAE,EAAE,YAAY,EAAE,EAAE,EAAE,EAAE,sCAAsC,EAAE,EAAE;KACxE;IACD;QACE,IAAI,EAAE,MAAM;QACZ,KAAK,EAAE;YACL,YAAY,EAAE,EAAE,EAAE,EAAE,sCAAsC,EAAE,IAAI,EAAE,IAAI,EAAE;SACzE;KACF;CACF,CAAC;AACF,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,KAAK,EAAE,qBAAqB;IAC5B,MAAM,EAAE,4BAA4B;IACpC,IAAI,EAAE,0BAA0B;CACxB,CAAC;AACX,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,KAAK,EAAE,iBAAiB;IACxB,MAAM,EAAE,iBAAiB;IACzB,IAAI,EAAE,iBAAiB;CACf,CAAC","sourcesContent":["import type { AgentCliScenario } from \"./cli-diagnostics.types.ts\";\n\nexport const cliDiagnosticScenarios: readonly AgentCliScenario[] = [\n { mode: \"start\", input: {} },\n {\n mode: \"resume\",\n input: { continuation: { id: \"00000000-0000-0000-0000-000000000000\" } },\n },\n {\n mode: \"fork\",\n input: {\n continuation: { id: \"00000000-0000-0000-0000-000000000000\", fork: true },\n },\n },\n];\nexport const codexDiagnosticUsage = {\n start: \"Usage: codex exec [\",\n resume: \"Usage: codex exec resume [\",\n fork: \"Usage: codex exec fork [\",\n} as const;\nexport const claudeDiagnosticUsage = {\n start: \"Usage: claude [\",\n resume: \"Usage: claude [\",\n fork: \"Usage: claude [\",\n} as const;\n"]}
|
|
@@ -2,3 +2,4 @@ import type { AgentInput } from "../../domain/agent.types.ts";
|
|
|
2
2
|
import type { Command } from "../../domain/command.types.ts";
|
|
3
3
|
import type { AgentCliDiagnostic, AgentCliMode } from "./cli-diagnostics.types.ts";
|
|
4
4
|
export declare function cliDiagnostics(request: (input: AgentInput) => Command, usage: Readonly<Record<AgentCliMode, string>>): readonly AgentCliDiagnostic[];
|
|
5
|
+
export declare function helpDiagnostics(request: (input: AgentInput) => Command, usage: string, resume?: boolean): readonly AgentCliDiagnostic[];
|
|
@@ -11,4 +11,22 @@ export function cliDiagnostics(request, usage) {
|
|
|
11
11
|
};
|
|
12
12
|
});
|
|
13
13
|
}
|
|
14
|
+
export function helpDiagnostics(request, usage, resume = false) {
|
|
15
|
+
const modes = resume ? ["start", "resume"] : ["start"];
|
|
16
|
+
return modes.map((mode) => {
|
|
17
|
+
const command = request(mode === "resume"
|
|
18
|
+
? { continuation: { id: "00000000-0000-0000-0000-000000000000" } }
|
|
19
|
+
: {});
|
|
20
|
+
return {
|
|
21
|
+
mode,
|
|
22
|
+
usage,
|
|
23
|
+
options: (command.arguments ?? []).filter((argument) => argument.startsWith("--")),
|
|
24
|
+
command: {
|
|
25
|
+
executable: command.executable,
|
|
26
|
+
arguments: ["--help"],
|
|
27
|
+
...(command.variables ? { variables: command.variables } : {}),
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
});
|
|
31
|
+
}
|
|
14
32
|
//# sourceMappingURL=cli-diagnostics.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli-diagnostics.js","sourceRoot":"","sources":["../../../src/adapters/agents/cli-diagnostics.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AAMxE,MAAM,UAAU,cAAc,CAC5B,OAAuC,EACvC,KAA6C;IAE7C,OAAO,sBAAsB,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,EAAE;QACpD,MAAM,OAAO,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;QAC/B,MAAM,IAAI,GAAG,OAAO,CAAC,SAAS,IAAI,EAAE,CAAC;QACrC,OAAO;YACL,IAAI;YACJ,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC;YAClB,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;YAC7D,OAAO,EAAE,EAAE,GAAG,OAAO,EAAE,SAAS,EAAE,CAAC,GAAG,IAAI,EAAE,QAAQ,CAAC,EAAE;SACxD,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import type { AgentInput } from \"../../domain/agent.types.ts\";\nimport type { Command } from \"../../domain/command.types.ts\";\nimport { cliDiagnosticScenarios } from \"./cli-diagnostics.constants.ts\";\nimport type {\n AgentCliDiagnostic,\n AgentCliMode,\n} from \"./cli-diagnostics.types.ts\";\n\nexport function cliDiagnostics(\n request: (input: AgentInput) => Command,\n usage: Readonly<Record<AgentCliMode, string>>,\n): readonly AgentCliDiagnostic[] {\n return cliDiagnosticScenarios.map(({ mode, input }) => {\n const command = request(input);\n const args = command.arguments ?? [];\n return {\n mode,\n usage: usage[mode],\n options: args.filter((argument) => argument.startsWith(\"--\")),\n command: { ...command, arguments: [...args, \"--help\"] },\n };\n });\n}\n"]}
|
|
1
|
+
{"version":3,"file":"cli-diagnostics.js","sourceRoot":"","sources":["../../../src/adapters/agents/cli-diagnostics.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AAMxE,MAAM,UAAU,cAAc,CAC5B,OAAuC,EACvC,KAA6C;IAE7C,OAAO,sBAAsB,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,EAAE;QACpD,MAAM,OAAO,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;QAC/B,MAAM,IAAI,GAAG,OAAO,CAAC,SAAS,IAAI,EAAE,CAAC;QACrC,OAAO;YACL,IAAI;YACJ,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC;YAClB,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;YAC7D,OAAO,EAAE,EAAE,GAAG,OAAO,EAAE,SAAS,EAAE,CAAC,GAAG,IAAI,EAAE,QAAQ,CAAC,EAAE;SACxD,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,eAAe,CAC7B,OAAuC,EACvC,KAAa,EACb,MAAM,GAAG,KAAK;IAEd,MAAM,KAAK,GAAG,MAAM,CAAC,CAAC,CAAE,CAAC,OAAO,EAAE,QAAQ,CAAW,CAAC,CAAC,CAAE,CAAC,OAAO,CAAW,CAAC;IAC7E,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;QACxB,MAAM,OAAO,GAAG,OAAO,CACrB,IAAI,KAAK,QAAQ;YACf,CAAC,CAAC,EAAE,YAAY,EAAE,EAAE,EAAE,EAAE,sCAAsC,EAAE,EAAE;YAClE,CAAC,CAAC,EAAE,CACP,CAAC;QACF,OAAO;YACL,IAAI;YACJ,KAAK;YACL,OAAO,EAAE,CAAC,OAAO,CAAC,SAAS,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,EAAE,CACrD,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,CAC1B;YACD,OAAO,EAAE;gBACP,UAAU,EAAE,OAAO,CAAC,UAAU;gBAC9B,SAAS,EAAE,CAAC,QAAQ,CAAC;gBACrB,GAAG,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,OAAO,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;aAC/D;SACF,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import type { AgentInput } from \"../../domain/agent.types.ts\";\nimport type { Command } from \"../../domain/command.types.ts\";\nimport { cliDiagnosticScenarios } from \"./cli-diagnostics.constants.ts\";\nimport type {\n AgentCliDiagnostic,\n AgentCliMode,\n} from \"./cli-diagnostics.types.ts\";\n\nexport function cliDiagnostics(\n request: (input: AgentInput) => Command,\n usage: Readonly<Record<AgentCliMode, string>>,\n): readonly AgentCliDiagnostic[] {\n return cliDiagnosticScenarios.map(({ mode, input }) => {\n const command = request(input);\n const args = command.arguments ?? [];\n return {\n mode,\n usage: usage[mode],\n options: args.filter((argument) => argument.startsWith(\"--\")),\n command: { ...command, arguments: [...args, \"--help\"] },\n };\n });\n}\n\nexport function helpDiagnostics(\n request: (input: AgentInput) => Command,\n usage: string,\n resume = false,\n): readonly AgentCliDiagnostic[] {\n const modes = resume ? ([\"start\", \"resume\"] as const) : ([\"start\"] as const);\n return modes.map((mode) => {\n const command = request(\n mode === \"resume\"\n ? { continuation: { id: \"00000000-0000-0000-0000-000000000000\" } }\n : {},\n );\n return {\n mode,\n usage,\n options: (command.arguments ?? []).filter((argument) =>\n argument.startsWith(\"--\"),\n ),\n command: {\n executable: command.executable,\n arguments: [\"--help\"],\n ...(command.variables ? { variables: command.variables } : {}),\n },\n };\n });\n}\n"]}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { credentialPlanner } from "./authentication.js";
|
|
2
|
+
import { codexCredentials } from "./codex-authentication.js";
|
|
2
3
|
import { codexProvider } from "./codex-provider.js";
|
|
3
4
|
import { codexEvents } from "./codex-events.js";
|
|
4
5
|
import { codexRequest } from "./codex-request.js";
|
|
@@ -7,9 +8,10 @@ import { harnessSettings, supportModel } from "./model-support.js";
|
|
|
7
8
|
function bindCodex(settings) {
|
|
8
9
|
supportModel(codexModelSupport, settings.model);
|
|
9
10
|
codexProvider(settings);
|
|
11
|
+
const credentials = credentialPlanner("Codex", codexCredentials(settings.modelProvider), settings.authentication, settings.model);
|
|
10
12
|
return Object.freeze({
|
|
11
13
|
name: "codex",
|
|
12
|
-
|
|
14
|
+
...(credentials ? { credentials } : {}),
|
|
13
15
|
conversations: "codex",
|
|
14
16
|
resumable: true,
|
|
15
17
|
capture: settings.saveConversations ?? true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codex-adapter.js","sourceRoot":"","sources":["../../../src/adapters/agents/codex-adapter.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"codex-adapter.js","sourceRoot":"","sources":["../../../src/adapters/agents/codex-adapter.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAE7D,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,WAAW,EA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C;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 { credentialPlanner } from \"./authentication.ts\";\nimport { codexCredentials } from \"./codex-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 const credentials = credentialPlanner(\n \"Codex\",\n codexCredentials(settings.modelProvider),\n settings.authentication,\n settings.model,\n );\n return Object.freeze({\n name: \"codex\",\n ...(credentials ? { credentials } : {}),\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"]}
|