@elie-laloum/outpost 11.1.3 → 11.2.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 +25 -0
- package/README.md +1 -0
- package/SECURITY.md +5 -1
- package/dist/adapters/agents/antigravity/antigravity-adapter.js +9 -0
- package/dist/adapters/agents/antigravity/antigravity-adapter.js.map +1 -1
- package/dist/adapters/agents/antigravity/antigravity-hook-plan.d.ts +3 -0
- package/dist/adapters/agents/antigravity/antigravity-hook-plan.js +39 -0
- package/dist/adapters/agents/antigravity/antigravity-hook-plan.js.map +1 -0
- package/dist/adapters/agents/antigravity/antigravity-hooks.constants.d.ts +3 -0
- package/dist/adapters/agents/antigravity/antigravity-hooks.constants.js +394 -0
- package/dist/adapters/agents/antigravity/antigravity-hooks.constants.js.map +1 -0
- package/dist/adapters/agents/antigravity/antigravity-hooks.d.ts +2 -0
- package/dist/adapters/agents/antigravity/antigravity-hooks.js +6 -0
- package/dist/adapters/agents/antigravity/antigravity-hooks.js.map +1 -0
- package/dist/adapters/agents/antigravity/antigravity-hooks.types.d.ts +114 -0
- package/dist/adapters/agents/antigravity/antigravity-hooks.types.js +2 -0
- package/dist/adapters/agents/antigravity/antigravity-hooks.types.js.map +1 -0
- package/dist/adapters/agents/antigravity/antigravity.types.d.ts +1 -0
- package/dist/adapters/agents/antigravity/antigravity.types.js.map +1 -1
- package/dist/adapters/agents/authentication.js +1 -0
- package/dist/adapters/agents/authentication.js.map +1 -1
- package/dist/adapters/agents/claude/claude-adapter.js +15 -0
- package/dist/adapters/agents/claude/claude-adapter.js.map +1 -1
- package/dist/adapters/agents/claude/claude-hook-plan.constants.d.ts +1 -0
- package/dist/adapters/agents/claude/claude-hook-plan.constants.js +20 -0
- package/dist/adapters/agents/claude/claude-hook-plan.constants.js.map +1 -0
- package/dist/adapters/agents/claude/claude-hook-plan.d.ts +4 -0
- package/dist/adapters/agents/claude/claude-hook-plan.js +60 -0
- package/dist/adapters/agents/claude/claude-hook-plan.js.map +1 -0
- package/dist/adapters/agents/claude/claude-hooks.constants.d.ts +3 -0
- package/dist/adapters/agents/claude/claude-hooks.constants.js +2968 -0
- package/dist/adapters/agents/claude/claude-hooks.constants.js.map +1 -0
- package/dist/adapters/agents/claude/claude-hooks.d.ts +2 -0
- package/dist/adapters/agents/claude/claude-hooks.js +6 -0
- package/dist/adapters/agents/claude/claude-hooks.js.map +1 -0
- package/dist/adapters/agents/claude/claude-hooks.types.d.ts +900 -0
- package/dist/adapters/agents/claude/claude-hooks.types.js +2 -0
- package/dist/adapters/agents/claude/claude-hooks.types.js.map +1 -0
- package/dist/adapters/agents/claude/claude-profile.d.ts +1 -0
- package/dist/adapters/agents/claude/claude-profile.js +23 -11
- package/dist/adapters/agents/claude/claude-profile.js.map +1 -1
- package/dist/adapters/agents/codex/codex-adapter.js +17 -1
- package/dist/adapters/agents/codex/codex-adapter.js.map +1 -1
- package/dist/adapters/agents/codex/codex-authentication.js +1 -0
- package/dist/adapters/agents/codex/codex-authentication.js.map +1 -1
- package/dist/adapters/agents/codex/codex-conversations.constants.d.ts +1 -0
- package/dist/adapters/agents/codex/codex-conversations.constants.js +2 -0
- package/dist/adapters/agents/codex/codex-conversations.constants.js.map +1 -0
- package/dist/adapters/agents/codex/codex-conversations.js +8 -5
- package/dist/adapters/agents/codex/codex-conversations.js.map +1 -1
- package/dist/adapters/agents/codex/codex-hook-plan.d.ts +3 -0
- package/dist/adapters/agents/codex/codex-hook-plan.js +72 -0
- package/dist/adapters/agents/codex/codex-hook-plan.js.map +1 -0
- package/dist/adapters/agents/codex/codex-hooks.constants.d.ts +3 -0
- package/dist/adapters/agents/codex/codex-hooks.constants.js +942 -0
- package/dist/adapters/agents/codex/codex-hooks.constants.js.map +1 -0
- package/dist/adapters/agents/codex/codex-hooks.d.ts +2 -0
- package/dist/adapters/agents/codex/codex-hooks.js +6 -0
- package/dist/adapters/agents/codex/codex-hooks.js.map +1 -0
- package/dist/adapters/agents/codex/codex-hooks.types.d.ts +255 -0
- package/dist/adapters/agents/codex/codex-hooks.types.js +2 -0
- package/dist/adapters/agents/codex/codex-hooks.types.js.map +1 -0
- package/dist/adapters/agents/codex/codex-provider.js +2 -2
- package/dist/adapters/agents/codex/codex-provider.js.map +1 -1
- package/dist/adapters/agents/copilot/copilot-adapter.js +14 -0
- package/dist/adapters/agents/copilot/copilot-adapter.js.map +1 -1
- package/dist/adapters/agents/copilot/copilot-hook-plan.d.ts +3 -0
- package/dist/adapters/agents/copilot/copilot-hook-plan.js +26 -0
- package/dist/adapters/agents/copilot/copilot-hook-plan.js.map +1 -0
- package/dist/adapters/agents/copilot/copilot-hooks.constants.d.ts +3 -0
- package/dist/adapters/agents/copilot/copilot-hooks.constants.js +528 -0
- package/dist/adapters/agents/copilot/copilot-hooks.constants.js.map +1 -0
- package/dist/adapters/agents/copilot/copilot-hooks.d.ts +2 -0
- package/dist/adapters/agents/copilot/copilot-hooks.js +6 -0
- package/dist/adapters/agents/copilot/copilot-hooks.js.map +1 -0
- package/dist/adapters/agents/copilot/copilot-hooks.types.d.ts +166 -0
- package/dist/adapters/agents/copilot/copilot-hooks.types.js +2 -0
- package/dist/adapters/agents/copilot/copilot-hooks.types.js.map +1 -0
- package/dist/adapters/agents/copilot/copilot.types.d.ts +1 -0
- package/dist/adapters/agents/copilot/copilot.types.js.map +1 -1
- package/dist/adapters/agents/hook-groups.d.ts +2 -0
- package/dist/adapters/agents/hook-groups.js +17 -0
- package/dist/adapters/agents/hook-groups.js.map +1 -0
- package/dist/adapters/agents/kimi/kimi-adapter.js +16 -1
- package/dist/adapters/agents/kimi/kimi-adapter.js.map +1 -1
- package/dist/adapters/agents/kimi/kimi-hook-plan.d.ts +3 -0
- package/dist/adapters/agents/kimi/kimi-hook-plan.js +33 -0
- package/dist/adapters/agents/kimi/kimi-hook-plan.js.map +1 -0
- package/dist/adapters/agents/kimi/kimi-hooks.constants.d.ts +3 -0
- package/dist/adapters/agents/kimi/kimi-hooks.constants.js +747 -0
- package/dist/adapters/agents/kimi/kimi-hooks.constants.js.map +1 -0
- package/dist/adapters/agents/kimi/kimi-hooks.d.ts +2 -0
- package/dist/adapters/agents/kimi/kimi-hooks.js +6 -0
- package/dist/adapters/agents/kimi/kimi-hooks.js.map +1 -0
- package/dist/adapters/agents/kimi/kimi-hooks.types.d.ts +226 -0
- package/dist/adapters/agents/kimi/kimi-hooks.types.js +2 -0
- package/dist/adapters/agents/kimi/kimi-hooks.types.js.map +1 -0
- package/dist/adapters/agents/kimi/kimi-request.js +2 -0
- package/dist/adapters/agents/kimi/kimi-request.js.map +1 -1
- package/dist/adapters/agents/kimi/kimi.constants.d.ts +1 -0
- package/dist/adapters/agents/kimi/kimi.constants.js +1 -0
- package/dist/adapters/agents/kimi/kimi.constants.js.map +1 -1
- package/dist/adapters/agents/kimi/kimi.types.d.ts +1 -0
- package/dist/adapters/agents/kimi/kimi.types.js.map +1 -1
- package/dist/adapters/agents/native-hooks.d.ts +4 -0
- package/dist/adapters/agents/native-hooks.js +63 -0
- package/dist/adapters/agents/native-hooks.js.map +1 -0
- package/dist/adapters/agents/native-hooks.types.d.ts +22 -0
- package/dist/adapters/agents/native-hooks.types.js +2 -0
- package/dist/adapters/agents/native-hooks.types.js.map +1 -0
- package/dist/adapters/agents/settings.types.d.ts +2 -0
- package/dist/adapters/agents/settings.types.js.map +1 -1
- package/dist/adapters/decisions/system-one-provider.constants.d.ts +1 -1
- package/dist/adapters/decisions/system-one-provider.constants.js +1 -1
- package/dist/adapters/decisions/system-one-provider.constants.js.map +1 -1
- package/dist/adapters/decisions/system-one-provider.js +8 -21
- package/dist/adapters/decisions/system-one-provider.js.map +1 -1
- package/dist/adapters/models/anthropic-model-provider.constants.d.ts +1 -0
- package/dist/adapters/models/anthropic-model-provider.constants.js +4 -0
- package/dist/adapters/models/anthropic-model-provider.constants.js.map +1 -1
- package/dist/adapters/models/anthropic-model-provider.js +7 -1
- package/dist/adapters/models/anthropic-model-provider.js.map +1 -1
- package/dist/adapters/models/http-failure.d.ts +3 -0
- package/dist/adapters/models/http-failure.js +43 -0
- package/dist/adapters/models/http-failure.js.map +1 -0
- package/dist/adapters/models/http-provider.js +14 -20
- package/dist/adapters/models/http-provider.js.map +1 -1
- package/dist/adapters/models/model-protocol.types.d.ts +1 -0
- package/dist/adapters/models/model-protocol.types.js.map +1 -1
- package/dist/adapters/models/model.constants.d.ts +2 -0
- package/dist/adapters/models/model.constants.js +17 -0
- package/dist/adapters/models/model.constants.js.map +1 -1
- package/dist/adapters/models/openai-chat-stream.js +3 -1
- package/dist/adapters/models/openai-chat-stream.js.map +1 -1
- package/dist/adapters/models/openai-responses.js +4 -0
- package/dist/adapters/models/openai-responses.js.map +1 -1
- package/dist/adapters/secrets/aws.js +5 -4
- package/dist/adapters/secrets/aws.js.map +1 -1
- package/dist/adapters/secrets/azure.constants.d.ts +1 -0
- package/dist/adapters/secrets/azure.constants.js +2 -0
- package/dist/adapters/secrets/azure.constants.js.map +1 -0
- package/dist/adapters/secrets/azure.js +2 -1
- package/dist/adapters/secrets/azure.js.map +1 -1
- package/dist/adapters/secrets/gcp.constants.d.ts +1 -0
- package/dist/adapters/secrets/gcp.constants.js +2 -0
- package/dist/adapters/secrets/gcp.constants.js.map +1 -0
- package/dist/adapters/secrets/gcp.js +11 -9
- package/dist/adapters/secrets/gcp.js.map +1 -1
- package/dist/adapters/secrets/infisical.js +3 -2
- package/dist/adapters/secrets/infisical.js.map +1 -1
- package/dist/adapters/secrets/onepassword.constants.d.ts +1 -0
- package/dist/adapters/secrets/onepassword.constants.js +2 -0
- package/dist/adapters/secrets/onepassword.constants.js.map +1 -0
- package/dist/adapters/secrets/onepassword.js +2 -1
- package/dist/adapters/secrets/onepassword.js.map +1 -1
- package/dist/adapters/secrets/secret-source.js +3 -1
- package/dist/adapters/secrets/secret-source.js.map +1 -1
- package/dist/adapters/secrets/vault-response.js +5 -5
- package/dist/adapters/secrets/vault-response.js.map +1 -1
- package/dist/adapters/secrets/vault.js +4 -3
- package/dist/adapters/secrets/vault.js.map +1 -1
- package/dist/adapters/testing/scripted-agent.d.ts +3 -1
- package/dist/adapters/testing/scripted-agent.js +3 -1
- package/dist/adapters/testing/scripted-agent.js.map +1 -1
- package/dist/adapters/tools/edit-tools.js +3 -3
- package/dist/adapters/tools/edit-tools.js.map +1 -1
- package/dist/adapters/tools/git-tools.js +16 -1
- package/dist/adapters/tools/git-tools.js.map +1 -1
- package/dist/adapters/tools/mcp-launcher.constants.d.ts +1 -1
- package/dist/adapters/tools/mcp-launcher.constants.js +29 -7
- package/dist/adapters/tools/mcp-launcher.constants.js.map +1 -1
- package/dist/adapters/tools/mcp-resources.js +5 -1
- package/dist/adapters/tools/mcp-resources.js.map +1 -1
- package/dist/adapters/tools/mcp.constants.d.ts +0 -6
- package/dist/adapters/tools/mcp.constants.js +0 -6
- package/dist/adapters/tools/mcp.constants.js.map +1 -1
- package/dist/adapters/tools/mcp.js +1 -0
- package/dist/adapters/tools/mcp.js.map +1 -1
- package/dist/adapters/tools/sandbox-files.constants.d.ts +1 -0
- package/dist/adapters/tools/sandbox-files.constants.js +17 -0
- package/dist/adapters/tools/sandbox-files.constants.js.map +1 -0
- package/dist/adapters/tools/sandbox-files.d.ts +1 -0
- package/dist/adapters/tools/sandbox-files.js +14 -1
- package/dist/adapters/tools/sandbox-files.js.map +1 -1
- package/dist/adapters/tools/tools.constants.js +1 -0
- package/dist/adapters/tools/tools.constants.js.map +1 -1
- package/dist/adapters/triggers/github-webhook.js +14 -11
- package/dist/adapters/triggers/github-webhook.js.map +1 -1
- package/dist/adapters/triggers/gitlab-webhook.js +16 -13
- package/dist/adapters/triggers/gitlab-webhook.js.map +1 -1
- package/dist/adapters/triggers/slack-request.js +10 -7
- package/dist/adapters/triggers/slack-request.js.map +1 -1
- package/dist/adapters/triggers/standard-webhook.js +10 -7
- package/dist/adapters/triggers/standard-webhook.js.map +1 -1
- package/dist/application/agent-authentication.js +4 -1
- package/dist/application/agent-authentication.js.map +1 -1
- package/dist/application/agent-turn.js +20 -5
- package/dist/application/agent-turn.js.map +1 -1
- package/dist/application/cli-hooks.constants.d.ts +2 -0
- package/dist/application/cli-hooks.constants.js +69 -0
- package/dist/application/cli-hooks.constants.js.map +1 -0
- package/dist/application/cli-hooks.d.ts +3 -0
- package/dist/application/cli-hooks.js +168 -0
- package/dist/application/cli-hooks.js.map +1 -0
- package/dist/application/cli-steering.js +33 -2
- package/dist/application/cli-steering.js.map +1 -1
- package/dist/application/custom-turn.js +10 -1
- package/dist/application/custom-turn.js.map +1 -1
- package/dist/application/diagnostic-probe.d.ts +1 -1
- package/dist/application/diagnostic-probe.js +7 -3
- package/dist/application/diagnostic-probe.js.map +1 -1
- package/dist/application/dispatch-observation.js +4 -0
- package/dist/application/dispatch-observation.js.map +1 -1
- package/dist/application/doctor-agent.d.ts +1 -1
- package/dist/application/doctor-agent.js +2 -2
- package/dist/application/doctor-agent.js.map +1 -1
- package/dist/application/doctor-deadline.d.ts +1 -0
- package/dist/application/doctor-deadline.js +10 -0
- package/dist/application/doctor-deadline.js.map +1 -0
- package/dist/application/doctor-image.js +9 -7
- package/dist/application/doctor-image.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.constants.d.ts +2 -0
- package/dist/application/doctor.constants.js +2 -0
- package/dist/application/doctor.constants.js.map +1 -1
- package/dist/application/doctor.js +12 -8
- package/dist/application/doctor.js.map +1 -1
- package/dist/application/doctor.types.d.ts +2 -0
- package/dist/application/doctor.types.js.map +1 -1
- package/dist/application/file-sandbox.js +49 -11
- package/dist/application/file-sandbox.js.map +1 -1
- package/dist/application/harness-context.js +4 -2
- package/dist/application/harness-context.js.map +1 -1
- package/dist/application/harness-hook-transforms.d.ts +8 -0
- package/dist/application/harness-hook-transforms.js +115 -0
- package/dist/application/harness-hook-transforms.js.map +1 -0
- package/dist/application/harness-hooks.d.ts +5 -3
- package/dist/application/harness-hooks.js +37 -50
- package/dist/application/harness-hooks.js.map +1 -1
- package/dist/application/harness-loop.d.ts +2 -1
- package/dist/application/harness-loop.js +95 -21
- package/dist/application/harness-loop.js.map +1 -1
- package/dist/application/harness-subagent.d.ts +1 -1
- package/dist/application/harness-subagent.js +63 -12
- package/dist/application/harness-subagent.js.map +1 -1
- package/dist/application/harness.types.d.ts +3 -0
- package/dist/application/harness.types.js.map +1 -1
- package/dist/application/hook-invocation.d.ts +4 -0
- package/dist/application/hook-invocation.js +59 -0
- package/dist/application/hook-invocation.js.map +1 -0
- package/dist/application/queue-worker.js +51 -9
- 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/recipes/native-schemas.constants.js +1439 -218
- package/dist/application/recipes/native-schemas.constants.js.map +1 -1
- package/dist/application/recovery-inspection.js +4 -1
- package/dist/application/recovery-inspection.js.map +1 -1
- package/dist/application/remote-download.js +15 -5
- package/dist/application/remote-download.js.map +1 -1
- package/dist/application/remote-paths.d.ts +1 -0
- package/dist/application/remote-paths.js +7 -0
- package/dist/application/remote-paths.js.map +1 -0
- package/dist/application/remote-validation.js +40 -9
- package/dist/application/remote-validation.js.map +1 -1
- package/dist/application/remote-workspace.js +17 -2
- package/dist/application/remote-workspace.js.map +1 -1
- package/dist/application/repetition-watchdog.js +3 -1
- package/dist/application/repetition-watchdog.js.map +1 -1
- package/dist/application/sandbox-attach.js +38 -9
- package/dist/application/sandbox-attach.js.map +1 -1
- package/dist/application/sandbox-dispatch.js +7 -1
- package/dist/application/sandbox-dispatch.js.map +1 -1
- package/dist/application/schedules.js +2 -0
- package/dist/application/schedules.js.map +1 -1
- package/dist/application/secrets.js +4 -0
- package/dist/application/secrets.js.map +1 -1
- package/dist/application/tool-execution.js +28 -8
- package/dist/application/tool-execution.js.map +1 -1
- package/dist/application/transport-retention.js +3 -3
- package/dist/application/transport-retention.js.map +1 -1
- package/dist/application/workspace-fingerprint.d.ts +1 -0
- package/dist/application/workspace-fingerprint.js +19 -4
- package/dist/application/workspace-fingerprint.js.map +1 -1
- package/dist/cli/doctor-command.js +12 -2
- package/dist/cli/doctor-command.js.map +1 -1
- package/dist/cli/image.js +2 -0
- package/dist/cli/image.js.map +1 -1
- package/dist/cli/main.constants.d.ts +14 -2
- package/dist/cli/main.constants.js +27 -1
- package/dist/cli/main.constants.js.map +1 -1
- package/dist/cli/project-settings.js +7 -1
- package/dist/cli/project-settings.js.map +1 -1
- package/dist/cli/recipe-yaml.js +8 -0
- package/dist/cli/recipe-yaml.js.map +1 -1
- package/dist/cli/recovery-command.js +3 -0
- package/dist/cli/recovery-command.js.map +1 -1
- package/dist/cli/recovery-unlock-command.d.ts +2 -0
- package/dist/cli/recovery-unlock-command.js +19 -0
- package/dist/cli/recovery-unlock-command.js.map +1 -0
- package/dist/cli/scaffold-files.js +4 -1
- package/dist/cli/scaffold-files.js.map +1 -1
- package/dist/cli/scaffold-validation.js +3 -0
- package/dist/cli/scaffold-validation.js.map +1 -1
- package/dist/cli/scaffold.js +2 -0
- package/dist/cli/scaffold.js.map +1 -1
- package/dist/domain/agent-hook.types.d.ts +28 -0
- package/dist/domain/agent-hook.types.js +2 -0
- package/dist/domain/agent-hook.types.js.map +1 -0
- package/dist/domain/agent-profile-hooks.d.ts +2 -0
- package/dist/domain/agent-profile-hooks.js +52 -0
- package/dist/domain/agent-profile-hooks.js.map +1 -0
- package/dist/domain/agent-profile-permissions.js +11 -1
- package/dist/domain/agent-profile-permissions.js.map +1 -1
- package/dist/domain/agent-profile.constants.d.ts +1 -0
- package/dist/domain/agent-profile.constants.js +9 -0
- package/dist/domain/agent-profile.constants.js.map +1 -1
- package/dist/domain/agent-profile.js +6 -1
- package/dist/domain/agent-profile.js.map +1 -1
- package/dist/domain/agent-profile.types.d.ts +11 -0
- package/dist/domain/agent-profile.types.js.map +1 -1
- package/dist/domain/agent.types.d.ts +2 -0
- package/dist/domain/agent.types.js.map +1 -1
- package/dist/domain/container-image.d.ts +1 -0
- package/dist/domain/container-image.js +8 -0
- package/dist/domain/container-image.js.map +1 -0
- package/dist/domain/context.constants.d.ts +1 -0
- package/dist/domain/context.constants.js +1 -0
- package/dist/domain/context.constants.js.map +1 -1
- package/dist/domain/context.js +6 -1
- package/dist/domain/context.js.map +1 -1
- package/dist/domain/egress.js +6 -1
- package/dist/domain/egress.js.map +1 -1
- package/dist/domain/glob.js +1 -1
- package/dist/domain/glob.js.map +1 -1
- package/dist/domain/harness.js +4 -1
- package/dist/domain/harness.js.map +1 -1
- package/dist/domain/hook-command.d.ts +2 -0
- package/dist/domain/hook-command.js +26 -0
- package/dist/domain/hook-command.js.map +1 -0
- package/dist/domain/hook-command.types.d.ts +7 -0
- package/dist/domain/hook-command.types.js +2 -0
- package/dist/domain/hook-command.types.js.map +1 -0
- package/dist/domain/hook-decision.d.ts +2 -0
- package/dist/domain/hook-decision.js +38 -0
- package/dist/domain/hook-decision.js.map +1 -0
- package/dist/domain/hook.constants.d.ts +3 -0
- package/dist/domain/hook.constants.js +31 -1
- package/dist/domain/hook.constants.js.map +1 -1
- package/dist/domain/hook.js +49 -5
- package/dist/domain/hook.js.map +1 -1
- package/dist/domain/hook.types.d.ts +82 -5
- package/dist/domain/hook.types.js.map +1 -1
- package/dist/domain/mcp-server.constants.d.ts +6 -0
- package/dist/domain/mcp-server.constants.js +6 -0
- package/dist/domain/mcp-server.constants.js.map +1 -1
- package/dist/domain/mcp-server.js +1 -0
- package/dist/domain/mcp-server.js.map +1 -1
- package/dist/domain/permissions.types.d.ts +1 -0
- package/dist/domain/permissions.types.js.map +1 -1
- package/dist/domain/pricing.js +4 -2
- package/dist/domain/pricing.js.map +1 -1
- package/dist/domain/redaction.js +6 -3
- package/dist/domain/redaction.js.map +1 -1
- package/dist/domain/secret-fault.d.ts +4 -0
- package/dist/domain/secret-fault.js +11 -0
- package/dist/domain/secret-fault.js.map +1 -0
- package/dist/domain/secrets.js +3 -2
- package/dist/domain/secrets.js.map +1 -1
- package/dist/domain/steering.js +2 -0
- package/dist/domain/steering.js.map +1 -1
- package/dist/domain/steering.types.d.ts +1 -1
- package/dist/domain/steering.types.js.map +1 -1
- package/dist/domain/transport.js +5 -1
- package/dist/domain/transport.js.map +1 -1
- package/dist/domain/trigger-payload.d.ts +4 -0
- package/dist/domain/trigger-payload.js +15 -0
- package/dist/domain/trigger-payload.js.map +1 -0
- package/dist/domain/workflow/checkpoint.js +19 -2
- package/dist/domain/workflow/checkpoint.js.map +1 -1
- package/dist/domain/workflow/retry.constants.d.ts +1 -0
- package/dist/domain/workflow/retry.constants.js +1 -0
- package/dist/domain/workflow/retry.constants.js.map +1 -1
- package/dist/domain/workflow/retry.js +6 -2
- package/dist/domain/workflow/retry.js.map +1 -1
- package/dist/domain/workflow/task-runner.js +5 -3
- package/dist/domain/workflow/task-runner.js.map +1 -1
- package/dist/domain/workflow/workflow-state.js +2 -1
- package/dist/domain/workflow/workflow-state.js.map +1 -1
- package/dist/domain/workflow.types.d.ts +1 -0
- package/dist/domain/workflow.types.js.map +1 -1
- package/dist/index.d.ts +15 -1
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -1
- package/dist/infrastructure/conversations/transcript-store.js +32 -5
- package/dist/infrastructure/conversations/transcript-store.js.map +1 -1
- package/dist/infrastructure/files.d.ts +1 -0
- package/dist/infrastructure/files.js +8 -4
- package/dist/infrastructure/files.js.map +1 -1
- package/dist/infrastructure/git/integration-candidate.js +3 -2
- package/dist/infrastructure/git/integration-candidate.js.map +1 -1
- package/dist/infrastructure/git/lock-recovery.d.ts +3 -0
- package/dist/infrastructure/git/lock-recovery.js +58 -0
- package/dist/infrastructure/git/lock-recovery.js.map +1 -0
- package/dist/infrastructure/git/lock-recovery.types.d.ts +11 -0
- package/dist/infrastructure/git/lock-recovery.types.js +2 -0
- package/dist/infrastructure/git/lock-recovery.types.js.map +1 -0
- package/dist/infrastructure/git/managed-worktree.js +5 -8
- package/dist/infrastructure/git/managed-worktree.js.map +1 -1
- package/dist/infrastructure/git/verification-command.js +35 -30
- package/dist/infrastructure/git/verification-command.js.map +1 -1
- package/dist/infrastructure/git/workspace-lease.js +12 -5
- package/dist/infrastructure/git/workspace-lease.js.map +1 -1
- package/dist/infrastructure/hook-configuration.constants.d.ts +1 -0
- package/dist/infrastructure/hook-configuration.constants.js +59 -0
- package/dist/infrastructure/hook-configuration.constants.js.map +1 -0
- package/dist/infrastructure/hook-configuration.d.ts +3 -0
- package/dist/infrastructure/hook-configuration.js +16 -0
- package/dist/infrastructure/hook-configuration.js.map +1 -0
- package/dist/infrastructure/hook-configuration.types.d.ts +14 -0
- package/dist/infrastructure/hook-configuration.types.js +2 -0
- package/dist/infrastructure/hook-configuration.types.js.map +1 -0
- package/dist/infrastructure/http-transport.constants.d.ts +1 -0
- package/dist/infrastructure/http-transport.constants.js +14 -0
- package/dist/infrastructure/http-transport.constants.js.map +1 -0
- package/dist/infrastructure/http-transport.d.ts +7 -0
- package/dist/infrastructure/http-transport.js +19 -0
- package/dist/infrastructure/http-transport.js.map +1 -0
- package/dist/infrastructure/input-failure.d.ts +4 -0
- package/dist/infrastructure/input-failure.js +14 -0
- package/dist/infrastructure/input-failure.js.map +1 -0
- package/dist/infrastructure/inspection-file.d.ts +1 -0
- package/dist/infrastructure/inspection-file.js +8 -2
- package/dist/infrastructure/inspection-file.js.map +1 -1
- package/dist/infrastructure/local-transport.js +16 -11
- package/dist/infrastructure/local-transport.js.map +1 -1
- package/dist/infrastructure/process.constants.d.ts +1 -0
- package/dist/infrastructure/process.constants.js +1 -0
- package/dist/infrastructure/process.constants.js.map +1 -1
- package/dist/infrastructure/process.d.ts +1 -0
- package/dist/infrastructure/process.js +48 -8
- package/dist/infrastructure/process.js.map +1 -1
- package/dist/infrastructure/reservation-ledger.d.ts +2 -0
- package/dist/infrastructure/reservation-ledger.js +84 -0
- package/dist/infrastructure/reservation-ledger.js.map +1 -0
- package/dist/infrastructure/reservation-recovery.d.ts +4 -0
- package/dist/infrastructure/reservation-recovery.js +28 -0
- package/dist/infrastructure/reservation-recovery.js.map +1 -0
- package/dist/infrastructure/s3-tombstones.d.ts +3 -0
- package/dist/infrastructure/s3-tombstones.js +46 -0
- package/dist/infrastructure/s3-tombstones.js.map +1 -0
- package/dist/infrastructure/s3-tombstones.types.d.ts +6 -0
- package/dist/infrastructure/s3-tombstones.types.js +2 -0
- package/dist/infrastructure/s3-tombstones.types.js.map +1 -0
- package/dist/infrastructure/s3-transport.d.ts +2 -0
- package/dist/infrastructure/s3-transport.js +4 -2
- package/dist/infrastructure/s3-transport.js.map +1 -1
- package/dist/infrastructure/sse.js +6 -3
- package/dist/infrastructure/sse.js.map +1 -1
- package/dist/infrastructure/task-queue-bullmq-connection.d.ts +3 -0
- package/dist/infrastructure/task-queue-bullmq-connection.js +32 -0
- package/dist/infrastructure/task-queue-bullmq-connection.js.map +1 -0
- package/dist/infrastructure/task-queue-bullmq-connection.types.d.ts +8 -0
- package/dist/infrastructure/task-queue-bullmq-connection.types.js +2 -0
- package/dist/infrastructure/task-queue-bullmq-connection.types.js.map +1 -0
- package/dist/infrastructure/task-queue-bullmq-resources.js +21 -15
- package/dist/infrastructure/task-queue-bullmq-resources.js.map +1 -1
- package/dist/infrastructure/task-queue-bullmq-state.d.ts +1 -0
- package/dist/infrastructure/task-queue-bullmq-state.js +1 -0
- package/dist/infrastructure/task-queue-bullmq-state.js.map +1 -1
- package/dist/infrastructure/task-queue-bullmq.constants.d.ts +2 -1
- package/dist/infrastructure/task-queue-bullmq.constants.js +2 -1
- package/dist/infrastructure/task-queue-bullmq.constants.js.map +1 -1
- package/dist/infrastructure/task-queue-bullmq.js +10 -1
- package/dist/infrastructure/task-queue-bullmq.js.map +1 -1
- package/dist/infrastructure/task-queue.js +13 -4
- package/dist/infrastructure/task-queue.js.map +1 -1
- package/dist/infrastructure/transfer-copy.d.ts +1 -0
- package/dist/infrastructure/transfer-copy.js +16 -1
- package/dist/infrastructure/transfer-copy.js.map +1 -1
- package/dist/infrastructure/transport-archive.d.ts +3 -3
- package/dist/infrastructure/transport-archive.js +71 -48
- package/dist/infrastructure/transport-archive.js.map +1 -1
- package/dist/infrastructure/transport-archive.types.d.ts +3 -0
- package/dist/infrastructure/transport-archive.types.js.map +1 -1
- package/dist/infrastructure/transport-checkpoint.js +14 -4
- package/dist/infrastructure/transport-checkpoint.js.map +1 -1
- package/dist/infrastructure/transport-envelope.d.ts +1 -0
- package/dist/infrastructure/transport-envelope.js +22 -5
- package/dist/infrastructure/transport-envelope.js.map +1 -1
- package/dist/infrastructure/transport-reservations.constants.d.ts +2 -0
- package/dist/infrastructure/transport-reservations.constants.js +3 -0
- package/dist/infrastructure/transport-reservations.constants.js.map +1 -0
- package/dist/infrastructure/transport-reservations.d.ts +1 -2
- package/dist/infrastructure/transport-reservations.js +18 -22
- package/dist/infrastructure/transport-reservations.js.map +1 -1
- package/dist/infrastructure/transport-reservations.types.d.ts +23 -2
- package/dist/infrastructure/transport-reservations.types.js.map +1 -1
- package/dist/infrastructure/trigger-server.js +12 -9
- package/dist/infrastructure/trigger-server.js.map +1 -1
- package/dist/infrastructure/trigger-server.types.d.ts +1 -1
- package/dist/infrastructure/trigger-server.types.js.map +1 -1
- package/dist/infrastructure/workflow-checkpoint.constants.d.ts +1 -0
- package/dist/infrastructure/workflow-checkpoint.constants.js +1 -0
- package/dist/infrastructure/workflow-checkpoint.constants.js.map +1 -1
- package/dist/infrastructure/workspace-lock.constants.d.ts +2 -1
- package/dist/infrastructure/workspace-lock.constants.js +2 -1
- package/dist/infrastructure/workspace-lock.constants.js.map +1 -1
- package/dist/infrastructure/workspace-lock.js +48 -10
- package/dist/infrastructure/workspace-lock.js.map +1 -1
- package/dist/providers/cloud-cache.js +14 -9
- package/dist/providers/cloud-cache.js.map +1 -1
- package/dist/providers/cloud-cache.types.d.ts +1 -0
- package/dist/providers/cloud-cache.types.js.map +1 -1
- package/dist/providers/cloud-files.js +3 -4
- package/dist/providers/cloud-files.js.map +1 -1
- package/dist/providers/cloud-input.constants.d.ts +2 -2
- package/dist/providers/cloud-input.constants.js +2 -1
- package/dist/providers/cloud-input.constants.js.map +1 -1
- package/dist/providers/cloud-input.d.ts +2 -2
- package/dist/providers/cloud-input.js +14 -3
- package/dist/providers/cloud-input.js.map +1 -1
- package/dist/providers/container-command.js +30 -5
- package/dist/providers/container-command.js.map +1 -1
- package/dist/providers/container-egress.constants.d.ts +7 -0
- package/dist/providers/container-egress.constants.js +8 -0
- package/dist/providers/container-egress.constants.js.map +1 -0
- package/dist/providers/container-egress.d.ts +7 -0
- package/dist/providers/container-egress.js +101 -0
- package/dist/providers/container-egress.js.map +1 -0
- package/dist/providers/container-files.js +10 -11
- package/dist/providers/container-files.js.map +1 -1
- package/dist/providers/container-mounts.js +3 -0
- package/dist/providers/container-mounts.js.map +1 -1
- package/dist/providers/container-network.js +16 -1
- package/dist/providers/container-network.js.map +1 -1
- package/dist/providers/container-plan.js +7 -10
- package/dist/providers/container-plan.js.map +1 -1
- package/dist/providers/container-recovery.js +8 -3
- package/dist/providers/container-recovery.js.map +1 -1
- package/dist/providers/container.js +36 -5
- package/dist/providers/container.js.map +1 -1
- package/dist/providers/container.types.d.ts +1 -0
- package/dist/providers/container.types.js.map +1 -1
- package/dist/providers/daytona-command.constants.js +4 -1
- package/dist/providers/daytona-command.constants.js.map +1 -1
- package/dist/providers/daytona-command.js +39 -16
- package/dist/providers/daytona-command.js.map +1 -1
- package/dist/providers/daytona-files.js +5 -5
- package/dist/providers/daytona-files.js.map +1 -1
- package/dist/providers/daytona-output.js +11 -3
- package/dist/providers/daytona-output.js.map +1 -1
- package/dist/providers/daytona.js +11 -9
- package/dist/providers/daytona.js.map +1 -1
- package/dist/providers/egress/address.d.ts +3 -0
- package/dist/providers/egress/address.js +26 -0
- package/dist/providers/egress/address.js.map +1 -0
- package/dist/providers/egress/egress.constants.d.ts +22 -0
- package/dist/providers/egress/egress.constants.js +23 -0
- package/dist/providers/egress/egress.constants.js.map +1 -0
- package/dist/providers/egress/egress.types.d.ts +11 -0
- package/dist/providers/egress/egress.types.js +2 -0
- package/dist/providers/egress/egress.types.js.map +1 -0
- package/dist/providers/egress/firewall.d.ts +3 -0
- package/dist/providers/egress/firewall.js +29 -0
- package/dist/providers/egress/firewall.js.map +1 -0
- package/dist/providers/egress/main.d.ts +1 -0
- package/dist/providers/egress/main.js +90 -0
- package/dist/providers/egress/main.js.map +1 -0
- package/dist/providers/egress/policy.d.ts +5 -0
- package/dist/providers/egress/policy.js +54 -0
- package/dist/providers/egress/policy.js.map +1 -0
- package/dist/providers/egress/proxy.d.ts +2 -0
- package/dist/providers/egress/proxy.js +129 -0
- package/dist/providers/egress/proxy.js.map +1 -0
- package/dist/providers/egress/tls-hello.d.ts +1 -0
- package/dist/providers/egress/tls-hello.js +75 -0
- package/dist/providers/egress/tls-hello.js.map +1 -0
- package/dist/providers/firecracker-command.js +12 -6
- package/dist/providers/firecracker-command.js.map +1 -1
- package/dist/providers/local-files.d.ts +2 -0
- package/dist/providers/local-files.js +24 -0
- package/dist/providers/local-files.js.map +1 -0
- package/dist/providers/local.js +2 -20
- package/dist/providers/local.js.map +1 -1
- package/dist/providers/vercel-command.js +33 -9
- package/dist/providers/vercel-command.js.map +1 -1
- package/dist/providers/vercel.js +11 -9
- package/dist/providers/vercel.js.map +1 -1
- package/dist/testing.d.ts +1 -1
- package/dist/testing.js +1 -1
- package/dist/testing.js.map +1 -1
- package/package.json +2 -2
- package/recipe-configuration.schema.json +2164 -35
- package/recipe.schema.json +2512 -404
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import type { NativeHook, NativeHookOptions } from "../native-hooks.types.ts";
|
|
2
|
+
export interface AntigravityHookEvents {
|
|
3
|
+
readonly SessionStart: {
|
|
4
|
+
readonly conversationId: string;
|
|
5
|
+
readonly workspacePaths: readonly string[];
|
|
6
|
+
readonly transcriptPath?: string;
|
|
7
|
+
readonly artifactDirectoryPath?: string;
|
|
8
|
+
readonly modelName?: string;
|
|
9
|
+
};
|
|
10
|
+
readonly PreToolUse: {
|
|
11
|
+
readonly conversationId: string;
|
|
12
|
+
readonly workspacePaths: readonly string[];
|
|
13
|
+
readonly transcriptPath?: string;
|
|
14
|
+
readonly artifactDirectoryPath?: string;
|
|
15
|
+
readonly modelName?: string;
|
|
16
|
+
readonly toolCall?: {
|
|
17
|
+
readonly name: string;
|
|
18
|
+
readonly args: Readonly<Record<string, unknown>>;
|
|
19
|
+
};
|
|
20
|
+
readonly stepIdx?: number;
|
|
21
|
+
};
|
|
22
|
+
readonly PostToolUse: {
|
|
23
|
+
readonly conversationId: string;
|
|
24
|
+
readonly workspacePaths: readonly string[];
|
|
25
|
+
readonly transcriptPath?: string;
|
|
26
|
+
readonly artifactDirectoryPath?: string;
|
|
27
|
+
readonly modelName?: string;
|
|
28
|
+
readonly toolCall?: {
|
|
29
|
+
readonly name: string;
|
|
30
|
+
readonly args: Readonly<Record<string, unknown>>;
|
|
31
|
+
};
|
|
32
|
+
readonly stepIdx?: number;
|
|
33
|
+
readonly error?: string;
|
|
34
|
+
};
|
|
35
|
+
readonly PreInvocation: {
|
|
36
|
+
readonly conversationId: string;
|
|
37
|
+
readonly workspacePaths: readonly string[];
|
|
38
|
+
readonly transcriptPath?: string;
|
|
39
|
+
readonly artifactDirectoryPath?: string;
|
|
40
|
+
readonly modelName?: string;
|
|
41
|
+
readonly invocationNum?: number;
|
|
42
|
+
readonly initialNumSteps?: number;
|
|
43
|
+
};
|
|
44
|
+
readonly PostInvocation: {
|
|
45
|
+
readonly conversationId: string;
|
|
46
|
+
readonly workspacePaths: readonly string[];
|
|
47
|
+
readonly transcriptPath?: string;
|
|
48
|
+
readonly artifactDirectoryPath?: string;
|
|
49
|
+
readonly modelName?: string;
|
|
50
|
+
readonly invocationNum?: number;
|
|
51
|
+
readonly initialNumSteps?: number;
|
|
52
|
+
};
|
|
53
|
+
readonly Stop: {
|
|
54
|
+
readonly conversationId: string;
|
|
55
|
+
readonly workspacePaths: readonly string[];
|
|
56
|
+
readonly transcriptPath?: string;
|
|
57
|
+
readonly artifactDirectoryPath?: string;
|
|
58
|
+
readonly modelName?: string;
|
|
59
|
+
readonly executionNum?: number;
|
|
60
|
+
readonly terminationReason?: string;
|
|
61
|
+
readonly error?: string;
|
|
62
|
+
readonly fullyIdle?: boolean;
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
export interface AntigravityHookDecisions {
|
|
66
|
+
readonly SessionStart: {
|
|
67
|
+
readonly injectSteps?: readonly {
|
|
68
|
+
readonly systemMessage?: {
|
|
69
|
+
readonly systemMessage?: string;
|
|
70
|
+
readonly metadata?: Readonly<Record<string, unknown>>;
|
|
71
|
+
};
|
|
72
|
+
readonly userMessage?: string;
|
|
73
|
+
readonly ephemeralMessage?: string;
|
|
74
|
+
readonly toolCall?: Readonly<Record<string, unknown>>;
|
|
75
|
+
}[];
|
|
76
|
+
};
|
|
77
|
+
readonly PreToolUse: {
|
|
78
|
+
readonly decision: "allow" | "auto_approve" | "deny" | "ask" | "force_ask" | "deny_unless_prior_grant";
|
|
79
|
+
readonly reason?: string;
|
|
80
|
+
readonly overwrite?: Readonly<Record<string, unknown>>;
|
|
81
|
+
readonly permissionOverrides?: readonly string[];
|
|
82
|
+
};
|
|
83
|
+
readonly PostToolUse: {};
|
|
84
|
+
readonly PreInvocation: {
|
|
85
|
+
readonly injectSteps?: readonly {
|
|
86
|
+
readonly systemMessage?: {
|
|
87
|
+
readonly systemMessage?: string;
|
|
88
|
+
readonly metadata?: Readonly<Record<string, unknown>>;
|
|
89
|
+
};
|
|
90
|
+
readonly userMessage?: string;
|
|
91
|
+
readonly ephemeralMessage?: string;
|
|
92
|
+
readonly toolCall?: Readonly<Record<string, unknown>>;
|
|
93
|
+
}[];
|
|
94
|
+
};
|
|
95
|
+
readonly PostInvocation: {
|
|
96
|
+
readonly injectSteps?: readonly {
|
|
97
|
+
readonly systemMessage?: {
|
|
98
|
+
readonly systemMessage?: string;
|
|
99
|
+
readonly metadata?: Readonly<Record<string, unknown>>;
|
|
100
|
+
};
|
|
101
|
+
readonly userMessage?: string;
|
|
102
|
+
readonly ephemeralMessage?: string;
|
|
103
|
+
readonly toolCall?: Readonly<Record<string, unknown>>;
|
|
104
|
+
}[];
|
|
105
|
+
readonly terminationBehavior?: "force_continue" | "terminate" | "";
|
|
106
|
+
};
|
|
107
|
+
readonly Stop: {
|
|
108
|
+
readonly decision: string;
|
|
109
|
+
readonly reason?: string;
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
export type AntigravityHookPhase = keyof AntigravityHookEvents;
|
|
113
|
+
export type AntigravityHook<Phase extends AntigravityHookPhase = AntigravityHookPhase> = NativeHook<"antigravity", Phase>;
|
|
114
|
+
export type AntigravityHookOptions<Phase extends AntigravityHookPhase> = NativeHookOptions<Phase, AntigravityHookEvents[Phase], AntigravityHookDecisions[Phase]>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"antigravity-hooks.types.js","sourceRoot":"","sources":["../../../../src/adapters/agents/antigravity/antigravity-hooks.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { NativeHook, NativeHookOptions } from \"../native-hooks.types.ts\";\n\nexport interface AntigravityHookEvents {\n readonly SessionStart: {\n readonly conversationId: string;\n readonly workspacePaths: readonly string[];\n readonly transcriptPath?: string;\n readonly artifactDirectoryPath?: string;\n readonly modelName?: string;\n };\n readonly PreToolUse: {\n readonly conversationId: string;\n readonly workspacePaths: readonly string[];\n readonly transcriptPath?: string;\n readonly artifactDirectoryPath?: string;\n readonly modelName?: string;\n readonly toolCall?: {\n readonly name: string;\n readonly args: Readonly<Record<string, unknown>>;\n };\n readonly stepIdx?: number;\n };\n readonly PostToolUse: {\n readonly conversationId: string;\n readonly workspacePaths: readonly string[];\n readonly transcriptPath?: string;\n readonly artifactDirectoryPath?: string;\n readonly modelName?: string;\n readonly toolCall?: {\n readonly name: string;\n readonly args: Readonly<Record<string, unknown>>;\n };\n readonly stepIdx?: number;\n readonly error?: string;\n };\n readonly PreInvocation: {\n readonly conversationId: string;\n readonly workspacePaths: readonly string[];\n readonly transcriptPath?: string;\n readonly artifactDirectoryPath?: string;\n readonly modelName?: string;\n readonly invocationNum?: number;\n readonly initialNumSteps?: number;\n };\n readonly PostInvocation: {\n readonly conversationId: string;\n readonly workspacePaths: readonly string[];\n readonly transcriptPath?: string;\n readonly artifactDirectoryPath?: string;\n readonly modelName?: string;\n readonly invocationNum?: number;\n readonly initialNumSteps?: number;\n };\n readonly Stop: {\n readonly conversationId: string;\n readonly workspacePaths: readonly string[];\n readonly transcriptPath?: string;\n readonly artifactDirectoryPath?: string;\n readonly modelName?: string;\n readonly executionNum?: number;\n readonly terminationReason?: string;\n readonly error?: string;\n readonly fullyIdle?: boolean;\n };\n}\n\nexport interface AntigravityHookDecisions {\n readonly SessionStart: {\n readonly injectSteps?: readonly {\n readonly systemMessage?: {\n readonly systemMessage?: string;\n readonly metadata?: Readonly<Record<string, unknown>>;\n };\n readonly userMessage?: string;\n readonly ephemeralMessage?: string;\n readonly toolCall?: Readonly<Record<string, unknown>>;\n }[];\n };\n readonly PreToolUse: {\n readonly decision:\n | \"allow\"\n | \"auto_approve\"\n | \"deny\"\n | \"ask\"\n | \"force_ask\"\n | \"deny_unless_prior_grant\";\n readonly reason?: string;\n readonly overwrite?: Readonly<Record<string, unknown>>;\n readonly permissionOverrides?: readonly string[];\n };\n readonly PostToolUse: {};\n readonly PreInvocation: {\n readonly injectSteps?: readonly {\n readonly systemMessage?: {\n readonly systemMessage?: string;\n readonly metadata?: Readonly<Record<string, unknown>>;\n };\n readonly userMessage?: string;\n readonly ephemeralMessage?: string;\n readonly toolCall?: Readonly<Record<string, unknown>>;\n }[];\n };\n readonly PostInvocation: {\n readonly injectSteps?: readonly {\n readonly systemMessage?: {\n readonly systemMessage?: string;\n readonly metadata?: Readonly<Record<string, unknown>>;\n };\n readonly userMessage?: string;\n readonly ephemeralMessage?: string;\n readonly toolCall?: Readonly<Record<string, unknown>>;\n }[];\n readonly terminationBehavior?: \"force_continue\" | \"terminate\" | \"\";\n };\n readonly Stop: { readonly decision: string; readonly reason?: string };\n}\n\nexport type AntigravityHookPhase = keyof AntigravityHookEvents;\nexport type AntigravityHook<\n Phase extends AntigravityHookPhase = AntigravityHookPhase,\n> = NativeHook<\"antigravity\", Phase>;\nexport type AntigravityHookOptions<Phase extends AntigravityHookPhase> =\n NativeHookOptions<\n Phase,\n AntigravityHookEvents[Phase],\n AntigravityHookDecisions[Phase]\n >;\n"]}
|
|
@@ -3,6 +3,7 @@ import type { AgentAuthentication } from "../../../domain/agent.types.ts";
|
|
|
3
3
|
import type { Variables } from "../../../domain/command.types.ts";
|
|
4
4
|
import type { McpServers } from "../../../domain/mcp-server.types.ts";
|
|
5
5
|
export interface AntigravitySettings {
|
|
6
|
+
readonly hooks?: readonly import("./antigravity-hooks.types.ts").AntigravityHook[];
|
|
6
7
|
readonly authentication?: AgentAuthentication;
|
|
7
8
|
readonly variables?: Variables;
|
|
8
9
|
readonly mcpServers?: McpServers;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"antigravity.types.js","sourceRoot":"","sources":["../../../../src/adapters/agents/antigravity/antigravity.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { AgentProfile } from \"../../../domain/agent-profile.types.ts\";\nimport type { AgentAuthentication } from \"../../../domain/agent.types.ts\";\nimport type { Variables } from \"../../../domain/command.types.ts\";\nimport type { McpServers } from \"../../../domain/mcp-server.types.ts\";\n\nexport interface AntigravitySettings {\n readonly authentication?: AgentAuthentication;\n readonly variables?: Variables;\n readonly mcpServers?: McpServers;\n readonly profile?: AgentProfile;\n readonly mode?: \"accept-edits\" | \"plan\";\n}\n"]}
|
|
1
|
+
{"version":3,"file":"antigravity.types.js","sourceRoot":"","sources":["../../../../src/adapters/agents/antigravity/antigravity.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { AgentProfile } from \"../../../domain/agent-profile.types.ts\";\nimport type { AgentAuthentication } from \"../../../domain/agent.types.ts\";\nimport type { Variables } from \"../../../domain/command.types.ts\";\nimport type { McpServers } from \"../../../domain/mcp-server.types.ts\";\n\nexport interface AntigravitySettings {\n readonly hooks?: readonly import(\"./antigravity-hooks.types.ts\").AntigravityHook[];\n readonly authentication?: AgentAuthentication;\n readonly variables?: Variables;\n readonly mcpServers?: McpServers;\n readonly profile?: AgentProfile;\n readonly mode?: \"accept-edits\" | \"plan\";\n}\n"]}
|
|
@@ -3,6 +3,7 @@ import { invariant } from "../../domain/errors.js";
|
|
|
3
3
|
import { credentialRecipes } from "./authentication.constants.js";
|
|
4
4
|
export function credentialPlan(plan = {}) {
|
|
5
5
|
return Object.freeze({
|
|
6
|
+
...(plan.requiresSandbox ? { requiresSandbox: true } : {}),
|
|
6
7
|
variables: Object.freeze({ ...plan.variables }),
|
|
7
8
|
host: Object.freeze([...(plan.host ?? [])]),
|
|
8
9
|
files: Object.freeze([...(plan.files ?? [])]),
|
|
@@ -1 +1 @@
|
|
|
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,C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AC,SAAS,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC,CAAC;YACzC,OAAO,OAAO,CAAC,SAAS,CAAC,CAAC;QAC5B,CAAC,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,iBAAiB,CAC/B,KAAa,EACb,QAA4B,EAC5B,cAA+C,EAC/C,KAAkB;IAElB,IAAI,cAAc,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IACnD,MAAM,EAAE,IAAI,EAAE,KAAK,GAAG,EAAE,EAAE,GAAG,kBAAkB,CAAC,cAAc,CAAC,CAAC;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"]}
|
|
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,GAAG,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,EAAE,eAAe,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC1D,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;K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AO,CAAC,SAAS,CAAC,CAAC;QAC5B,CAAC,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,iBAAiB,CAC/B,KAAa,EACb,QAA4B,EAC5B,cAA+C,EAC/C,KAAkB;IAElB,IAAI,cAAc,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IACnD,MAAM,EAAE,IAAI,EAAE,KAAK,GAAG,EAAE,EAAE,GAAG,kBAAkB,CAAC,cAAc,CAAC,CAAC;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 ...(plan.requiresSandbox ? { requiresSandbox: true } : {}),\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"]}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { composedNativeHooks } from "../native-hooks.js";
|
|
2
|
+
import { claudeHookSchemas } from "./claude-hooks.constants.js";
|
|
3
|
+
import { claudeHookPlan } from "./claude-hook-plan.js";
|
|
1
4
|
import { supportClaudeProfile } from "./claude-profile.js";
|
|
2
5
|
import { createClaudeConversations, claudeConversationLayout, } from "./claude-conversations.js";
|
|
3
6
|
import { claudeLabel, claudeMcpSupport, claudeModelSupport, claudeQuotaPatterns, claudeUnavailablePatterns, CLAUDE_MAX_OUTPUT_VARIABLE, CLAUDE_MCP_TIMEOUT_VARIABLE, } from "./claude.constants.js";
|
|
@@ -26,6 +29,9 @@ function bindClaude(settings) {
|
|
|
26
29
|
const credentials = credentialPlanner(claudeLabel, claudeCredentials, settings.authentication, settings.model);
|
|
27
30
|
const configuration = mcpConfigurationPlanner(claudeLabel, settings.mcpServers, undefined, claudeMcpLogins);
|
|
28
31
|
return Object.freeze({
|
|
32
|
+
...(settings.hooks?.length
|
|
33
|
+
? { hooks: claudeHookPlan(settings.hooks, settings) }
|
|
34
|
+
: {}),
|
|
29
35
|
usageInput: "uncached",
|
|
30
36
|
name: "claude",
|
|
31
37
|
...(credentials ? { credentials } : {}),
|
|
@@ -33,6 +39,13 @@ function bindClaude(settings) {
|
|
|
33
39
|
bootstrap: "claude",
|
|
34
40
|
...conversationStorage(settings, createClaudeConversations),
|
|
35
41
|
resumable: true,
|
|
42
|
+
fileWorkspaces: Object.freeze({
|
|
43
|
+
dispatch: true,
|
|
44
|
+
repairs: true,
|
|
45
|
+
continuation: true,
|
|
46
|
+
liveInput: true,
|
|
47
|
+
interactive: true,
|
|
48
|
+
}),
|
|
36
49
|
capture: settings.saveConversations ?? true,
|
|
37
50
|
variables: Object.freeze({
|
|
38
51
|
...settings.variables,
|
|
@@ -55,10 +68,12 @@ export function createClaudeHarness(settings = {}) {
|
|
|
55
68
|
harnessSettings(settings);
|
|
56
69
|
conversationSettings(claudeLabel, claudeConversationLayout.format, settings);
|
|
57
70
|
const configured = configuredSettings(settings);
|
|
71
|
+
const hooks = composedNativeHooks("claude", claudeHookSchemas, configured.profile?.hooks?.claude, settings.hooks);
|
|
58
72
|
return Object.freeze({
|
|
59
73
|
kind: "cli",
|
|
60
74
|
bind: (model) => bindClaude({
|
|
61
75
|
...configured,
|
|
76
|
+
hooks,
|
|
62
77
|
...(model === undefined ? {} : { model }),
|
|
63
78
|
}),
|
|
64
79
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claude-adapter.js","sourceRoot":"","sources":["../../../../src/adapters/agents/claude/claude-adapter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EACL,yBAAyB,EACzB,wBAAwB,GACzB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,WAAW,EACX,gBAAgB,EAChB,kBAAkB,EAClB,mBAAmB,EACnB,yBAAyB,EACzB,0BAA0B,EAC1B,2BAA2B,GAC5B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EACL,uBAAuB,EACvB,oBAAoB,EACpB,iBAAiB,GAClB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EACL,oBAAoB,EACpB,mBAAmB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C;AAED,MAAM,UAAU,mBAAmB,CAAC,WAA2B,EAAE;IAC/D,eAAe,CAAC,QAAQ,CAAC,CAAC;IAC1B,oBAAoB,CAAC,WAAW,EAAE,wBAAwB,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IAC7E,MAAM,UAAU,GAAG,kBAAkB,CAAC,QAAQ,CAAC,CAAC;IAChD,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 { supportClaudeProfile } from \"./claude-profile.ts\";\nimport {\n createClaudeConversations,\n claudeConversationLayout,\n} from \"./claude-conversations.ts\";\nimport {\n claudeLabel,\n claudeMcpSupport,\n claudeModelSupport,\n claudeQuotaPatterns,\n claudeUnavailablePatterns,\n CLAUDE_MAX_OUTPUT_VARIABLE,\n CLAUDE_MCP_TIMEOUT_VARIABLE,\n} from \"./claude.constants.ts\";\nimport { claudeMcpLogins } from \"./claude-mcp.ts\";\nimport {\n mcpConfigurationPlanner,\n sharedStartupTimeout,\n supportMcpServers,\n} from \"../mcp-configuration.ts\";\nimport { textMatcher } from \"../text-matcher.ts\";\nimport {\n conversationSettings,\n conversationStorage,\n} from \"../conversation-settings.ts\";\nimport { transientNoticePatterns } from \"../unavailable.constants.ts\";\nimport { 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 { claudeLiveInput } from \"./claude-input.ts\";\nimport { claudeRequest } from \"./claude-request.ts\";\nimport {\n configuredSettings,\n harnessSettings,\n supportModel,\n} 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 supportClaudeProfile(settings);\n supportMcpServers(claudeMcpSupport, settings.mcpServers);\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 mcpTimeout = sharedStartupTimeout(settings.mcpServers);\n invariant(\n mcpTimeout === undefined ||\n !Object.hasOwn(settings.variables ?? {}, CLAUDE_MCP_TIMEOUT_VARIABLE),\n `Set startupTimeoutMs on MCP servers or ${CLAUDE_MCP_TIMEOUT_VARIABLE}, not both`,\n );\n const credentials = credentialPlanner(\n claudeLabel,\n claudeCredentials,\n settings.authentication,\n settings.model,\n );\n const configuration = mcpConfigurationPlanner(\n claudeLabel,\n settings.mcpServers,\n undefined,\n claudeMcpLogins,\n );\n return Object.freeze({\n usageInput: \"uncached\",\n name: \"claude\",\n ...(credentials ? { credentials } : {}),\n ...(configuration ? { configuration } : {}),\n bootstrap: \"claude\",\n ...conversationStorage(settings, createClaudeConversations),\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 ...(mcpTimeout === undefined\n ? {}\n : { [CLAUDE_MCP_TIMEOUT_VARIABLE]: String(mcpTimeout) }),\n }),\n request: (input) => claudeRequest(settings, input),\n events: claudeEvents,\n liveInput: claudeLiveInput,\n quota: textMatcher(claudeQuotaPatterns),\n unavailable: textMatcher(\n claudeUnavailablePatterns,\n transientNoticePatterns,\n ),\n transcriptUsage: claudeTranscriptUsage,\n } satisfies AgentAdapter);\n}\n\nexport function createClaudeHarness(settings: ClaudeSettings = {}): CliHarness {\n harnessSettings(settings);\n conversationSettings(claudeLabel, claudeConversationLayout.format, settings);\n const configured = configuredSettings(settings);\n return Object.freeze({\n kind: \"cli\",\n bind: (model?: AgentModel) =>\n bindClaude({\n ...configured,\n ...(model === undefined ? {} : { model }),\n }),\n });\n}\n"]}
|
|
1
|
+
{"version":3,"file":"claude-adapter.js","sourceRoot":"","sources":["../../../../src/adapters/agents/claude/claude-adapter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EACL,yBAAyB,EACzB,wBAAwB,GACzB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,WAAW,EACX,gBAAgB,EAChB,kBAAkB,EAClB,mBAAmB,EACnB,yBAAyB,EACzB,0BAA0B,EAC1B,2BAA2B,GAC5B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EACL,uBAAuB,EACvB,oBAAoB,EACpB,iBAAiB,GAClB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EACL,oBAAoB,EACpB,mBAAmB,GACpB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AACtE,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAEtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,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WAAW,CAAC,mBAAmB,CAAC;QACvC,WAAW,EAAE,WAAW,CACtB,yBAAyB,EACzB,uBAAuB,CACxB;QACD,eAAe,EAAE,qBAAqB;KAChB,CAAC,CAAC;AAC5B,CAAC;AAED,MAAM,UAAU,mBAAmB,CAAC,WAA2B,EAAE;IAC/D,eAAe,CAAC,QAAQ,CAAC,CAAC;IAC1B,oBAAoB,CAAC,WAAW,EAAE,wBAAwB,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IAC7E,MAAM,UAAU,GAAG,kBAAkB,CAAC,QAAQ,CAAC,CAAC;IAChD,MAAM,KAAK,GAAG,mBAAmB,CAC/B,QAAQ,EACR,iBAAiB,EACjB,UAAU,CAAC,OAAO,EAAE,KAAK,EAAE,MAAM,EACjC,QAAQ,CAAC,KAAK,CACf,CAAC;IACF,OAAO,MAAM,CAAC,MAAM,CAAC;QACnB,IAAI,EAAE,KAAK;QACX,IAAI,EAAE,CAAC,KAAkB,EAAE,EAAE,CAC3B,UAAU,CAAC;YACT,GAAG,UAAU;YACb,KAAK;YACL,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 { composedNativeHooks } from \"../native-hooks.ts\";\nimport { claudeHookSchemas } from \"./claude-hooks.constants.ts\";\nimport { claudeHookPlan } from \"./claude-hook-plan.ts\";\nimport { supportClaudeProfile } from \"./claude-profile.ts\";\nimport {\n createClaudeConversations,\n claudeConversationLayout,\n} from \"./claude-conversations.ts\";\nimport {\n claudeLabel,\n claudeMcpSupport,\n claudeModelSupport,\n claudeQuotaPatterns,\n claudeUnavailablePatterns,\n CLAUDE_MAX_OUTPUT_VARIABLE,\n CLAUDE_MCP_TIMEOUT_VARIABLE,\n} from \"./claude.constants.ts\";\nimport { claudeMcpLogins } from \"./claude-mcp.ts\";\nimport {\n mcpConfigurationPlanner,\n sharedStartupTimeout,\n supportMcpServers,\n} from \"../mcp-configuration.ts\";\nimport { textMatcher } from \"../text-matcher.ts\";\nimport {\n conversationSettings,\n conversationStorage,\n} from \"../conversation-settings.ts\";\nimport { transientNoticePatterns } from \"../unavailable.constants.ts\";\nimport { 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 { claudeLiveInput } from \"./claude-input.ts\";\nimport { claudeRequest } from \"./claude-request.ts\";\nimport {\n configuredSettings,\n harnessSettings,\n supportModel,\n} 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 supportClaudeProfile(settings);\n supportMcpServers(claudeMcpSupport, settings.mcpServers);\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 mcpTimeout = sharedStartupTimeout(settings.mcpServers);\n invariant(\n mcpTimeout === undefined ||\n !Object.hasOwn(settings.variables ?? {}, CLAUDE_MCP_TIMEOUT_VARIABLE),\n `Set startupTimeoutMs on MCP servers or ${CLAUDE_MCP_TIMEOUT_VARIABLE}, not both`,\n );\n const credentials = credentialPlanner(\n claudeLabel,\n claudeCredentials,\n settings.authentication,\n settings.model,\n );\n const configuration = mcpConfigurationPlanner(\n claudeLabel,\n settings.mcpServers,\n undefined,\n claudeMcpLogins,\n );\n return Object.freeze({\n ...(settings.hooks?.length\n ? { hooks: claudeHookPlan(settings.hooks, settings) }\n : {}),\n usageInput: \"uncached\",\n name: \"claude\",\n ...(credentials ? { credentials } : {}),\n ...(configuration ? { configuration } : {}),\n bootstrap: \"claude\",\n ...conversationStorage(settings, createClaudeConversations),\n resumable: true,\n fileWorkspaces: Object.freeze({\n dispatch: true,\n repairs: true,\n continuation: true,\n liveInput: true,\n interactive: true,\n }),\n capture: settings.saveConversations ?? true,\n variables: Object.freeze({\n ...settings.variables,\n ...(maxOutputTokens === undefined\n ? {}\n : { [CLAUDE_MAX_OUTPUT_VARIABLE]: String(maxOutputTokens) }),\n ...(mcpTimeout === undefined\n ? {}\n : { [CLAUDE_MCP_TIMEOUT_VARIABLE]: String(mcpTimeout) }),\n }),\n request: (input) => claudeRequest(settings, input),\n events: claudeEvents,\n liveInput: claudeLiveInput,\n quota: textMatcher(claudeQuotaPatterns),\n unavailable: textMatcher(\n claudeUnavailablePatterns,\n transientNoticePatterns,\n ),\n transcriptUsage: claudeTranscriptUsage,\n } satisfies AgentAdapter);\n}\n\nexport function createClaudeHarness(settings: ClaudeSettings = {}): CliHarness {\n harnessSettings(settings);\n conversationSettings(claudeLabel, claudeConversationLayout.format, settings);\n const configured = configuredSettings(settings);\n const hooks = composedNativeHooks(\n \"claude\",\n claudeHookSchemas,\n configured.profile?.hooks?.claude,\n settings.hooks,\n );\n return Object.freeze({\n kind: \"cli\",\n bind: (model?: AgentModel) =>\n bindClaude({\n ...configured,\n hooks,\n ...(model === undefined ? {} : { model }),\n }),\n });\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const claudeGuardedHook: string;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export const claudeGuardedHook = String.raw `
|
|
2
|
+
const fs = require('node:fs'); const { spawnSync } = require('node:child_process');
|
|
3
|
+
const config = CONFIG;
|
|
4
|
+
const input = fs.readFileSync(0, 'utf8');
|
|
5
|
+
function guard(value) {
|
|
6
|
+
const checked = spawnSync(process.execPath, ['-e', config.guard], { input: value, encoding: 'utf8', timeout: config.timeoutMs, maxBuffer: 1048576 });
|
|
7
|
+
if (checked.status !== 0) { process.stderr.write('Denied by agent profile allowedTools'); process.exit(2); }
|
|
8
|
+
}
|
|
9
|
+
guard(input);
|
|
10
|
+
const result = spawnSync(config.command, { input, shell: true, encoding: 'utf8', timeout: config.timeoutMs, maxBuffer: 1048576 });
|
|
11
|
+
if (result.status !== 0) { process.stderr.write(result.stderr || 'Hook command failed'); process.exit(2); }
|
|
12
|
+
try {
|
|
13
|
+
const output = JSON.parse(result.stdout || '{}');
|
|
14
|
+
if (output.hookSpecificOutput && Object.hasOwn(output.hookSpecificOutput, 'updatedInput')) {
|
|
15
|
+
guard(JSON.stringify({ ...JSON.parse(input), tool_input: output.hookSpecificOutput.updatedInput }));
|
|
16
|
+
}
|
|
17
|
+
} catch { process.stderr.write('Invalid hook output'); process.exit(2); }
|
|
18
|
+
process.stdout.write(result.stdout || ''); process.stderr.write(result.stderr || '');
|
|
19
|
+
`;
|
|
20
|
+
//# sourceMappingURL=claude-hook-plan.constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claude-hook-plan.constants.js","sourceRoot":"","sources":["../../../../src/adapters/agents/claude/claude-hook-plan.constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;;;;;;;;;;;;CAkB1C,CAAC","sourcesContent":["export const claudeGuardedHook = String.raw`\nconst fs = require('node:fs'); const { spawnSync } = require('node:child_process');\nconst config = CONFIG;\nconst input = fs.readFileSync(0, 'utf8');\nfunction guard(value) {\n const checked = spawnSync(process.execPath, ['-e', config.guard], { input: value, encoding: 'utf8', timeout: config.timeoutMs, maxBuffer: 1048576 });\n if (checked.status !== 0) { process.stderr.write('Denied by agent profile allowedTools'); process.exit(2); }\n}\nguard(input);\nconst result = spawnSync(config.command, { input, shell: true, encoding: 'utf8', timeout: config.timeoutMs, maxBuffer: 1048576 });\nif (result.status !== 0) { process.stderr.write(result.stderr || 'Hook command failed'); process.exit(2); }\ntry {\n const output = JSON.parse(result.stdout || '{}');\n if (output.hookSpecificOutput && Object.hasOwn(output.hookSpecificOutput, 'updatedInput')) {\n guard(JSON.stringify({ ...JSON.parse(input), tool_input: output.hookSpecificOutput.updatedInput }));\n }\n} catch { process.stderr.write('Invalid hook output'); process.exit(2); }\nprocess.stdout.write(result.stdout || ''); process.stderr.write(result.stderr || '');\n`;\n"]}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { AgentHookPlan } from "../../../domain/agent-hook.types.ts";
|
|
2
|
+
import type { ClaudeHook } from "./claude-hooks.types.ts";
|
|
3
|
+
import type { ClaudeSettings } from "../settings.types.ts";
|
|
4
|
+
export declare function claudeHookPlan(value: readonly ClaudeHook[], settings?: ClaudeSettings): AgentHookPlan;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { invariant } from "../../../domain/errors.js";
|
|
2
|
+
import { nativeHooks } from "../native-hooks.js";
|
|
3
|
+
import { hookGroups } from "../hook-groups.js";
|
|
4
|
+
import { claudeProfileScript } from "./claude-profile.js";
|
|
5
|
+
import { claudeGuardedHook } from "./claude-hook-plan.constants.js";
|
|
6
|
+
export function claudeHookPlan(value, settings = {}) {
|
|
7
|
+
const handlers = nativeHooks("claude", value);
|
|
8
|
+
return {
|
|
9
|
+
handlers,
|
|
10
|
+
async prepare(_sandbox, commands) {
|
|
11
|
+
const guarded = commands.map((command, index) => {
|
|
12
|
+
if (settings.profile?.allowedTools === undefined ||
|
|
13
|
+
handlers[index]?.on !== "PreToolUse")
|
|
14
|
+
return command;
|
|
15
|
+
const source = claudeGuardedHook.replace("CONFIG", JSON.stringify({
|
|
16
|
+
command,
|
|
17
|
+
guard: claudeProfileScript(settings),
|
|
18
|
+
timeoutMs: handlers[index].timeoutMs,
|
|
19
|
+
}));
|
|
20
|
+
return `node -e "eval(Buffer.from('${Buffer.from(source).toString("base64")}','base64').toString())"`;
|
|
21
|
+
});
|
|
22
|
+
const hooks = hookGroups(handlers, guarded);
|
|
23
|
+
return {
|
|
24
|
+
command(command) {
|
|
25
|
+
const args = [...(command.arguments ?? [])];
|
|
26
|
+
const index = args.indexOf("--settings");
|
|
27
|
+
const parsed = index < 0 ? {} : JSON.parse(args[index + 1]);
|
|
28
|
+
invariant(parsed !== null &&
|
|
29
|
+
typeof parsed === "object" &&
|
|
30
|
+
!Array.isArray(parsed), "Claude inline settings must be an object");
|
|
31
|
+
const existing = Object.fromEntries(Object.entries(parsed));
|
|
32
|
+
const previous = existing.hooks;
|
|
33
|
+
invariant(previous === undefined ||
|
|
34
|
+
(previous !== null &&
|
|
35
|
+
typeof previous === "object" &&
|
|
36
|
+
!Array.isArray(previous)), "Claude inline hooks must be an object");
|
|
37
|
+
const combined = {};
|
|
38
|
+
for (const [phase, entries] of Object.entries(previous ?? {})) {
|
|
39
|
+
invariant(Array.isArray(entries), "Claude hook event declarations must be arrays");
|
|
40
|
+
combined[phase] = entries;
|
|
41
|
+
}
|
|
42
|
+
for (const [phase, entries] of Object.entries(hooks))
|
|
43
|
+
combined[phase] = [...(combined[phase] ?? []), ...entries];
|
|
44
|
+
if (index >= 0)
|
|
45
|
+
args.splice(index, 2);
|
|
46
|
+
return {
|
|
47
|
+
...command,
|
|
48
|
+
arguments: [
|
|
49
|
+
"--settings",
|
|
50
|
+
JSON.stringify({ ...existing, hooks: combined }),
|
|
51
|
+
...args,
|
|
52
|
+
],
|
|
53
|
+
};
|
|
54
|
+
},
|
|
55
|
+
close: async () => undefined,
|
|
56
|
+
};
|
|
57
|
+
},
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=claude-hook-plan.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claude-hook-plan.js","sourceRoot":"","sources":["../../../../src/adapters/agents/claude/claude-hook-plan.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAEtD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AAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;oBACtC,OAAO;wBACL,GAAG,OAAO;wBACV,SAAS,EAAE;4BACT,YAAY;4BACZ,IAAI,CAAC,SAAS,CAAC,EAAE,GAAG,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC;4BAChD,GAAG,IAAI;yBACR;qBACF,CAAC;gBACJ,CAAC;gBACD,KAAK,EAAE,KAAK,IAAI,EAAE,CAAC,SAAS;aAC7B,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["import { invariant } from \"../../../domain/errors.ts\";\nimport type { AgentHookPlan } from \"../../../domain/agent-hook.types.ts\";\nimport { nativeHooks } from \"../native-hooks.ts\";\nimport { hookGroups } from \"../hook-groups.ts\";\nimport type { ClaudeHook } from \"./claude-hooks.types.ts\";\nimport type { ClaudeSettings } from \"../settings.types.ts\";\nimport { claudeProfileScript } from \"./claude-profile.ts\";\nimport { claudeGuardedHook } from \"./claude-hook-plan.constants.ts\";\n\nexport function claudeHookPlan(\n value: readonly ClaudeHook[],\n settings: ClaudeSettings = {},\n): AgentHookPlan {\n const handlers = nativeHooks(\"claude\", value);\n return {\n handlers,\n async prepare(_sandbox, commands) {\n const guarded = commands.map((command, index) => {\n if (\n settings.profile?.allowedTools === undefined ||\n handlers[index]?.on !== \"PreToolUse\"\n )\n return command;\n const source = claudeGuardedHook.replace(\n \"CONFIG\",\n JSON.stringify({\n command,\n guard: claudeProfileScript(settings),\n timeoutMs: handlers[index]!.timeoutMs,\n }),\n );\n return `node -e \"eval(Buffer.from('${Buffer.from(source).toString(\"base64\")}','base64').toString())\"`;\n });\n const hooks = hookGroups(handlers, guarded);\n return {\n command(command) {\n const args = [...(command.arguments ?? [])];\n const index = args.indexOf(\"--settings\");\n const parsed: unknown = index < 0 ? {} : JSON.parse(args[index + 1]!);\n invariant(\n parsed !== null &&\n typeof parsed === \"object\" &&\n !Array.isArray(parsed),\n \"Claude inline settings must be an object\",\n );\n const existing = Object.fromEntries(Object.entries(parsed));\n const previous: unknown = existing.hooks;\n invariant(\n previous === undefined ||\n (previous !== null &&\n typeof previous === \"object\" &&\n !Array.isArray(previous)),\n \"Claude inline hooks must be an object\",\n );\n const combined: Record<string, unknown[]> = {};\n for (const [phase, entries] of Object.entries(previous ?? {})) {\n invariant(\n Array.isArray(entries),\n \"Claude hook event declarations must be arrays\",\n );\n combined[phase] = entries;\n }\n for (const [phase, entries] of Object.entries(hooks))\n combined[phase] = [...(combined[phase] ?? []), ...entries];\n if (index >= 0) args.splice(index, 2);\n return {\n ...command,\n arguments: [\n \"--settings\",\n JSON.stringify({ ...existing, hooks: combined }),\n ...args,\n ],\n };\n },\n close: async () => undefined,\n };\n },\n };\n}\n"]}
|